summaryrefslogtreecommitdiff
path: root/emacs/project-stuff.el
diff options
context:
space:
mode:
authortmu <t.man.atl.2012@gmail.com>2023-01-06 17:01:21 -0700
committertmu <t.man.atl.2012@gmail.com>2023-01-06 17:01:21 -0700
commitc372a02968b6d0e77e34e7819c3dd7e7cf5f5bd5 (patch)
tree31c2a303efa0f0dfe6f1e1a2d1000b3ad00133e0 /emacs/project-stuff.el
parent04912b6f1da411720fc5bf97e7d268515d018c01 (diff)
emacs
Diffstat (limited to 'emacs/project-stuff.el')
-rw-r--r--emacs/project-stuff.el41
1 files changed, 41 insertions, 0 deletions
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.Jarnestrom<at>ki.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)