unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* tex-mode.el dependency on (cl) every?
@ 2007-09-17 13:04 David Kastrup
  2007-09-17 14:07 ` David Kastrup
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Kastrup @ 2007-09-17 13:04 UTC (permalink / raw)
  To: emacs-devel


I see that we have

+(put 'tex-verbatim-environments 'safe-local-variable
+     (lambda (x) (require 'cl) (every 'stringp x)))

Couldn't we rather use the equivalent
  (lambda (x) (null (delq t (mapcar 'stringp x))))
instead?

And why is this needed at all?  tex-verbatim-environments is only ever
passed to regexp-opt and member, so any old value will be _safe_.  So
it should be ok just to do

(put 'tex-verbatim-environments 'safe-local-variable t)

shouldn't it?

-- 
David Kastrup

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tex-mode.el dependency on (cl) every?
  2007-09-17 13:04 tex-mode.el dependency on (cl) every? David Kastrup
@ 2007-09-17 14:07 ` David Kastrup
  2007-09-17 14:17 ` Stefan Monnier
  2007-09-17 22:24 ` Richard Stallman
  2 siblings, 0 replies; 5+ messages in thread
From: David Kastrup @ 2007-09-17 14:07 UTC (permalink / raw)
  To: emacs-devel

David Kastrup <dak@gnu.org> writes:

> I see that we have
>
> +(put 'tex-verbatim-environments 'safe-local-variable
> +     (lambda (x) (require 'cl) (every 'stringp x)))
>
> Couldn't we rather use the equivalent
>   (lambda (x) (null (delq t (mapcar 'stringp x))))
> instead?
>
> And why is this needed at all?  tex-verbatim-environments is only ever
> passed to regexp-opt and member, so any old value will be _safe_.  So
> it should be ok just to do
>
> (put 'tex-verbatim-environments 'safe-local-variable t)
>
> shouldn't it?

Well, or
(put 'tex-verbatim-environments 'safe-local-variable 'listp)
at least.

-- 
David Kastrup

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tex-mode.el dependency on (cl) every?
  2007-09-17 13:04 tex-mode.el dependency on (cl) every? David Kastrup
  2007-09-17 14:07 ` David Kastrup
@ 2007-09-17 14:17 ` Stefan Monnier
  2007-09-17 14:36   ` David Kastrup
  2007-09-17 22:24 ` Richard Stallman
  2 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2007-09-17 14:17 UTC (permalink / raw)
  To: David Kastrup; +Cc: emacs-devel

> And why is this needed at all?  tex-verbatim-environments is only ever
> passed to regexp-opt and member, so any old value will be _safe_.  So
> it should be ok just to do

> (put 'tex-verbatim-environments 'safe-local-variable t)

We like `safe-local-variable' to be conservative.  To reduce probablity of
introducing holes in the future.


        Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tex-mode.el dependency on (cl) every?
  2007-09-17 14:17 ` Stefan Monnier
@ 2007-09-17 14:36   ` David Kastrup
  0 siblings, 0 replies; 5+ messages in thread
From: David Kastrup @ 2007-09-17 14:36 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> And why is this needed at all?  tex-verbatim-environments is only ever
>> passed to regexp-opt and member, so any old value will be _safe_.  So
>> it should be ok just to do
>
>> (put 'tex-verbatim-environments 'safe-local-variable t)
>
> We like `safe-local-variable' to be conservative.  To reduce probablity of
> introducing holes in the future.

listp is ok here, I think.  Anyway, since in most cases
"safe-local-variable" amounts to "matches type defined by customize"
anyway, why don't we just add something like an explicit ":safe" tag
to our customization types?  This could cover part or all of the
customization type, and so everything not matching the "safe" parts of
a customization pattern (including not matching the customize type at
all) would be considered unsafe.

Since the "safe" tag would be a visible part of the customization
type, the likelihood of introducing eval-capable extensions without
thinking about security implications would likely be less than what we
have now.

-- 
David Kastrup

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tex-mode.el dependency on (cl) every?
  2007-09-17 13:04 tex-mode.el dependency on (cl) every? David Kastrup
  2007-09-17 14:07 ` David Kastrup
  2007-09-17 14:17 ` Stefan Monnier
@ 2007-09-17 22:24 ` Richard Stallman
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2007-09-17 22:24 UTC (permalink / raw)
  To: David Kastrup; +Cc: emacs-devel

I installed this change.
Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-17 22:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-17 13:04 tex-mode.el dependency on (cl) every? David Kastrup
2007-09-17 14:07 ` David Kastrup
2007-09-17 14:17 ` Stefan Monnier
2007-09-17 14:36   ` David Kastrup
2007-09-17 22:24 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).