From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.bugs Subject: bug#7788: 23.2.91; tmm-menubar command broken: Wrong type argument: stringp, nil Date: Wed, 05 Jan 2011 15:56:46 +0200 Message-ID: <871v4rqwrl.fsf@mithlond.arda> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1294237462 21642 80.91.229.12 (5 Jan 2011 14:24:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2011 14:24:22 +0000 (UTC) To: 7788@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 05 15:24:17 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PaUHY-0007Oo-Hx for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Jan 2011 15:24:17 +0100 Original-Received: from localhost ([127.0.0.1]:38205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaUHX-0007yy-JM for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Jan 2011 09:24:07 -0500 Original-Received: from [140.186.70.92] (port=48756 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaUHQ-0007yM-5s for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2011 09:24:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaUHN-0002Pc-2S for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2011 09:24:00 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaUHM-0002PS-Vt for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2011 09:23:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PaTlV-0002Bp-PH; Wed, 05 Jan 2011 08:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Teemu Likonen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Jan 2011 13:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7788 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.12942354098354 (code B ref -1); Wed, 05 Jan 2011 13:51:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jan 2011 13:50:09 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PaTke-0002Ag-Om for submit@debbugs.gnu.org; Wed, 05 Jan 2011 08:50:09 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PaTkb-0002AB-3s for submit@debbugs.gnu.org; Wed, 05 Jan 2011 08:50:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaTrV-0004Y2-3v for submit@debbugs.gnu.org; Wed, 05 Jan 2011 08:57:16 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:48685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaTrU-0004Xw-T3 for submit@debbugs.gnu.org; Wed, 05 Jan 2011 08:57:13 -0500 Original-Received: from [140.186.70.92] (port=37248 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaTrS-000390-65 for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2011 08:57:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaTrP-0004WZ-Kg for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2011 08:57:10 -0500 Original-Received: from mta-out.inet.fi ([195.156.147.13]:50470 helo=jenni2.inet.fi) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaTrP-0004Vu-35 for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2011 08:57:07 -0500 Original-Received: from mithlond.arda (84.251.132.215) by jenni2.inet.fi (8.5.133) id 4D061FFC00BFADFC for bug-gnu-emacs@gnu.org; Wed, 5 Jan 2011 15:56:59 +0200 Original-Received: from dtw by mithlond.arda with local (Exim 4.69) (envelope-from ) id 1PaTr4-0003pF-Hb for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2011 15:56:46 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 05 Jan 2011 08:51:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:43098 Archived-At: Sometimes tmm-menubar command doesn't work because it stops with error Wrong type argument: stringp, nil See the backtrace below. I don't know yet how to reproduce the bug after "emacs -Q" but I see the issue quite often in my system. The bug happens in function tmm-get-keymap which is in file lisp/tmm.el. There is string-width function which gets nil as its argument. The bug was introduced by this change: commit b38a6aa1f48496e095e99742d009c621bf56b394 Author: Stefan Monnier Date: 2010-05-11 16:07:12 -0400 Backport from trunk: compute shortcuts in tmm.el. * tmm.el (tmm-prompt): Don't try to precompute bindings. (tmm-get-keymap): Compute shortcuts since the cache is empty. In a running Emacs session, if I evaluate (M-x eval-buffer) an earlier version of lisp/tmm.el file the bug disappears. Evaluating lisp/tmm.el again after that commit and the bug appears again. --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-width(nil) (- colwidth (string-width str) (string-width binding)) (max 2 (- colwidth (string-width str) (string-width binding))) (make-string (max 2 (- colwidth ... ...)) 32) (concat str (make-string (max 2 ...) 32) binding) (setq str (concat str (make-string ... 32) binding)) (let ((colwidth ...)) (setq str (concat str ... binding))) (progn (setq binding (key-description binding)) (let (...) (setq str ...)= )) (if binding (progn (setq binding ...) (let ... ...))) (when binding (setq binding (key-description binding)) (let (...) (setq s= tr ...))) (let ((binding ...)) (when binding (setq binding ...) (let ... ...))) (if (eq km (quote ignore)) nil (let (...) (when binding ... ...))) (unless (eq km (quote ignore)) (let (...) (when binding ... ...))) (if (assoc event tmm-table-undef) nil (cond (... ...) (... ... ...) (... = ... ...) (... ... ... ... ... ... ... ... ... ... ...) (... ... ...) (... .= ..)) (unless (eq km ...) (let ... ...))) (unless (assoc event tmm-table-undef) (cond (... ...) (... ... ...) (... = ... ...) (... ... ... ... ... ... ... ... ... ... ...) (... ... ...) (... .= ..)) (unless (eq km ...) (let ... ...))) (if (eq elt (quote undefined)) (setq tmm-table-undef (cons ... tmm-table-= undef)) (unless (assoc event tmm-table-undef) (cond ... ... ... ... ... ...= ) (unless ... ...)) (and km (stringp km) (setq str km)) (when (and km ... .= ..) (setq km ...)) (and km str (or ... ...))) (let (km str plist filter visible enable (event ...)) (setq elt (cdr elt)= ) (if (eq elt ...) (setq tmm-table-undef ...) (unless ... ... ...) (and km = ... ...) (when ... ...) (and km str ...))) tmm-get-keymap(nil nil) (cond ((listp elt) (tmm-get-keymap elt not-menu)) ((vectorp elt) (dotimes= ... ...))) (if (stringp elt) (setq gl-str elt) (cond (... ...) (... ...))) (lambda (elt) (if (stringp elt) (setq gl-str elt) (cond ... ...)))(nil) mapc((lambda (elt) (if (stringp elt) (setq gl-str elt) (cond ... ...))) (= keymap (file "File" keymap (new-file menu-item "Visit New File..." find-fil= e :enable ... :help "Specify a new file's name, to edit the file") (open-fi= le menu-item "Open File..." menu-find-file-existing :enable ... :help "Read= an existing file into an Emacs buffer") (dired menu-item "Open Directory..= ." dired :enable ... :help "Read a directory, to operate on its files") (in= sert-file menu-item "Insert File..." insert-file :enable ... :help "Insert = another file into current buffer") (kill-buffer menu-item "Close" kill-this= -buffer :enable ... :help "Discard (kill) current buffer") (separator-save = "--") (save-buffer menu-item "Save" save-buffer :enable ... :help "Save cur= rent buffer to its file") (write-file menu-item "Save As..." write-file :en= able ... :help "Write current buffer to another file") (revert-buffer menu-= item "Revert Buffer" revert-buffer :enable ... :help "Re-read current buffe= r from its file") (recover-session menu-item "Recover Crashed Session" reco= ver-session :enable ... :help "Recover edits from a crashed session") (sepa= rator-print "--") (print-buffer menu-item "Print Buffer" print-buffer :enab= le ... :help "Print current buffer with page headings") (print-region menu-= item "Print Region" print-region :enable mark-active :help "Print region be= tween mark and current position") (ps-print-buffer-faces menu-item "Postscr= ipt Print Buffer" ps-print-buffer-with-faces :enable ... :help "Pretty-prin= t current buffer to PostScript printer") (ps-print-region-faces menu-item "= Postscript Print Region" ps-print-region-with-faces :enable mark-active :he= lp "Pretty-print marked region to PostScript printer") (ps-print-buffer men= u-item "Postscript Print Buffer (B+W)" ps-print-buffer :enable ... :help "P= retty-print current buffer in black and white to PostScript printer") (ps-p= rint-region menu-item "Postscript Print Region (B+W)" ps-print-region :enab= le mark-active :help "Pretty-print marked region in black and white to Post= Script printer") (separator-window "--") (split-window menu-item "Split Win= dow" split-window-vertically :enable ... :help "Split selected window in tw= o windows") (one-window menu-item "Remove Splits" delete-other-windows :ena= ble ... :help "Selected window grows to fill the whole frame") (make-frame = menu-item "New Frame" make-frame-command :visible ... :help "Open a new fra= me") (make-frame-on-display menu-item "New Frame on Display..." make-frame-= on-display :visible ... :help "Open a new frame on another display") (delet= e-this-frame menu-item "Delete Frame" delete-frame :visible ... :enable ...= :help "Delete currently selected frame") (separator-exit "--") (exit-emacs= menu-item "Quit" save-buffers-kill-terminal :help "Save unsaved buffers, t= hen exit") "File") (edit "Edit" keymap (undo menu-item "Undo" undo :enable = ... :help "Undo last operation") (cut "Cut" "Delete text in region and copy= it to the clipboard" . clipboard-kill-region) (copy "Copy" "Copy text in r= egion to the clipboard" . clipboard-kill-ring-save) (paste menu-item "Paste= " x-clipboard-yank :enable ... :help "Paste (yank) text most recently cut/c= opied") (paste-from-menu menu-item "Paste from Kill Menu" yank-menu :enable= ... :help "Choose a string from the kill ring and paste it") (clear menu-i= tem "Clear" delete-region :enable ... :help "Delete the text in region betw= een mark and current position") (mark-whole-buffer menu-item "Select All" m= ark-whole-buffer :help "Mark the whole buffer for a subsequent cut/copy") (= separator-search "--") (search menu-item "Search" ...) (replace menu-item "= Replace" ...) (goto menu-item "Go To" ...) (bookmark menu-item "Bookmarks" = menu-bar-bookmark-map) (separator-bookmark "--") (fill menu-item "Fill" fil= l-region :enable ... :help "Fill text in region to fit between left and rig= ht margin") (props menu-item "Text Properties" facemenu-menu) "Edit") (opti= ons "Options" keymap (transient-mark-mode menu-item "Active Region Highligh= ting" transient-mark-mode :enable ... :help "Make text in active region sta= nd out in color (Transient Mark mode)" :button ...) (highlight-paren-mode m= enu-item "Paren Match Highlighting" show-paren-mode :help "Highlight matchi= ng/mismatched parentheses at cursor (Show Paren mode)" :button ...) (highli= ght-separator "--") (line-wrapping menu-item "Line Wrapping in this Buffer"= ...) (auto-fill-mode menu-item "Auto Fill in Text Modes" menu-bar-text-mod= e-auto-fill :help "Automatically fill text while typing (Auto Fill mode)" := button ...) (case-fold-search menu-item "Case-Insensitive Search" toggle-ca= se-fold-search :help "Ignore letter-case in search commands" :button ...) (= cua-emulation-mode menu-item "Shift movement mark region (CUA)" cua-mode :v= isible ... :help "Use shifted movement keys to set and extend the region." = :button ...) (cua-mode menu-item "C-x/C-c/C-v Cut and Paste (CUA)" cua-mode= :visible ... :help "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste" :but= ton ...) (edit-options-separator "--") (uniquify menu-item "Use Directory N= ames in Buffer Names" toggle-uniquify-buffer-names :help "Uniquify buffer n= ames by adding parent directory names" :button ...) (save-place menu-item "= Save Place in Files between Sessions" toggle-save-place-globally :help "Vis= it files of previous session when restarting Emacs" :button ...) (cursor-se= parator "--") (blink-cursor-mode menu-item "Blinking Cursor" blink-cursor-m= ode :help "Whether the cursor blinks (Blink Cursor mode)" :button ...) (deb= ugger-separator "--") (debug-on-error menu-item "Enter Debugger on Error" t= oggle-debug-on-error :help "Enter Lisp debugger when an error is signaled" = :button ...) (debug-on-quit menu-item "Enter Debugger on Quit/C-g" toggle-d= ebug-on-quit :help "Enter Lisp debugger when C-g is pressed" :button ...) (= mule-separator "--") (mule menu-item "Mule (Multilingual Environment)" ...)= (showhide-separator "--") (showhide menu-item "Show/Hide" ...) (menu-set-f= ont menu-item "Set Default Font..." menu-set-font :visible ... :help "Selec= t a default font") (custom-separator "--") (save menu-item "Save Options" m= enu-bar-options-save :help "Save options set from the menu above") (customi= ze menu-item "Customize Emacs" ...) "Options" (package menu-item "Manage Pa= ckages" package-list-packages :help "Install or uninstall additional Emacs = packages")) (buffer "Buffers" keymap "Select Buffer" [... ... ... ... ... .= .. ... ... ... ...] (frames-separator "--") (frames menu-item "Frames" ...)= (command-separator "--") (next-buffer menu-item "Next Buffer" next-buffer = :help "Switch to the \"next\" buffer in a cyclic order") (previous-buffer m= enu-item "Previous Buffer" previous-buffer :help "Switch to the \"previous\= " buffer in a cyclic order") (select-named-buffer menu-item "Select Named B= uffer..." switch-to-buffer :help "Prompt for a buffer name, and select that= buffer in the current window") (list-all-buffers menu-item "List All Buffe= rs" list-buffers :help "Pop up a window listing all Emacs buffers")) (tools= "Tools" keymap (grep menu-item "Search Files (Grep)..." grep :help "Search= files for strings or regexps (with Grep)") (compile menu-item "Compile..."= compile :help "Invoke compiler or Make, view compilation errors") (shell m= enu-item "Shell Command..." shell-command :help "Invoke a shell command and= catch its output") (shell-on-region menu-item "Shell Command on Region..."= shell-command-on-region :enable mark-active :help "Pass marked region to a= shell command") (gdb menu-item "Debugger (GDB)..." gdb :help "Debug a prog= ram from within Emacs with GDB") (ede menu-item "Project support (EDE)" glo= bal-ede-mode :help "Toggle the Emacs Development Environment (Global EDE mo= de)" :button ...) (semantic menu-item "Source Code Parsers (Semantic)" sema= ntic-mode :help "Toggle automatic parsing in source code buffers (Semantic = mode)" :button ...) (separator-prog "--") (spell menu-item "Spell Checking"= ispell-menu-map) (separator-spell "--") (compare menu-item "Compare (Ediff= )" menu-bar-ediff-menu) (ediff-merge menu-item "Merge" menu-bar-ediff-merge= -menu) (epatch menu-item "Apply Patch" menu-bar-epatch-menu) (separator-com= pare "--") (vc menu-item "Version Control" vc-menu-map :filter vc-menu-map-= filter) (pcl-cvs menu-item "PCL-CVS" cvs-global-menu) (separator-vc "--") (= gnus menu-item "Read Net News (Gnus)" gnus :help "Read network news groups"= ) (rmail menu-item ... menu-bar-read-mail :visible ... :help "Read your mai= l and reply to it") (compose-mail menu-item ... compose-mail :visible ... := help "Send a mail message") (directory-search menu-item "Directory Search" = eudc-tools-menu) (separator-net "--") (calendar menu-item "Calendar" calend= ar :help "Invoke the Emacs built-in calendar") (calc menu-item "Programmabl= e Calculator" calc :help "Invoke the Emacs built-in full scientific calcula= tor") (simple-calculator menu-item "Simple Calculator" calculator :help "In= voke the Emacs built-in quick calculator") (separator-encryption-decryption= "--") (encryption-decryption menu-item "Encryption/Decryption" ...) (separ= ator-games "--") (games menu-item "Games" ...) "Tools") (mouse-1 . tmm-menu= bar-mouse) (Field menu-item "Field" (keymap "Field" ... ... ... ... ... ...= ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ..= . ... ... ... ... ... ... ... ... ... ...)) (Message menu-item "Message" (k= eymap "Message" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...= ... ... ... ... ... ...)) (Attachments menu-item "Attachments" (keymap "At= tachments" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... = ... ... ... ... ... ...)) nil (help-menu "Help" keymap (emacs-tutorial menu= -item "Emacs Tutorial" help-with-tutorial :help "Learn how to use Emacs") (= emacs-tutorial-language-specific menu-item "Emacs Tutorial (choose language= )..." help-with-tutorial-spec-language :help "Learn how to use Emacs (choos= e a language)") (emacs-faq menu-item "Emacs FAQ" view-emacs-FAQ :help "Freq= uently asked (and answered) questions about Emacs") (emacs-news menu-item "= Emacs News" view-emacs-news :help "New features of this version") (emacs-kn= own-problems menu-item "Emacs Known Problems" view-emacs-problems :help "Re= ad about known problems with Emacs") (send-emacs-bug-report menu-item "Send= Bug Report..." report-emacs-bug :help "Send e-mail to Emacs maintainers") = (emacs-psychotherapist menu-item "Emacs Psychotherapist" doctor :help "Our = doctor will help you feel better") (sep1 "--") (search-documentation menu-i= tem "Search Documentation" ...) (describe menu-item "Describe" ...) (emacs-= manual menu-item "Read the Emacs Manual" info-emacs-manual :help "Full docu= mentation of Emacs features") (more-manuals menu-item "More Manuals" ...) (= find-emacs-packages menu-item "Find Emacs Packages" finder-by-keyword :help= "Find packages and features by keyword") (external-packages menu-item "Ext= ernal Packages" menu-bar-help-extra-packages :help "Lisp packages distribut= ed separately for use in Emacs") (sep2 "--") (getting-new-versions menu-ite= m "Getting New Versions" describe-distribution :help "How to get the latest= version of Emacs") (describe-copying menu-item "Copying Conditions" descri= be-copying :help "Show the Emacs license (GPL)") (describe-no-warranty menu= -item "(Non)Warranty" describe-no-warranty :help "Explain that Emacs has NO= WARRANTY") (sep4 "--") (about-emacs menu-item "About Emacs" about-emacs :h= elp "Display version number, copyright info, and basic help") (about-gnu-pr= oject menu-item "About GNU" describe-gnu-project :help "About the GNU Syste= m, GNU Project, and GNU/Linux") "Help"))) (let ((gl-str "Menu bar") tmm-km-list out history history-len tmm-table-u= ndef tmm-c-prompt tmm-old-mb-map tmm-old-comp-map tmm-short-cuts chosen-str= ing choice (not-menu ...)) (run-hooks (quote activate-menubar-hook)) (mapc = (lambda ... ...) menu) (if (and not-menu ...) (setq choice ...) (unless tmm= -km-list ...) (and tmm-km-list ...) (setq choice ...) (and ... ... ... ...)= (and ... out ...)) (setq chosen-string (car choice)) (setq choice (cdr cho= ice)) (cond (in-popup choice) (not-menu ...) (... ... ... ...) (choice ...)= )) tmm-prompt((keymap (file "File" keymap (new-file menu-item "Visit New Fil= e..." find-file :enable ... :help "Specify a new file's name, to edit the f= ile") (open-file menu-item "Open File..." menu-find-file-existing :enable .= .. :help "Read an existing file into an Emacs buffer") (dired menu-item "Op= en Directory..." dired :enable ... :help "Read a directory, to operate on i= ts files") (insert-file menu-item "Insert File..." insert-file :enable ... = :help "Insert another file into current buffer") (kill-buffer menu-item "Cl= ose" kill-this-buffer :enable ... :help "Discard (kill) current buffer") (s= eparator-save "--") (save-buffer menu-item "Save" save-buffer :enable ... := help "Save current buffer to its file") (write-file menu-item "Save As..." = write-file :enable ... :help "Write current buffer to another file") (rever= t-buffer menu-item "Revert Buffer" revert-buffer :enable ... :help "Re-read= current buffer from its file") (recover-session menu-item "Recover Crashed= Session" recover-session :enable ... :help "Recover edits from a crashed s= ession") (separator-print "--") (print-buffer menu-item "Print Buffer" prin= t-buffer :enable ... :help "Print current buffer with page headings") (prin= t-region menu-item "Print Region" print-region :enable mark-active :help "P= rint region between mark and current position") (ps-print-buffer-faces menu= -item "Postscript Print Buffer" ps-print-buffer-with-faces :enable ... :hel= p "Pretty-print current buffer to PostScript printer") (ps-print-region-fac= es menu-item "Postscript Print Region" ps-print-region-with-faces :enable m= ark-active :help "Pretty-print marked region to PostScript printer") (ps-pr= int-buffer menu-item "Postscript Print Buffer (B+W)" ps-print-buffer :enabl= e ... :help "Pretty-print current buffer in black and white to PostScript p= rinter") (ps-print-region menu-item "Postscript Print Region (B+W)" ps-prin= t-region :enable mark-active :help "Pretty-print marked region in black and= white to PostScript printer") (separator-window "--") (split-window menu-i= tem "Split Window" split-window-vertically :enable ... :help "Split selecte= d window in two windows") (one-window menu-item "Remove Splits" delete-othe= r-windows :enable ... :help "Selected window grows to fill the whole frame"= ) (make-frame menu-item "New Frame" make-frame-command :visible ... :help "= Open a new frame") (make-frame-on-display menu-item "New Frame on Display..= ." make-frame-on-display :visible ... :help "Open a new frame on another di= splay") (delete-this-frame menu-item "Delete Frame" delete-frame :visible .= .. :enable ... :help "Delete currently selected frame") (separator-exit "--= ") (exit-emacs menu-item "Quit" save-buffers-kill-terminal :help "Save unsa= ved buffers, then exit") "File") (edit "Edit" keymap (undo menu-item "Undo"= undo :enable ... :help "Undo last operation") (cut "Cut" "Delete text in r= egion and copy it to the clipboard" . clipboard-kill-region) (copy "Copy" "= Copy text in region to the clipboard" . clipboard-kill-ring-save) (paste me= nu-item "Paste" x-clipboard-yank :enable ... :help "Paste (yank) text most = recently cut/copied") (paste-from-menu menu-item "Paste from Kill Menu" yan= k-menu :enable ... :help "Choose a string from the kill ring and paste it")= (clear menu-item "Clear" delete-region :enable ... :help "Delete the text = in region between mark and current position") (mark-whole-buffer menu-item = "Select All" mark-whole-buffer :help "Mark the whole buffer for a subsequen= t cut/copy") (separator-search "--") (search menu-item "Search" ...) (repla= ce menu-item "Replace" ...) (goto menu-item "Go To" ...) (bookmark menu-ite= m "Bookmarks" menu-bar-bookmark-map) (separator-bookmark "--") (fill menu-i= tem "Fill" fill-region :enable ... :help "Fill text in region to fit betwee= n left and right margin") (props menu-item "Text Properties" facemenu-menu)= "Edit") (options "Options" keymap (transient-mark-mode menu-item "Active R= egion Highlighting" transient-mark-mode :enable ... :help "Make text in act= ive region stand out in color (Transient Mark mode)" :button ...) (highligh= t-paren-mode menu-item "Paren Match Highlighting" show-paren-mode :help "Hi= ghlight matching/mismatched parentheses at cursor (Show Paren mode)" :butto= n ...) (highlight-separator "--") (line-wrapping menu-item "Line Wrapping i= n this Buffer" ...) (auto-fill-mode menu-item "Auto Fill in Text Modes" men= u-bar-text-mode-auto-fill :help "Automatically fill text while typing (Auto= Fill mode)" :button ...) (case-fold-search menu-item "Case-Insensitive Sea= rch" toggle-case-fold-search :help "Ignore letter-case in search commands" = :button ...) (cua-emulation-mode menu-item "Shift movement mark region (CUA= )" cua-mode :visible ... :help "Use shifted movement keys to set and extend= the region." :button ...) (cua-mode menu-item "C-x/C-c/C-v Cut and Paste (= CUA)" cua-mode :visible ... :help "Use C-z/C-x/C-c/C-v keys for undo/cut/co= py/paste" :button ...) (edit-options-separator "--") (uniquify menu-item "U= se Directory Names in Buffer Names" toggle-uniquify-buffer-names :help "Uni= quify buffer names by adding parent directory names" :button ...) (save-pla= ce menu-item "Save Place in Files between Sessions" toggle-save-place-globa= lly :help "Visit files of previous session when restarting Emacs" :button .= ..) (cursor-separator "--") (blink-cursor-mode menu-item "Blinking Cursor" = blink-cursor-mode :help "Whether the cursor blinks (Blink Cursor mode)" :bu= tton ...) (debugger-separator "--") (debug-on-error menu-item "Enter Debugg= er on Error" toggle-debug-on-error :help "Enter Lisp debugger when an error= is signaled" :button ...) (debug-on-quit menu-item "Enter Debugger on Quit= /C-g" toggle-debug-on-quit :help "Enter Lisp debugger when C-g is pressed" = :button ...) (mule-separator "--") (mule menu-item "Mule (Multilingual Envi= ronment)" ...) (showhide-separator "--") (showhide menu-item "Show/Hide" ..= .) (menu-set-font menu-item "Set Default Font..." menu-set-font :visible ..= . :help "Select a default font") (custom-separator "--") (save menu-item "S= ave Options" menu-bar-options-save :help "Save options set from the menu ab= ove") (customize menu-item "Customize Emacs" ...) "Options" (package menu-i= tem "Manage Packages" package-list-packages :help "Install or uninstall add= itional Emacs packages")) (buffer "Buffers" keymap "Select Buffer" [... ...= ... ... ... ... ... ... ... ...] (frames-separator "--") (frames menu-item= "Frames" ...) (command-separator "--") (next-buffer menu-item "Next Buffer= " next-buffer :help "Switch to the \"next\" buffer in a cyclic order") (pre= vious-buffer menu-item "Previous Buffer" previous-buffer :help "Switch to t= he \"previous\" buffer in a cyclic order") (select-named-buffer menu-item "= Select Named Buffer..." switch-to-buffer :help "Prompt for a buffer name, a= nd 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 buf= fers")) (tools "Tools" keymap (grep menu-item "Search Files (Grep)..." grep= :help "Search files for strings or regexps (with Grep)") (compile menu-ite= m "Compile..." compile :help "Invoke compiler or Make, view compilation err= ors") (shell menu-item "Shell Command..." shell-command :help "Invoke a she= ll command and catch its output") (shell-on-region menu-item "Shell Command= on Region..." shell-command-on-region :enable mark-active :help "Pass mark= ed region to a shell command") (gdb menu-item "Debugger (GDB)..." gdb :help= "Debug a program from within Emacs with GDB") (ede menu-item "Project supp= ort (EDE)" global-ede-mode :help "Toggle the Emacs Development Environment = (Global EDE mode)" :button ...) (semantic menu-item "Source Code Parsers (S= emantic)" semantic-mode :help "Toggle automatic parsing in source code buff= ers (Semantic mode)" :button ...) (separator-prog "--") (spell menu-item "S= pell Checking" ispell-menu-map) (separator-spell "--") (compare menu-item "= Compare (Ediff)" menu-bar-ediff-menu) (ediff-merge menu-item "Merge" menu-b= ar-ediff-merge-menu) (epatch menu-item "Apply Patch" menu-bar-epatch-menu) = (separator-compare "--") (vc menu-item "Version Control" vc-menu-map :filte= r vc-menu-map-filter) (pcl-cvs menu-item "PCL-CVS" cvs-global-menu) (separa= tor-vc "--") (gnus menu-item "Read Net News (Gnus)" gnus :help "Read networ= k news groups") (rmail menu-item ... menu-bar-read-mail :visible ... :help = "Read your mail and reply to it") (compose-mail menu-item ... compose-mail = :visible ... :help "Send a mail message") (directory-search menu-item "Dire= ctory Search" eudc-tools-menu) (separator-net "--") (calendar menu-item "Ca= lendar" calendar :help "Invoke the Emacs built-in calendar") (calc menu-ite= m "Programmable Calculator" calc :help "Invoke the Emacs built-in full scie= ntific calculator") (simple-calculator menu-item "Simple Calculator" calcul= ator :help "Invoke the Emacs built-in quick calculator") (separator-encrypt= ion-decryption "--") (encryption-decryption menu-item "Encryption/Decryptio= n" ...) (separator-games "--") (games menu-item "Games" ...) "Tools") (mous= e-1 . tmm-menubar-mouse) (Field menu-item "Field" (keymap "Field" ... ... .= .. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... = ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) (Message menu-ite= m "Message" (keymap "Message" ... ... ... ... ... ... ... ... ... ... ... .= .. ... ... ... ... ... ... ... ... ...)) (Attachments menu-item "Attachment= s" (keymap "Attachments" ... ... ... ... ... ... ... ... ... ... ... ... ..= . ... ... ... ... ... ... ... ... ...)) nil (help-menu "Help" keymap (emacs= -tutorial menu-item "Emacs Tutorial" help-with-tutorial :help "Learn how to= use Emacs") (emacs-tutorial-language-specific menu-item "Emacs Tutorial (c= hoose language)..." help-with-tutorial-spec-language :help "Learn how to us= e Emacs (choose a language)") (emacs-faq menu-item "Emacs FAQ" view-emacs-F= AQ :help "Frequently asked (and answered) questions about Emacs") (emacs-ne= ws menu-item "Emacs News" view-emacs-news :help "New features of this versi= on") (emacs-known-problems menu-item "Emacs Known Problems" view-emacs-prob= lems :help "Read about known problems with Emacs") (send-emacs-bug-report m= enu-item "Send Bug Report..." report-emacs-bug :help "Send e-mail to Emacs = maintainers") (emacs-psychotherapist menu-item "Emacs Psychotherapist" doct= or :help "Our doctor will help you feel better") (sep1 "--") (search-docume= ntation menu-item "Search Documentation" ...) (describe menu-item "Describe= " ...) (emacs-manual menu-item "Read the Emacs Manual" info-emacs-manual :h= elp "Full documentation of Emacs features") (more-manuals menu-item "More M= anuals" ...) (find-emacs-packages menu-item "Find Emacs Packages" finder-by= -keyword :help "Find packages and features by keyword") (external-packages = menu-item "External Packages" menu-bar-help-extra-packages :help "Lisp pack= ages distributed separately for use in Emacs") (sep2 "--") (getting-new-ver= sions menu-item "Getting New Versions" describe-distribution :help "How to = get the latest version of Emacs") (describe-copying menu-item "Copying Cond= itions" describe-copying :help "Show the Emacs license (GPL)") (describe-no= -warranty menu-item "(Non)Warranty" describe-no-warranty :help "Explain tha= t Emacs has NO WARRANTY") (sep4 "--") (about-emacs menu-item "About Emacs" = about-emacs :help "Display version number, copyright info, and basic help")= (about-gnu-project menu-item "About GNU" describe-gnu-project :help "About= the GNU System, GNU Project, and GNU/Linux") "Help")) nil nil) (let ((menu-bar ...) menu-bar-item) (let (...) (while list ... ...)) (if = x-position (let ... ... ...)) (tmm-prompt menu-bar nil menu-bar-item)) tmm-menubar() call-interactively(tmm-menubar nil nil) --8<---------------cut here---------------end--------------->8---