mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
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.
This commit is contained in:
parent
cf23537279
commit
3d7cafccf8
@ -984,11 +984,8 @@ Honour `yas-dont-activate-functions', which see."
|
|||||||
Meaning it's visiting a file under one of the mode directories in
|
Meaning it's visiting a file under one of the mode directories in
|
||||||
`yas-snippet-dirs'."
|
`yas-snippet-dirs'."
|
||||||
(when buffer-file-name
|
(when buffer-file-name
|
||||||
(member
|
(cl-member buffer-file-name (yas-snippet-dirs)
|
||||||
(expand-file-name
|
:test #'file-in-directory-p)))
|
||||||
".."
|
|
||||||
(file-name-directory buffer-file-name))
|
|
||||||
(yas-snippet-dirs))))
|
|
||||||
|
|
||||||
;; We're abusing `magic-fallback-mode-alist' here because
|
;; We're abusing `magic-fallback-mode-alist' here because
|
||||||
;; `auto-mode-alist' doesn't support function matchers.
|
;; `auto-mode-alist' doesn't support function matchers.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user