From: Glenn Morris Date: Tue, 15 Feb 2011 05:09:54 +0000 (-0800) Subject: * lisp/dired-x.el: Use easymenu for menu items. Fix item capitalization. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~872 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c5ca3aa00840c5dfa0aa7eeb8483ea077e5577bc;p=emacs.git * lisp/dired-x.el: Use easymenu for menu items. Fix item capitalization. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 742cbfc9267..a9adce5a3f5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-02-15 Glenn Morris + + * dired-x.el: Use easymenu for menu items. Fix item capitalization. + 2011-02-14 Chong Yidong * vc/vc-git.el (vc-git-root-log-format): New option for diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 8011b4d32a4..95381ccdc0c 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -231,69 +231,44 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used." ;;; MENU BINDINGS -(let ((menu-bar (lookup-key dired-mode-map [menu-bar]))) - (let ((menu (lookup-key menu-bar [operate]))) - (define-key-after - menu - [find-files] - '(menu-item - "Find files" - dired-do-find-marked-files - :help "Find current or marked files") - 'delete) - (define-key-after - menu - [relsymlink] - '(menu-item - "Relative symlink to..." - dired-do-relsymlink - :visible (fboundp 'make-symbolic-link) - :help "Make relative symbolic links for current or marked files") - 'symlink)) - (let ((menu (lookup-key menu-bar [mark]))) - (define-key-after - menu - [flag-extension] - '(menu-item - "Flag extension..." - dired-flag-extension - :help "Flag files with a certain extension for deletion") - 'garbage-files) - (define-key-after - menu - [mark-extension] - '(menu-item - "Mark extension..." - dired-mark-extension - :help "Mark files with a certain extension") - 'symlinks) - (define-key-after - menu - [mark-omitted] - '(menu-item - "Mark omitted" - dired-mark-omitted - :help "Mark files matching `dired-omit-files' and `dired-omit-extensions'") - 'mark-extension)) - (let ((menu (lookup-key menu-bar [regexp]))) - (define-key-after - menu - [relsymlink-regexp] - '(menu-item - "Relative symlink..." - dired-do-relsymlink-regexp - :visible (fboundp 'make-symbolic-link) - :help "Make relative symbolic links for files matching regexp") - 'symlink)) - (let ((menu (lookup-key menu-bar [immediate]))) - (define-key-after - menu - [omit-mode] - '(menu-item - "Omit mode" dired-omit-mode - :button (:toggle . dired-omit-mode) - :help "Enable or disable omitting \"uninteresting\" files") - 'dashes))) +(require 'easymenu) + +(let ((menu (lookup-key dired-mode-map [menu-bar]))) + (easy-menu-add-item menu '("Operate") + ["Find Files" dired-do-find-marked-files + :help "Find current or marked files"] + "Shell Command...") + (easy-menu-add-item menu '("Operate") + ["Relative Symlink to..." dired-do-relsymlink + :visible (fboundp 'make-symbolic-link) + :help "Make relative symbolic links for current or \ +marked files"] + "Hardlink to...") + (easy-menu-add-item menu '("Mark") + ["Flag Extension..." dired-flag-extension + :help "Flag files with a certain extension for deletion"] + "Mark Executables") + (easy-menu-add-item menu '("Mark") + ["Mark Extension..." dired-mark-extension + :help "Mark files with a certain extension"] + "Unmark All") + (easy-menu-add-item menu '("Mark") + ["Mark Omitted" dired-mark-omitted + :help "Mark files matching `dired-omit-files' \ +and `dired-omit-extensions'"] + "Unmark All") + (easy-menu-add-item menu '("Regexp") + ["Relative Symlink..." dired-do-relsymlink-regexp + :visible (fboundp 'make-symbolic-link) + :help "Make relative symbolic links for files \ +matching regexp"] + "Hardlink...") + (easy-menu-add-item menu '("Immediate") + ["Omit Mode" dired-omit-mode + :style toggle :selected dired-omit-mode + :help "Enable or disable omitting \"uninteresting\" \ +files"] + "Refresh")) ;;; GLOBAL BINDING. (when dired-bind-jump