GNU bug report logs - #12581
24.2.50: redo+ fails to modify edit menu

Previous Next

Package: emacs;

Reported by: Konstantinos Efstathiou <konstantinos <at> efstathiou.gr>

Date: Fri, 5 Oct 2012 21:04:01 UTC

Severity: normal

Found in version 24.2.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12581 in the body.
You can then email your comments to 12581 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12581; Package emacs. (Fri, 05 Oct 2012 21:04:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Konstantinos Efstathiou <konstantinos <at> efstathiou.gr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 05 Oct 2012 21:04:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Konstantinos Efstathiou <konstantinos <at> efstathiou.gr>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2.50: redo+ fails to modify edit menu
Date: Fri, 5 Oct 2012 23:00:43 +0200
In the latest versions from the repository it is impossible to load redo+.el
(version 1.15 available from ELPA). The command (require 'redo+)
fails with (error "Attempt to modify read-only object").

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

(car (cdr (memq :enable (assq 'undo menu-bar-edit-menu)))

is now read-only while it used to be modifiable.

Is this a bug or expected behavior? Should redo+ be modified?





Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Fri, 05 Oct 2012 21:56:02 GMT) Full text and rfc822 format available.

Notification sent to Konstantinos Efstathiou <konstantinos <at> efstathiou.gr>:
bug acknowledged by developer. (Fri, 05 Oct 2012 21:56:02 GMT) Full text and rfc822 format available.

Message #10 received at 12581-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Konstantinos Efstathiou <konstantinos <at> efstathiou.gr>
Cc: 12581-done <at> debbugs.gnu.org
Subject: Re: bug#12581: 24.2.50: redo+ fails to modify edit menu
Date: Fri, 05 Oct 2012 17:55:27 -0400
> 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





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 03 Nov 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.