diff options
author | Saroj Thirumalai <emacs_bugs.saroj@thirumalai.com> | 2021-06-23 23:17:03 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2021-06-23 23:17:03 +0300 |
commit | 7be75f17e79b547dc03e26e3980d4ce75bfa668d (patch) | |
tree | 47b7ea71fe731984b844d6a115d44960813d5eb6 /lisp/printing.el | |
parent | 006628df1823ef10bed92c71bee490717f2c2864 (diff) | |
download | emacs-7be75f17e79b547dc03e26e3980d4ce75bfa668d.tar.gz emacs-7be75f17e79b547dc03e26e3980d4ce75bfa668d.tar.bz2 emacs-7be75f17e79b547dc03e26e3980d4ce75bfa668d.zip |
* lisp/printing.el (pr-global-menubar): Fix duplicate menu problem.
In Emacs 27.1 Print menu items were moved to a submenu of the File menu.
The Printing package (lisp/printing.el) replaces the Print menu (via the
function: pr-global-menubar). The latter needs to be updated to reflect the
changes; otherwise, a second Print (sub)menu is created at the end of the
File menu.
Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/printing.el')
-rw-r--r-- | lisp/printing.el | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/lisp/printing.el b/lisp/printing.el index 5c7da96551f..e7aab901d53 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -1081,24 +1081,15 @@ Used by `pr-menu-bind' and `pr-update-menus'.") "Specify Printing menu-bar entry.") (defun pr-global-menubar (menu-spec) - (let ((menu-file '("menu-bar" "file"))) - (cond - (pr-menu-print-item - (easy-menu-add-item global-map menu-file - (easy-menu-create-menu "Print" menu-spec) - "print-buffer") - (dolist (item '("print-buffer" "print-region" - "ps-print-buffer-faces" "ps-print-region-faces" - "ps-print-buffer" "ps-print-region")) - (easy-menu-remove-item global-map menu-file item)) - (setq pr-menu-print-item nil - pr-menu-bar (vector 'menu-bar - (easy-menu-intern (nth 1 menu-file)) - (easy-menu-intern "Print")))) - (t - (easy-menu-add-item global-map menu-file - (easy-menu-create-menu "Print" menu-spec))) - ))) + (let ((menu-file '("menu-bar" "file")) + (submenu-path [menu-bar file Print]) + (submenu (easy-menu-create-menu "Print" menu-spec))) + (cond (pr-menu-print-item + (easy-menu-add-item global-map menu-file submenu "Print") + (easy-menu-remove-item global-map menu-file "print") + (setq pr-menu-print-item nil + pr-menu-bar submenu-path)) + (t (easy-menu-add-item global-map menu-file submenu))))) (defun pr-menu-position (entry index horizontal) (let ((pos (cdr (mouse-pixel-position)))) |