Skip to content

Commit

Permalink
✨ Optionally default quick add text to the region content
Browse files Browse the repository at this point in the history
The idea here being that, if a region is active, the user might want to
dnote its content.
  • Loading branch information
davep committed Jan 8, 2020
1 parent ec78bd6 commit f7cc730
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dnote.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
This command is designed to very quickly add a one-liner to dnote."
(interactive
(let* ((book (completing-read "Book: " (dnote--books)))
(text (read-string (format "Text (for %s): " book))))
(text (read-string
(format "Text (for %s): " book)
(when (use-region-p) (buffer-substring-no-properties (region-beginning) (region-end))))))
(list book text)))
(dnote--add book content)
(message "Note added to book \"%s\"." book))
Expand Down

0 comments on commit f7cc730

Please sign in to comment.