From 808eaeef00a14021f0b89fdabcde67d79afb4808 Mon Sep 17 00:00:00 2001 From: bth Date: Thu, 13 Aug 2026 11:50:38 -0700 Subject: [PATCH] next : um next calls (um--header) and only prints the filename for piping : no more auto open --- um.el | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/um.el b/um.el index a66674f..163b1e4 100644 --- a/um.el +++ b/um.el @@ -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