branch: externals/phps-mode commit 4b4a96fda2ad4dc920b99df9d315e5eba923c3fc Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Improved cache filename --- TODO.md | 4 ---- phps-mode-cache.el | 2 +- phps-mode-lex-analyzer.el | 6 +++--- test/phps-mode-test-cache.el | 10 ++++------ 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/TODO.md b/TODO.md index 31100a4eea..340f3da32c 100644 --- a/TODO.md +++ b/TODO.md @@ -18,7 +18,3 @@ } * Imenu-generation of conditionally defined functions and classes -* Cache elisp data in file-system - -Save to cache after incremental edits as well - diff --git a/phps-mode-cache.el b/phps-mode-cache.el index 783a027ae5..cab0518d23 100644 --- a/phps-mode-cache.el +++ b/phps-mode-cache.el @@ -23,7 +23,7 @@ (let ((filename (expand-file-name (replace-regexp-in-string - "\\(/\\|@\\|:\\|\\.\\|-\\)" "_" + "\\(/\\|@\\|:\\|\\.\\)" "_" key) directory-filename))) filename))) diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el index d6b884cb11..6bdb59c020 100644 --- a/phps-mode-lex-analyzer.el +++ b/phps-mode-lex-analyzer.el @@ -318,7 +318,7 @@ ) -)))) + )))) nil async @@ -1053,7 +1053,7 @@ (when (and previous-start (not - (= previous-start token-end))) + (= previous-start token-end))) (puthash token-end previous-start @@ -1076,7 +1076,7 @@ (when filename (setq cache-key - (format "lex-%s" filename)) + filename) (unless end (when (phps-mode-cache-test-p diff --git a/test/phps-mode-test-cache.el b/test/phps-mode-test-cache.el index 3218ea687c..9bcd8c1f91 100644 --- a/test/phps-mode-test-cache.el +++ b/test/phps-mode-test-cache.el @@ -25,23 +25,21 @@ (equal (phps-mode-cache-test-p "abc") nil)) - (message "Passed cache test function 1") - + (message "Passed cache test after delete") (phps-mode-cache-save '(0 1 2) "abc") (should (equal (phps-mode-cache-test-p "abc") t)) - - (message "Passed cache test function 2") + (message "Passed cache test after save") (should (equal (phps-mode-cache-load "abc") '(0 1 2))) - - (message "Passed cache load function") + (message "Passed cache load") + (phps-mode-cache-delete "abc") (message "Passed tests for cache"))