next : um next calls (um--header) and only prints the filename for piping : no more auto open
This commit is contained in:
parent
117da02e16
commit
808eaeef00
1 changed files with 10 additions and 21 deletions
31
um.el
31
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue