um-tag-dwim : um-find-file-at-point should run thing-at-point
This commit is contained in:
parent
d3e20df7d3
commit
f0942ff6ae
1 changed files with 3 additions and 4 deletions
|
|
@ -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)))
|
||||||
))
|
))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue