next : um next calls (um--header) and only prints the filename for piping : no more auto open

This commit is contained in:
bth 2026-08-13 11:50:38 -07:00
commit 808eaeef00

31
um.el
View file

@ -358,27 +358,16 @@ Prefix arg prompts for the directory instead.
+ tags
"
(insert
(format "# %s\n: %s%s" filename (format-time-string um--date-format) um--header-end))
(when tags
(forward-line -1)
(dolist (tag (split-string tags ","))
(insert (format "+ %s\n"
(if (equal "+" tag)
(cadr (split-string filename "\\."))
tag))))
(forward-line)))
;;;###autoload
(defun um-next (filename &optional tags)
"Takes the filename generated by the CLI, opens it, and adds the header.
Optional TAGS string may contain more than one tag separated by a comma.
A tag with a value of \"+\" is rendered as the descriptor portion of the filename.
"
(find-file filename)
(um--header filename tags))
(with-temp-buffer (insert
(format "# %s\n: %s%s" filename (format-time-string um--date-format) um--header-end))
(when tags
(forward-line -1)
(dolist (tag (split-string tags ","))
(insert (format "+ %s\n"
(if (equal "+" tag)
(cadr (split-string filename "\\."))
tag)))))
(buffer-string)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; um-minor-mode