emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote 847323c935 3/4: Move documentation about denote-


From: ELPA Syncer
Subject: [elpa] externals/denote 847323c935 3/4: Move documentation about denote-region command further up
Date: Sat, 20 Jan 2024 06:57:47 -0500 (EST)

branch: externals/denote
commit 847323c9359918ef0290069a38b7567fd7ab6f91
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Move documentation about denote-region command further up
---
 README.org | 84 +++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/README.org b/README.org
index 958fad489a..faf4607721 100644
--- a/README.org
+++ b/README.org
@@ -703,6 +703,48 @@ treated the same as =:title= or ~t~).
                :jump-to-captured t))
 #+end_src
 
+** Create a note with the region's contents
+:PROPERTIES:
+:CUSTOM_ID: h:2f8090f1-50af-4965-9771-d5a91a0a87bd
+:END:
+
+#+findex: denote-region
+The command ~denote-region~ takes the contents of the active region
+and then calls the ~denote~ command.  Once a new note is created, it
+inserts the contents of the region therein.  This is useful to
+quickly elaborate on some snippet of text or capture it for future
+reference.
+
+#+vindex: denote-region-after-new-note-functions
+When the ~denote-region~ command is called with an active region, it
+finalises its work by calling ~denote-region-after-new-note-functions~.
+This is an abnormal hook, meaning that the functions added to it are
+called with arguments.  The arguments are two, representing the
+beginning and end positions of the newly inserted text.
+
+A common use-case for Org mode users is to call the command
+~org-insert-structure-template~ after a region is inserted.  Emacs
+will thus prompt for a structure template, such as the one
+corresponding to a source block.  In this case the function added to
+~denote-region-after-new-note-functions~ does not actually need
+aforementioned arguments: it can simply declare those as ignored by
+prefixing the argument names with an underscore (an underscore is
+enough, but it is better to include a name for clarity).  For example,
+the following will prompt for a structure template as soon as
+~denote-region~ is done:
+
+#+begin_src emacs-lisp
+(defun my-denote-region-org-structure-template (_beg _end)
+  (when (derived-mode-p 'org-mode)
+    (activate-mark)
+    (call-interactively 'org-insert-structure-template)))
+
+(add-hook 'denote-region-after-new-note-functions 
#'my-denote-region-org-structure-template)
+#+end_src
+
+Remember that ~denote-region-after-new-note-functions~ are not called
+if ~denote-region~ is used without an active region.
+
 ** Open an existing note or create it if missing
 :PROPERTIES:
 :CUSTOM_ID: h:ad91ca39-cf10-4e16-b224-fdf78f093883
@@ -2870,48 +2912,6 @@ Sources for ~tmr~:
     + GitLab: <https://gitlab.com/protesilaos/tmr>
 + Mailing list: <https://lists.sr.ht/~protesilaos/tmr>
 
-** Create a note with the region's contents
-:PROPERTIES:
-:CUSTOM_ID: h:2f8090f1-50af-4965-9771-d5a91a0a87bd
-:END:
-
-#+findex: denote-region
-The command ~denote-region~ takes the contents of the active region
-and then calls the ~denote~ command.  Once a new note is created, it
-inserts the contents of the region therein.  This is useful to
-quickly elaborate on some snippet of text or capture it for future
-reference.
-
-#+vindex: denote-region-after-new-note-functions
-When the ~denote-region~ command is called with an active region, it
-finalises its work by calling ~denote-region-after-new-note-functions~.
-This is an abnormal hook, meaning that the functions added to it are
-called with arguments.  The arguments are two, representing the
-beginning and end positions of the newly inserted text.
-
-A common use-case for Org mode users is to call the command
-~org-insert-structure-template~ after a region is inserted.  Emacs
-will thus prompt for a structure template, such as the one
-corresponding to a source block.  In this case the function added to
-~denote-region-after-new-note-functions~ does not actually need
-aforementioned arguments: it can simply declare those as ignored by
-prefixing the argument names with an underscore (an underscore is
-enough, but it is better to include a name for clarity).  For example,
-the following will prompt for a structure template as soon as
-~denote-region~ is done:
-
-#+begin_src emacs-lisp
-(defun my-denote-region-org-structure-template (_beg _end)
-  (when (derived-mode-p 'org-mode)
-    (activate-mark)
-    (call-interactively 'org-insert-structure-template)))
-
-(add-hook 'denote-region-after-new-note-functions 
#'my-denote-region-org-structure-template)
-#+end_src
-
-Remember that ~denote-region-after-new-note-functions~ are not called
-if ~denote-region~ is used without an active region.
-
 ** Narrow the list of files in Dired
 :PROPERTIES:
 :CUSTOM_ID: h:ea173a01-69ef-4574-89a7-6e60ede02f13



reply via email to

[Prev in Thread] Current Thread [Next in Thread]