From unknown Sat Jun 14 05:05:16 2025 X-Loop: don@donarmstrong.com Subject: bug#1164: 23.0.60; Doc strings of mode-name, mode-line-format and format-mode-line Reply-To: Eli Zaretskii , 1164@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 14 Oct 2008 12:25:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1164 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122398679515619 (code B ref -1); Tue, 14 Oct 2008 12:25:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.4 required=4.0 tests=AWL,BAYES_00,FOURLA, RCVD_IN_DNSWL_MED,RCVD_IN_NIX1 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 14 Oct 2008 12:19:55 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9ECJq1L015613 for ; Tue, 14 Oct 2008 05:19:53 -0700 Received: from mail.gnu.org ([199.232.76.166]:58352 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Kpiq1-00084t-3E for emacs-pretest-bug@gnu.org; Tue, 14 Oct 2008 08:17:21 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KpisQ-0002N2-SU for emacs-pretest-bug@gnu.org; Tue, 14 Oct 2008 08:19:51 -0400 Received: from mtaout7.012.net.il ([84.95.2.19]:17150) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KpisQ-0002Mi-Cp for emacs-pretest-bug@gnu.org; Tue, 14 Oct 2008 08:19:50 -0400 Received: from HOME-C4E4A596F7 ([77.127.24.3]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K8Q00JP3ABA1880@i-mtaout7.012.net.il> for emacs-pretest-bug@gnu.org; Tue, 14 Oct 2008 14:21:10 +0200 (IST) Date: Tue, 14 Oct 2008 14:19:53 +0200 From: Eli Zaretskii X-012-Sender: halo1@inter.net.il To: emacs-pretest-bug@gnu.org Message-id: X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (1203?) Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: "C-h v mode-name RET" produces: mode-name is a variable defined in `buffer.c'. Its value is "Emacs-Lisp" Local in buffer bindings.el; global value is 0 Automatically becomes buffer-local when set in any fashion. Documentation: Pretty name of current buffer's major mode. Usually a string. See `mode-line-format' for other possible forms. Use the function `format-mode-line' to get the value as a string. The line before the last refers to mode-line-format for possible forms of mode-name. However, nothing in the doc string of mode-line-format says anything specific about the form of mode-name, and neither does the doc string of format-mode-line say anything about how to produce a string out of mode-name. In general, I loathe references to other doc strings for important information: it's a nuisance to chase multiple links when you need to do a simple job such as displaying the mode name. Unless the information is large and complex, it is better to reproduce it where it is needed, even if that requires some duplication. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file d:/gnu/emacs/etc/DEBUG for instructions. In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-10-14 on HOME-C4E4A596F7 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENU value of $XMODIFIERS: nil locale-coding-system: cp1255 default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: show-paren-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x C-f l i s / b i n d C-s m o d e C-s m a j C-s C-s C-h v C-x o C-x o C-h v m o d e - n a e m e M-x e m a c s - r e p o r e p o r t Recent messages: Making completion list... Quit call-interactively: End of buffer Mark set Quit [2 times] call-interactively: End of buffer Mark saved where search started [3 times] Mark set [3 times] Mark saved where search started [3 times] Type C-x 4 C-o RET to restore the other window, C-M-v to scroll help. From unknown Sat Jun 14 05:05:16 2025 X-Loop: don@donarmstrong.com Subject: bug#1164: 23.0.60; Doc strings of mode-name, mode-line-format and format-mode-line Reply-To: Glenn Morris , 1164@debbugs.gnu.org Resent-From: Glenn Morris Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 14 Oct 2008 19:50:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1164 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1164-submit@emacsbugs.donarmstrong.com id=B1164.122401348729750 (code B ref 1164); Tue, 14 Oct 2008 19:50:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-10.7 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED,UNRESOLVED_TEMPLATE,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1164) by emacsbugs.donarmstrong.com; 14 Oct 2008 19:44:47 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9EJifmO029744 for <1164@emacsbugs.donarmstrong.com>; Tue, 14 Oct 2008 12:44:42 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1KppmT-00081n-BD; Tue, 14 Oct 2008 15:42:09 -0400 From: Glenn Morris To: Eli Zaretskii Cc: 1164@debbugs.gnu.org References: X-Spook: Osama Audiotel AMW Al-Qaeda MIT-LL unclassified broadside X-Ran: ak&?yxr9O1=;eoo0\?4G=|C3]e9uDidgu%d8k2K"h#h"_Bde1c6v12Ndz:`q&c?E5E%NFq X-Hue: red X-Attribution: GM Date: Tue, 14 Oct 2008 15:42:09 -0400 In-Reply-To: (Eli Zaretskii's message of "Tue, 14 Oct 2008 14:19:53 +0200") Message-ID: <4x1vyjklpq.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Eli Zaretskii wrote: > Usually a string. See `mode-line-format' for other possible forms. > Use the function `format-mode-line' to get the value as a string. Better? This is usually a string, but can take any of the forms described for `mode-line-format'. Use `(format-mode-line mode-name)' to ensure a string value. From unknown Sat Jun 14 05:05:16 2025 X-Loop: don@donarmstrong.com Subject: bug#1164: 23.0.60; Doc strings of mode-name, mode-line-format and format-mode-line Reply-To: Eli Zaretskii , 1164@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 14 Oct 2008 19:55:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1164 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1164-submit@emacsbugs.donarmstrong.com id=B1164.122401379630958 (code B ref 1164); Tue, 14 Oct 2008 19:55:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.0 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_NIX1 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1164) by emacsbugs.donarmstrong.com; 14 Oct 2008 19:49:56 +0000 Received: from mtaout1.012.net.il (mtaout1.012.net.il [84.95.2.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9EJnqLG030952 for <1164@emacsbugs.donarmstrong.com>; Tue, 14 Oct 2008 12:49:54 -0700 Received: from HOME-C4E4A596F7 ([77.127.24.3]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K8Q00DF9V3H1670@i-mtaout1.012.net.il> for 1164@emacsbugs.donarmstrong.com; Tue, 14 Oct 2008 21:50:06 +0200 (IST) Date: Tue, 14 Oct 2008 21:48:49 +0200 From: Eli Zaretskii In-reply-to: <4x1vyjklpq.fsf@fencepost.gnu.org> X-012-Sender: halo1@inter.net.il To: Glenn Morris Cc: 1164@debbugs.gnu.org Message-id: References: <4x1vyjklpq.fsf@fencepost.gnu.org> > From: Glenn Morris > Cc: 1164@emacsbugs.donarmstrong.com > Date: Tue, 14 Oct 2008 15:42:09 -0400 > > Better? > > This is usually a string, but can take any of the forms described for > `mode-line-format'. Use `(format-mode-line mode-name)' to ensure a > string value. Yes, much better, if that's the whole truth and nothing but the truth. Is it? From unknown Sat Jun 14 05:05:16 2025 X-Loop: don@donarmstrong.com Subject: bug#1164: 23.0.60; Doc strings of mode-name, mode-line-format and format-mode-line Reply-To: Eli Zaretskii , 1164@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 14 Oct 2008 20:05:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1164 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1164-submit@emacsbugs.donarmstrong.com id=B1164.1224014154840 (code B ref 1164); Tue, 14 Oct 2008 20:05:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.0 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_NIX1 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1164) by emacsbugs.donarmstrong.com; 14 Oct 2008 19:55:54 +0000 Received: from mtaout4.012.net.il (mtaout4.012.net.il [84.95.2.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9EJtpLo000834 for <1164@emacsbugs.donarmstrong.com>; Tue, 14 Oct 2008 12:55:52 -0700 Received: from HOME-C4E4A596F7 ([77.127.24.3]) by i_mtaout4.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K8Q005MUVF71RJ2@i_mtaout4.012.net.il> for 1164@emacsbugs.donarmstrong.com; Tue, 14 Oct 2008 21:57:07 +0200 (IST) Date: Tue, 14 Oct 2008 21:55:50 +0200 From: Eli Zaretskii In-reply-to: <4x1vyjklpq.fsf@fencepost.gnu.org> X-012-Sender: halo1@inter.net.il To: Glenn Morris Cc: 1164@debbugs.gnu.org Message-id: References: <4x1vyjklpq.fsf@fencepost.gnu.org> > From: Glenn Morris > Cc: 1164@emacsbugs.donarmstrong.com > Date: Tue, 14 Oct 2008 15:42:09 -0400 > > Use `(format-mode-line mode-name)' to ensure a string value. Many users of format-mode-line do this: (format-mode-line mode-name nil nil buf) where BUF is some buffer. So evidently this isn't the whole story. From unknown Sat Jun 14 05:05:16 2025 X-Loop: don@donarmstrong.com Subject: bug#1164: 23.0.60; Doc strings of mode-name, mode-line-format and format-mode-line Reply-To: Glenn Morris , 1164@debbugs.gnu.org Resent-From: Glenn Morris Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 14 Oct 2008 20:55:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1164 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1164-submit@emacsbugs.donarmstrong.com id=B1164.122401716413500 (code B ref 1164); Tue, 14 Oct 2008 20:55:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-12.2 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1164) by emacsbugs.donarmstrong.com; 14 Oct 2008 20:46:04 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9EKk1LJ013494 for <1164@emacsbugs.donarmstrong.com>; Tue, 14 Oct 2008 13:46:02 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1Kpqjp-0002vl-Kg; Tue, 14 Oct 2008 16:43:29 -0400 From: Glenn Morris To: Eli Zaretskii Cc: 1164@debbugs.gnu.org References: <4x1vyjklpq.fsf@fencepost.gnu.org> X-Spook: beanpole tempest Abu Ghraib Lon Horiuchi Leuken-Baden X-Ran: \(:FD}(pYlW}x'vnl2w,`v X-Hue: magenta X-Attribution: GM Date: Tue, 14 Oct 2008 16:43:29 -0400 In-Reply-To: (Eli Zaretskii's message of "Tue, 14 Oct 2008 21:55:50 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Pretty name of current buffer's major mode. This is usually a string, but can take any of the forms described for `mode-line-format'. Pass to `format-mode-line' to get the value as a string, as it would appear in the mode line. ? From unknown Sat Jun 14 05:05:16 2025 X-Loop: don@donarmstrong.com Subject: bug#1164: 23.0.60; Doc strings of mode-name, mode-line-format and format-mode-line Reply-To: Eli Zaretskii , 1164@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 15 Oct 2008 11:45:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1164 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1164-submit@emacsbugs.donarmstrong.com id=B1164.12240706508665 (code B ref 1164); Wed, 15 Oct 2008 11:45:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.1 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_NIX1 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1164) by emacsbugs.donarmstrong.com; 15 Oct 2008 11:37:30 +0000 Received: from mtaout6.012.net.il (mtaout6.012.net.il [84.95.2.16]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9FBbMOT008659 for <1164@emacsbugs.donarmstrong.com>; Wed, 15 Oct 2008 04:37:24 -0700 Received: from HOME-C4E4A596F7 ([77.127.24.3]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K8S00LZ130ADL90@i-mtaout6.012.net.il> for 1164@emacsbugs.donarmstrong.com; Wed, 15 Oct 2008 13:38:34 +0200 (IST) Date: Wed, 15 Oct 2008 13:37:17 +0200 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il To: Glenn Morris Cc: 1164@debbugs.gnu.org Message-id: References: <4x1vyjklpq.fsf@fencepost.gnu.org> > From: Glenn Morris > Cc: 1164@emacsbugs.donarmstrong.com > Date: Tue, 14 Oct 2008 16:43:29 -0400 > > > Pretty name of current buffer's major mode. > This is usually a string, but can take any of the forms described for > `mode-line-format'. Pass to `format-mode-line' to get the value > as a string, as it would appear in the mode line. > > ? Thanks, I used a variant of the above. Btw, is there any package that actually uses this new functionality? I couldn't find one, but maybe my Grep command was too naive. From unknown Sat Jun 14 05:05:16 2025 X-Loop: don@donarmstrong.com Subject: bug#1164: 23.0.60; Doc strings of mode-name, mode-line-format and format-mode-line Reply-To: Glenn Morris , 1164@debbugs.gnu.org Resent-From: Glenn Morris Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 15 Oct 2008 17:20:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1164 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1164-submit@emacsbugs.donarmstrong.com id=B1164.122409073028571 (code B ref 1164); Wed, 15 Oct 2008 17:20:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-12.2 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,RCVD_IN_DNSWL_MED,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1164) by emacsbugs.donarmstrong.com; 15 Oct 2008 17:12:10 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9FHC7jS028565 for <1164@emacsbugs.donarmstrong.com>; Wed, 15 Oct 2008 10:12:08 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1Kq9sL-0006a2-O4; Wed, 15 Oct 2008 13:09:33 -0400 From: Glenn Morris To: Eli Zaretskii Cc: 1164@debbugs.gnu.org References: <4x1vyjklpq.fsf@fencepost.gnu.org> X-Spook: virus Fedayeen Rubin sweep Semtex Steve Case doctrine X-Ran: E]+.)2V"@&FyG?")JyP1R0~*6]/wL>+s.*v7]RW{jI2PZ,79n$]0ax>(P$r@C3L~m#=hs9 X-Hue: blue X-Attribution: GM Date: Wed, 15 Oct 2008 13:09:33 -0400 In-Reply-To: (Eli Zaretskii's message of "Wed, 15 Oct 2008 13:37:17 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Eli Zaretskii wrote: > Btw, is there any package that actually uses this new functionality? > I couldn't find one, but maybe my Grep command was too naive. textmodes/sgml-mode.el. It is hidden behind a define-derived-mode call: (define-derived-mode sgml-mode text-mode '(sgml-xml-mode "XML" "SGML") "Major mode for editing SGML documents.