emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 21f9a95: Hide "Set Tags File Name" and the separato


From: Dmitry Gutov
Subject: [Emacs-diffs] master 21f9a95: Hide "Set Tags File Name" and the separator when tags are not used
Date: Tue, 30 Dec 2014 03:19:04 +0000

branch: master
commit 21f9a9513a7a91ed630412b4c48ad29a5cabc71f
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Hide "Set Tags File Name" and the separator when tags are not used
    
    * lisp/menu-bar.el (menu-bar-goto-uses-etags-p): New function.
    (menu-bar-goto-menu): Use it to show or hide the `set-tags-name'
    and `separator-tag-file' items.
---
 lisp/ChangeLog   |    6 ++++++
 lisp/menu-bar.el |   10 +++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5ad67ab..6249a30 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2014-12-30  Dmitry Gutov  <address@hidden>
+
+       * menu-bar.el (menu-bar-goto-uses-etags-p): New function.
+       (menu-bar-goto-menu): Use it to show or hide the `set-tags-name'
+       and `separator-tag-file' items.
+
 2014-12-29  Paul Eggert  <address@hidden>
 
        * obsolete/pc-select.el (pc-selection-mode): Use system-type.
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index c5f587e..ea5794d 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -373,13 +373,14 @@
 
     (bindings--define-key menu [set-tags-name]
       '(menu-item "Set Tags File Name..." visit-tags-table
-                  :help "Tell Tags commands which tag table file to use"))
+                  :visible (menu-bar-goto-uses-etags-p)
+                  :help "Tell navigation commands which tag table file to 
use"))
 
     (bindings--define-key menu [separator-tag-file]
-      menu-bar-separator)
+      '(menu-item "--" nil :visible (menu-bar-goto-uses-etags-p)))
 
     (bindings--define-key menu [xref-pop]
-      '(menu-item "Back..." xref-pop-marker-stack
+      '(menu-item "Back" xref-pop-marker-stack
                   :help "Back to the position of the last search"))
 
     (bindings--define-key menu [xref-apropos]
@@ -409,6 +410,9 @@
                   :help "Read a line number and go to that line"))
     menu))
 
+(defun menu-bar-goto-uses-etags-p ()
+  (or (not (boundp 'xref-find-function))
+      (eq xref-find-function 'etags-xref-find)))
 
 (defvar yank-menu (cons (purecopy "Select Yank") nil))
 (fset 'yank-menu (cons 'keymap yank-menu))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]