um-tag-dwim : um-find-file-at-point should run thing-at-point

This commit is contained in:
bth 2025-12-25 19:14:24 -08:00
commit f0942ff6ae

View file

@ -219,9 +219,8 @@ Negative prefix arg is handled by `um-tag-do', which see.
(let* (
(tag (completing-read "insert um tag: " um-tags-history nil nil nil 'um-tags-history))
(marks (if (eq major-mode 'dired-mode) (dired-get-marked-files) nil))
;; NOTE: 'existing-filename would be better to avoid bogus strings, but
;; in view-mode when in another project, we can't verify it exists yet:
(fap (thing-at-point 'filename))
;; NOTE: should avoid bogus strings when in a markdown buffer:
(fap (um-find-file-at-point))
(files (cond
((and (region-active-p) (not (eq major-mode 'dired-mode)))
(string-split (buffer-substring (region-beginning) (region-end))))
@ -239,7 +238,7 @@ Negative prefix arg is handled by `um-tag-do', which see.
(switch-to-buffer buf)
(save-some-buffers t)
)
(um-tag-do tag ARG))
(save-excursion (um-tag-do tag ARG)))
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;