* bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode
[not found] <9417FE9A-2B7C-4A23-80DE-1322E0ECB812@rnkn.xyz>
@ 2024-08-08 2:25 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08 8:58 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-08 2:25 UTC (permalink / raw)
To: 72521
[-- Attachment #1: Type: text/plain, Size: 332 bytes --]
> On 8 Aug 2024, at 12:18, Paul W. Rankin <rnkn@rnkn.xyz> wrote:
>
> This is currently hard-coded and should instead be implemented as a
> user option, probably a hook, but this is outside the scope of this
> patch.
>
> <0001-lisp-help-macro.el-remove-hard-coded-variable-pitch-.patch>
Patched instead against current master.
[-- Attachment #2: 0001-lisp-help-macro.el-remove-hard-coded-variable-pitch-.patch --]
[-- Type: application/octet-stream, Size: 942 bytes --]
From f981194cd124871d1bb8cbec21812abe057577af Mon Sep 17 00:00:00 2001
From: "Paul W. Rankin" <rnkn@rnkn.xyz>
Date: Thu, 8 Aug 2024 12:23:55 +1000
Subject: [PATCH] * lisp/help-macro.el: remove hard-coded variable-pitch-mode
This should be implemented as a user option hook
---
lisp/help-macro.el | 1 -
1 file changed, 1 deletion(-)
diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index 8a16e85a329..5b941c0433b 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -146,7 +146,6 @@ help--help-screen
(insert (substitute-command-keys help-screen)))
(let ((minor-mode-map-alist new-minor-mode-map-alist))
(help-mode)
- (variable-pitch-mode)
(setq new-minor-mode-map-alist minor-mode-map-alist))
(goto-char (point-min))
(while (or (memq char (append help-event-list
--
2.39.3 (Apple Git-146)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode
2024-08-08 2:25 ` bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-08 8:58 ` Eli Zaretskii
2024-08-08 9:37 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08 9:37 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2024-08-08 8:58 UTC (permalink / raw)
To: Paul W. Rankin; +Cc: 72521
> Date: Thu, 8 Aug 2024 12:25:18 +1000
> From: "Paul W. Rankin" via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> > On 8 Aug 2024, at 12:18, Paul W. Rankin <rnkn@rnkn.xyz> wrote:
> >
> > This is currently hard-coded and should instead be implemented as a
> > user option, probably a hook, but this is outside the scope of this
> > patch.
> >
> > <0001-lisp-help-macro.el-remove-hard-coded-variable-pitch-.patch>
>
> Patched instead against current master.
Thanks, but we cannot possible install this patch, since this behavior
was introduced in Emacs 29. I agree with making this feature
optional, of course (and it will then be ON by default), but your
patch doesn't do that.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode
2024-08-08 8:58 ` Eli Zaretskii
@ 2024-08-08 9:37 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08 9:37 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 8+ messages in thread
From: Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-08 9:37 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 72521
> On 8 Aug 2024, at 18:58, Eli Zaretskii <eliz@gnu.org> wrote:
>
> Thanks, but we cannot possible install this patch, since this behavior
> was introduced in Emacs 29. I agree with making this feature
> optional, of course (and it will then be ON by default), but your
> patch doesn't do that.
Hi Eli,
Thanks. I’ve replaced the call to variable-pitch-mode with a hook,
help-screen-hook, which defaults to calling variable-pitch-mode.
Ideally I think this should just be help-mode-hook though, which of
course should not default to calling variable-pitch-mode.
Anyway, how’s the patch look to you?
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode
2024-08-08 8:58 ` Eli Zaretskii
2024-08-08 9:37 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-08 9:37 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08 9:45 ` Eli Zaretskii
1 sibling, 1 reply; 8+ messages in thread
From: Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-08 9:37 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 72521
[-- Attachment #1: Type: text/plain, Size: 644 bytes --]
> On 8 Aug 2024, at 18:58, Eli Zaretskii <eliz@gnu.org> wrote:
>
> Thanks, but we cannot possible install this patch, since this behavior
> was introduced in Emacs 29. I agree with making this feature
> optional, of course (and it will then be ON by default), but your
> patch doesn't do that.
Hi Eli,
Thanks. I’ve replaced the call to variable-pitch-mode with a hook,
help-screen-hook, which defaults to calling variable-pitch-mode.
Ideally I think this should just be help-mode-hook though, which of
course should not default to calling variable-pitch-mode.
Anyway, how’s the patch (now attached) look to you?
[-- Attachment #2: 0001-lisp-help-macro.el-add-help-screen-hook.patch --]
[-- Type: application/octet-stream, Size: 1520 bytes --]
From 24b8ab0bd7b937b46d6faad05821b462019732cc Mon Sep 17 00:00:00 2001
From: "Paul W. Rankin" <rnkn@rnkn.xyz>
Date: Thu, 8 Aug 2024 12:16:07 +1000
Subject: [PATCH] * lisp/help-macro.el: add help-screen-hook
help-screen-hook by default calls variable-pitch-mode for backwards
compatibility with Emacs 29
---
lisp/help-macro.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index 14d2a45f5f2..fce8f784076 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -78,6 +78,13 @@ three-step-help
:type 'boolean
:group 'help)
+(defcustom help-screen-hook
+ '(variable-pitch-mode)
+ "Hook run by `make-help-screen', called by command `help-for-help'."
+ :options '(variable-pitch-mode)
+ :type 'hook
+ :group 'help)
+
(defmacro make-help-screen (fname help-line help-text helped-map
&optional buffer-name)
"Construct help-menu function name FNAME.
@@ -141,7 +148,7 @@ make-help-screen
(insert (substitute-command-keys help-screen)))
(let ((minor-mode-map-alist new-minor-mode-map-alist))
(help-mode)
- (variable-pitch-mode)
+ (run-hooks 'help-screen-hook)
(setq new-minor-mode-map-alist minor-mode-map-alist))
(goto-char (point-min))
(while (or (memq char (append help-event-list
--
2.39.3 (Apple Git-146)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode
2024-08-08 9:37 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-08 9:45 ` Eli Zaretskii
2024-08-08 9:57 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-08-08 9:45 UTC (permalink / raw)
To: Paul W. Rankin; +Cc: 72521
> From: Paul W. Rankin <rnkn@rnkn.xyz>
> Date: Thu, 8 Aug 2024 19:37:56 +1000
> Cc: 72521@debbugs.gnu.org
>
> > On 8 Aug 2024, at 18:58, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > Thanks, but we cannot possible install this patch, since this behavior
> > was introduced in Emacs 29. I agree with making this feature
> > optional, of course (and it will then be ON by default), but your
> > patch doesn't do that.
>
> Hi Eli,
>
> Thanks. I’ve replaced the call to variable-pitch-mode with a hook,
> help-screen-hook, which defaults to calling variable-pitch-mode.
>
> Ideally I think this should just be help-mode-hook though, which of
> course should not default to calling variable-pitch-mode.
>
> Anyway, how’s the patch (now attached) look to you?
Looks good, but I wonder whether a simple boolean user option would be
better, and also easier to customize. After all this is not a mode,
so people will not expect it to have a hook. Also, if someone doesn't
want variable-pitch-mode, I doubt they will want some other mode
instead, so the hook will most of the time be or the default or nil.
WDYT?
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode
2024-08-08 9:45 ` Eli Zaretskii
@ 2024-08-08 9:57 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08 10:34 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-08 9:57 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 72521
[-- Attachment #1: Type: text/plain, Size: 702 bytes --]
> On 8 Aug 2024, at 19:45, Eli Zaretskii <eliz@gnu.org> wrote:
>
> Looks good, but I wonder whether a simple boolean user option would be
> better, and also easier to customize. After all this is not a mode,
> so people will not expect it to have a hook. Also, if someone doesn't
> want variable-pitch-mode, I doubt they will want some other mode
> instead, so the hook will most of the time be or the default or nil.
>
> WDYT?
Agreed. I’ve added `help-for-help-use-variable-pitch’ boolean option.
Although it’s a mouthful, I think this name is most discoverable since
C-h C-k C-h C-h returns `help-for-help’, and there’s variable
`help-for-help-buffer-name’.
[-- Attachment #2: 0001-lisp-help-macro.el-add-help-for-help-use-variable-pi.patch --]
[-- Type: application/octet-stream, Size: 1488 bytes --]
From 695e3839b105eea8ff019af17754d16972cdd399 Mon Sep 17 00:00:00 2001
From: "Paul W. Rankin" <rnkn@rnkn.xyz>
Date: Thu, 8 Aug 2024 12:16:07 +1000
Subject: [PATCH] * lisp/help-macro.el: add help-for-help-use-variable-pitch
option
t by default to preserve Emacs 29 behavior
---
lisp/help-macro.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index 14d2a45f5f2..0edf47bf318 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -78,6 +78,11 @@ three-step-help
:type 'boolean
:group 'help)
+(defcustom help-for-help-use-variable-pitch t
+ "Non-nil if `variable-pitch-mode' should be used by command `help-for-help'."
+ :type 'boolean
+ :group 'help)
+
(defmacro make-help-screen (fname help-line help-text helped-map
&optional buffer-name)
"Construct help-menu function name FNAME.
@@ -141,7 +146,7 @@ make-help-screen
(insert (substitute-command-keys help-screen)))
(let ((minor-mode-map-alist new-minor-mode-map-alist))
(help-mode)
- (variable-pitch-mode)
+ (when help-for-help-use-variable-pitch (variable-pitch-mode))
(setq new-minor-mode-map-alist minor-mode-map-alist))
(goto-char (point-min))
(while (or (memq char (append help-event-list
--
2.39.3 (Apple Git-146)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode
2024-08-08 9:57 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-08 10:34 ` Eli Zaretskii
2024-08-08 10:34 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-08-08 10:34 UTC (permalink / raw)
To: Paul W. Rankin; +Cc: 72521-done
> From: "Paul W. Rankin" <rnkn@rnkn.xyz>
> Date: Thu, 8 Aug 2024 19:57:18 +1000
> Cc: 72521@debbugs.gnu.org
>
> > On 8 Aug 2024, at 19:45, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > Looks good, but I wonder whether a simple boolean user option would be
> > better, and also easier to customize. After all this is not a mode,
> > so people will not expect it to have a hook. Also, if someone doesn't
> > want variable-pitch-mode, I doubt they will want some other mode
> > instead, so the hook will most of the time be or the default or nil.
> >
> > WDYT?
>
> Agreed. I’ve added `help-for-help-use-variable-pitch’ boolean option.
> Although it’s a mouthful, I think this name is most discoverable since
> C-h C-k C-h C-h returns `help-for-help’, and there’s variable
> `help-for-help-buffer-name’.
Thanks, installed on the emacs-30 release branch, and closing the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode
2024-08-08 10:34 ` Eli Zaretskii
@ 2024-08-08 10:34 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 8+ messages in thread
From: Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-08 10:34 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 72521-done
> On 8 Aug 2024, at 20:34, Eli Zaretskii <eliz@gnu.org> wrote:
>
> Thanks, installed on the emacs-30 release branch, and closing the bug.
Thanks :)
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-08-08 10:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <9417FE9A-2B7C-4A23-80DE-1322E0ECB812@rnkn.xyz>
2024-08-08 2:25 ` bug#72521: [PATCH]: lisp/help-macro.el: remove hard-coded variable-pitch-mode Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08 8:58 ` Eli Zaretskii
2024-08-08 9:37 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08 9:37 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08 9:45 ` Eli Zaretskii
2024-08-08 9:57 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08 10:34 ` Eli Zaretskii
2024-08-08 10:34 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.