emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 82b6b3c: Fix problem with auto-mode and dir-locals-


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 82b6b3c: Fix problem with auto-mode and dir-locals-collect-variables
Date: Wed, 25 Jan 2017 16:43:58 +0000 (UTC)

branch: master
commit 82b6b3cf8ff2544be4aab5157c3df05e98d77ab6
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix problem with auto-mode and dir-locals-collect-variables
    
    * lisp/files.el (dir-locals-collect-variables): When run from
    auto-mode, the file in question may not be an absolute path
    name (bug#24016).
    
    Example backtrace:
    
    Debugger entered--Lisp error: (args-out-of-range "compile-1st-in-loa
      dir-locals-collect-variables(((emacs-lisp-mode (indent-tabs-mode))
      hack-dir-local-variables()
      hack-local-variables(no-mode)
      run-mode-hooks(diff-mode-hook)
      diff-mode()
      mm-display-inline-fontify((#<buffer  *mm*-923037> ("text/x-diff" (
---
 lisp/files.el |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/files.el b/lisp/files.el
index f60282b..25392fd 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3723,7 +3723,8 @@ Return the new variables list."
   (let* ((file-name (or (buffer-file-name)
                        ;; Handle non-file buffers, too.
                        (expand-file-name default-directory)))
-        (sub-file-name (if file-name
+        (sub-file-name (if (and file-name
+                                 (file-name-absolute-p file-name))
                             ;; FIXME: Why not use file-relative-name?
                            (substring file-name (length root)))))
     (condition-case err



reply via email to

[Prev in Thread] Current Thread [Next in Thread]