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* ( (let* (
(tag (completing-read "insert um tag: " um-tags-history nil nil nil 'um-tags-history)) (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)) (marks (if (eq major-mode 'dired-mode) (dired-get-marked-files) nil))
;; NOTE: 'existing-filename would be better to avoid bogus strings, but ;; NOTE: should avoid bogus strings when in a markdown buffer:
;; in view-mode when in another project, we can't verify it exists yet: (fap (um-find-file-at-point))
(fap (thing-at-point 'filename))
(files (cond (files (cond
((and (region-active-p) (not (eq major-mode 'dired-mode))) ((and (region-active-p) (not (eq major-mode 'dired-mode)))
(string-split (buffer-substring (region-beginning) (region-end)))) (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) (switch-to-buffer buf)
(save-some-buffers t) (save-some-buffers t)
) )
(um-tag-do tag ARG)) (save-excursion (um-tag-do tag ARG)))
)) ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;