Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (require 'xref)
- (defun my-c-hook ()
- (interactive)
- (require 'gxref)
- (add-to-list 'xref-backend-functions 'gxref-xref-backend)
- ;; always let gxref figure out the root dir, dont reuse global one
- (setq-local gxref-project-root-dir nil)
- (let ((path (buffer-file-name)))
- (when path
- (setq path (expand-file-name path))
- (when (string-match-p (rx "/linux") path)
- (c-set-style "linux"))))
- ;; if the file doesnt have trailing whitespace, keep it this way
- (when (not (buffer-has-trailing-whitespace))
- (add-hook 'before-save-hook 'delete-trailing-whitespace)))
- (add-hook 'c-mode-hook 'my-c-hook)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement