help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto Fill Comments


From: Christopher Dimech
Subject: Re: Auto Fill Comments
Date: Thu, 26 Nov 2020 22:14:35 +0100

I have done as follows.  The problem started after reading that
for mode specific setup, comment-auto-fill-only-comments got to
be local


(setq-default fill-column 72)

(defun typh-auto-fill-mode (n)
   "Breaks lines at a specific number of columns using Auto Fill."
   (interactive "p")

   (if (= n 0) (turn-off-auto-fill))

   (if (= n 1)
      (progn
        (auto-fill-mode n)
        (setq comment-auto-fill-only-comments t) ))

   (if (= n 2)
      (progn
         (turn-on-auto-fill)
         (setq comment-auto-fill-only-comments nil) )))



> Sent: Thursday, November 26, 2020 at 9:16 PM
> From: tomas@tuxteam.de
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: Auto Fill Comments
>
> On Thu, Nov 26, 2020 at 07:44:10PM +0100, Christopher Dimech wrote:
>
> [...]
>
> > Had thought that setq was actually a global thing, not local.
> > For local variables I was using "let" and "let*", but that seems
> > a wrong understanding.
>
> No, no. I was talking about buffer-local, i.e. bound to the
> buffer. Your local is wrt. to the code (dynamic or lexical)
>
> Buffer-local variables are global variables, as seen from the
> code's perspective.
>
> You didn't look at the docs, did you?
>
> Cheers
>  - t
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]