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 ;; shell integration
;;;###autoload ;;;###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. "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. 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) (find-file next-file)
(unless skip-header (um-journal-header)
(um-journal-header) (if tags
(if tags (progn (forward-line -1)
(progn (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 next-file "\\."))
(cadr (split-string next-file "\\.")) tag))))
tag)))) (forward-line)))
(forward-line)))) (message (format "um next: %s" next-file)))
(message (format "creating %s" next-file))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; um-minor-mode : in markdown files under markdown-mode ;; um-minor-mode : in markdown files under markdown-mode