unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
Cc: Vinicius Jose Latorre <viniciusjl@ig.com.br>, emacs-devel@gnu.org
Subject: Re: [viniciusjl@ig.com.br: Re: Icicles, Printing and Easy Menu]
Date: Fri, 03 Nov 2006 22:18:39 -0500	[thread overview]
Message-ID: <87u01f292o.fsf@stupidchicken.com> (raw)
In-Reply-To: <E1GfkPX-0007Ou-P1@fencepost.gnu.org> (Richard Stallman's message of "Thu\, 02 Nov 2006 16\:47\:43 -0500")

Richard Stallman <rms@gnu.org> 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	other threads:[~2006-11-04  3:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-02 21:47 [viniciusjl@ig.com.br: Re: Icicles, Printing and Easy Menu] Richard Stallman
2006-11-04  3:18 ` Chong Yidong [this message]
2006-11-08  2:00   ` Vinicius Jose Latorre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87u01f292o.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=viniciusjl@ig.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).