From c372a02968b6d0e77e34e7819c3dd7e7cf5f5bd5 Mon Sep 17 00:00:00 2001 From: tmu Date: Fri, 6 Jan 2023 17:01:21 -0700 Subject: emacs --- emacs/project-stuff.el | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 emacs/project-stuff.el (limited to 'emacs/project-stuff.el') diff --git a/emacs/project-stuff.el b/emacs/project-stuff.el new file mode 100644 index 0000000..879eae0 --- /dev/null +++ b/emacs/project-stuff.el @@ -0,0 +1,41 @@ +(defun create-tags (dir-name) + "Create tags file." + (interactive "DDirectory: ") + (eshell-command + (format "gtags %s" dir-name))) + + ;;; Jonas.Jarnestromki.ericsson.se A smarter + ;;; find-tag that automagically reruns etags when it cant find a + ;;; requested item and then makes a new try to locate it. + ;;; Fri Mar 15 09:52:14 2002 + +(defadvice find-tag (around refresh-etags activate) + "Rerun etags and reload tags if tag not found and redo find-tag. + If buffer is modified, ask about save before running etags." + (let ((extension (file-name-extension (buffer-file-name)))) + (condition-case err + ad-do-it + (error (and (buffer-modified-p) + (not (ding)) + (y-or-n-p "Buffer is modified, save it? ") + (save-buffer)) + (er-refresh-tags extension) + ad-do-it)))) + +(defun er-refresh-tags (&optional extension) + "Run etags on all peer files in current dir and reload them silently." + (interactive) + (shell-command (format "etags *.%s" (or extension "el"))) + (let ((tags-revert-without-query t)) ; don't query, revert silently + (visit-tags-table default-directory nil))) + +(add-hook 'xref-backend-functions 'gxref-xref-backend) + +(require 'semantic/sb) +(setq semantic-default-submodes + '(global-semanticdb-minor-mode global-semantic-idle-scheduler-mode global-semantic-idle-summary-mode global-semantic-idle-completions-mode global-semantic-highlight-func-mode global-semantic-mru-bookmark-mode global-semantic-idle-local-symbol-highlight-mode)) +(semantic-mode 1) + +(load-file "~/.emacs.d/sr-speedbar.el") +(global-unset-key (kbd "M-i")) +(global-set-key (kbd "M-i") 'sr-speedbar-toggle) -- cgit v1.2.3