branch: elpa/spell-fu commit 38f4a4a275389690f492d91a23c03af0bd9470ce Author: Campbell Barton <ideasma...@gmail.com> Commit: Campbell Barton <ideasma...@gmail.com>
Fix #31: Failure to detect updated symlinked dictionaries Comparing dates wasn't working on symlinks. Follow symlinks on dictionaries before comparing dates. --- changelog.rst | 1 + spell-fu.el | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/changelog.rst b/changelog.rst index 0fe619a7c5..bec671bb24 100644 --- a/changelog.rst +++ b/changelog.rst @@ -4,6 +4,7 @@ Change Log ########## - In development. + - Fix #31, failure to detect updated personal dictionary when it's a symlink. - Stealthy font locking now checks words even when outside the view, so stealthy font locking ensures words are checked. - Fix #13, failure to properly generate word-list cache on MS-Windows. diff --git a/spell-fu.el b/spell-fu.el index ff4cf18882..8e87df25a5 100644 --- a/spell-fu.el +++ b/spell-fu.el @@ -1085,7 +1085,11 @@ Return t if the file was updated." (dict-aspell-name (cadr (nth 5 (assoc dict-name ispell-aspell-dictionary-alist)))) (dict-file (and dict-aspell-name (spell-fu--aspell-find-data-file dict-name))) (is-dict-outdated - (and has-words-file dict-file (spell-fu--file-is-older words-file dict-file))) + (and + has-words-file dict-file + (spell-fu--file-is-older words-file + ;; Chase links is needed as checking the symbolic-link date isn't correct, #31. + (file-chase-links dict-file)))) ;; Return value, failure to run `aspell' leaves this nil. (updated nil)) @@ -1275,9 +1279,9 @@ Return t if the file was updated." (has-dict-personal (and personal-words-file (file-exists-p personal-words-file))) (is-dict-outdated (and - has-words-file - has-dict-personal - (spell-fu--file-is-older words-file personal-words-file)))) + has-words-file has-dict-personal + ;; Chase links is needed as checking the symbolic-link date isn't correct, #31. + (spell-fu--file-is-older words-file (file-chase-links personal-words-file))))) (when (or (not has-words-file) is-dict-outdated)