From: daniela-spit@gmx.it
To: Drew Adams <drew.adams@oracle.com>
Cc: Michael Heerdegen <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
Subject: Re: RE: RE: Removing line and column number settings from some buffers
Date: Sun, 6 Dec 2020 00:53:20 +0100 [thread overview]
Message-ID: <trinity-fd575a47-b0ae-4edd-852a-0683c5b27ad5-1607212400774@3c-app-mailcom-bs06> (raw)
In-Reply-To: <755b3e84-b28a-4116-acec-81dfbfe68058@default>
> 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))
>
next prev parent reply other threads:[~2020-12-05 23:53 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-02 15:34 Removing line and column number settings from some buffers daniela-spit
2020-12-02 21:18 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-02 23:21 ` daniela-spit
2020-12-02 23:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-02 23:32 ` daniela-spit
2020-12-02 23:56 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-02 23:57 ` daniela-spit
2020-12-03 0:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-03 22:14 ` Michael Heerdegen
2020-12-03 22:19 ` daniela-spit
2020-12-03 22:22 ` Jean Louis
2020-12-03 22:33 ` daniela-spit
2020-12-03 22:52 ` Jean Louis
2020-12-03 23:09 ` daniela-spit
2020-12-04 0:38 ` Christopher Dimech
2020-12-04 1:16 ` Michael Heerdegen
2020-12-04 1:33 ` Christopher Dimech
2020-12-04 2:10 ` daniela-spit
2020-12-04 2:42 ` Christopher Dimech
2020-12-04 6:10 ` Jean Louis
2020-12-04 6:31 ` Christopher Dimech
2020-12-04 8:40 ` Eli Zaretskii
2020-12-05 5:13 ` Christopher Dimech
2020-12-05 15:41 ` Drew Adams
2020-12-05 17:58 ` Jean Louis
2020-12-05 18:16 ` Drew Adams
2020-12-05 18:57 ` Jean Louis
2020-12-04 2:46 ` Michael Heerdegen
2020-12-04 3:12 ` Christopher Dimech
2020-12-04 4:16 ` daniela-spit
2020-12-04 4:36 ` daniela-spit
2020-12-04 5:58 ` daniela-spit
2020-12-04 7:19 ` Jean Louis
2020-12-05 4:42 ` daniela-spit
2020-12-05 21:32 ` Michael Heerdegen
2020-12-05 21:35 ` Michael Heerdegen
2020-12-05 22:54 ` daniela-spit
2020-12-05 22:57 ` Drew Adams
2020-12-05 23:05 ` daniela-spit
2020-12-05 23:37 ` Drew Adams
2020-12-05 23:53 ` daniela-spit [this message]
2020-12-04 7:40 ` Jean Louis
2020-12-04 6:07 ` Jean Louis
2020-12-03 23:24 ` Michael Heerdegen
2020-12-03 23:36 ` daniela-spit
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-fd575a47-b0ae-4edd-852a-0683c5b27ad5-1607212400774@3c-app-mailcom-bs06 \
--to=daniela-spit@gmx.it \
--cc=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/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.
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).