aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas2022-05-02 12:03:08 +0200
committerLars Ingebrigtsen2022-05-02 12:03:08 +0200
commit2fba71cf1fadc9d681e6be250d152cc156bf6a00 (patch)
tree8a5d496f98bfb0c79095c3ae19a919be1b275c0b /test
parentf7a6dd4fcc54230630fcba73ca6bda2a413eff24 (diff)
downloademacs-2fba71cf1fadc9d681e6be250d152cc156bf6a00.tar.gz
emacs-2fba71cf1fadc9d681e6be250d152cc156bf6a00.zip
Fix handling double-click-time nil or t
* lisp/mouse.el (mouse-double-click-time): New function to always return a number for `double-click-time'. * lisp/emulation/viper-mous.el (viper-multiclick-timeout): * lisp/foldout.el (foldout-mouse-swallow-events): * lisp/help.el (help--read-key-sequence): * lisp/org/org-mouse.el (org-mouse-show-context-menu): Use 'mouse-double-click-time' instead of 'double-click-time'. * src/keyboard.c (syms_of_keyboard): Mention 'mouse-double-click-time' in doc string of 'double-click-time'. * test/lisp/mouse-tests.el (mouse-test-mouse-double-click-time): New test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/mouse-tests.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lisp/mouse-tests.el b/test/lisp/mouse-tests.el
index 1be32006a10..03ecbc19858 100644
--- a/test/lisp/mouse-tests.el
+++ b/test/lisp/mouse-tests.el
@@ -25,6 +25,20 @@
25 25
26;;; Code: 26;;; Code:
27 27
28(ert-deftest mouse-test-mouse-double-click-time ()
29 (let ((double-click-time 500))
30 (should (= (mouse-double-click-time) 500)))
31 (let ((double-click-time 0))
32 (should (= (mouse-double-click-time) 0)))
33 (let ((double-click-time -500))
34 (should (= (mouse-double-click-time) 0)))
35 (let ((double-click-time nil))
36 (should (= (mouse-double-click-time) 0)))
37 (let ((double-click-time t))
38 (should (numberp (mouse-double-click-time))))
39 (let ((double-click-time '(invalid)))
40 (should (= (mouse-double-click-time) 0))))
41
28(ert-deftest bug23288-use-return-value () 42(ert-deftest bug23288-use-return-value ()
29 "If `mouse-on-link-p' returns a string, its first character is used." 43 "If `mouse-on-link-p' returns a string, its first character is used."
30 (cl-letf ((unread-command-events '((down-mouse-1 nil 1) (mouse-1 nil 1))) 44 (cl-letf ((unread-command-events '((down-mouse-1 nil 1) (mouse-1 nil 1)))