um-next simplify

This commit is contained in:
bth 2026-05-19 16:03:33 -07:00
commit 290c9bb4e5

26
um.el
View file

@ -338,26 +338,22 @@ Negative prefix arg is handled by `um-tag-do', which see.
;; shell integration
;;;###autoload
(defun um-next (next-file &optional tags skip-header)
(defun um-next (next-file &optional tags)
"Takes the next-file generated by the shell script and opens it.
Optional TAGS string may contain more than one tag separated by a comma.
The SKIP-HEADER option says not to insert the um-journal-header at all,
in which case TAGS is also ignored.
"
(find-file next-file)
(unless skip-header
(um-journal-header)
(if tags
(progn (forward-line -1)
(dolist (tag (split-string tags ","))
(insert (format "+ %s\n"
(if (equal "+" tag)
(cadr (split-string next-file "\\."))
tag))))
(forward-line))))
(message (format "creating %s" next-file))
)
(um-journal-header)
(if tags
(progn (forward-line -1)
(dolist (tag (split-string tags ","))
(insert (format "+ %s\n"
(if (equal "+" tag)
(cadr (split-string next-file "\\."))
tag))))
(forward-line)))
(message (format "um next: %s" next-file)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; um-minor-mode : in markdown files under markdown-mode