From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Aaron S. Hawley" Newsgroups: gmane.emacs.bugs Subject: bug#11127: 24.0.94; [PATCH] Tutorial breaks with modified key bindings Date: Fri, 30 Mar 2012 14:12:54 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1333131283 27100 80.91.229.3 (30 Mar 2012 18:14:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Mar 2012 18:14:43 +0000 (UTC) Cc: 11127@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 30 20:14:42 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SDgLL-0003rW-JZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Mar 2012 20:14:35 +0200 Original-Received: from localhost ([::1]:60906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDgLK-0001X0-Ru for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Mar 2012 14:14:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDgLG-0001WV-FH for bug-gnu-emacs@gnu.org; Fri, 30 Mar 2012 14:14:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDgLE-0005pt-R2 for bug-gnu-emacs@gnu.org; Fri, 30 Mar 2012 14:14:30 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDgLE-0005pn-L2 for bug-gnu-emacs@gnu.org; Fri, 30 Mar 2012 14:14:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SDgLD-0000Gi-Ty for bug-gnu-emacs@gnu.org; Fri, 30 Mar 2012 14:14:28 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Aaron S. Hawley" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Mar 2012 18:14:27 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11127 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11127-submit@debbugs.gnu.org id=B11127.133313307612226 (code B ref 11127); Fri, 30 Mar 2012 18:14:27 +0000 Original-Received: (at 11127) by debbugs.gnu.org; 30 Mar 2012 18:44:36 +0000 Original-Received: from localhost ([127.0.0.1]:47365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDgoK-0003B2-2W for submit@debbugs.gnu.org; Fri, 30 Mar 2012 14:44:36 -0400 Original-Received: from mail-bk0-f44.google.com ([209.85.214.44]:50061) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDgoH-0003An-DZ for 11127@debbugs.gnu.org; Fri, 30 Mar 2012 14:44:30 -0400 Original-Received: by bkuw5 with SMTP id w5so791369bku.3 for <11127@debbugs.gnu.org>; Fri, 30 Mar 2012 11:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nAYWkcRxWAovXobs3449+dF3AT31e0Km2eTH5sKtTLA=; b=GeducsLq7rFHqeaMIJx26LZnT5u2PhygnSMa8CJ/5+9Bkmw4nhYQ0Izw5mwUM/6aW2 QdBkMMCvHnP2l3oe+mbyNLhhF9yf/z4DarstTLH8uvSEA4ym+UdR1bi4SViKZZ8LFqI0 Q7XcM773uRkys+mLmVLyizymEH32NwbQgn7N/VYDyi8blkxW+rvi+TxIUbrqA6gQpAM3 OAFeguDqAA6m8bE2ZVA2QgV1K1/xIBqPUMZxIUdD1nyu6Jyk4F6jzpOP/tq3ia+mesAL hNuINkoyjDSgJhhz6DqeI8Uw1+Vnz1LcGtUX5sTHoc0tQ0ev/msLd8Z3IK27KcTsx47T oF4g== Original-Received: by 10.205.122.73 with SMTP id gf9mr1358937bkc.96.1333131174789; Fri, 30 Mar 2012 11:12:54 -0700 (PDT) Original-Received: by 10.205.35.78 with HTTP; Fri, 30 Mar 2012 11:12:54 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58352 Archived-At: > 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)))