From unknown Sun Aug 10 11:49:04 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#64533 <64533@debbugs.gnu.org> To: bug#64533 <64533@debbugs.gnu.org> Subject: Status: [PATCH] Support displaying function name in the header line Reply-To: bug#64533 <64533@debbugs.gnu.org> Date: Sun, 10 Aug 2025 18:49:04 +0000 retitle 64533 [PATCH] Support displaying function name in the header line reassign 64533 emacs submitter 64533 Spencer Baugh severity 64533 normal tag 64533 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 13:56:30 2023 Received: (at submit) by debbugs.gnu.org; 8 Jul 2023 17:56:30 +0000 Received: from localhost ([127.0.0.1]:45148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qICAX-0008TT-Vh for submit@debbugs.gnu.org; Sat, 08 Jul 2023 13:56:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:39310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qICAW-0008TH-2P for submit@debbugs.gnu.org; Sat, 08 Jul 2023 13:56:29 -0400 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 1qICAV-0003i4-S9 for bug-gnu-emacs@gnu.org; Sat, 08 Jul 2023 13:56:27 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qICAS-0005IP-T6 for bug-gnu-emacs@gnu.org; Sat, 08 Jul 2023 13:56:27 -0400 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: [PATCH] Support displaying function name in the header line Date: Sat, 08 Jul 2023 13:56:23 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: -1.4 (-) 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: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch In some languages, the function name as displayed in the mode-line by which-func-mode can be quite long. It's useful to be able to display it in the header-line instead. Let's support that. This was my original motivation for Bug#63825, so that the header line was not displayed when which-func-mode wasn't enabled, but just teaching which-function-mode to handle this is much easier. * lisp/progmodes/which-func.el (which-func-use-header-line) (which-func-use-mode-line): Add. (which-func-try-to-enable): Support which-func-use-header-line. (which-func--disable): Add, to support which-func-use-header-line. (which-func-ff-hook, which-func-update-1): Use which-func--disable. In GNU Emacs 29.0.92 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2023-07-05 built on igm-qws-u22796a Repository revision: 4127aa427fc7e2cb5b3dbae9264c2ee628474db4 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: CentOS Linux 7 (Core) Configured using: 'configure --config-cache --with-x-toolkit=lucid --with-gif=ifavailable' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Support-displaying-function-name-in-the-header-line.patch >From a3f3e73dfcce1ae92da42e95f57740448327332f Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 8 Jul 2023 13:54:01 -0400 Subject: [PATCH] Support displaying function name in the header line In some languages, the function name as displayed in the mode-line by which-func-mode can be quite long. It's useful to be able to display it in the header-line instead. Let's support that. * lisp/progmodes/which-func.el (which-func-use-header-line) (which-func-use-mode-line): Add. (which-func-try-to-enable): Support which-func-use-header-line. (which-func--disable): Add, to support which-func-use-header-line. (which-func-ff-hook, which-func-update-1): Use which-func--disable. --- lisp/progmodes/which-func.el | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 09937a60988..846f28bddbd 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -86,6 +86,16 @@ which-func-non-auto-modes activation of Which Function until Imenu is used for the first time." :type '(repeat (symbol :tag "Major mode"))) +(defcustom which-func-use-header-line nil + "If non-nil, display the function name in the header line." + :type '(choice (const :tag "Display in header line" t) + (const :tag "Don't display in header line" nil))) + +(defcustom which-func-use-mode-line t + "If non-nil, display the function name in the mode line." + :type '(choice (const :tag "Display in mode line" t) + (const :tag "Don't display in mode line" nil))) + (defcustom which-func-maxout 500000 "Don't automatically compute the Imenu menu if buffer is this big or bigger. Zero means compute the Imenu menu regardless of size. @@ -184,7 +194,7 @@ which-func-current ;;;###autoload (put 'which-func-current 'risky-local-variable t) (defvar-local which-func-mode nil - "Non-nil means display current function name in mode line. + "Non-nil means display current function name in mode or header line. This makes a difference only if variable `which-function-mode' is non-nil.") @@ -194,7 +204,15 @@ which-func-try-to-enable (unless (or (not which-function-mode) (local-variable-p 'which-func-mode)) (setq which-func-mode (or (eq which-func-modes t) - (member major-mode which-func-modes))))) + (member major-mode which-func-modes))) + (when (and which-func-mode which-func-use-header-line) + (add-to-list 'header-line-format '("" which-func-format " "))))) + +(defun which-func--disable () + (when (and which-func-mode which-func-use-header-line) + (setq header-line-format + (delete '("" which-func-format " ") header-line-format))) + (setq which-func-mode nil)) (defun which-func-ff-hook () "`after-change-major-mode-hook' for Which Function mode. @@ -210,10 +228,10 @@ which-func-ff-hook (setq imenu--index-alist (save-excursion (funcall imenu-create-index-function)))) (imenu-unavailable - (setq which-func-mode nil)) + (which-func--disable)) (error (message "which-func-ff-hook error: %S" err) - (setq which-func-mode nil)))) + (which-func--disable)))) (defun which-func-update () "Update the Which-Function mode display in the current window." @@ -231,7 +249,7 @@ which-func-update-1 (puthash window current which-func-table) (force-mode-line-update))) (error - (setq which-func-mode nil) + (which-func--disable) (error "Error in which-func-update: %S" info)))))) (defvar which-func-update-timer nil) @@ -241,7 +259,8 @@ which-func-update-timer (add-to-list 'mode-line-misc-info '(which-function-mode ;Only display if mode is enabled. (which-func-mode ;Only display if buffer supports it. - ("" which-func-format " "))))) + (which-func-use-mode-line + ("" which-func-format " ")))))) ;; This is the name people would normally expect. ;;;###autoload -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 14:04:35 2023 Received: (at 64533) by debbugs.gnu.org; 8 Jul 2023 18:04:35 +0000 Received: from localhost ([127.0.0.1]:45162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qICIN-0000OM-07 for submit@debbugs.gnu.org; Sat, 08 Jul 2023 14:04:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qICIL-0000O0-0i for 64533@debbugs.gnu.org; Sat, 08 Jul 2023 14:04:33 -0400 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 1qICID-00074V-Vb; Sat, 08 Jul 2023 14:04:27 -0400 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=KGzAkiFGaigYod3ShfHQiajVSeux5rfH4S9mF3KtMo0=; b=j45CGvV0Jfmz C5lynaqQhYzJBFlPYIbmn79FIrnPfvJxpTDWSAw+USO+PTejMmC8hnjrma9ts/cW9jwtqbCurZEwZ n4JBYHqQQheUFScc4NZyiHvhLk1znfFpFjqrX+1iUL8p8IbJ2rPDNIxDMnF+iwq1Z4WnQQdsfn6a4 et5QsMJhT/2X3LDQwJ+HYpGZD6WhaNbaLQrZsWt0+JvomlGFlzSMqLU6c28MpMSBtPnETFN0Qys1H Ki6r3NTTjTfCRdbSF8cEveTpZX3Ou7M/0KSPP6YVX9yXm6y61rdwHW4Aoy/MCYVckcOgbLBjViskZ cwUH9FUA/maCNotzfwTdtw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qICIC-0001NR-V0; Sat, 08 Jul 2023 14:04:25 -0400 Date: Sat, 08 Jul 2023 21:04:30 +0300 Message-Id: <83y1jqb7pt.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Sat, 08 Jul 2023 13:56:23 -0400) Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64533 Cc: 64533@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 (---) > From: Spencer Baugh > Date: Sat, 08 Jul 2023 13:56:23 -0400 > > +(defcustom which-func-use-header-line nil > + "If non-nil, display the function name in the header line." > + :type '(choice (const :tag "Display in header line" t) > + (const :tag "Don't display in header line" nil))) > + > +(defcustom which-func-use-mode-line t > + "If non-nil, display the function name in the mode line." > + :type '(choice (const :tag "Display in mode line" t) > + (const :tag "Don't display in mode line" nil))) Defcustom's should have a :version tag. And why 2 separate defcustom's instead of just one? It looks un-economical, and also allows for situations in which the behavior is unclear without examining the code. Also, I think this needs a NEWS entry, and the user manual should be amended to account for the new optional display. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 14:14:49 2023 Received: (at 64533) by debbugs.gnu.org; 8 Jul 2023 18:14:49 +0000 Received: from localhost ([127.0.0.1]:45176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qICSG-0000pz-VP for submit@debbugs.gnu.org; Sat, 08 Jul 2023 14:14:49 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:36617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qICSF-0000pa-6s for 64533@debbugs.gnu.org; Sat, 08 Jul 2023 14:14:47 -0400 Received: from mail-lj1-f199.google.com ([209.85.208.199]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.96) id 1qICS9-003Mog-0Z for 64533@debbugs.gnu.org; Sat, 08 Jul 2023 14:14:41 -0400 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b6ad424a46so28568201fa.3 for <64533@debbugs.gnu.org>; Sat, 08 Jul 2023 11:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1688840080; x=1691432080; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fCZ2E4z2FBW6en6fOydoWHWdGFdS4f3+qsosn/W3G/c=; b=i8HmCkQEMxvgu4o+nxGIhbMkGoxNCP0uEfjSvgA8IFdxVWrJQrZeZK9Gza/h9xA87x 4mA8mL9QkHVQP+HKzqtPz0LFMSzPYx3dVnM5J4h7S3eiVVcZqWpFuQTbTzKhYkuPP5ox edqAPbM/fV8jWVB7hkEqFhaOXBGZ5/l/MOFRY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688840080; x=1691432080; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fCZ2E4z2FBW6en6fOydoWHWdGFdS4f3+qsosn/W3G/c=; b=Jw+wgQTKtAZwre1J08HBuzAUPQVDz4Si6uwp1OjZ6glyjPVwNs68TK3x44zD9uR7gp dtPNOjKPibZdJZJLXyMXDKgLQMfLC/CwefkOa/G8mqpukW5+wBQi5RsO/YfgkMRj0GuH G/QlzxQUIJqhSCU0SVVClpOOO1JtDDQvx9zXJxxm5cV8zh/KHu1V9jl04cf3/MJpTPWl V2JTNmVXe4iC566DXzuHUpVg5yMPGJvMm5nwKtrRvKDKsj5hdGACCaaUPCTsIbrrZgzP GmbgE4CCwUF2pboO0YGLw5aU9vcAozCpC7N3Jtw8oOyMV4MJG7YLGLOfi9eeOMU91752 tnMA== X-Gm-Message-State: ABy/qLbb5ziWzL9HWcYSQ/f85takeNl6S7q5m6GwuRtWZo16govvXU+m 5o0W6j2glkKBuKnMzDLTFXxhtwlb1OE9C3QSFtTVpr3zAiPJo/PCdPrBcC8yqueLCpcRuF0CND2 cBXzcYV540QN6icsuKfyeX19e98s60Q== X-Received: by 2002:a2e:300a:0:b0:2b6:e361:4b3c with SMTP id w10-20020a2e300a000000b002b6e3614b3cmr5592912ljw.14.1688840080679; Sat, 08 Jul 2023 11:14:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlFN76p8fXpKvUzz7f21PuRmLdeqy0UsC2Ym6JwBFuDVAAtCMwMkCk/JLQmko/c/MW1x4rvI9ubeIXihe4kAKks= X-Received: by 2002:a2e:300a:0:b0:2b6:e361:4b3c with SMTP id w10-20020a2e300a000000b002b6e3614b3cmr5592905ljw.14.1688840080351; Sat, 08 Jul 2023 11:14:40 -0700 (PDT) MIME-Version: 1.0 References: <83y1jqb7pt.fsf@gnu.org> In-Reply-To: <83y1jqb7pt.fsf@gnu.org> From: Spencer Baugh Date: Sat, 8 Jul 2023 14:14:30 -0400 Message-ID: Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000127b4005fffdb9b4" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64533 Cc: 64533@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.0 (-) --000000000000127b4005fffdb9b4 Content-Type: text/plain; charset="UTF-8" On Sat, Jul 8, 2023, 14:04 Eli Zaretskii wrote: > > From: Spencer Baugh > > Date: Sat, 08 Jul 2023 13:56:23 -0400 > > > > +(defcustom which-func-use-header-line nil > > + "If non-nil, display the function name in the header line." > > + :type '(choice (const :tag "Display in header line" t) > > + (const :tag "Don't display in header line" nil))) > > + > > +(defcustom which-func-use-mode-line t > > + "If non-nil, display the function name in the mode line." > > + :type '(choice (const :tag "Display in mode line" t) > > + (const :tag "Don't display in mode line" nil))) > > Defcustom's should have a :version tag. > Will do. And why 2 separate defcustom's instead of just one? It looks > un-economical, and also allows for situations in which the behavior is > unclear without examining the code. > If I had, say, a single defcustom with possible values 'header 'mode and 'both, I would need to add an :eval to mode-line-format to decide whether to include the function name. I assumed that was undesirable. Although I could make these current defcustoms into internal variables and just set them based on a single defcustom, would that be good? Also, I think this needs a NEWS entry, and the user manual should be > amended to account for the new optional display. > Will do. > Thanks. > --000000000000127b4005fffdb9b4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Jul 8, 2023, 14:04 Eli Zaretskii <eliz@gnu.org> wrote:
> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Sat, 08 Jul 2023 13:56:23 -0400
>
> +(defcustom which-func-use-header-line nil
> +=C2=A0 "If non-nil, display the function name in the header line= ."
> +=C2=A0 :type '(choice (const :tag "Display in header line&qu= ot; t)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(const = :tag "Don't display in header line" nil)))
> +
> +(defcustom which-func-use-mode-line t
> +=C2=A0 "If non-nil, display the function name in the mode line.&= quot;
> +=C2=A0 :type '(choice (const :tag "Display in mode line"= ; t)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(const = :tag "Don't display in mode line" nil)))

Defcustom's should have a :version tag.

Will d= o.

And why 2 separate defcustom's instead of just one?=C2=A0 It looks
un-economical, and also allows for situations in which the behavior is
unclear without examining the code.

If I had, say, a single defcustom with p= ossible values 'header 'mode and 'both, I would need to add an = :eval to mode-line-format to decide whether to include the function name. I= assumed that was undesirable.

Although I could make these current defcustoms into internal variabl= es and just set them based on a single defcustom, would that be good?
=

Also, I think this needs a NEWS entry, and the user manual should be
amended to account for the new optional display.

Will do.


Thanks.
--000000000000127b4005fffdb9b4-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 14:33:46 2023 Received: (at 64533) by debbugs.gnu.org; 8 Jul 2023 18:33:46 +0000 Received: from localhost ([127.0.0.1]:45201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qICkc-0001bZ-8E for submit@debbugs.gnu.org; Sat, 08 Jul 2023 14:33:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qICka-0001bG-5q for 64533@debbugs.gnu.org; Sat, 08 Jul 2023 14:33:44 -0400 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 1qICkU-0001cV-82; Sat, 08 Jul 2023 14:33:38 -0400 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=qyU5TOLUgW6p+gTIVsVmwdoYuPShfY60NGl3e0OfW+k=; b=RUGqsXbedn50 bcMiH1gwqGChOvFGTHU+NxITukxH3fcJ+CKadM+IUJ57h0tdRv/l1GneelLUoELxV3bmkMTkEQfYs SKhiHNhKGV/vSliI2WEeUM74SEP3phJTy+sBYPCi6u0kxxPiVYm/DMLnoKp77SW8XPY4+sQJ8DqEI Meq9vv6xk619L1elYUdtqOfkja579AjhpsCLSiDYIt5853BptyMQ7NKDtUUZ1GzzY5y5QH0+A08g9 CUEpNoFiuC1UMmMEx/Dxds1VwkERLxWz775cvm7jNGh238+5OSkYl2fpMkI6itzl6A7f0VMqnNHkz /g/Sdn5Dc7Q/h5uwXSGscA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qICkT-0001lX-Nv; Sat, 08 Jul 2023 14:33:38 -0400 Date: Sat, 08 Jul 2023 21:33:42 +0300 Message-Id: <83wmzab6d5.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Sat, 8 Jul 2023 14:14:30 -0400) Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line References: <83y1jqb7pt.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64533 Cc: 64533@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 (---) > From: Spencer Baugh > Date: Sat, 8 Jul 2023 14:14:30 -0400 > Cc: 64533@debbugs.gnu.org > > Although I could make these current defcustoms into internal variables and just set them based on a > single defcustom, would that be good? Yes, why not? From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 15:26:31 2023 Received: (at 64533) by debbugs.gnu.org; 8 Jul 2023 19:26:31 +0000 Received: from localhost ([127.0.0.1]:45230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIDZe-0003G4-Vo for submit@debbugs.gnu.org; Sat, 08 Jul 2023 15:26:31 -0400 Received: from mxout6.mail.janestreet.com ([64.215.233.21]:48953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIDZc-0003Fo-P4 for 64533@debbugs.gnu.org; Sat, 08 Jul 2023 15:26:29 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line In-Reply-To: <83wmzab6d5.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Jul 2023 21:33:42 +0300") References: <83y1jqb7pt.fsf@gnu.org> <83wmzab6d5.fsf@gnu.org> Date: Sat, 08 Jul 2023 15:26:23 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64533 Cc: 64533@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.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Spencer Baugh >> Date: Sat, 8 Jul 2023 14:14:30 -0400 >> Cc: 64533@debbugs.gnu.org >> >> Although I could make these current defcustoms into internal variables and just set them based on a >> single defcustom, would that be good? > > Yes, why not? Fixed, along with your previous comments. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Support-displaying-function-name-in-the-header-line.patch >From 3086671e447a188b2cdceda779b447d095b3b118 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 8 Jul 2023 13:54:01 -0400 Subject: [PATCH] Support displaying function name in the header line In some languages, the function name as displayed in the mode-line by which-func-mode can be quite long. It's useful to be able to display it in the header-line instead. Let's support that. * lisp/progmodes/which-func.el (which-func-display) (which-func--use-header-line, which-func--use-mode-line): Add. (which-func-try-to-enable): Support which-func--use-header-line. (which-func--disable): Add, to support which-func--use-header-line. (which-func-ff-hook, which-func-update-1): Use which-func--disable. --- doc/emacs/programs.texi | 10 +++++++-- etc/NEWS | 9 +++++++++ lisp/progmodes/which-func.el | 39 ++++++++++++++++++++++++++++++------ 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 953de2e4786..c01503ab9f0 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -396,8 +396,8 @@ Which Function @cindex current function name in mode line Which Function mode is a global minor mode (@pxref{Minor Modes}) -which displays the current function name in the mode line, updating it -as you move around in a buffer. +which displays the current function name in the mode line or header +line, updating it as you move around in a buffer. @findex which-function-mode @vindex which-func-modes @@ -410,6 +410,12 @@ Which Function @code{t} (which means to support all available major modes) to a list of major mode names. +@vindex which-func-display + By default, Which Function mode displays the current function name +using the mode line. Customize @code{which-func-display} to +@code{header}, @code{mode}, or @code{both} to use the header line, +mode line, or both, respectively. + @node Program Indent @section Indentation for Programs @cindex indentation for programs diff --git a/etc/NEWS b/etc/NEWS index 0556e8be585..9f100d93281 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -243,6 +243,15 @@ docstring, or a comment, or (re)indents the surrounding defun if point is not in a comment or a string. It is by default bound to 'M-q' in 'prog-mode' and all its descendants. +** Which Function Mode + ++++ +*** Displaying the function name in the header line is now supported. +The new user option 'which-func-display' allows choosing where the +function name is displayed. The default is 'mode' to display in the +mode line. 'header' will display in the header line. 'both' displays +in both the header line and mode line. + ** Tramp +++ diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 09937a60988..0152670bc98 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -86,6 +86,16 @@ which-func-non-auto-modes activation of Which Function until Imenu is used for the first time." :type '(repeat (symbol :tag "Major mode"))) +(defcustom which-func-display 'mode + "Where to display the function name. + +If 'mode, display in the mode line. If 'header, display in the +header line. If 'both, display in both." + :type '(choice (const :tag "Display in mode line" mode) + (const :tag "Display in header line" header) + (const :tag "Display in both header and mode line" both)) + :version "30.1") + (defcustom which-func-maxout 500000 "Don't automatically compute the Imenu menu if buffer is this big or bigger. Zero means compute the Imenu menu regardless of size. @@ -184,17 +194,33 @@ which-func-current ;;;###autoload (put 'which-func-current 'risky-local-variable t) (defvar-local which-func-mode nil - "Non-nil means display current function name in mode line. + "Non-nil means display current function name in mode or header line. This makes a difference only if variable `which-function-mode' is non-nil.") +(defvar-local which-func--use-header-line nil + "If non-nil, display the function name in the header line.") + +(defvar-local which-func--use-mode-line nil + "If non-nil, display the function name in the mode line.") + (add-hook 'after-change-major-mode-hook #'which-func-ff-hook t) (defun which-func-try-to-enable () (unless (or (not which-function-mode) (local-variable-p 'which-func-mode)) (setq which-func-mode (or (eq which-func-modes t) - (member major-mode which-func-modes))))) + (member major-mode which-func-modes))) + (setq which-func--use-mode-line (member which-func-display '(mode both))) + (setq which-func--use-header-line (member which-func-display '(header both))) + (when (and which-func-mode which-func--use-header-line) + (add-to-list 'header-line-format '("" which-func-format " "))))) + +(defun which-func--disable () + (when (and which-func-mode which-func--use-header-line) + (setq header-line-format + (delete '("" which-func-format " ") header-line-format))) + (setq which-func-mode nil)) (defun which-func-ff-hook () "`after-change-major-mode-hook' for Which Function mode. @@ -210,10 +236,10 @@ which-func-ff-hook (setq imenu--index-alist (save-excursion (funcall imenu-create-index-function)))) (imenu-unavailable - (setq which-func-mode nil)) + (which-func--disable)) (error (message "which-func-ff-hook error: %S" err) - (setq which-func-mode nil)))) + (which-func--disable)))) (defun which-func-update () "Update the Which-Function mode display in the current window." @@ -231,7 +257,7 @@ which-func-update-1 (puthash window current which-func-table) (force-mode-line-update))) (error - (setq which-func-mode nil) + (which-func--disable) (error "Error in which-func-update: %S" info)))))) (defvar which-func-update-timer nil) @@ -241,7 +267,8 @@ which-func-update-timer (add-to-list 'mode-line-misc-info '(which-function-mode ;Only display if mode is enabled. (which-func-mode ;Only display if buffer supports it. - ("" which-func-format " "))))) + (which-func--use-mode-line + ("" which-func-format " ")))))) ;; This is the name people would normally expect. ;;;###autoload -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 16:46:17 2023 Received: (at 64533) by debbugs.gnu.org; 8 Jul 2023 20:46:18 +0000 Received: from localhost ([127.0.0.1]:45264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIEoo-0005TK-IP for submit@debbugs.gnu.org; Sat, 08 Jul 2023 16:46:17 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:55354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIEom-0005T8-HO for 64533@debbugs.gnu.org; Sat, 08 Jul 2023 16:46:13 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Qz2Nf4tHDz1sCmD; Sat, 8 Jul 2023 22:46:10 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4Qz2Nf2P50z1qqlW; Sat, 8 Jul 2023 22:46:10 +0200 (CEST) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id vTM2Ztkso9Zx; Sat, 8 Jul 2023 22:46:08 +0200 (CEST) X-Auth-Info: EQVIGcyE0kycjsV7mZdSJ3/4uI8uce0/QPXsLUKAnNMdEvUEzoOnM52N8Kwd7yPE Received: from igel.home (aftr-62-216-205-115.dynamic.mnet-online.de [62.216.205.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sat, 8 Jul 2023 22:46:08 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 7535B2C150D; Sat, 8 Jul 2023 22:46:08 +0200 (CEST) From: Andreas Schwab To: Spencer Baugh Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line In-Reply-To: (Spencer Baugh's message of "Sat, 08 Jul 2023 15:26:23 -0400") References: <83y1jqb7pt.fsf@gnu.org> <83wmzab6d5.fsf@gnu.org> X-Yow: I will invent "TIDY BOWL"... Date: Sat, 08 Jul 2023 22:46:08 +0200 Message-ID: <87fs5yi12n.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 64533 Cc: Eli Zaretskii , 64533@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.4 (-) On Jul 08 2023, Spencer Baugh wrote: > +@vindex which-func-display > + By default, Which Function mode displays the current function name > +using the mode line. Customize @code{which-func-display} to > +@code{header}, @code{mode}, or @code{both} to use the header line, Or a list of 'header and/or 'mode. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 16:56:36 2023 Received: (at 64533) by debbugs.gnu.org; 8 Jul 2023 20:56:36 +0000 Received: from localhost ([127.0.0.1]:45268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIEyp-0005w5-PL for submit@debbugs.gnu.org; Sat, 08 Jul 2023 16:56:36 -0400 Received: from mxout1.mail.janestreet.com ([38.105.200.78]:36449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIEyo-0005vo-IE for 64533@debbugs.gnu.org; Sat, 08 Jul 2023 16:56:35 -0400 From: Spencer Baugh To: Andreas Schwab Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line In-Reply-To: <87fs5yi12n.fsf@igel.home> (Andreas Schwab's message of "Sat, 08 Jul 2023 22:46:08 +0200") References: <83y1jqb7pt.fsf@gnu.org> <83wmzab6d5.fsf@gnu.org> <87fs5yi12n.fsf@igel.home> Date: Sat, 08 Jul 2023 16:56:29 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 64533 Cc: Eli Zaretskii , 64533@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 (-) --=-=-= Content-Type: text/plain Andreas Schwab writes: > On Jul 08 2023, Spencer Baugh wrote: > >> +@vindex which-func-display >> + By default, Which Function mode displays the current function name >> +using the mode line. Customize @code{which-func-display} to >> +@code{header}, @code{mode}, or @code{both} to use the header line, > > Or a list of 'header and/or 'mode. Oh much better idea, done: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Support-displaying-function-name-in-the-header-line.patch >From 8c5acd79f67535703b8c669b25502c6edf141d24 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 8 Jul 2023 13:54:01 -0400 Subject: [PATCH] Support displaying function name in the header line In some languages, the function name as displayed in the mode-line by which-func-mode can be quite long. It's useful to be able to display it in the header-line instead. Let's support that. * lisp/progmodes/which-func.el (which-func-display) (which-func--use-header-line, which-func--use-mode-line): Add. (Bug#64533) (which-func-try-to-enable): Support which-func--use-header-line. (which-func--disable): Add, to support which-func--use-header-line. (which-func-ff-hook, which-func-update-1): Use which-func--disable. --- doc/emacs/programs.texi | 10 +++++++-- etc/NEWS | 8 ++++++++ lisp/progmodes/which-func.el | 39 ++++++++++++++++++++++++++++++------ 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 953de2e4786..705e3dd358e 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -396,8 +396,8 @@ Which Function @cindex current function name in mode line Which Function mode is a global minor mode (@pxref{Minor Modes}) -which displays the current function name in the mode line, updating it -as you move around in a buffer. +which displays the current function name in the mode line or header +line, updating it as you move around in a buffer. @findex which-function-mode @vindex which-func-modes @@ -410,6 +410,12 @@ Which Function @code{t} (which means to support all available major modes) to a list of major mode names. +@vindex which-func-display + @code{which-func-display} is a list of symbols; if it contains +@code{mode}, the function name is displayed in the mode line. If it +contains @code{header}, the function name is displayed in the header +line. By default it contains only @code{mode}. + @node Program Indent @section Indentation for Programs @cindex indentation for programs diff --git a/etc/NEWS b/etc/NEWS index 0556e8be585..f5de6974a46 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -243,6 +243,14 @@ docstring, or a comment, or (re)indents the surrounding defun if point is not in a comment or a string. It is by default bound to 'M-q' in 'prog-mode' and all its descendants. +** Which Function Mode + ++++ +*** Displaying the function name in the header line is now supported. +The new user option 'which-func-display' is a list of places to +display the function name. Add 'header' to that list to display in +the header line. + ** Tramp +++ diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 09937a60988..4c32002e991 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -86,6 +86,16 @@ which-func-non-auto-modes activation of Which Function until Imenu is used for the first time." :type '(repeat (symbol :tag "Major mode"))) +(defcustom which-func-display '(mode) + "Where to display the function name. + +This should be a list of symbols +If 'mode, display in the mode line. If 'header, display in the +header line. If 'both, display in both." + :type '(set (const :tag "Display in mode line" mode) + (const :tag "Display in header line" header)) + :version "30.1") + (defcustom which-func-maxout 500000 "Don't automatically compute the Imenu menu if buffer is this big or bigger. Zero means compute the Imenu menu regardless of size. @@ -184,17 +194,33 @@ which-func-current ;;;###autoload (put 'which-func-current 'risky-local-variable t) (defvar-local which-func-mode nil - "Non-nil means display current function name in mode line. + "Non-nil means display current function name in mode or header line. This makes a difference only if variable `which-function-mode' is non-nil.") +(defvar-local which-func--use-header-line nil + "If non-nil, display the function name in the header line.") + +(defvar-local which-func--use-mode-line nil + "If non-nil, display the function name in the mode line.") + (add-hook 'after-change-major-mode-hook #'which-func-ff-hook t) (defun which-func-try-to-enable () (unless (or (not which-function-mode) (local-variable-p 'which-func-mode)) (setq which-func-mode (or (eq which-func-modes t) - (member major-mode which-func-modes))))) + (member major-mode which-func-modes))) + (setq which-func--use-mode-line (member 'mode which-func-display)) + (setq which-func--use-header-line (member 'header which-func-display)) + (when (and which-func-mode which-func--use-header-line) + (add-to-list 'header-line-format '("" which-func-format " "))))) + +(defun which-func--disable () + (when (and which-func-mode which-func--use-header-line) + (setq header-line-format + (delete '("" which-func-format " ") header-line-format))) + (setq which-func-mode nil)) (defun which-func-ff-hook () "`after-change-major-mode-hook' for Which Function mode. @@ -210,10 +236,10 @@ which-func-ff-hook (setq imenu--index-alist (save-excursion (funcall imenu-create-index-function)))) (imenu-unavailable - (setq which-func-mode nil)) + (which-func--disable)) (error (message "which-func-ff-hook error: %S" err) - (setq which-func-mode nil)))) + (which-func--disable)))) (defun which-func-update () "Update the Which-Function mode display in the current window." @@ -231,7 +257,7 @@ which-func-update-1 (puthash window current which-func-table) (force-mode-line-update))) (error - (setq which-func-mode nil) + (which-func--disable) (error "Error in which-func-update: %S" info)))))) (defvar which-func-update-timer nil) @@ -241,7 +267,8 @@ which-func-update-timer (add-to-list 'mode-line-misc-info '(which-function-mode ;Only display if mode is enabled. (which-func-mode ;Only display if buffer supports it. - ("" which-func-format " "))))) + (which-func--use-mode-line + ("" which-func-format " ")))))) ;; This is the name people would normally expect. ;;;###autoload -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 16:59:12 2023 Received: (at 64533) by debbugs.gnu.org; 8 Jul 2023 20:59:12 +0000 Received: from localhost ([127.0.0.1]:45277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIF1L-00061z-SO for submit@debbugs.gnu.org; Sat, 08 Jul 2023 16:59:12 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:46813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIF15-00060s-U0 for 64533@debbugs.gnu.org; Sat, 08 Jul 2023 16:59:11 -0400 From: Spencer Baugh To: Andreas Schwab Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line In-Reply-To: (Spencer Baugh's message of "Sat, 08 Jul 2023 16:56:29 -0400") References: <83y1jqb7pt.fsf@gnu.org> <83wmzab6d5.fsf@gnu.org> <87fs5yi12n.fsf@igel.home> Date: Sat, 08 Jul 2023 16:58:50 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64533 Cc: Eli Zaretskii , 64533@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.0 (-) --=-=-= Content-Type: text/plain Spencer Baugh writes: > Andreas Schwab writes: >> On Jul 08 2023, Spencer Baugh wrote: >> >>> +@vindex which-func-display >>> + By default, Which Function mode displays the current function name >>> +using the mode line. Customize @code{which-func-display} to >>> +@code{header}, @code{mode}, or @code{both} to use the header line, >> >> Or a list of 'header and/or 'mode. > > Oh much better idea, done: Oops, minor doc fix: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Support-displaying-function-name-in-the-header-line.patch >From 25be8c9040cdbe2ffe50e399a2d65eaf7759dce9 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 8 Jul 2023 13:54:01 -0400 Subject: [PATCH] Support displaying function name in the header line In some languages, the function name as displayed in the mode-line by which-func-mode can be quite long. It's useful to be able to display it in the header-line instead. Let's support that. * lisp/progmodes/which-func.el (which-func-display) (which-func--use-header-line, which-func--use-mode-line): Add. (Bug#64533) (which-func-try-to-enable): Support which-func--use-header-line. (which-func--disable): Add, to support which-func--use-header-line. (which-func-ff-hook, which-func-update-1): Use which-func--disable. --- doc/emacs/programs.texi | 10 +++++++-- etc/NEWS | 8 ++++++++ lisp/progmodes/which-func.el | 39 ++++++++++++++++++++++++++++++------ 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 953de2e4786..705e3dd358e 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -396,8 +396,8 @@ Which Function @cindex current function name in mode line Which Function mode is a global minor mode (@pxref{Minor Modes}) -which displays the current function name in the mode line, updating it -as you move around in a buffer. +which displays the current function name in the mode line or header +line, updating it as you move around in a buffer. @findex which-function-mode @vindex which-func-modes @@ -410,6 +410,12 @@ Which Function @code{t} (which means to support all available major modes) to a list of major mode names. +@vindex which-func-display + @code{which-func-display} is a list of symbols; if it contains +@code{mode}, the function name is displayed in the mode line. If it +contains @code{header}, the function name is displayed in the header +line. By default it contains only @code{mode}. + @node Program Indent @section Indentation for Programs @cindex indentation for programs diff --git a/etc/NEWS b/etc/NEWS index 0556e8be585..f5de6974a46 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -243,6 +243,14 @@ docstring, or a comment, or (re)indents the surrounding defun if point is not in a comment or a string. It is by default bound to 'M-q' in 'prog-mode' and all its descendants. +** Which Function Mode + ++++ +*** Displaying the function name in the header line is now supported. +The new user option 'which-func-display' is a list of places to +display the function name. Add 'header' to that list to display in +the header line. + ** Tramp +++ diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 09937a60988..4ea6ca1ee6f 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -86,6 +86,16 @@ which-func-non-auto-modes activation of Which Function until Imenu is used for the first time." :type '(repeat (symbol :tag "Major mode"))) +(defcustom which-func-display '(mode) + "Where to display the function name. + +This should be a list of symbols. If it contains 'mode, display +in the mode line. If it contains 'header, display in the header +line." + :type '(set (const :tag "Display in mode line" mode) + (const :tag "Display in header line" header)) + :version "30.1") + (defcustom which-func-maxout 500000 "Don't automatically compute the Imenu menu if buffer is this big or bigger. Zero means compute the Imenu menu regardless of size. @@ -184,17 +194,33 @@ which-func-current ;;;###autoload (put 'which-func-current 'risky-local-variable t) (defvar-local which-func-mode nil - "Non-nil means display current function name in mode line. + "Non-nil means display current function name in mode or header line. This makes a difference only if variable `which-function-mode' is non-nil.") +(defvar-local which-func--use-header-line nil + "If non-nil, display the function name in the header line.") + +(defvar-local which-func--use-mode-line nil + "If non-nil, display the function name in the mode line.") + (add-hook 'after-change-major-mode-hook #'which-func-ff-hook t) (defun which-func-try-to-enable () (unless (or (not which-function-mode) (local-variable-p 'which-func-mode)) (setq which-func-mode (or (eq which-func-modes t) - (member major-mode which-func-modes))))) + (member major-mode which-func-modes))) + (setq which-func--use-mode-line (member 'mode which-func-display)) + (setq which-func--use-header-line (member 'header which-func-display)) + (when (and which-func-mode which-func--use-header-line) + (add-to-list 'header-line-format '("" which-func-format " "))))) + +(defun which-func--disable () + (when (and which-func-mode which-func--use-header-line) + (setq header-line-format + (delete '("" which-func-format " ") header-line-format))) + (setq which-func-mode nil)) (defun which-func-ff-hook () "`after-change-major-mode-hook' for Which Function mode. @@ -210,10 +236,10 @@ which-func-ff-hook (setq imenu--index-alist (save-excursion (funcall imenu-create-index-function)))) (imenu-unavailable - (setq which-func-mode nil)) + (which-func--disable)) (error (message "which-func-ff-hook error: %S" err) - (setq which-func-mode nil)))) + (which-func--disable)))) (defun which-func-update () "Update the Which-Function mode display in the current window." @@ -231,7 +257,7 @@ which-func-update-1 (puthash window current which-func-table) (force-mode-line-update))) (error - (setq which-func-mode nil) + (which-func--disable) (error "Error in which-func-update: %S" info)))))) (defvar which-func-update-timer nil) @@ -241,7 +267,8 @@ which-func-update-timer (add-to-list 'mode-line-misc-info '(which-function-mode ;Only display if mode is enabled. (which-func-mode ;Only display if buffer supports it. - ("" which-func-format " "))))) + (which-func--use-mode-line + ("" which-func-format " ")))))) ;; This is the name people would normally expect. ;;;###autoload -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 09 01:29:32 2023 Received: (at 64533) by debbugs.gnu.org; 9 Jul 2023 05:29:32 +0000 Received: from localhost ([127.0.0.1]:45547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIMzE-0005Iz-G7 for submit@debbugs.gnu.org; Sun, 09 Jul 2023 01:29:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIMzC-0005Ik-4x for 64533@debbugs.gnu.org; Sun, 09 Jul 2023 01:29:30 -0400 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 1qIMz4-0002lE-Jv; Sun, 09 Jul 2023 01:29:22 -0400 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=hKWLBgsGPtjvLK9fGRuDnyeoIIRgFTkWSPhKoXart5w=; b=aX5zt72IvhKN GaKS/WFYJKfbcXYyAFjr1V0UADhx2vRXZBcdNOq6Kwi2RyAUvcOIQGDFpXG70B/6gNeYoj+sXO6W9 jYryNsIcRtnxoiqEuen5aRDyBfHVkQv9/hc7hGd4MgmKM4l1iY5/v7x3q2PumvnkIw4/QBi15mFOr QgxyD++uzgKFk589xUI8UytEmvsVnARm88sphwU/ibjBNd9nZ/gVikB8/j1EsV1B9+MVoK3o0rNKp gYI8CG2lgtZSai8KyCep+wDbECogNrLCSi93AoUemJMb37a8szpRXbqTgRCVlu8rBdB62H396L6sk Wb/K61X0AhXF481EJ9PMSg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIMz3-00034u-TW; Sun, 09 Jul 2023 01:29:22 -0400 Date: Sun, 09 Jul 2023 08:29:28 +0300 Message-Id: <83r0phbqkn.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Sat, 08 Jul 2023 16:56:29 -0400) Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line References: <83y1jqb7pt.fsf@gnu.org> <83wmzab6d5.fsf@gnu.org> <87fs5yi12n.fsf@igel.home> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64533 Cc: schwab@linux-m68k.org, 64533@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 (---) > From: Spencer Baugh > Cc: Eli Zaretskii , 64533@debbugs.gnu.org > Date: Sat, 08 Jul 2023 16:56:29 -0400 > > >> +@vindex which-func-display > >> + By default, Which Function mode displays the current function name > >> +using the mode line. Customize @code{which-func-display} to > >> +@code{header}, @code{mode}, or @code{both} to use the header line, > > > > Or a list of 'header and/or 'mode. > > Oh much better idea, done: I disagree that it is a better idea. It makes a tad harder to customize the variable in Lisp if the user is not familiar enough with Emacs Lisp. The Custom interface is also more cumbersome. So my clear preference is for the previous variant, with separate symbols. If 'both' is too vague, we could use 'mode-and-header' instead. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 09 01:36:38 2023 Received: (at 64533) by debbugs.gnu.org; 9 Jul 2023 05:36:39 +0000 Received: from localhost ([127.0.0.1]:45567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIN66-0005aN-JW for submit@debbugs.gnu.org; Sun, 09 Jul 2023 01:36:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIN64-0005a1-7F for 64533@debbugs.gnu.org; Sun, 09 Jul 2023 01:36:36 -0400 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 1qIN5y-00005o-De; Sun, 09 Jul 2023 01:36:30 -0400 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=xJBaHbJT0BNywuTDlRwG1TLuKdLBWAJABzIpHvAmyfM=; b=M5WY5v0o/KM/ wNZ8tIgDdFuiPEGapc3TAm+O30rqO7D778swgoXeGcXH8EHR32ep3+jpYAqhSsqshzVCfUGYZqg0n 2Y9OcN1vFgIO+guzhT8S99QU6r/k2YFHSb6FiFMEfjBc43R6WBfcx9KV4TIGspZNmIwNj7oaiC4Md c03myIuwJBqpv9HkRr5Bk6eNnVah9BJpq9G7X9n4Dc/UAQo5sl6i8DcnmT5oly/cxCxjCUnCkem4d mA0WeOWWSNvUbX2N7t+rWM1MP8eHQYO906pXD/sBq6xiqI5pJKj8Cx7DNhTwTmR9J0iPEFxfR/jeK d3+jER4wiSTnQYU3Mn81IQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIN5x-0006wO-T2; Sun, 09 Jul 2023 01:36:30 -0400 Date: Sun, 09 Jul 2023 08:36:37 +0300 Message-Id: <83o7klbq8q.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Sat, 08 Jul 2023 16:58:50 -0400) Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line References: <83y1jqb7pt.fsf@gnu.org> <83wmzab6d5.fsf@gnu.org> <87fs5yi12n.fsf@igel.home> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64533 Cc: schwab@linux-m68k.org, 64533@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 (---) > From: Spencer Baugh > Cc: Eli Zaretskii , 64533@debbugs.gnu.org > Date: Sat, 08 Jul 2023 16:58:50 -0400 > > +** Which Function Mode > + > ++++ > +*** Displaying the function name in the header line is now supported. Passive voice alert! Here's a better wording (also for reasons other than passive voice);; Which Function Mode can now display function names on the header line. > +(defcustom which-func-display '(mode) > + "Where to display the function name. > + > +This should be a list of symbols. If it contains 'mode, display > +in the mode line. If it contains 'header, display in the header > +line." Which leaves it to the user to deduce that '(mode header) means both: yet another reason not to prefer this kind of values in user options. It also doesn't tell how to disable this display: another riddle left to the user to solve. Let's always remember that Emacs users are not necessarily experienced Lispers. User options should not be "tricky", especially where such trickery is unjustified. And the doc strings should not pose riddles, however logical they seem to us. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 09 13:26:18 2023 Received: (at 64533) by debbugs.gnu.org; 9 Jul 2023 17:26:18 +0000 Received: from localhost ([127.0.0.1]:47117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIYAr-0005rD-Pw for submit@debbugs.gnu.org; Sun, 09 Jul 2023 13:26:18 -0400 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:46796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIYAp-0005qz-R1 for 64533@debbugs.gnu.org; Sun, 09 Jul 2023 13:26:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: cc:content-type:from:subject:to; s=s1; bh=kuavA96FjUGv8Oxgo7aPAVIbKgifTLcFBJ4Ru87VmEs=; b=whsgmhrElQnxMYxeGW79eTNQMQAs5LF/rO7Q8qG8cZASQuPszkuvhCgJzlII4a38knVK 6daf05lioYd84jx5lptihbYdk5IzczfO/oaMD+ca9j7CZCTv7tEWoE71sujuP3HEVocW2Z H+ixAu7Rcuc6jAz0rR2lNfxMryFS193cbMc3ijLHGXtwJzb/+NkGvQ+9YG/ZyPc6cPi4BV 4BhD8N/PbrR1SjYLakwFLi7XzRWdmtWTbJvyFDYwC53gTpur/xg804ndrKO/Ip1iuLjsdS fHPSQtZDRk8wbfp2t8cBpQxFPB48Mt4f2s5AzgqNuyMrQ3Sf2RQ0JfJzXWfarfIQ== Received: by filterdrecv-84b96456cb-hrvlt with SMTP id filterdrecv-84b96456cb-hrvlt-1-64AAEDB1-12 2023-07-09 17:26:09.408126761 +0000 UTC m=+5161654.404226784 Received: from earth.catern.com (unknown) by geopod-ismtpd-27 (SG) with ESMTP id bn2RCH5wRv-_xxMb5YW4zg Sun, 09 Jul 2023 17:26:09.291 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gnu.org Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id D6E3762568; Sun, 9 Jul 2023 13:26:08 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line In-Reply-To: <83o7klbq8q.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 09 Jul 2023 08:36:37 +0300") References: <83y1jqb7pt.fsf@gnu.org> <83wmzab6d5.fsf@gnu.org> <87fs5yi12n.fsf@igel.home> <83o7klbq8q.fsf@gnu.org> Date: Sun, 09 Jul 2023 17:26:09 +0000 (UTC) Message-ID: <87r0phkndb.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbJsTf59cN620Cy4HmbjnB?= =?us-ascii?Q?ASF=2FDaT=2F4Kq3zy5B8X3UoirwihzPM9nndvkKW9K?= =?us-ascii?Q?HSWAy8nktTidEKCEFtRN=2F1q4+qSjutZR7cFKPXS?= =?us-ascii?Q?RKVR0yezbsbOI945q1jxVbUSjNawkCCQm6r5j5U?= =?us-ascii?Q?eehZlB39BG18PE2qHO9mOHwr7bFyXDdcz7g=3D=3D?= To: Eli Zaretskii X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64533 Cc: Spencer Baugh , schwab@linux-m68k.org, 64533@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.0 (-) --=-=-= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: Eli Zaretskii , 64533@debbugs.gnu.org >> Date: Sat, 08 Jul 2023 16:58:50 -0400 >> >> +** Which Function Mode >> + >> ++++ >> +*** Displaying the function name in the header line is now supported. > > Passive voice alert! Here's a better wording (also for reasons other > than passive voice);; > > Which Function Mode can now display function names on the header line. Fixed. >> +(defcustom which-func-display '(mode) >> + "Where to display the function name. >> + >> +This should be a list of symbols. If it contains 'mode, display >> +in the mode line. If it contains 'header, display in the header >> +line." > > Which leaves it to the user to deduce that '(mode header) means both: > yet another reason not to prefer this kind of values in user options. > > It also doesn't tell how to disable this display: another riddle left > to the user to solve. > > Let's always remember that Emacs users are not necessarily experienced > Lispers. User options should not be "tricky", especially where such > trickery is unjustified. And the doc strings should not pose riddles, > however logical they seem to us. > > Thanks. Fair point. Back to the single symbol. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Support-displaying-function-name-in-the-header-line.patch >From 3f23e559cae5ce864aef2c15e990f6beb5484eb7 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sun, 9 Jul 2023 12:16:28 -0400 Subject: [PATCH] Support displaying function name in the header line In some languages, the function name as displayed in the mode-line by which-func-mode can be quite long. It's useful to be able to display it in the header-line instead. Let's support that. * lisp/progmodes/which-func.el (which-func-display) (which-func--use-header-line, which-func--use-mode-line): Add. (Bug#64533) (which-func-try-to-enable): Support which-func--use-header-line. (which-func--disable): Add, to support which-func--use-header-line. (which-func-ff-hook, which-func-update-1): Use which-func--disable. --- doc/emacs/programs.texi | 10 +++++++-- etc/NEWS | 9 ++++++++ lisp/progmodes/which-func.el | 42 ++++++++++++++++++++++++++++++------ 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index a0e0fc06385..41780a95489 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -335,8 +335,8 @@ Which Function @cindex current function name in mode line Which Function mode is a global minor mode (@pxref{Minor Modes}) -which displays the current function name in the mode line, updating it -as you move around in a buffer. +which displays the current function name in the mode line or header +line, updating it as you move around in a buffer. @findex which-function-mode @vindex which-func-modes @@ -349,6 +349,12 @@ Which Function @code{t} (which means to support all available major modes) to a list of major mode names. +@vindex which-func-display + By default, Which Function mode displays the current function name +using the mode line. Customize @code{which-func-display} to +@code{header}, @code{mode}, or @code{mode-and-header} to use the +header line, mode line, or both, respectively. + @node Program Indent @section Indentation for Programs @cindex indentation for programs diff --git a/etc/NEWS b/etc/NEWS index 9c99cf6c725..efd323cb1da 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2989,6 +2989,15 @@ The newly created buffer will be displayed via 'display-buffer', which can be customized through the usual mechanism of 'display-buffer-alist' and friends. +** Which Function Mode + ++++ +*** Which Function Mode can now display function names on the header line. +The new user option 'which-func-display' allows choosing where the +function name is displayed. The default is 'mode' to display in the +mode line. 'header' will display in the header line. +'mode-and-header' displays in both the header line and mode line. + ** Tramp +++ diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 09937a60988..631d47bb729 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -86,6 +86,17 @@ which-func-non-auto-modes activation of Which Function until Imenu is used for the first time." :type '(repeat (symbol :tag "Major mode"))) +(defcustom which-func-display 'mode + "Where to display the function name. + +If 'mode, display in the mode line. If 'header, display in the +header line. If 'mode-and-header, display in both." + :type '(choice (const :tag "Display in mode line" mode) + (const :tag "Display in header line" header) + (const :tag "Display in both header and mode line" + mode-and-header)) + :version "30.1") + (defcustom which-func-maxout 500000 "Don't automatically compute the Imenu menu if buffer is this big or bigger. Zero means compute the Imenu menu regardless of size. @@ -184,17 +195,35 @@ which-func-current ;;;###autoload (put 'which-func-current 'risky-local-variable t) (defvar-local which-func-mode nil - "Non-nil means display current function name in mode line. + "Non-nil means display current function name in mode or header line. This makes a difference only if variable `which-function-mode' is non-nil.") +(defvar-local which-func--use-header-line nil + "If non-nil, display the function name in the header line.") + +(defvar-local which-func--use-mode-line nil + "If non-nil, display the function name in the mode line.") + (add-hook 'after-change-major-mode-hook #'which-func-ff-hook t) (defun which-func-try-to-enable () (unless (or (not which-function-mode) (local-variable-p 'which-func-mode)) (setq which-func-mode (or (eq which-func-modes t) - (member major-mode which-func-modes))))) + (member major-mode which-func-modes))) + (setq which-func--use-mode-line + (member which-func-display '(mode mode-and-header))) + (setq which-func--use-header-line + (member which-func-display '(header mode-and-header))) + (when (and which-func-mode which-func--use-header-line) + (add-to-list 'header-line-format '("" which-func-format " "))))) + +(defun which-func--disable () + (when (and which-func-mode which-func--use-header-line) + (setq header-line-format + (delete '("" which-func-format " ") header-line-format))) + (setq which-func-mode nil)) (defun which-func-ff-hook () "`after-change-major-mode-hook' for Which Function mode. @@ -210,10 +239,10 @@ which-func-ff-hook (setq imenu--index-alist (save-excursion (funcall imenu-create-index-function)))) (imenu-unavailable - (setq which-func-mode nil)) + (which-func--disable)) (error (message "which-func-ff-hook error: %S" err) - (setq which-func-mode nil)))) + (which-func--disable)))) (defun which-func-update () "Update the Which-Function mode display in the current window." @@ -231,7 +260,7 @@ which-func-update-1 (puthash window current which-func-table) (force-mode-line-update))) (error - (setq which-func-mode nil) + (which-func--disable) (error "Error in which-func-update: %S" info)))))) (defvar which-func-update-timer nil) @@ -241,7 +270,8 @@ which-func-update-timer (add-to-list 'mode-line-misc-info '(which-function-mode ;Only display if mode is enabled. (which-func-mode ;Only display if buffer supports it. - ("" which-func-format " "))))) + (which-func--use-mode-line + ("" which-func-format " ")))))) ;; This is the name people would normally expect. ;;;###autoload -- 2.41.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 15 04:02:39 2023 Received: (at 64533-done) by debbugs.gnu.org; 15 Jul 2023 08:02:39 +0000 Received: from localhost ([127.0.0.1]:44031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKaEh-0001vV-CH for submit@debbugs.gnu.org; Sat, 15 Jul 2023 04:02:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKaEe-0001vF-Bw for 64533-done@debbugs.gnu.org; Sat, 15 Jul 2023 04:02:37 -0400 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 1qKaEX-00026z-9W; Sat, 15 Jul 2023 04:02:29 -0400 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=5v1x2yQ1GnJ8uxNQVdniA1/uK5t8ul0yNO3wDst5a9g=; b=fhpQHMgwhOhb 6OEb46B5qjGafR658uzJI8jvvCJQyuZj1W3yLjdbKzvsk3o502+/wH/wAvhMcKtH7eYj39+FJn3xq jOItGVUlk+IrDpfdDoo4C+8xk+605qMFXjGee+e4F98ks6X/gH3h9T112vPrBUsRHg5BBes81cLDu FW/pOeYj1MptBbmPwvP/HWlEUDDxEvz+8IA0fZiIahhzlSrq9WYeu5fhEmg4bpjNIm8keG06QYAt7 5wbAHwuAOwBTdRUb5EWTHkg1aeDDfFUohVrQQ1u55Hs5vLgEUqXCJg1QnGqY0TMPKDsczQfwFJ+1E Nx+gmLO36m2j3Ywi/epqQA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKaEW-00085o-Gz; Sat, 15 Jul 2023 04:02:28 -0400 Date: Sat, 15 Jul 2023 11:02:50 +0300 Message-Id: <83v8eld2l1.fsf@gnu.org> From: Eli Zaretskii To: sbaugh@catern.com In-Reply-To: <87r0phkndb.fsf@catern.com> (sbaugh@catern.com) Subject: Re: bug#64533: [PATCH] Support displaying function name in the header line References: <83y1jqb7pt.fsf@gnu.org> <83wmzab6d5.fsf@gnu.org> <87fs5yi12n.fsf@igel.home> <83o7klbq8q.fsf@gnu.org> <87r0phkndb.fsf@catern.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64533-done Cc: sbaugh@janestreet.com, schwab@linux-m68k.org, 64533-done@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 (---) > From: sbaugh@catern.com > Date: Sun, 09 Jul 2023 17:26:09 +0000 (UTC) > Cc: Spencer Baugh , schwab@linux-m68k.org, > 64533@debbugs.gnu.org > > Eli Zaretskii writes: > > >> +This should be a list of symbols. If it contains 'mode, display > >> +in the mode line. If it contains 'header, display in the header > >> +line." > > > > Which leaves it to the user to deduce that '(mode header) means both: > > yet another reason not to prefer this kind of values in user options. > > > > It also doesn't tell how to disable this display: another riddle left > > to the user to solve. > > > > Let's always remember that Emacs users are not necessarily experienced > > Lispers. User options should not be "tricky", especially where such > > trickery is unjustified. And the doc strings should not pose riddles, > > however logical they seem to us. > > > > Thanks. > > Fair point. Back to the single symbol. Thanks, installed on master, and closing the bug. From unknown Sun Aug 10 11:49:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 12 Aug 2023 11:24:09 +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