Skip to content

Commit

Permalink
Buffer local o
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgilchrist committed Sep 13, 2024
1 parent 33fa16f commit 553b57c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions emacs/merlin-cap-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,11 @@
(should (equal (merlin-cap--regions "aa.Bb.Cc.x" "")
'("aa." "aa.Bb.Cc." "x" ""))))

(defvar-local messages-buffer-name "*Messages*")

(defun merlin-cap--current-message ()
"Like `current-message' but work in batch mode and use `messages-buffer-name'."
(with-current-buffer
;; Only defined in Emacs 29 onwards, use default value if not defined.
(if (boundp 'messages-buffer-name)
(progn messages-buffer-name)
(progn "*Messages*"))
(with-current-buffer messages-buffer-name
(save-excursion
(forward-line -1)
(buffer-substring (point) (pos-eol)))))
Expand Down

0 comments on commit 553b57c

Please sign in to comment.