Skip to content

Instantly share code, notes, and snippets.

@leoliu
Created March 12, 2014 14:58
Show Gist options
  • Save leoliu/9508659 to your computer and use it in GitHub Desktop.
Save leoliu/9508659 to your computer and use it in GitHub Desktop.
ggtags.diff
diff --git a/ggtags.el b/ggtags.el
index fa007a9f..1584f8b3 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1128,6 +1128,7 @@ (defvar ggtags-navigation-map
(define-key map "\M-{" 'ggtags-navigation-previous-file)
(define-key map "\M->" 'ggtags-navigation-last-error)
(define-key map "\M-<" 'ggtags-navigation-first-error)
+ (define-key map "\C-hr" 'ggtags-navigation-rename-buffer)
(define-key map "\C-c\C-k"
(lambda () (interactive)
(ggtags-ensure-global-buffer (kill-compilation))))
@@ -1245,6 +1246,14 @@ (defun ggtags-navigation-last-error ()
(compilation-previous-error 1)
(compile-goto-error)))
+(defun ggtags-navigation-rename-buffer (name)
+ (interactive
+ (list (if current-prefix-arg
+ (read-string "New buffer name: ")
+ (format "*ggtags-%s*" (or ggtags-current-tag-name "save")))))
+ (cl-check-type name string)
+ (ggtags-ensure-global-buffer (rename-buffer name t)))
+
(defun ggtags-navigation-visible-mode (&optional arg)
(interactive (list (or current-prefix-arg 'toggle)))
(ggtags-ensure-global-buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment