branch: master commit c3683a0a8a611fbd15bb3ec78ccac121843711c9 Author: Ian Dunn <du...@gnu.org> Commit: Ian Dunn <du...@gnu.org>
Fixed bug with non-existent thing at point * paced.el (paced-excluded-p): Check for non-existent thing at point. * paced-tests.el: Add test. * paced.org: Document change in Changelog. --- paced-tests.el | 11 +++++++++++ paced.el | 6 +++++- paced.info | 11 ++++++----- paced.org | 1 + test-files/fourth.org | 2 ++ 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/paced-tests.el b/paced-tests.el index c7dc3bb..3f8d0ea 100644 --- a/paced-tests.el +++ b/paced-tests.el @@ -41,6 +41,7 @@ (defconst paced-first-test-file (paced-test-file "first.txt")) (defconst paced-second-test-file (paced-test-file "second.cpp")) (defconst paced-third-test-file (paced-test-file "third.org")) +(defconst paced-fourth-test-file (paced-test-file "fourth.org")) (defconst paced-test-dict-save-file (paced-test-file "paced-dictionary-case-sensitive")) (defconst paced-test-default-registered-map (make-hash-table :test 'equal)) @@ -491,6 +492,16 @@ (let* ((paced-character-limit 3)) (should-not (paced-excluded-p)))))) +(ert-deftest paced-no-thing-at-point () + "Test for non-existent thing at point." + (let* ((org-element-use-cache nil) ;; Causes crashes, so disable it + (paced-exclude-function (lambda () nil)) + (buffer-four (find-file-noselect paced-fourth-test-file))) + (with-current-buffer buffer-four + (goto-char (point-min)) + (should-not (paced-thing-at-point)) + (should (paced-excluded-p))))) + (provide 'paced-tests) ;;; paced-tests.el ends here diff --git a/paced.el b/paced.el index 984c9be..6b8f2aa 100644 --- a/paced.el +++ b/paced.el @@ -7,7 +7,7 @@ ;; Keywords: convenience, completion ;; Package-Requires: ((emacs "25.1") (async "1.9.1")) ;; URL: https://savannah.nongnu.org/projects/paced-el/ -;; Version: 1.1.2 +;; Version: 1.1.3 ;; Created: 22 Jan 2017 ;; Modified: 05 Feb 2018 @@ -605,9 +605,13 @@ the thing at point. See `paced-point-in-thing-at-point-for-exclusion' for how to set this. +If there is no current \"thing\" at point, the text under point +will be excluded, and paced will move on. + This also handles character limits set by `paced-character-limit'." (or (not (paced-thing-meets-limit-p)) + (not (paced-bounds-of-thing-at-point)) ;; There's no thing at point (save-excursion (pcase paced-point-in-thing-at-point-for-exclusion (`beginning diff --git a/paced.info b/paced.info index 8095407..a39ac19 100644 --- a/paced.info +++ b/paced.info @@ -921,6 +921,7 @@ File: paced.info, Node: 113, Next: 112, Up: Changelog ===== • Fixed bug with printing an empty dictionary + • Fixed bug with paced crashing on non-existent thing at point File: paced.info, Node: 112, Next: 111, Prev: 113, Up: Changelog @@ -1014,11 +1015,11 @@ Node: Documentation30153 Node: Working with EDE30620 Node: Changelog31663 Node: 11331841 -Node: 11231966 -Node: 11132096 -Node: 1132335 -Node: 10132942 -Node: 1033150 +Node: 11232034 +Node: 11132164 +Node: 1132403 +Node: 10133010 +Node: 1033218 End Tag Table diff --git a/paced.org b/paced.org index 6ce0ed0..495f3cb 100644 --- a/paced.org +++ b/paced.org @@ -757,6 +757,7 @@ and letting one of us handle it is a good way to go. :END: ** 1.1.3 - Fixed bug with printing an empty dictionary +- Fixed bug with paced crashing on non-existent thing at point ** 1.1.2 - Fixed bug with printing dictionaries ** 1.1.1 diff --git a/test-files/fourth.org b/test-files/fourth.org new file mode 100644 index 0000000..2d7b9ad --- /dev/null +++ b/test-files/fourth.org @@ -0,0 +1,2 @@ +#+CATEGORY: Testing +Test1 Test2