From: "Aaron S. Hawley" <aaron.s.hawley@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 11127@debbugs.gnu.org
Subject: bug#11127: 24.0.94; [PATCH] Tutorial breaks with modified key bindings
Date: Fri, 30 Mar 2012 14:12:54 -0400 [thread overview]
Message-ID: <CAFw1JJ776Vf_xQqjD79wQz6fKoL_B=iH1mdPGp6Z56G2N5GAWg@mail.gmail.com> (raw)
In-Reply-To: <t7bonedprn.fsf@fencepost.gnu.org>
> I'm not sure that will help with the specified example, where dir-locals
> are applied by a class setting, not an actual file.
My understanding is that all dir-locals classes need to apply to some
directory path.
> Also, the tutorial explains the use of C-x C-s, which implicitly relies
> on the directory being writable (maybe it should actually set d-d to ~).
Stefan's last comment made me wonder whether we could let-bind
`default-directory' to a bogus value that will never be a dir-locals
path. How about the empty string? This patch seems to work. I
tested it with the same scenario before.
emacs -Q
(progn
(dir-locals-set-class-variables
'unwritable-directory
'((nil . ((buffer-read-only . t)))))
(dir-locals-set-directory-class default-directory 'unwritable-directory))
C-h t
--- tutorial.el 2012-02-13 11:13:25.000000000 -0500
+++ tutorial.el 2012-03-30 13:57:49.942206100 -0400
@@ -830,7 +830,8 @@
(if old-tut-file
(progn
(insert-file-contents (tutorial--saved-file))
- (let ((enable-local-variables :safe))
+ (let ((default-directory "")
+ (enable-local-variables :safe))
(hack-local-variables))
(goto-char (point-min))
(setq old-tut-point
@@ -847,7 +848,8 @@
(goto-char tutorial--point-before-chkeys)
(setq tutorial--point-before-chkeys (point-marker)))
(insert-file-contents (expand-file-name filename tutorial-directory))
- (let ((enable-local-variables :safe))
+ (let ((default-directory "")
+ (enable-local-variables :safe))
(hack-local-variables))
(forward-line)
(setq tutorial--point-before-chkeys (point-marker)))
next prev parent reply other threads:[~2012-03-30 18:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-29 18:49 bug#11127: 24.0.94; [PATCH] Tutorial breaks with modified key bindings Aaron S. Hawley
2012-03-29 20:17 ` Glenn Morris
2012-03-29 21:31 ` Aaron S. Hawley
2012-03-30 3:58 ` Glenn Morris
2012-03-30 12:32 ` Stefan Monnier
2012-03-30 16:20 ` Glenn Morris
2012-03-30 18:12 ` Aaron S. Hawley [this message]
2012-03-31 18:35 ` Glenn Morris
2012-04-02 13:28 ` Aaron S. Hawley
2012-04-09 20:50 ` Glenn Morris
2013-02-11 1:52 ` Glenn Morris
2012-03-30 17:23 ` Glenn Morris
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='CAFw1JJ776Vf_xQqjD79wQz6fKoL_B=iH1mdPGp6Z56G2N5GAWg@mail.gmail.com' \
--to=aaron.s.hawley@gmail.com \
--cc=11127@debbugs.gnu.org \
--cc=rgm@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 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).