um-next simplify
This commit is contained in:
parent
b007aa605f
commit
290c9bb4e5
1 changed files with 11 additions and 15 deletions
26
um.el
26
um.el
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue