bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: [PATCH] gettext documentation: make key bindings for po-mode up-to-d


From: Kalle Olavi Niemitalo
Subject: Re: [PATCH] gettext documentation: make key bindings for po-mode up-to-date
Date: Thu, 30 Oct 2008 02:02:49 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.51 (gnu/linux)

Bruno Haible <address@hidden> writes:

> In po-mode, however, this variable is always t, and the variable
> po-read-only should be tested instead. How could this be implemented?
> I'm thinking of fetching this menu-item from the (current-global-map),
> then applying a substitution buffer-read-only -> po-read-only, then
> stuffing the result into the po-mode-map. But as I'm not familiar with
> Emacs Lisp, I cannot find the right Emacs Lisp functions for doing this.

This reminds me about <http://bugs.debian.org/287261>, where
I had customized view-read-only to t, and when po-mode set
buffer-read-only, Emacs enabled view-mode, which shadowed the
key bindings of po-mode.  It seems Emacs just does not support
the kind of temporary read-onlyness you want for po-mode.  Until
it does, I think po-mode should set the read-only text property
instead.  Then, in Emacs 22, po-mode could bind [remap undo] to
po-undo.

If you want to keep using buffer-read-only and need to alter the
menu item accordingly, I think you should copy the menu item in
the source, rather than substitute things at run time.  That is
because nothing prevents Emacs developers from moving the :enable
test into a function and calling that from the menu item.

If you nevertheless insist on looking up the menu item at run
time, you can apparently do this in GNU Emacs:

  (cdr (assoc 'undo menu-bar-edit-menu))

In XEmacs 21.4 however, there is no menu-bar-edit-menu variable.
It seems you can do this instead:

  (car (find-menu-item default-menubar '("%_Edit" "%_Undo")))

The sublis function is available via (require 'cl).

Attachment: pgpi4MV0S8krV.pgp
Description: PGP signature


reply via email to

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