From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Trying to find the status of auto-fill-mode in a buffer Date: Sat, 23 Nov 2024 11:37:56 +0200 Message-ID: <86ldxamgsr.fsf@gnu.org> References: <20241123112257.3563543d@enoush2o> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24271"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 23 10:38:52 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tEmbL-0006AQ-Oe for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Nov 2024 10:38:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEmaY-0005SF-Nx; Sat, 23 Nov 2024 04:38:02 -0500 Original-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 1tEmaW-0005Rm-HF for help-gnu-emacs@gnu.org; Sat, 23 Nov 2024 04:38:00 -0500 Original-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 1tEmaW-0003ld-9M for help-gnu-emacs@gnu.org; Sat, 23 Nov 2024 04:38:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=hiNmp8c0T4VjkQ8YqPcsGEu18J8HdM/QMZQXdghYKl0=; b=qz9jWCwfrtrbTXP77ARD TlbPYAVhMcCWX2gAcZmPMTNhrv8n+4/5P8QRe1gtN4pUfMhi+Hj5eo9VN7RZSDfx0sc4/jY8aP6aa lSY9Aea2GPFGPhSeXgwiQeUvdq9S+kNkHun3V+JteDE9Z3j/UQAzyP5v/RnorWCeyZ2s2kFjT2LJY SwSywaQY+pfdLU5etmNrsniUHCFET914mkg32TbMansaO60LvtyopRHuhmvQjaIjoOS9HzXI3fs+B aNTQ77GZJ0EEGAc8BSKBDrjh4+feB9ZYikiNTXkeZiIFwUlV94AFSmG9PMJxSFS3uWJ29Dzsr3pnG BYG7QTz6DsZ21w==; In-Reply-To: <20241123112257.3563543d@enoush2o> (message from Alexandros Prekates on Sat, 23 Nov 2024 09:22:57 +0000) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148368 Archived-At: > Date: Sat, 23 Nov 2024 09:22:57 +0000 > From: Alexandros Prekates > > 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?