unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21436: 25.0.50; dir local variables are ignored
@ 2015-09-08 17:15 Sam Steingold
  2015-09-08 22:07 ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Sam Steingold @ 2015-09-08 17:15 UTC (permalink / raw)
  To: 21436

My .dir-locals.el is

--8<---------------cut here---------------start------------->8---
((python-mode . ((python-shell-extra-pythonpaths . ("../utils" "")))))
--8<---------------cut here---------------end--------------->8---

nevertheless the value of `python-shell-extra-pythonpaths' in the python
buffer is `nil' even after an explicit M-: (hack-dir-local-variables)
RET or killing the buffer and re-visiting the file.

enable-local-variables ==> :safe
enable-dir-local-variables ==> t
dir-local-variables-alist ==> ((python-shell-extra-pythonpaths "../utils" ""))

The doc seems to support this behavior:

--8<---------------cut here---------------start------------->8---
hack-dir-local-variables is a compiled Lisp function in ‘files.el’.
Read per-directory local variables for the current buffer.
Store the directory-local variables in ‘dir-local-variables-alist’
and ‘file-local-variables-alist’, without applying them.
--8<---------------cut here---------------end--------------->8---

however, ISTR that `hack-dir-local-variables' did install the local
vars.

so, what do I need to do to get the dir-local vars to take effect?



In GNU Emacs 25.0.50.3 (x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F27))
 of 2015-09-08
Repository revision: 48857075c96c00bdbf8536e25234d33ed1b6e3b9
Windowing system distributor 'Apple', version 10.3.1348
Configured using:
 'configure --with-ns'

Configured features:
JPEG IMAGEMAGICK ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
  value of $LANG: C
  locale-coding-system: utf-8-unix

Major mode: Python

Minor modes in effect:
  diff-auto-refine-mode: t
  anaconda-mode: t
  rcirc-track-minor-mode: t
  which-function-mode: t
  url-handler-mode: t
  show-paren-mode: t
  desktop-save-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  abbrev-mode: t

Recent messages:

Load-path shadows:
None found.

Features:
(shadow sort bbdb-message mailalias cookie1 flyspell ispell mail-extr
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap
gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source tls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range
gnus-win emacsbug message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums time-stamp apropos dabbrev tramp-cache debug skeleton
misearch multi-isearch vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc-dir
ewoc vc remember vc-dispatcher image-mode dired-aux dired vc-hg vc-git
diff-mode easy-mmode anaconda-mode f s ucs-normalize dash json-rpc
python-x folding-isearch folding python tramp-sh tramp tramp-compat
tramp-loaddefs trampver json finder-inf package epg-config warnings
midnight gnus gnus-ems nnheader mail-utils wid-edit bbdb-mua bbdb-com
crm mailabbrev bbdb-loaddefs bbdb bbdb-site timezone rcirc server
which-func imenu url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs gnus-util mm-util help-fns mail-prsvr password-cache
url-vars paren help-at-pt desktop frameset cus-start cus-load ido seq
byte-opt bytecomp byte-compile cconv cl-extra help-mode ess-toolbar
ess-mouse mouseme thingatpt browse-url ess-menu ess-swv ess-noweb
ess-noweb-font-lock-mode ess-bugs-l essd-els ess-sas-d ess-sas-l
ess-sas-a shell pcomplete ess-sta-d ess-sta-l cc-vars cc-defs
make-regexp ess-sp6-d ess-sp3-d ess-julia ess-r-d ess-r-completion
compile ess-tracebug format-spec ess-roxy advice hideshow ess-help
ess-developer ess-s-l ess ess-inf comint ansi-color ring ess-mode
ess-noweb-mode ess-utils ess-custom executable easymenu ess-compat
ess-site cl gv cl-loaddefs pcase cl-lib time-date mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
ns-win term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 523930 33265)
 (symbols 48 66127 0)
 (miscs 40 6106 69)
 (strings 32 183271 16989)
 (string-bytes 1 4406061)
 (vectors 16 71432)
 (vector-slots 8 1033994 2707)
 (floats 8 486 794)
 (intervals 56 3014 0)
 (buffers 976 32))

-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1348
http://www.childpsy.net/ http://think-israel.org http://camera.org
http://mideasttruth.com http://ffii.org http://memri.org http://truepeace.org
Never argue with an idiot: he has more experience with idiotic
arguments.





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

* bug#21436: 25.0.50; dir local variables are ignored
  2015-09-08 17:15 bug#21436: 25.0.50; dir local variables are ignored Sam Steingold
@ 2015-09-08 22:07 ` Glenn Morris
  2015-09-08 23:04   ` Sam Steingold
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2015-09-08 22:07 UTC (permalink / raw)
  To: sds; +Cc: 21436

Sam Steingold wrote:

> My .dir-locals.el is
>
> --8<---------------cut here---------------start------------->8---
> ((python-mode . ((python-shell-extra-pythonpaths . ("../utils" "")))))
> --8<---------------cut here---------------end--------------->8---

Works for me with emacs -Q.

> enable-local-variables ==> :safe

[non-standard setting]

And if you test it in emacs -Q, you'll see why it does not work for you.





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

* bug#21436: 25.0.50; dir local variables are ignored
  2015-09-08 22:07 ` Glenn Morris
@ 2015-09-08 23:04   ` Sam Steingold
  2015-09-09 17:03     ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Sam Steingold @ 2015-09-08 23:04 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 21436

thanks for your help!
why isn't python-shell-extra-pythonpaths safe?
where is it marked unsafe?
how do I mark it safe?
this is a recent change, why was it made?


On Tue, Sep 8, 2015 at 6:07 PM, Glenn Morris <rgm@gnu.org> wrote:
> Sam Steingold wrote:
>
>> My .dir-locals.el is
>>
>> --8<---------------cut here---------------start------------->8---
>> ((python-mode . ((python-shell-extra-pythonpaths . ("../utils" "")))))
>> --8<---------------cut here---------------end--------------->8---
>
> Works for me with emacs -Q.
>
>> enable-local-variables ==> :safe
>
> [non-standard setting]
>
> And if you test it in emacs -Q, you'll see why it does not work for you.



-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net/>





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

* bug#21436: 25.0.50; dir local variables are ignored
  2015-09-08 23:04   ` Sam Steingold
@ 2015-09-09 17:03     ` Glenn Morris
  2015-09-09 17:43       ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2015-09-09 17:03 UTC (permalink / raw)
  To: Sam Steingold; +Cc: 21436

Sam Steingold wrote:

> why isn't python-shell-extra-pythonpaths safe?
> where is it marked unsafe?
> how do I mark it safe?
> this is a recent change, why was it made?

It may help to check the manuals and the git log.





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

* bug#21436: 25.0.50; dir local variables are ignored
  2015-09-09 17:03     ` Glenn Morris
@ 2015-09-09 17:43       ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2015-09-09 17:43 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 21436, Sam Steingold

>> why isn't python-shell-extra-pythonpaths safe?

Just think of ways you (as an attacker) could set this variable in
a file, then pass this file to a user (maybe a user on the same machine)
and see this user run the code you choose.


        Stefan





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

end of thread, other threads:[~2015-09-09 17:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-08 17:15 bug#21436: 25.0.50; dir local variables are ignored Sam Steingold
2015-09-08 22:07 ` Glenn Morris
2015-09-08 23:04   ` Sam Steingold
2015-09-09 17:03     ` Glenn Morris
2015-09-09 17:43       ` Stefan Monnier

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