unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* FW: On the Printing Problem
@ 2006-11-01  6:00 Herbert Euler
  2006-11-02 21:54 ` Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Herbert Euler @ 2006-11-01  6:00 UTC (permalink / raw)
  Cc: viniciusjl, rms, drew.adams

>From: Vinicius Jose Latorre <viniciusjl@ig.com.br>
>To: Herbert Euler <herberteuler@hotmail.com>
>CC: rms@gnu.org, emacs-devel@gnu.org
>Subject: Re: Icicles, Printing and Easy Menu
>Date: Wed, 01 Nov 2006 03:08:05 -0200
>
>For some reason the command:
>
>   (easy-menu-change '("file") "Print" pr-menu-spec "print-buffer")
>
>has no effect just after step 5.
>The command above is correct, but has no effect, that is, "Print" submenu 
>is not created.
>
>But if after step 5, you do:
>
>    5.1 C-h v global-map RET    ;; create *Help* buffer in another window
>    5.2 C-x o                                 ;; switch to *Help* buffer
>
>Now, all works.

I tried that, the evaluation of (pr-update-menus t) failed again.

Below is what I wrote to Drew.

Regards,
Guanpeng Xu

>From: "Herbert Euler" <herberteuler@hotmail.com>
>To: drew.adams@oracle.com
>CC: herberteuler@hotmail.com
>Subject: On the Printing Problem
>Date: Tue, 31 Oct 2006 11:26:21 +0800
>
>Hello,
>
>Here is my conclusion on the problem arised when I mixed Icicles and
>Printing.
>
>This problem is arised because Icicles mode rebinds the key bindings
>in a way that is not robust in all aspects.  In file
>`icicles-mode.el', Icicles mode rebinds many key bindings with
>`substitute-key-definition'.  Let's see what
>`substitute-key-definition' does.  As in your mail to the emacs-devel
>mailing list, we evaluate some forms:
>
>(defvar foo-map (make-sparse-keymap) "")
>==> foo-map
>
>(substitute-key-definition 'find-file
>                           'find-file-literally
>                           foo-map
>                           global-map)
>==> nil
>
>foo-map
>==> (keymap
>     (open . find-file-literally)
>     (menu-bar keymap
>               (file keymap
>                     (new-file menu-item "Visit New File..." 
>find-file-literally
>                               ([24 6]
>                                . "  (C-x C-f)")
>                               :enable
>                               (menu-bar-non-minibuffer-window-p)
>                               :help "Specify a new file's name, to edit 
>the file")))
>     (24 keymap
>         (6 . find-file-literally)))
>
>As you see, `substitute-key-definition' copies the entries that with
>`find-file' in their bindings in `global-map' into `foo-map' and
>substitutes `find-file' with `find-file-literally'.
>
>Icicles mode copies the entries in `global-map' in the same way.
>After that, by enabling Icicles mode, `icicle-mode-map' becomes active
>to all of the visible buffers.  `icicle-mode-map' is a minor mode
>keymap, so it will shadow `global-map'.
>
>When the user invokes `(pr-update-menus t)', Printing tries to update
>Emacs' menu with `easy-menu-change'.  This will finally cause
>`easy-menu-get-map' get invoked.  We have found that
>`easy-menu-get-map' will pick up all maps but pick the global map
>last.  Since Icicles mode already shadows the global map with its
>`icicle-mode-map', a wrong entry is picked by `easy-menu-get-map', and
>so Printing complains.  (In fact, `easy-menu-get-map' tries to find
>the entry with `menu-bar' first.)
>
>The purpose of `icicle-mode-map' is to rebind key bindings.  But there
>is another way to do this, without making other packages signaling
>errors.  Please take a look at (info "(elisp) Remapping Commands").
>The other packages that try to provide similar completion features,
>such as `ido', accomplish in this way actually.  The function
>`ido-mode' in file `lisp/ido.el' is an example of using the remapping
>feature.
>
>Regards,
>Herbert
>
>_________________________________________________________________
>Get FREE company branded e-mail accounts and business Web site from 
>Microsoft Office Live 
>http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-02 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-01  6:00 FW: On the Printing Problem Herbert Euler
2006-11-02 21:54 ` Drew Adams

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).