unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* another minor lexbind patch
@ 2010-04-27 20:20 Tom Tromey
  2010-04-27 21:04 ` Davis Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2010-04-27 20:20 UTC (permalink / raw)
  To: Emacs discussions

Here's a trivial patch to the lexbind branch to make lexical-binding a
safe local variable.

Tom

2010-04-27  Tom Tromey  <tromey@redhat.com>

	* files.el (lexical-binding): Set safe-local-variable.

=== modified file 'lisp/files.el'
*** lisp/files.el	2009-12-11 11:04:56 +0000
--- lisp/files.el	2010-04-27 20:10:38 +0000
***************
*** 2,8 ****
  
  ;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994, 1995, 1996,
  ;;   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
! ;;   2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  
  ;; Maintainer: FSF
  
--- 2,8 ----
  
  ;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994, 1995, 1996,
  ;;   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
! ;;   2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
  
  ;; Maintainer: FSF
  
***************
*** 2770,2776 ****
  	(left-margin          . integerp)   ;; C source code
  	(no-update-autoloads  . booleanp)
  	(tab-width            . integerp)   ;; C source code
! 	(truncate-lines       . booleanp))) ;; C source code
  
  (put 'c-set-style 'safe-local-eval-function t)
  
--- 2770,2777 ----
  	(left-margin          . integerp)   ;; C source code
  	(no-update-autoloads  . booleanp)
  	(tab-width            . integerp)   ;; C source code
! 	(truncate-lines       . booleanp)   ;; C source code
! 	(lexical-binding      . booleanp))) ;; C source code
  
  (put 'c-set-style 'safe-local-eval-function t)
  





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

* Re: another minor lexbind patch
  2010-04-27 20:20 another minor lexbind patch Tom Tromey
@ 2010-04-27 21:04 ` Davis Herring
  2010-04-27 21:37   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Davis Herring @ 2010-04-27 21:04 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Emacs discussions

> Here's a trivial patch to the lexbind branch to make lexical-binding a
> safe local variable.

If `lexical-binding' is taken into account other than at read or
compilation time, it might not be wise to make it safe: someone could find
(old, well-established, well-distributed, commonly-used) code that behaves
in some undesirable way if it's non-nil.

If it does only affect loading/compiling code in the file where it's set,
that's fine, of course: you're already trusting that file if you eval
things in it, although I suppose someone could try to write a file that
did something evil that wasn't obvious if you read it assuming dynamic
binding.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




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

* Re: another minor lexbind patch
  2010-04-27 21:04 ` Davis Herring
@ 2010-04-27 21:37   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2010-04-27 21:37 UTC (permalink / raw)
  To: herring; +Cc: Emacs discussions

>>>>> "Davis" == Davis Herring <herring@lanl.gov> writes:

>> Here's a trivial patch to the lexbind branch to make lexical-binding a
>> safe local variable.

Davis> If `lexical-binding' is taken into account other than at read or
Davis> compilation time, it might not be wise to make it safe: someone
Davis> could find (old, well-established, well-distributed,
Davis> commonly-used) code that behaves in some undesirable way if it's
Davis> non-nil.

It is used for eval-region.  That is why I sent this patch: it is very
strange to set lexical-binding in a file, then be queried when trying to
edit the file.

I don't believe it has any effect in other situations.

Tom




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

end of thread, other threads:[~2010-04-27 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27 20:20 another minor lexbind patch Tom Tromey
2010-04-27 21:04 ` Davis Herring
2010-04-27 21:37   ` Tom Tromey

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