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

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

Re: RE: RE: Removing line and column number settings from some buffers


From: daniela-spit
Subject: Re: RE: RE: Removing line and column number settings from some buffers
Date: Sun, 6 Dec 2020 00:53:20 +0100


> Sent: Sunday, December 06, 2020 at 12:37 AM
> From: "Drew Adams" <drew.adams@oracle.com>
> To: daniela-spit@gmx.it
> Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: RE: RE: Removing line and column number settings from some buffers
>
> > > > Look at this code.  Correct, you don't need a variable for storing,
> > > > but what is happening with n in the following code.
> > > >
> > > > The byte compiler complains about the variable n
> > > >
> > > > (defun auto-fill-cycle ()
> > > >    (interactive)
> > > >    (setq-local n (get 'auto-fill-cycle 'state))...)
> > >
> > > `n' is a free variable.  Add a `defvar' for it, if you
> > > don't want Emacs to tell you about that.
> >
> > Would that be a valid approach or is it just to stop emacs complaining?
>
> Valid.  The variable is free in your function.
>
> > Was considering to use (let (n) ...
>
> Where are you going to put your `let'?
>
> You want the value to persist beyond an invocation of
> your function, right?

auto-fill would be buffer local and the function property 'state' in
being changed.  Additionally, it is only used so not to use the longer
(get 'auto-fill-cycle 'state) for the when condition.  Why would you want
'n' to persist beyond an invocation of auto-fill-cycle?  I don't see a reason
to do that.  Can do '(let (n)' and close it after setting the state to 1 when
the function gets cycled to  state 3.

With the use of 'let' would I then use the following?
(setq n (get 'gungadin-auto-fill-cycle 'state))

>



reply via email to

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