emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 3d7cafc 34/51: Make yas-snippet-mode-buffer-p robust again


From: Noam Postavsky
Subject: [elpa] master 3d7cafc 34/51: Make yas-snippet-mode-buffer-p robust against symlinks
Date: Sun, 13 May 2018 13:11:44 -0400 (EDT)

branch: master
commit 3d7cafccf8d7ea9d62e0ccd63c30769de5b8cf01
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Make yas-snippet-mode-buffer-p robust against symlinks
    
    * yasnippet.el (yas-snippet-mode-buffer-p): Instead of a string
    comparison of file names to check whether the buffer file is in on of
    the `yas-snippet-dirs', use the builtin `file-in-directory-p'
    function.
---
 yasnippet.el | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index 69b880a..11bc270 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -984,11 +984,8 @@ Honour `yas-dont-activate-functions', which see."
 Meaning it's visiting a file under one of the mode directories in
 `yas-snippet-dirs'."
   (when buffer-file-name
-    (member
-     (expand-file-name
-      ".."
-      (file-name-directory buffer-file-name))
-     (yas-snippet-dirs))))
+    (cl-member buffer-file-name (yas-snippet-dirs)
+               :test #'file-in-directory-p)))
 
 ;; We're abusing `magic-fallback-mode-alist' here because
 ;; `auto-mode-alist' doesn't support function matchers.



reply via email to

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