~protesilaos/denote

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

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

Details
Message ID
<m1y1vfvsln.fsf@esmac.lan>
DKIM signature
missing
Download raw message
Patch: +5 -1
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
Details
Message ID
<87k06yj1my.fsf@protesilaos.com>
In-Reply-To
<m1y1vfvsln.fsf@esmac.lan> (view parent)
DKIM signature
missing
Download raw message
> From: Eshel Yaron <me@eshelyaron.com>
> Date: Tue, 23 Aug 2022 19:21:08 +0300
>
>
> Hello Prot, all,

Hello Eshel,

> The following is a tiny patch that I want to suggest for denote
> [... 31 lines elided]

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

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)