From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Trying to find the status of auto-fill-mode in a buffer
Date: Sat, 23 Nov 2024 11:37:56 +0200 [thread overview]
Message-ID: <86ldxamgsr.fsf@gnu.org> (raw)
In-Reply-To: <20241123112257.3563543d@enoush2o> (message from Alexandros Prekates on Sat, 23 Nov 2024 09:22:57 +0000)
> Date: Sat, 23 Nov 2024 09:22:57 +0000
> From: Alexandros Prekates <aprekates@posteo.net>
>
> Regarding the discussion about the naming, i dont have the experience
> in lisp and elisp but i think i can try to convey what perhaps is
> the difficulty here for me as a newbie.
>
> the C-h f auto-fill-mode says
> To check whether the minor mode is enabled in the current buffer,
> ^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^^
> evaluate (the variable) ‘auto-fill-function’
> ^^^^^^^^ (+master) ^^^^^^^^
>
> So on one hand i think it would be reasonable my mind to think of a
> state-like variable (not a function) . In that state i think
> a boolean variable auto-fill-mode-activation-state would make more
> sense to me.
But there's no such state variable in this case.
> But then i think i step into a possible semanticaly foggy area. Emacs
> tells me that to find the state of a minor mode lets:
> 'evaluate' sth called 'auto-fill-function'
> Reading the current discussion and reading more carefully :
> C-h f auto-fill-mode
> C-h v auto-fill-function
> auto-fill-function is a variable defined in ‘C source code’.
> C-v f auto-fill-function
> auto-fill-function is a native-compiled Lisp function in
> ‘simple.el’.
> and do-auto-fill is a native-compiled Lisp function in ‘simple.el’
>
>
> What i understand vaguely is that emacs uses the value of a variable
> that holds or points to the function that does the actual auto-fill
> and if it has nil value that means that the mode is not active in the
> current buffer.(i wonder if that is an idiosyncratic way to tell if
> a mode is active or used often).
The text displayed by "C-h v auto-fill-function RET" in a buffer
where auto-fill is not turned on is the following:
auto-fill-function is a variable defined in ‘C source code’.
Its value is nil
Function called (if non-nil) to perform auto-fill.
while in a buffer where the mode is turned on, the text is:
auto-fill-function is a variable defined in ‘C source code’.
Its value is ‘mail-mode-auto-fill’
Local in buffer *mail*; global value is nil
Function called (if non-nil) to perform auto-fill.
This tells to me that if the value is non-nil, the mode is turned on,
and Emacs performs auto-filling using that function, otherwise it is
turned off and no auto-filling takes place. I don't find the above to
be vague at all.
> But i get the feeling (a hunch) that we are in a borderline world
> where C land semantics mix with the Lisp land ones.
> For example i dont see the word 'symbol'.
How do you get that feeling and why?
next prev parent reply other threads:[~2024-11-23 9:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-23 9:22 Trying to find the status of auto-fill-mode in a buffer Alexandros Prekates
2024-11-23 9:37 ` Eli Zaretskii [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-11-19 6:43 Alexandros Prekates
2024-11-19 9:39 ` Arsen Arsenović
2024-11-19 9:49 ` Alexandros Prekates
2024-11-19 10:35 ` Tassilo Horn
2024-11-19 14:16 ` Alexandros Prekates
2024-11-19 11:27 ` Robert Pluim
2024-11-19 14:52 ` Arsen Arsenović
2024-11-19 17:25 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-11-19 17:38 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-11-20 7:56 ` Robert Pluim
2024-11-20 16:05 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-11-20 16:14 ` Robert Pluim
2024-11-20 19:14 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-11-20 19:27 ` Eli Zaretskii
2024-11-20 23:50 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-11-21 6:50 ` Eli Zaretskii
2024-11-20 18:51 ` mbork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ldxamgsr.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.