From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: ;; Local variables: (was: Re: The function ‘cl-set-difference’ might not be defined at runtime)
Date: Wed, 15 Apr 2020 19:25:54 +0200 [thread overview]
Message-ID: <20200415172554.GC5222@tuxteam.de> (raw)
In-Reply-To: <87zhbcfz8k.fsf_-_@ebih.ebihd>
[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]
On Wed, Apr 15, 2020 at 07:14:03PM +0200, Emanuel Berg via Users list for the GNU Emacs text editor wrote:
> tomas wrote:
>
> >> [...] what does this mean?
> >>
> >> ;; Local variables:
> >> ;; byte-compile-dynamic: t
> >> ;; End:
> >
> > Quoth "describe-variable" (aka C-h v):
[...]
> Yes, but I meant the comment/variable syntax, which
> I haven't see before. In the particular variable's
> docstring, they mention
>
> -*- byte-compile-dynamic: t -*-
>
> so how does that differ from
>
> ;; Local variables:
> ;; byte-compile-dynamic: t
> ;; End:
The one goes to the beginning of the file, the other to the
end. Otherwise, they are just alternative ways to express
the same thing. The "-*- ... -*-" form has limitations whenever
the first line of the file is needed for other things (e.g.
the #! in shell scripts. When you've got many file variables,
the end form is arguably a bit more readable. See "File
Variables" in the manual [1]
> As for the syntax, I tried with this and then did
> `emacs-lisp-mode', what happened was it popped up
> a warning telling me the values were possibly unsafe -
> what does that mean?
>
> ;; Local variables:
> ;; local-test-var: t
> ;; End:
File variables can do Bad Things (remember Word macro
viruses?). Code is potentially executed when you load
the file. So there's a limited set of file variables
considered "safe" (to which you can add) -- beyond
that you are warned (unless you switch that off).
Just imagine I (evil mastermind) send you a text
file with some bad stuff hidden in file variables...
See [2].
Cheers
[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables
[2] https://www.gnu.org/software/emacs/manual/html_node/emacs/Safe-File-Variables.html#Safe-File-Variables
-- t
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2020-04-15 17:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 17:53 The function ‘cl-set-difference’ might not be defined at runtime Jorge P. de Morais Neto
2020-04-14 18:12 ` Štěpán Němec
2020-04-14 18:25 ` Jorge P. de Morais Neto
2020-04-14 18:39 ` Noam Postavsky
2020-04-14 18:47 ` Štěpán Němec
2020-04-14 19:17 ` Jorge P. de Morais Neto
2020-04-14 19:43 ` Noam Postavsky
2020-04-14 20:21 ` Štěpán Němec
2020-04-14 20:59 ` Jorge P. de Morais Neto
2020-04-15 4:01 ` Stefan Monnier
2020-04-15 4:34 ` Emanuel Berg via Users list for the GNU Emacs text editor
[not found] ` <20200415070046.GA17630@tuxteam.de>
2020-04-15 17:14 ` ;; Local variables: (was: Re: The function ‘cl-set-difference’ might not be defined at runtime) Emanuel Berg via Users list for the GNU Emacs text editor
2020-04-15 17:25 ` tomas [this message]
2020-04-15 12:52 ` The function ‘cl-set-difference’ might not be defined at runtime Jorge P. de Morais Neto
2020-04-15 13:01 ` Noam Postavsky
2020-04-14 20:21 ` Stefan Monnier
2020-04-14 21:10 ` Jorge P. de Morais Neto
2020-04-15 4:05 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200415172554.GC5222@tuxteam.de \
--to=tomas@tuxteam.de \
--cc=help-gnu-emacs@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.