]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix mistake in test for erc-ring-previous-command
authorF. Jason Park <jp@neverwas.me>
Thu, 16 Sep 2021 13:20:59 +0000 (15:20 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 16 Sep 2021 13:20:59 +0000 (15:20 +0200)
* test/lisp/erc/erc-tests.el (erc-ring-previous-command):
The variable erc-send-completed-hook was previously set to nil
permanently, which would affect other tests (bug#50005).

test/lisp/erc/erc-tests.el

index d13397274aaaed5dc0766ce648bc8942787ad602..9efcf4a703864570b03ddd0ac223c1fa6f0dc80f 100644 (file)
   (with-current-buffer (get-buffer-create "*#fake*")
     (erc-mode)
     (insert "\n\n")
-    (setq erc-input-marker (make-marker) ; these are all local
-          erc-insert-marker (make-marker)
-          erc-send-completed-hook nil)
+    (should-not (local-variable-if-set-p 'erc-send-completed-hook))
+    (set (make-local-variable 'erc-send-completed-hook) nil) ; skip t (globals)
+    (setq erc-input-marker (make-marker)
+          erc-insert-marker (make-marker))
     (set-marker erc-insert-marker (point-max))
     (erc-display-prompt)
     (should (= (point) erc-input-marker))
-    (add-hook 'erc-pre-send-functions #'erc-add-to-input-ring nil t)
+    ;; Just in case erc-ring-mode is already on
+    (setq-local erc-pre-send-functions nil)
+    (add-hook 'erc-pre-send-functions #'erc-add-to-input-ring)
     ;;
     (cl-letf (((symbol-function 'erc-process-input-line)
                (lambda (&rest _)