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 + tags
" "
(insert (with-temp-buffer (insert
(format "# %s\n: %s%s" filename (format-time-string um--date-format) um--header-end)) (format "# %s\n: %s%s" filename (format-time-string um--date-format) um--header-end))
(when tags (when tags
(forward-line -1) (forward-line -1)
(dolist (tag (split-string tags ",")) (dolist (tag (split-string tags ","))
(insert (format "+ %s\n" (insert (format "+ %s\n"
(if (equal "+" tag) (if (equal "+" tag)
(cadr (split-string filename "\\.")) (cadr (split-string filename "\\."))
tag)))) tag)))))
(forward-line))) (buffer-string)))
;;;###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))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; um-minor-mode ;;; um-minor-mode