* bug#7788: 23.2.91; tmm-menubar command broken: Wrong type argument: stringp, nil
@ 2011-01-05 13:56 Teemu Likonen
2011-01-05 17:09 ` Glenn Morris
2011-01-11 2:31 ` Stefan Monnier
0 siblings, 2 replies; 3+ messages in thread
From: Teemu Likonen @ 2011-01-05 13:56 UTC (permalink / raw)
To: 7788
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 <monnier@iro.umontreal.ca>
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 str ...)))
(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-file :enable ... :help "Specify a new file's name, to edit the file") (open-file 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") (insert-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 current buffer to its file") (write-file menu-item "Save As..." write-file :enable ... :help "Write current buffer to another file") (revert-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 session") (separator-print "--") (print-buffer menu-item "Print Buffer" print-buffer :enable ... :help "Print current buffer with page headings") (print-region menu-item "Print Region" print-region :enable mark-active :help "Print region between mark and current position") (ps-print-buffer-faces menu-item "Postscript Print Buffer" ps-print-buffer-with-faces :enable ... :help "Pretty-print current buffer to PostScript printer") (ps-print-region-faces menu-item "Postscript Print Region" ps-print-region-with-faces :enable mark-active :help "Pretty-print marked region to PostScript printer") (ps-print-buffer menu-item "Postscript Print Buffer (B+W)" ps-print-buffer :enable ... :help "Pretty-print current buffer in black and white to PostScript printer") (ps-print-region menu-item "Postscript Print Region (B+W)" ps-print-region :enable mark-active :help "Pretty-print marked region in black and white to PostScript printer") (separator-window "--") (split-window menu-item "Split Window" split-window-vertically :enable ... :help "Split selected window in two windows") (one-window menu-item "Remove Splits" delete-other-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 display") (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 unsaved buffers, then 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 region to the clipboard" . clipboard-kill-ring-save) (paste menu-item "Paste" x-clipboard-yank :enable ... :help "Paste (yank) text most recently cut/copied") (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-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 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" fill-region :enable ... :help "Fill text in region to fit between left and right margin") (props menu-item "Text Properties" facemenu-menu) "Edit") (options "Options" keymap (transient-mark-mode menu-item "Active Region Highlighting" transient-mark-mode :enable ... :help "Make text in active region stand out in color (Transient Mark mode)" :button ...) (highlight-paren-mode menu-item "Paren Match Highlighting" show-paren-mode :help "Highlight matching/mismatched parentheses at cursor (Show Paren mode)" :button ...) (highlight-separator "--") (line-wrapping menu-item "Line Wrapping in this Buffer" ...) (auto-fill-mode menu-item "Auto Fill in Text Modes" menu-bar-text-mode-auto-fill :help "Automatically fill text while typing (Auto Fill mode)" :button ...) (case-fold-search menu-item "Case-Insensitive Search" 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/copy/paste" :button ...) (edit-options-separator "--") (uniquify menu-item "Use Directory Names in Buffer Names" toggle-uniquify-buffer-names :help "Uniquify buffer names by adding parent directory names" :button ...) (save-place menu-item "Save Place in Files between Sessions" toggle-save-place-globally :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)" :button ...) (debugger-separator "--") (debug-on-error menu-item "Enter Debugger 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 Environment)" ...) (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 "Save Options" menu-bar-options-save :help "Save options set from the menu above") (customize menu-item "Customize Emacs" ...) "Options" (package menu-item "Manage Packages" 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 menu-item "Previous Buffer" previous-buffer :help "Switch to the \"previous\" buffer in a cyclic order") (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")) (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 menu-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 program from within Emacs with GDB") (ede menu-item "Project support (EDE)" global-ede-mode :help "Toggle the Emacs Development Environment (Global EDE mode)" :button ...) (semantic menu-item "Source Code Parsers (Semantic)" semantic-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-compare "--") (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 mail 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" calendar :help "Invoke the Emacs built-in calendar") (calc menu-item "Programmable Calculator" calc :help "Invoke the Emacs built-in full scientific calculator") (simple-calculator menu-item "Simple Calculator" calculator :help "Invoke the Emacs built-in quick calculator") (separator-encryption-decryption "--") (encryption-decryption menu-item "Encryption/Decryption" ...) (separator-games "--") (games menu-item "Games" ...) "Tools") (mouse-1 . tmm-menubar-mouse) (Field menu-item "Field" (keymap "Field" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) (Message menu-item "Message" (keymap "Message" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) (Attachments menu-item "Attachments" (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 (choose language)..." help-with-tutorial-spec-language :help "Learn how to use Emacs (choose a language)") (emacs-faq menu-item "Emacs FAQ" view-emacs-FAQ :help "Frequently asked (and answered) questions about Emacs") (emacs-news menu-item "Emacs News" view-emacs-news :help "New features of this version") (emacs-known-problems menu-item "Emacs Known Problems" view-emacs-problems :help "Read 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-item "Search Documentation" ...) (describe menu-item "Describe" ...) (emacs-manual menu-item "Read the Emacs Manual" info-emacs-manual :help "Full documentation 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 "External Packages" menu-bar-help-extra-packages :help "Lisp packages distributed separately for use in Emacs") (sep2 "--") (getting-new-versions menu-item "Getting New Versions" describe-distribution :help "How to get the latest version of Emacs") (describe-copying menu-item "Copying Conditions" describe-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 :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")))
(let ((gl-str "Menu bar") tmm-km-list out history history-len tmm-table-undef tmm-c-prompt tmm-old-mb-map tmm-old-comp-map tmm-short-cuts chosen-string 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 choice)) (cond (in-popup choice) (not-menu ...) (... ... ... ...) (choice ...)))
tmm-prompt((keymap (file "File" keymap (new-file menu-item "Visit New File..." find-file :enable ... :help "Specify a new file's name, to edit the file") (open-file 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") (insert-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 current buffer to its file") (write-file menu-item "Save As..." write-file :enable ... :help "Write current buffer to another file") (revert-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 session") (separator-print "--") (print-buffer menu-item "Print Buffer" print-buffer :enable ... :help "Print current buffer with page headings") (print-region menu-item "Print Region" print-region :enable mark-active :help "Print region between mark and current position") (ps-print-buffer-faces menu-item "Postscript Print Buffer" ps-print-buffer-with-faces :enable ... :help "Pretty-print current buffer to PostScript printer") (ps-print-region-faces menu-item "Postscript Print Region" ps-print-region-with-faces :enable mark-active :help "Pretty-print marked region to PostScript printer") (ps-print-buffer menu-item "Postscript Print Buffer (B+W)" ps-print-buffer :enable ... :help "Pretty-print current buffer in black and white to PostScript printer") (ps-print-region menu-item "Postscript Print Region (B+W)" ps-print-region :enable mark-active :help "Pretty-print marked region in black and white to PostScript printer") (separator-window "--") (split-window menu-item "Split Window" split-window-vertically :enable ... :help "Split selected window in two windows") (one-window menu-item "Remove Splits" delete-other-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 display") (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 unsaved buffers, then 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 region to the clipboard" . clipboard-kill-ring-save) (paste menu-item "Paste" x-clipboard-yank :enable ... :help "Paste (yank) text most recently cut/copied") (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-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 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" fill-region :enable ... :help "Fill text in region to fit between left and right margin") (props menu-item "Text Properties" facemenu-menu) "Edit") (options "Options" keymap (transient-mark-mode menu-item "Active Region Highlighting" transient-mark-mode :enable ... :help "Make text in active region stand out in color (Transient Mark mode)" :button ...) (highlight-paren-mode menu-item "Paren Match Highlighting" show-paren-mode :help "Highlight matching/mismatched parentheses at cursor (Show Paren mode)" :button ...) (highlight-separator "--") (line-wrapping menu-item "Line Wrapping in this Buffer" ...) (auto-fill-mode menu-item "Auto Fill in Text Modes" menu-bar-text-mode-auto-fill :help "Automatically fill text while typing (Auto Fill mode)" :button ...) (case-fold-search menu-item "Case-Insensitive Search" 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/copy/paste" :button ...) (edit-options-separator "--") (uniquify menu-item "Use Directory Names in Buffer Names" toggle-uniquify-buffer-names :help "Uniquify buffer names by adding parent directory names" :button ...) (save-place menu-item "Save Place in Files between Sessions" toggle-save-place-globally :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)" :button ...) (debugger-separator "--") (debug-on-error menu-item "Enter Debugger 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 Environment)" ...) (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 "Save Options" menu-bar-options-save :help "Save options set from the menu above") (customize menu-item "Customize Emacs" ...) "Options" (package menu-item "Manage Packages" 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 menu-item "Previous Buffer" previous-buffer :help "Switch to the \"previous\" buffer in a cyclic order") (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")) (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 menu-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 program from within Emacs with GDB") (ede menu-item "Project support (EDE)" global-ede-mode :help "Toggle the Emacs Development Environment (Global EDE mode)" :button ...) (semantic menu-item "Source Code Parsers (Semantic)" semantic-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-compare "--") (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 mail 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" calendar :help "Invoke the Emacs built-in calendar") (calc menu-item "Programmable Calculator" calc :help "Invoke the Emacs built-in full scientific calculator") (simple-calculator menu-item "Simple Calculator" calculator :help "Invoke the Emacs built-in quick calculator") (separator-encryption-decryption "--") (encryption-decryption menu-item "Encryption/Decryption" ...) (separator-games "--") (games menu-item "Games" ...) "Tools") (mouse-1 . tmm-menubar-mouse) (Field menu-item "Field" (keymap "Field" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) (Message menu-item "Message" (keymap "Message" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) (Attachments menu-item "Attachments" (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 (choose language)..." help-with-tutorial-spec-language :help "Learn how to use Emacs (choose a language)") (emacs-faq menu-item "Emacs FAQ" view-emacs-FAQ :help "Frequently asked (and answered) questions about Emacs") (emacs-news menu-item "Emacs News" view-emacs-news :help "New features of this version") (emacs-known-problems menu-item "Emacs Known Problems" view-emacs-problems :help "Read 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-item "Search Documentation" ...) (describe menu-item "Describe" ...) (emacs-manual menu-item "Read the Emacs Manual" info-emacs-manual :help "Full documentation 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 "External Packages" menu-bar-help-extra-packages :help "Lisp packages distributed separately for use in Emacs") (sep2 "--") (getting-new-versions menu-item "Getting New Versions" describe-distribution :help "How to get the latest version of Emacs") (describe-copying menu-item "Copying Conditions" describe-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 :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---
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#7788: 23.2.91; tmm-menubar command broken: Wrong type argument: stringp, nil
2011-01-05 13:56 bug#7788: 23.2.91; tmm-menubar command broken: Wrong type argument: stringp, nil Teemu Likonen
@ 2011-01-05 17:09 ` Glenn Morris
2011-01-11 2:31 ` Stefan Monnier
1 sibling, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2011-01-05 17:09 UTC (permalink / raw)
To: 7788
merge 7721 7788
stop
Dupe of http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7721
(with a backtrace this time though)
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#7788: 23.2.91; tmm-menubar command broken: Wrong type argument: stringp, nil
2011-01-05 13:56 bug#7788: 23.2.91; tmm-menubar command broken: Wrong type argument: stringp, nil Teemu Likonen
2011-01-05 17:09 ` Glenn Morris
@ 2011-01-11 2:31 ` Stefan Monnier
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2011-01-11 2:31 UTC (permalink / raw)
To: Teemu Likonen; +Cc: 7788
close 7721
thanks
> Sometimes tmm-menubar command doesn't work because it stops with error
[...]
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
> string-width(nil)
> (- colwidth (string-width str) (string-width binding))
Thanks a lot for the backtrace. I think it is a symptom of an invalid
entry in one of the keymaps, but indeed it's also a bug in tmm.el.
I've installed the patch below into the emacs-23 branch which should
fix it.
Stefan
=== modified file 'lisp/tmm.el'
--- lisp/tmm.el 2011-01-02 23:50:46 +0000
+++ lisp/tmm.el 2011-01-11 02:27:23 +0000
@@ -497,7 +495,7 @@
(if (or in-x-menu (stringp (car-safe elt)))
(setq str event event nil km elt)
(setq str event event nil km (cons 'keymap elt)))))
- (unless (eq km 'ignore)
+ (unless (or (eq km 'ignore) (null str))
(let ((binding (where-is-internal km nil t)))
(when binding
(setq binding (key-description binding))
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-11 2:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 13:56 bug#7788: 23.2.91; tmm-menubar command broken: Wrong type argument: stringp, nil Teemu Likonen
2011-01-05 17:09 ` Glenn Morris
2011-01-11 2:31 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.