From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Attempt to modify read-only value Date: 23 Apr 2002 17:43:17 +0900 Sender: emacs-devel-admin@gnu.org Message-ID: References: <20020423094917.6913.LEKTU@terra.es> Reply-To: Miles Bader NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1019551702 9390 127.0.0.1 (23 Apr 2002 08:48:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 23 Apr 2002 08:48:22 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16zvyH-0002RL-00 for ; Tue, 23 Apr 2002 10:48:21 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16zvzO-0006K9-00 for ; Tue, 23 Apr 2002 10:49:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16zvy8-0003cB-00; Tue, 23 Apr 2002 04:48:12 -0400 Original-Received: from tyo201.gate.nec.co.jp ([202.32.8.214]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16zvvG-0003K7-00; Tue, 23 Apr 2002 04:45:14 -0400 Original-Received: from mailgate4.nec.co.jp ([10.7.69.195]) by TYO201.gate.nec.co.jp (8.11.6/3.7W01080315) with ESMTP id g3N8j3V08717; Tue, 23 Apr 2002 17:45:03 +0900 (JST) Original-Received: from mailsv.nec.co.jp (mailgate51.nec.co.jp [10.7.69.190]) by mailgate4.nec.co.jp (8.11.6/3.7W-MAILGATE-NEC) with ESMTP id g3N8ipL08527; Tue, 23 Apr 2002 17:44:52 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp ([10.30.114.133]) by mailsv.nec.co.jp (8.11.6/3.7W-MAILSV-NEC) with ESMTP id g3N8hOB07341; Tue, 23 Apr 2002 17:44:12 +0900 (JST) Original-Received: from mcspd15.ucom.lsi.nec.co.jp (mcspd15 [10.30.114.174]) by mcsss2.ucom.lsi.nec.co.jp (8.10.2+Sun/3.7Wlsi_mx_6.0) with ESMTP id g3N8hKg09792; Tue, 23 Apr 2002 17:43:20 +0900 (JST) Original-Received: by mcspd15.ucom.lsi.nec.co.jp (Postfix, from userid 31295) id 43D653723; Tue, 23 Apr 2002 17:43:17 +0900 (JST) Original-To: Juanma Barranquero System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: <20020423094917.6913.LEKTU@terra.es> Original-Lines: 77 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:3080 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3080 Juanma Barranquero writes: > I'm getting "attempt to modify read-only value" while bootstraping. I've fixed it in CVS: 2002-04-23 Miles Bader * menu-bar.el (menu-bar-update-buffers): Don't use constant lists for command menu entries, since the low-level menu code modifies them. Cache the resulting list. (menu-bar-buffers-menu-command-entries): New variable. Index: menu-bar.el =================================================================== RCS file: /cvs/emacs/lisp/menu-bar.el,v retrieving revision 1.207 retrieving revision 1.208 diff -u -p -r1.207 -r1.208 --- menu-bar.el 23 Apr 2002 05:01:50 -0000 1.207 +++ menu-bar.el 23 Apr 2002 08:34:57 -0000 1.208 @@ -1282,6 +1282,9 @@ key (or menu-item)")) file)) (car elt))) +;; Used to cache the menu entries for commands in the Buffers menu +(defvar menu-bar-buffers-menu-command-entries nil) + (defun menu-bar-update-buffers (&optional force) ;; If user discards the Buffers item, play along. (and (lookup-key (current-global-map) [menu-bar buffer]) @@ -1357,20 +1360,27 @@ key (or menu-item)")) `((frames-separator "--") (frames menu-item "Frames" ,frames-menu)))))) - ;; Add in some normal commands at the end of the menu + ;; Add in some normal commands at the end of the menu. We use + ;; the copy cached in `menu-bar-buffers-menu-command-entries' + ;; if it's been set already. Note that we can't use constant + ;; lists for the menu-entries, because the low-level menu-code + ;; modifies them. + (unless menu-bar-buffers-menu-command-entries + (setq menu-bar-buffers-menu-command-entries + (list '(command-separator "--") + (list 'select-named-buffer + 'menu-item + "Select Named Buffer..." + 'switch-to-buffer + :help "Prompt for a buffer name, and select that buffer in the current window") + (list 'list-all-buffers + 'menu-item + "List All Buffers" + 'list-buffers + :help "Pop up a window listing all emacs buffers" + )))) (setq buffers-menu - (nconc buffers-menu - '((command-separator "--") - (select-named-buffer - menu-item - "Select Named Buffer..." - switch-to-buffer - :help "Prompt for a buffer name, and select that buffer in the current window") - (list-all-buffers - menu-item - "List All Buffers" - list-buffers - :help "Pop up a window listing all emacs buffers")))) + (nconc buffers-menu menu-bar-buffers-menu-command-entries)) (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu))) (define-key (current-global-map) [menu-bar buffer] -Miles -- 80% of success is just showing up. --Woody Allen