From unknown Tue Aug 19 10:00:15 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#68600 <68600@debbugs.gnu.org> To: bug#68600 <68600@debbugs.gnu.org> Subject: Status: 30.0.50; Bad mode hook docstring when mode-line constructs are present in the mode-name Reply-To: bug#68600 <68600@debbugs.gnu.org> Date: Tue, 19 Aug 2025 17:00:15 +0000 retitle 68600 30.0.50; Bad mode hook docstring when mode-line constructs ar= e present in the mode-name reassign 68600 emacs submitter 68600 Phil Sainty severity 68600 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 20 00:16:20 2024 Received: (at submit) by debbugs.gnu.org; 20 Jan 2024 05:16:20 +0000 Received: from localhost ([127.0.0.1]:60676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rR3iN-00073p-5f for submit@debbugs.gnu.org; Sat, 20 Jan 2024 00:16:20 -0500 Received: from lists.gnu.org ([2001:470:142::17]:34738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rR3iK-0006wa-Ud for submit@debbugs.gnu.org; Sat, 20 Jan 2024 00:16:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rR3iC-0001CZ-N9 for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 00:16:08 -0500 Received: from smtp-2.orcon.net.nz ([60.234.4.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rR3i8-0001op-9q for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 00:16:08 -0500 Received: from [10.253.37.70] (port=52087 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1rR3hv-0004Iz-OX for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 18:15:55 +1300 Received: from ip-139-180-86-108.kinect.net.nz ([139.180.86.108]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Sat, 20 Jan 2024 18:15:51 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 20 Jan 2024 18:15:51 +1300 From: Phil Sainty To: bug-gnu-emacs@gnu.org Subject: 30.0.50; Bad mode hook docstring when mode-line constructs are present in the mode-name Message-ID: X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- Received-SPF: pass client-ip=60.234.4.43; envelope-from=psainty@orcon.net.nz; helo=smtp-2.orcon.net.nz X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) If we define a major mode with mode-line constructs in its mode-name (in this example using a copy of the constructs from `emacs-lisp-mode'): ;; Force hook docstring re-generation: (put 'example-lisp-mode-hook 'variable-documentation nil) (define-derived-mode example-lisp-mode lisp-data-mode `("Example" (lexical-binding (:propertize "/l" help-echo "Using lexical-binding mode") (:propertize "/d" help-echo "Using old dynamic scoping mode\n\ mouse-1: Enable lexical-binding mode" face warning mouse-face mode-line-highlight local-map ,elisp--dynlex-modeline-map))) "Example mode.") Then, unles we have previously defined the mode hook variable with a custom docstring (which seems to be the workaround in the meantime), C-h v example-lisp-mode-hook says: Hook run after entering `(Example (lexical-binding (:propertize /l help-echo Using lexical-binding mode) (:propertize /d help-echo Using old dynamic scoping mode mouse-1: Enable lexical-binding mode face warning mouse-face mode-line-highlight local-map ,elisp--dynlex-modeline-map))) mode. Instead of: "Hook run after entering Example mode." I figure `format-mode-line' needs to be called on the `mode-name' when generating the docstring for the mode hook (which possibly means making these docstrings dynamic?) -Phil In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars) of 2024-01-09 built on phil-lp Repository revision: 774c8ec74c98d69d56b2511a613145f2b69fb2eb Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Ubuntu 22.04.3 LTS Configured using: 'configure --prefix=/home/phil/emacs/trunk/usr/local --without-native-compilation --with-x-toolkit=lucid --without-sound '--program-transform-name=s/^ctags$/ctags_emacs/'' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XPM LUCID ZLIB Important settings: value of $LC_MONETARY: en_NZ.UTF-8 value of $LC_NUMERIC: en_NZ.UTF-8 value of $LC_TIME: en_NZ.UTF-8 value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8 Major mode: Lisp Interaction Minor modes in effect: hi-lock-mode: t elisp-slime-nav-mode: t hl-sexp-mode: t lexbind-mode: t idle-highlight-mode: t minibuffer-line-mode: t global-edit-server-edit-mode: t savehist-mode: t magit-wip-initial-backup-mode: t magit-wip-before-change-mode: t magit-wip-after-apply-mode: t magit-wip-after-save-mode: t magit-wip-mode: t global-git-commit-mode: t magit-auto-revert-mode: t server-mode: t my-contextual-help-mode: t global-so-long-mode: t display-battery-mode: t my-visible-bell-mode: t cua-mode: t global-display-fill-column-indicator-mode: t display-fill-column-indicator-mode: t minibuffer-depth-indicate-mode: t which-key-mode: t windmove-mode: t winner-mode: t global-subword-mode: t subword-mode: t global-hl-line-mode: t hl-line-mode: t display-time-mode: t keep-buffers-mode: t fic-mode: t my-keys-local-minor-mode: t auto-compile-on-load-mode: t auto-compile-on-save-mode: t url-handler-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t minibuffer-regexp-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/el-get/scratch/el-get hides /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/el-get/el-get/el-get /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/el-get/delight/delight hides /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/elpa/delight-1.7/delight /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/lisp/python hides /home/phil/emacs/trunk/usr/local/share/emacs/30.0.50/lisp/progmodes/python Features: (shadow sort ecomplete mail-extr emacsbug whitespace debug backtrace ibuf-ext face-remap ibuffer ibuffer-loaddefs hippie-exp misearch multi-isearch shortdoc comp-common autoinsert goto-addr find-func cl-print help-fns hi-lock elisp-slime-nav etags fileloop generator xref project hl-sexp lexbind-mode idle-highlight-mode tramp-sh warnings docker-tramp tramp-cache time-stamp tramp trampver tramp-integration files-x tramp-message tramp-compat xdg parse-time iso8601 tramp-loaddefs tabify minibuffer-line edit-server my-org my-projects my-session savehist desktop frameset my-theme zenburn-theme my-mail pcase autoloads my-libraries sudo my-version-control magit-wip magit-log which-func imenu magit-diff smerge-mode diff git-commit rx log-edit message sendmail yank-media puny rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete comint ansi-osc server ansi-color magit-mode transient edmacro kmacro format-spec magit-git magit-section magit-utils crm dash my-text my-programming my-python so-long my-whitespace ws-trim my-rectangles my-utilities browse-kill-ring my-configuration cus-edit pp cus-load wid-edit dired-details dired-x highlight-parentheses battery delight delsel cua-base ffap display-fill-column-indicator mb-depth which-key framemove windmove winner ring cap-words superword subword hl-line time my-externals .loaddefs windcycle transpose-frame simple-wiki derived sdcv-mode noutline outline icons sauron rainbow-mode notify dbus xml multiple-cursors mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more thingatpt mc-cycle-cursors mc-edit-lines multiple-cursors-core rect mo-git-blame keep-buffers iedit fic-mode dtrt-indent browse-at-remote vc-git diff-mode easy-mmode vc-dispatcher s el-get cl-extra help-mode autoload loaddefs-gen radix-tree lisp-mnt cl dired dired-loaddefs jka-compr my-local my-keybindings auto-compile packed compat-autoloads etags-select-autoloads info project-local-variables-autoloads advice wtf-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo x-toolkit x multi-tty move-toolbar make-network-process emacs) Memory information: ((conses 16 452119 295599) (symbols 48 24552 0) (strings 32 84489 6031) (string-bytes 1 3339539) (vectors 16 46546) (vector-slots 8 1200262 242797) (floats 8 268 207) (intervals 56 47487 619) (buffers 984 21)) From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 20 02:40:51 2024 Received: (at 68600) by debbugs.gnu.org; 20 Jan 2024 07:40:51 +0000 Received: from localhost ([127.0.0.1]:60772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rR5yE-00028q-Nt for submit@debbugs.gnu.org; Sat, 20 Jan 2024 02:40:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rR5yC-00028c-3L for 68600@debbugs.gnu.org; Sat, 20 Jan 2024 02:40:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rR5y2-0008Ca-MW; Sat, 20 Jan 2024 02:40:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=eK6oD11oZHDq6FBjcRxEybKkwDyL/uXddjrInU5wkPQ=; b=gwkdVTaq4tsz me4cy5HRjcocMKvagMJ+AtR9eta5Z1/bS8SoloxY8GQb3BCShksFLy6OSMeXkl2edW4y91OwnhA18 RASWkk9Rd3mrgTyzk8ozMCbBoM6F+mMLF8eS8ojaJ2WQoOxC/2zoP1PKIh5nxiNb1aLLl0smouZMX HHURGuiVoMWg3I/UdC7LZ0DNZSc4kr8b8KIcLa6so1bemji3/3kVN9ONZCZL35X7bpHY4gYv2PX8f eZpw7uOEPnOBExSLxnKbdPOS+o5HbAWiVOWyXM7UsGCAaTbqMgMSIx3S9KJa/KIFQbvCCyWRy+TIy ZRVTZwY+Xu2Kb2mlxZdO2w==; Date: Sat, 20 Jan 2024 09:40:17 +0200 Message-Id: <831qacv4f2.fsf@gnu.org> From: Eli Zaretskii To: Phil Sainty , Stefan Monnier In-Reply-To: (message from Phil Sainty on Sat, 20 Jan 2024 18:15:51 +1300) Subject: Re: bug#68600: 30.0.50; Bad mode hook docstring when mode-line constructs are present in the mode-name References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68600 Cc: 68600@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 20 Jan 2024 18:15:51 +1300 > From: Phil Sainty > > If we define a major mode with mode-line constructs in its mode-name > (in this example using a copy of the constructs from `emacs-lisp-mode'): > > ;; Force hook docstring re-generation: > (put 'example-lisp-mode-hook 'variable-documentation nil) > > (define-derived-mode example-lisp-mode lisp-data-mode > `("Example" > (lexical-binding (:propertize "/l" > help-echo "Using lexical-binding mode") > (:propertize "/d" > help-echo "Using old dynamic scoping mode\n\ > mouse-1: Enable lexical-binding mode" > face warning > mouse-face mode-line-highlight > local-map ,elisp--dynlex-modeline-map))) > "Example mode.") > > Then, unles we have previously defined the mode hook variable with a > custom docstring (which seems to be the workaround in the meantime), > C-h v example-lisp-mode-hook says: > > Hook run after entering `(Example (lexical-binding (:propertize /l > help-echo Using lexical-binding mode) (:propertize /d help-echo Using > old dynamic scoping mode > mouse-1: Enable lexical-binding mode face warning mouse-face > mode-line-highlight local-map ,elisp--dynlex-modeline-map))) mode. > > Instead of: "Hook run after entering Example mode." > > I figure `format-mode-line' needs to be called on the `mode-name' when > generating the docstring for the mode hook (which possibly means making > these docstrings dynamic?) I'd very much prefer not to call format-mode-line in these cases. It's a very blunt instrument, and its results are sometimes unexpected, especially when there are arbitrary advanced elements in mode-line-format. If we cannot find a better way to solve this, I'd prefer documenting the current workaround, and otherwise leaving the code unchanged. Adding Stefan, in case he has some comments or ideas to suggest. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 20 10:47:22 2024 Received: (at 68600) by debbugs.gnu.org; 20 Jan 2024 15:47:22 +0000 Received: from localhost ([127.0.0.1]:35535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRDZ4-0004F4-12 for submit@debbugs.gnu.org; Sat, 20 Jan 2024 10:47:22 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRDZ2-0004En-EN for 68600@debbugs.gnu.org; Sat, 20 Jan 2024 10:47:21 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EEE7D441085; Sat, 20 Jan 2024 10:47:10 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1705765629; bh=xgoHVwEViWCL28g0AcJ9mdBXrY/sBk6W8k6K2wvHcm8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Q3bvk6+WMHzPGlY+m6Kx37gfUqFRQBVfKvxpqo1FX1C7+puM2smhhEs1T7GNRjeRC 4xRmATK9ESp7Pfe7655WsttXWM36YQwT7ypNcUJRyiSTWcOtuhmttAOjfU/ZbOL1ZP WfCgY++WKF8O+EB1zo5LOAdPg0t1ooO4GJV6y1azp3OjW0H5MRiO9bDTjcUi8MTlmo vMcCyjB7Mpu7Q+ObGMcKqWvZvUU3y0pROoAUkDhPIt3mQIELJbmbc8+fzQyiRwey4T 7gKfyimazEnjsuGEYjhP0to7TfAtJVL6WGH+vylCd66N8hLye8bzelrwJ8FV1ac9OF LZcddY04rDVdA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5DDDD440D1E; Sat, 20 Jan 2024 10:47:09 -0500 (EST) Received: from pastel (104-222-114-253.cpe.teksavvy.com [104.222.114.253]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2D91D1208DE; Sat, 20 Jan 2024 10:47:09 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#68600: 30.0.50; Bad mode hook docstring when mode-line constructs are present in the mode-name In-Reply-To: <831qacv4f2.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Jan 2024 09:40:17 +0200") Message-ID: References: <831qacv4f2.fsf@gnu.org> Date: Sat, 20 Jan 2024 10:47:07 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.010 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68600 Cc: Phil Sainty , 68600@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> If we define a major mode with mode-line constructs in its mode-name >> (in this example using a copy of the constructs from `emacs-lisp-mode'): >> >> ;; Force hook docstring re-generation: >> (put 'example-lisp-mode-hook 'variable-documentation nil) >> >> (define-derived-mode example-lisp-mode lisp-data-mode >> `("Example" >> (lexical-binding (:propertize "/l" >> help-echo "Using lexical-binding mode") >> (:propertize "/d" >> help-echo "Using old dynamic scoping mode\n\ >> mouse-1: Enable lexical-binding mode" >> face warning >> mouse-face mode-line-highlight >> local-map ,elisp--dynlex-modeline-map))) >> "Example mode.") >> >> Then, unles we have previously defined the mode hook variable with a >> custom docstring (which seems to be the workaround in the meantime), >> C-h v example-lisp-mode-hook says: >> >> Hook run after entering `(Example (lexical-binding (:propertize /l >> help-echo Using lexical-binding mode) (:propertize /d help-echo Using >> old dynamic scoping mode >> mouse-1: Enable lexical-binding mode face warning mouse-face >> mode-line-highlight local-map ,elisp--dynlex-modeline-map))) mode. >> >> Instead of: "Hook run after entering Example mode." Duh, indeed. >> I figure `format-mode-line' needs to be called on the `mode-name' when >> generating the docstring for the mode hook (which possibly means making >> these docstrings dynamic?) I don't think we want to make it dynamic, no. But indeed with `format-mode-line` the docstring would say "Exemple/l" or "Exemple/d" whereas we'd probably prefer it to say just "Exemple". The patch below solves the problem in a different way. > I'd very much prefer not to call format-mode-line in these cases. > It's a very blunt instrument, and its results are sometimes > unexpected, especially when there are arbitrary advanced elements in > mode-line-format. I don't think we need to avoid `format-mode-line` like the plague, but indeed it will tend to give subpar results here (being too specific while the docstring should say what the var does in general). Stefan diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 5c224362708..f48774f7ad8 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -211,10 +211,10 @@ define-derived-mode (defvar ,hook nil) (unless (get ',hook 'variable-documentation) (put ',hook 'variable-documentation - ,(format "Hook run after entering %s mode. + ,(format "Hook run after entering `%S'. No problems result if this variable is not bound. `add-hook' automatically binds it. (This is true for all hook variables.)" - name))) + child))) (unless (boundp ',map) (put ',map 'definition-name ',child)) (with-no-warnings (defvar ,map (make-sparse-keymap))) From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 20 21:52:05 2024 Received: (at 68600) by debbugs.gnu.org; 21 Jan 2024 02:52:06 +0000 Received: from localhost ([127.0.0.1]:36243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRNwL-00042K-KO for submit@debbugs.gnu.org; Sat, 20 Jan 2024 21:52:05 -0500 Received: from smtp-4.orcon.net.nz ([60.234.4.59]:52105) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRNwH-00041r-H1 for 68600@debbugs.gnu.org; Sat, 20 Jan 2024 21:52:04 -0500 Received: from [10.253.37.70] (port=32947 helo=webmail.orcon.net.nz) by smtp-4.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1rRNw6-0007wz-Ur; Sun, 21 Jan 2024 15:51:51 +1300 Received: from ip-139-180-86-108.kinect.net.nz ([139.180.86.108]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Sun, 21 Jan 2024 15:51:50 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sun, 21 Jan 2024 15:51:50 +1300 From: Phil Sainty To: Stefan Monnier Subject: Re: bug#68600: 30.0.50; Bad mode hook docstring when mode-line constructs are present in the mode-name In-Reply-To: References: <831qacv4f2.fsf@gnu.org> Message-ID: X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 68600 Cc: Eli Zaretskii , 68600@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2024-01-21 04:47, Stefan Monnier wrote: > The patch below solves the problem in a different way. For my example, it gives us a cross-linked "Hook run after entering ‘example-lisp-mode’." I think that's a good solution. -Phil From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 20 22:21:00 2024 Received: (at 68600) by debbugs.gnu.org; 21 Jan 2024 03:21:00 +0000 Received: from localhost ([127.0.0.1]:36249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rROOK-0007Se-A7 for submit@debbugs.gnu.org; Sat, 20 Jan 2024 22:21:00 -0500 Received: from smtp-4.orcon.net.nz ([60.234.4.59]:57943) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rROOE-0007SS-2E for 68600@debbugs.gnu.org; Sat, 20 Jan 2024 22:20:58 -0500 Received: from [10.253.37.70] (port=35091 helo=webmail.orcon.net.nz) by smtp-4.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1rROO6-0002EL-C3; Sun, 21 Jan 2024 16:20:46 +1300 Received: from ip-139-180-86-108.kinect.net.nz ([139.180.86.108]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Sun, 21 Jan 2024 16:20:46 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sun, 21 Jan 2024 16:20:46 +1300 From: Phil Sainty To: Stefan Monnier Subject: Re: bug#68600: 30.0.50; Bad mode hook docstring when mode-line constructs are present in the mode-name In-Reply-To: References: <831qacv4f2.fsf@gnu.org> Message-ID: X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 68600 Cc: Eli Zaretskii , 68600@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > "Hook run after entering ‘example-lisp-mode’." This is also consistent with the minor mode hook docstring code, which is doing this: (put ',hook 'variable-documentation ,(format "Hook run after entering or leaving `%s'. No problems result if this variable is not bound. `add-hook' automatically binds it. (This is true for all hook variables.)" modefun)) The sole difference being %S vs %s -- I figure that should be consistent one way or the other? From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 20 23:12:00 2024 Received: (at 68600-done) by debbugs.gnu.org; 21 Jan 2024 04:12:00 +0000 Received: from localhost ([127.0.0.1]:36279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRPBg-00038d-1z for submit@debbugs.gnu.org; Sat, 20 Jan 2024 23:12:00 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:41903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRPBd-00038E-T6 for 68600-done@debbugs.gnu.org; Sat, 20 Jan 2024 23:11:58 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 13BCE10007D; Sat, 20 Jan 2024 23:11:49 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1705810303; bh=plF/4DowwDEvwcTIfMGO4ehaPHR/QOxQlBgOgFr3hw8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Tsum6tdIhAJB6rPDFJpVlhT2X7pKpr/mYFqc53UX2t0P7PcbtkVtVi8JcGkFCvB4T GglA4ezv9xZwUhxeTKa0TrsMLMFQBTzdhJh8nQzWf11SsH11LyVLUC5HbZWdO3pSYS AYSF0BQz+rGmQ0dOR0ZeDX3Ihbk4mRdtpuMrf1FhnI1BPYQj6vNXggEAhaFPipYVm0 vVxqYumCR56OuNfdb0izx7A+UE0vMD+66nF5chQinR2bmfp6o558vLTL374Xh3CKRm ZXDw9lKnJX78B7pIE5w9CAxALkKsPO99AHNnGO0YJrJu9cQyTksSfBo+81cEp3TFHJ SSrSJFKKtHlXA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E07DA10001D; Sat, 20 Jan 2024 23:11:43 -0500 (EST) Received: from pastel (104-222-114-253.cpe.teksavvy.com [104.222.114.253]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B2DC4120313; Sat, 20 Jan 2024 23:11:43 -0500 (EST) From: Stefan Monnier To: Phil Sainty Subject: Re: bug#68600: 30.0.50; Bad mode hook docstring when mode-line constructs are present in the mode-name In-Reply-To: (Phil Sainty's message of "Sun, 21 Jan 2024 16:20:46 +1300") Message-ID: References: <831qacv4f2.fsf@gnu.org> Date: Sat, 20 Jan 2024 23:11:38 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.082 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68600-done Cc: 68600-done@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> "Hook run after entering =E2=80=98example-lisp-mode=E2=80=99." > This is also consistent with the minor mode hook docstring code, Thanks, pushed, closing. > The sole difference being %S vs %s -- I figure that should be > consistent one way or the other? %s is for use to include the contents of a string. In the current case we're including a symbol. For symbols %s and %S behave identically, tho, so it doesn't matter very much. I do think %S is the better option (e.g. it will make it clear if/when the arg is a string rather than a symbol, for example, since it will put "..." around the contents), but it's not important enough to go and change the `easy-mmode.el` code. Stefan From unknown Tue Aug 19 10:00:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 18 Feb 2024 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator