unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Trying to find the status of auto-fill-mode in a buffer
@ 2024-11-19  6:43 Alexandros Prekates
  2024-11-19  9:39 ` Arsen Arsenović
  0 siblings, 1 reply; 19+ messages in thread
From: Alexandros Prekates @ 2024-11-19  6:43 UTC (permalink / raw)
  To: help-gnu-emacs

C-h f auto-fill-mode says : 
  ''To check whether the minor mode is
  enabled in the current buffer, evaluate ‘auto-fill-function’. ''

How do we test that IN a certain buffer ? 
I evaluated (auto-fill-function) in scratch buffer
but it gives me nil. 

Alexandros 



^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: Trying to find the status of auto-fill-mode in a buffer
@ 2024-11-23  9:22 Alexandros Prekates
  2024-11-23  9:37 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Alexandros Prekates @ 2024-11-23  9:22 UTC (permalink / raw)
  To: help-gnu-emacs

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 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). 
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'.


----------
Thanks to Marcin for bringing to my attention the coding convention
regarding 'auto-fill-function'.

Thanks to Arsen for bringing to my attention C-j.

As for M-: that Michael suggested i have currently a keyboard
conflict that wont allow me to enter that key.


 



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

end of thread, other threads:[~2024-11-23  9:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19  6:43 Trying to find the status of auto-fill-mode in a buffer 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
  -- strict thread matches above, loose matches on Subject: below --
2024-11-23  9:22 Alexandros Prekates
2024-11-23  9:37 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).