~protesilaos/denote

denote.el (denote): Use active region in default title prompt v1 APPLIED

Eshel Yaron: 1
 denote.el (denote): Use active region in default title prompt

 1 files changed, 5 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~protesilaos/denote/patches/34870/mbox | git am -3
Learn more about email & git

[PATCH] denote.el (denote): Use active region in default title prompt Export this patch

Hello Prot, all,

The following is a tiny patch that I want to suggest for denote, which
is intended to facilitate a slightly smoother note taking by passing the
contents of the region from the denote command to denote--title-prompt
as the DEFAULT-TITLE argument, when the region is active.

The idea behind this DWIM-flavored patch is to be able to take a note
about a subject that I appears in a buffer by simply marking it before
invoking the denote command, which feels natural to me.


---
 denote.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 4b3598b..ddc7256 100644
--- a/denote.el
+++ b/denote.el
@@ -1084,7 +1084,11 @@ When called from Lisp, all arguments are optional.
   (let ((args (make-vector 6 nil)))
     (dolist (prompt denote-prompts)
       (pcase prompt
         ('title (aset args 0 (denote--title-prompt)))
         ('title (aset args 0 (denote--title-prompt
                               (when (use-region-p)
                                 (buffer-substring-no-properties
                                  (region-beginning)
                                  (region-end))))))
         ('keywords (aset args 1 (denote--keywords-prompt)))
         ('file-type (aset args 2 (denote--file-type-prompt)))
         ('subdirectory (aset args 3 (denote--subdirs-prompt)))
-- 


Best,
Eshel
Hello Eshel,
Thank you!  I just installed it using the body of your message as the
message of the commit (with minor tweaks):

    commit 5faa20b7bf2308f31176904fa2946cb254e988bf
    Author: Eshel Yaron <me@eshelyaron.com>
    Date:   Tue Aug 23 19:21:08 2022 +0300

        Use active region in default title prompt

        Facilitate a slightly smoother note taking by passing the contents of
        the region from the denote command to denote--title-prompt as the
        DEFAULT-TITLE argument, when the region is active.

        The idea behind this DWIM-flavored patch is to be able to take a note
        about a subject that appears in a buffer by simply marking it before
        invoking the denote command, which feels natural to me.

     denote.el | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)

Also the follow-up, which is about the manual:

    commit a842cbd258559c4b0baca607711d121085ac0b57
    Author: Protesilaos Stavrou <info@protesilaos.com>
    Date:   Tue Aug 23 20:40:00 2022 +0300

        Add Eshel Yaron to the acknowledgements for 5faa20b

        The commit is below the ~15 line threshold that thus requires no
        copyright assignment to the Free Software Foundation.

     README.org | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)

All the best,
Prot