diff --git a/elisp/um.el b/elisp/um.el index 8666872..9fb2447 100644 --- a/elisp/um.el +++ b/elisp/um.el @@ -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))) )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;