[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FW: On the Printing Problem
FW: On the Printing Problem
Wed, 01 Nov 2006 14:00:25 +0800
From: Vinicius Jose Latorre <address@hidden>
To: Herbert Euler <address@hidden>
CC: address@hidden, address@hidden
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.
From: "Herbert Euler" <address@hidden>
Subject: On the Printing Problem
Date: Tue, 31 Oct 2006 11:26:21 +0800
Here is my conclusion on the problem arised when I mixed Icicles and
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) "")
(open . find-file-literally)
(new-file menu-item "Visit New File..."
. " (C-x C-f)")
:help "Specify a new file's name, to edit
(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
Get FREE company branded e-mail accounts and business Web site from
Microsoft Office Live
Express yourself instantly with MSN Messenger! Download today it's FREE!
- FW: On the Printing Problem,
Herbert Euler <=