[beets] Apropos should not return stale results
It's confusing for emacs.
This commit is contained in:
parent
ef10f0e6c3
commit
f0f1a374ae
1 changed files with 12 additions and 3 deletions
|
|
@ -98,9 +98,13 @@
|
||||||
(defun doty-tools--apropos (pattern)
|
(defun doty-tools--apropos (pattern)
|
||||||
"Invoke the help apropos function for PATTERN and return the results as a string."
|
"Invoke the help apropos function for PATTERN and return the results as a string."
|
||||||
(save-window-excursion
|
(save-window-excursion
|
||||||
|
(when-let (existing-buffer (get-buffer "*Apropos*"))
|
||||||
|
(kill-buffer existing-buffer))
|
||||||
(apropos pattern)
|
(apropos pattern)
|
||||||
(with-current-buffer "*Apropos*"
|
(if-let* ((apropos-buffer (get-buffer "*Apropos*")))
|
||||||
(buffer-substring-no-properties (point-min) (point-max)))))
|
(with-current-buffer apropos-buffer
|
||||||
|
(buffer-substring-no-properties (point-min) (point-max)))
|
||||||
|
"")))
|
||||||
|
|
||||||
(gptel-make-tool
|
(gptel-make-tool
|
||||||
:name "emacs_help_apropos"
|
:name "emacs_help_apropos"
|
||||||
|
|
@ -118,7 +122,12 @@
|
||||||
(should
|
(should
|
||||||
(string-match-p "with-current-buffer"
|
(string-match-p "with-current-buffer"
|
||||||
(doty-tools--test--invoke-tool
|
(doty-tools--test--invoke-tool
|
||||||
"emacs_help_apropos" '(:pattern "buffer")))))
|
"emacs_help_apropos" '(:pattern "buffer"))))
|
||||||
|
|
||||||
|
(should
|
||||||
|
(string-match-p ""
|
||||||
|
(doty-tools--test--invoke-tool
|
||||||
|
"emacs_help_apropos" '(:pattern "argle-3324-nonsense")))))
|
||||||
|
|
||||||
;; === File reading
|
;; === File reading
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue