branch: master
commit 3d7cafccf8d7ea9d62e0ccd63c30769de5b8cf01
Author: Noam Postavsky <npost...@users.sourceforge.net>
Commit: Noam Postavsky <npost...@users.sourceforge.net>

    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