From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12581: 24.2.50: redo+ fails to modify edit menu Date: Fri, 05 Oct 2012 17:55:27 -0400 Message-ID: References: <849B42E2-D952-4D03-844C-58DCC774D86B@efstathiou.gr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349474154 8170 80.91.229.3 (5 Oct 2012 21:55:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Oct 2012 21:55:54 +0000 (UTC) Cc: 12581-done@debbugs.gnu.org To: Konstantinos Efstathiou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 05 23:56:00 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TKFsG-0005Mb-7L for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Oct 2012 23:56:00 +0200 Original-Received: from localhost ([::1]:49721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKFsA-0004vu-GU for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Oct 2012 17:55:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKFs7-0004vZ-LS for bug-gnu-emacs@gnu.org; Fri, 05 Oct 2012 17:55:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKFs6-0000C7-EI for bug-gnu-emacs@gnu.org; Fri, 05 Oct 2012 17:55:51 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46766) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKFs6-0000C1-AL for bug-gnu-emacs@gnu.org; Fri, 05 Oct 2012 17:55:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TKFsI-00076G-E1 for bug-gnu-emacs@gnu.org; Fri, 05 Oct 2012 17:56:02 -0400 Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Oct 2012 21:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 12581 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 12581@debbugs.gnu.org, monnier@iro.umontreal.ca Original-Received: via spool by 12581-done@debbugs.gnu.org id=D12581.134947414927270 (code D ref 12581); Fri, 05 Oct 2012 21:56:02 +0000 Original-Received: (at 12581-done) by debbugs.gnu.org; 5 Oct 2012 21:55:49 +0000 Original-Received: from localhost ([127.0.0.1]:57015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TKFs5-00075n-8H for submit@debbugs.gnu.org; Fri, 05 Oct 2012 17:55:49 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:22191) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TKFs3-00075a-80 for 12581-done@debbugs.gnu.org; Fri, 05 Oct 2012 17:55:47 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09FxLQG/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDSSIHAW6CZBEA6MzgViDBQ X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="200767545" Original-Received: from 69-196-180-6.dsl.teksavvy.com (HELO pastel.home) ([69.196.180.6]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Oct 2012 17:55:28 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0AB43594CB; Fri, 5 Oct 2012 17:55:27 -0400 (EDT) In-Reply-To: <849B42E2-D952-4D03-844C-58DCC774D86B@efstathiou.gr> (Konstantinos Efstathiou's message of "Fri, 5 Oct 2012 23:00:43 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:65241 Archived-At: > 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)) ) elem)) -- Stefan