all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#72825: [PATCH] Fix the doc on setting tool-bar-mode at startup
@ 2024-08-26 20:19 Krystian Samp
  2024-08-27 10:50 ` Visuwesh
  2024-08-27 12:19 ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Krystian Samp @ 2024-08-26 20:19 UTC (permalink / raw)
  To: 72825


[-- Attachment #1.1: Type: text/plain, Size: 574 bytes --]

Tags: patch

Emacs info doc states: "To control the use of tool bars at startup,
customize the variable `tool-bar-mode`."

`describe-variable` for `tool-bar-mode` states: "Setting this variable
directly does not take effect;" and suggests to customize it through a call
to `tool-bar-mode` function.

The latter seems to be the correct way. Setting `tool-bar-mode` variable in
init.el has no effect, but calling (tool-bar-mode -1) does work as
expected. Therefore, the patch changes the Emacs info doc to also suggest
customization through a function call.

Thanks,
Krystian

[-- Attachment #1.2: Type: text/html, Size: 722 bytes --]

[-- Attachment #2: 0001-Fix-the-doc-on-setting-tool-bar-mode-at-startup.patch --]
[-- Type: application/octet-stream, Size: 910 bytes --]

From c0ef9595302f0d7d581d5d6f4d883e0dee1e28ee Mon Sep 17 00:00:00 2001
From: Krystian Samp <samp.krystian@gmail.com>
Date: Mon, 26 Aug 2024 00:13:37 +0200
Subject: [PATCH] Fix the doc on setting tool-bar-mode at startup

---
 doc/emacs/frames.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index b5f2c5f5e84..ab046126293 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -1316,7 +1316,7 @@ prevent this replacement from happening, customize the variable
 @vindex tool-bar-mode
   To toggle the use of tool bars, type @kbd{M-x tool-bar-mode}.  This
 command applies to all frames, including frames yet to be created.  To
-control the use of tool bars at startup, customize the variable
+control the use of tool bars at startup, call the function
 @code{tool-bar-mode}.
 
 @vindex tool-bar-style
-- 
2.39.3 (Apple Git-146)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#72825: [PATCH] Fix the doc on setting tool-bar-mode at startup
  2024-08-26 20:19 bug#72825: [PATCH] Fix the doc on setting tool-bar-mode at startup Krystian Samp
@ 2024-08-27 10:50 ` Visuwesh
  2024-08-27 12:19 ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Visuwesh @ 2024-08-27 10:50 UTC (permalink / raw)
  To: Krystian Samp; +Cc: 72825

[திங்கள் ஆகஸ்ட் 26, 2024] Krystian Samp wrote:

> Tags: patch
>
> Emacs info doc states: "To control the use of tool bars at startup,
> customize the variable `tool-bar-mode`."
>
> `describe-variable` for `tool-bar-mode` states: "Setting this variable
> directly does not take effect;" and suggests to customize it through a call
> to `tool-bar-mode` function.
>
> The latter seems to be the correct way. Setting `tool-bar-mode` variable in
> init.el has no effect, but calling (tool-bar-mode -1) does work as
> expected. Therefore, the patch changes the Emacs info doc to also suggest
> customization through a function call.

I am not sure how you "set" the variable.  If you customise the variable
like the info manual suggests, e.g., using setopt as

    (setopt tool-bar-mode nil)

the mode does get disabled.  However, if you set the variable with setq,
no such thing happens.  Also note how describe-variable suggests to
customise the variable.

This applies to every minor-mode as minor-modes defined with
define-minor-mode have the minor-mode variable declared as a defcustom
with a :set function that turns on/off the minor-mode accordingly.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#72825: [PATCH] Fix the doc on setting tool-bar-mode at startup
  2024-08-26 20:19 bug#72825: [PATCH] Fix the doc on setting tool-bar-mode at startup Krystian Samp
  2024-08-27 10:50 ` Visuwesh
@ 2024-08-27 12:19 ` Eli Zaretskii
  2024-08-27 12:26   ` Krystian Samp
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-08-27 12:19 UTC (permalink / raw)
  To: Krystian Samp; +Cc: 72825

> From: Krystian Samp <samp.krystian@gmail.com>
> Date: Mon, 26 Aug 2024 22:19:00 +0200
> 
> Emacs info doc states: "To control the use of tool bars at startup, customize the variable `tool-bar-mode`."
> 
> `describe-variable` for `tool-bar-mode` states: "Setting this variable directly does not take effect;" and suggests
> to customize it through a call to `tool-bar-mode` function.
> 
> The latter seems to be the correct way. Setting `tool-bar-mode` variable in init.el has no effect, but calling
> (tool-bar-mode -1) does work as expected. Therefore, the patch changes the Emacs info doc to also suggest
> customization through a function call.

When Emacs documentation says "customize the variable", it usually
means to invoke "M-x customize-variable RET".  (In newer versions of
Emacs you can also use 'setopt' in your init file.)

So I think this is a kind of misinterpretation of what the manual
says.

Thanks.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#72825: [PATCH] Fix the doc on setting tool-bar-mode at startup
  2024-08-27 12:19 ` Eli Zaretskii
@ 2024-08-27 12:26   ` Krystian Samp
  2024-08-29 12:09     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Krystian Samp @ 2024-08-27 12:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 72825

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

Eli, Visuwesh

Thanks. I interpreted it as using setq, but info says 'customize the
variable' which refers to what you are pointing. So this is
misinterpretation on my side!

This can be closed :)

Thanks for the comments!

On Tue, 27 Aug 2024 at 14:19, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Krystian Samp <samp.krystian@gmail.com>
> > Date: Mon, 26 Aug 2024 22:19:00 +0200
> >
> > Emacs info doc states: "To control the use of tool bars at startup,
> customize the variable `tool-bar-mode`."
> >
> > `describe-variable` for `tool-bar-mode` states: "Setting this variable
> directly does not take effect;" and suggests
> > to customize it through a call to `tool-bar-mode` function.
> >
> > The latter seems to be the correct way. Setting `tool-bar-mode` variable
> in init.el has no effect, but calling
> > (tool-bar-mode -1) does work as expected. Therefore, the patch changes
> the Emacs info doc to also suggest
> > customization through a function call.
>
> When Emacs documentation says "customize the variable", it usually
> means to invoke "M-x customize-variable RET".  (In newer versions of
> Emacs you can also use 'setopt' in your init file.)
>
> So I think this is a kind of misinterpretation of what the manual
> says.
>
> Thanks.
>

[-- Attachment #2: Type: text/html, Size: 1813 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#72825: [PATCH] Fix the doc on setting tool-bar-mode at startup
  2024-08-27 12:26   ` Krystian Samp
@ 2024-08-29 12:09     ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2024-08-29 12:09 UTC (permalink / raw)
  To: Krystian Samp; +Cc: 72825-done

> From: Krystian Samp <samp.krystian@gmail.com>
> Date: Tue, 27 Aug 2024 14:26:53 +0200
> Cc: 72825@debbugs.gnu.org
> 
> Eli, Visuwesh
> 
> Thanks. I interpreted it as using setq, but info says 'customize the variable' which refers to what you are
> pointing. So this is misinterpretation on my side!
> 
> This can be closed :)
> 
> Thanks for the comments!

Closing.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-29 12:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-26 20:19 bug#72825: [PATCH] Fix the doc on setting tool-bar-mode at startup Krystian Samp
2024-08-27 10:50 ` Visuwesh
2024-08-27 12:19 ` Eli Zaretskii
2024-08-27 12:26   ` Krystian Samp
2024-08-29 12:09     ` Eli Zaretskii

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.