unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Konstantinos Efstathiou <konstantinos@efstathiou.gr>
Cc: 12581-done@debbugs.gnu.org
Subject: bug#12581: 24.2.50: redo+ fails to modify edit menu
Date: Fri, 05 Oct 2012 17:55:27 -0400	[thread overview]
Message-ID: <jwvbogg38c4.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <849B42E2-D952-4D03-844C-58DCC774D86B@efstathiou.gr> (Konstantinos Efstathiou's message of "Fri, 5 Oct 2012 23:00:43 +0200")

> I have tracked this down to the command
> (setcar (cdr (memq :enable (assq 'undo menu-bar-edit-menu))) nil)
[...]
> that fails with the same error. Actually redo+ attempts to setcar to
> something else but obviously the problem is that for some reason
[...]
> Is this a bug or expected behavior? Should redo+ be modified?

It's not a bug, AFAIC.  You can change redo+ to use something like:

   (define-key menu-bar-edit-menu [undo]
     ;; We use `cdr+assq' instead of `lookup-key' because lookup-key
     ;; would return the actual binding inside the menu-item, whereas
     ;; we want the whole menu-item (IOW we don't want the get_keyelt
     ;; part of lookup-key).  We could use
     ;; (catch 'found
     ;;   (map-keymap (lambda (k v)
     ;;                 (if (eq k 'undo) (throw 'found v)))
     ;;               menu-bar-edit-menu))
     ;; instead.
     (let ((elem (copy-sequence (cdr (assq 'undo menu-bar-edit-menu)))))
       (setcar (cdr (memq :enable elem)) <your-exp-here>)
       elem))

       
-- Stefan






      reply	other threads:[~2012-10-05 21:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05 21:00 bug#12581: 24.2.50: redo+ fails to modify edit menu Konstantinos Efstathiou
2012-10-05 21:55 ` Stefan Monnier [this message]

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=jwvbogg38c4.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=12581-done@debbugs.gnu.org \
    --cc=konstantinos@efstathiou.gr \
    /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).