emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Re: Icicles, Printing and Easy Menu]


From: Chong Yidong
Subject: Re: address@hidden: Re: Icicles, Printing and Easy Menu]
Date: Fri, 03 Nov 2006 22:18:39 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (gnu/linux)

Richard Stallman <address@hidden> writes:

> Would one of the expert debuggers please turn attention to this issue?
> We need to figure out what is happening in this simple test case.

This is because when you redefine some keys to the File Menu, the menu
keymap changes.  The result is that the changes that pr-menu-bind (in
printing.el) tries to make to the File Menu using easymenu won't
succeed.  The following patch fixes how pr-menu-bind changes the File
Menu.  It also fixes a bug where loading printing.el twice causes
pr-menu-bind to be called.

I'll check it in if there are no objections over the next couple of
days.

*** emacs/lisp/printing.el.~1.37.~      2006-09-21 10:57:33.000000000 -0400
--- emacs/lisp/printing.el      2006-11-03 22:06:22.000000000 -0500
***************
*** 1144,1149 ****
--- 1144,1150 ----
    "Set the value of custom variables for printer & utility selection."
    (set symbol value)
    (and (featurep 'printing)           ; update only after printing is loaded
+        (not pr-menu-print-item)
         (pr-update-menus t)))
  
  
***************
*** 1151,1156 ****
--- 1152,1158 ----
    "Update utility menu entry."
    (set symbol value)
    (and (featurep 'printing)           ; update only after printing is loaded
+        (not pr-menu-print-item)
         (pr-menu-set-utility-title value)))
  
  
***************
*** 1158,1163 ****
--- 1160,1166 ----
    "Update `PostScript Printer:' menu entry."
    (set symbol value)
    (and (featurep 'printing)           ; update only after printing is loaded
+        (not pr-menu-print-item)
         (pr-menu-set-ps-title value)))
  
  
***************
*** 1165,1170 ****
--- 1168,1174 ----
    "Update `Text Printer:' menu entry."
    (set symbol value)
    (and (featurep 'printing)           ; update only after printing is loaded
+        (not pr-menu-print-item)
         (pr-menu-set-txt-title value)))
  
  
***************
*** 3096,3118 ****
                                  (pr-get-symbol "Printing")))))
       ;; Emacs 21 & 22
       (t
!       (let* ((has-file  (lookup-key global-map (vector 'menu-bar 'file)))
!            (item-file (if has-file '("file") '("files"))))
!       (cond
!        (pr-menu-print-item
!         (easy-menu-change item-file "Print" pr-menu-spec "print-buffer")
!         (let ((items '("print-buffer"          "print-region"
!                        "ps-print-buffer-faces" "ps-print-region-faces"
!                        "ps-print-buffer"       "ps-print-region")))
!           (while items
!             (easy-menu-remove-item nil item-file (car items))
!             (setq items (cdr items)))
!           (setq pr-menu-print-item nil
!                 pr-menu-bar (vector 'menu-bar
!                                     (if has-file 'file 'files)
!                                     (pr-get-symbol "Print")))))
!        (t
!         (easy-menu-change item-file "Print" pr-menu-spec))))))))
    (pr-update-menus t))
  
  
--- 3100,3120 ----
                                  (pr-get-symbol "Printing")))))
       ;; Emacs 21 & 22
       (t
!       (cond
!        (pr-menu-print-item
!       (easy-menu-add-item menu-bar-file-menu nil
!                           (easy-menu-create-menu "Print" pr-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 menu-bar-file-menu nil item))
!       (setq pr-menu-print-item nil
!             pr-menu-bar (vector 'menu-bar
!                                 'file
!                                 (pr-get-symbol "Print"))))
!        (t
!       (easy-menu-change '("file") "Print" pr-menu-spec)))))))
    (pr-update-menus t))
  
  




reply via email to

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