Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. (require 'xref)
  2. (defun my-c-hook ()
  3. (interactive)
  4. (require 'gxref)
  5. (add-to-list 'xref-backend-functions 'gxref-xref-backend)
  6.  
  7. ;; always let gxref figure out the root dir, dont reuse global one
  8. (setq-local gxref-project-root-dir nil)
  9. (let ((path (buffer-file-name)))
  10. (when path
  11. (setq path (expand-file-name path))
  12. (when (string-match-p (rx "/linux") path)
  13. (c-set-style "linux"))))
  14.  
  15. ;; if the file doesnt have trailing whitespace, keep it this way
  16. (when (not (buffer-has-trailing-whitespace))
  17. (add-hook 'before-save-hook 'delete-trailing-whitespace)))
  18. (add-hook 'c-mode-hook 'my-c-hook)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement