summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2021-11-26 19:12:00 +0100
committerQuentin Aristote <quentin@aristote.fr>2021-11-26 19:12:00 +0100
commitd4ad38ecccd29245d4dca60275db64f27e7a5996 (patch)
treec1c9eb926df1a05dad6485410a785e2c7143e3d3
parentb3f0258e041fe03b527576d5433d726d5c9d9be4 (diff)
add commands and shortcuts to change the state of an entry
add bibli-paris/set-to-{todo,next,booked,done} and the corresponding shortcuts prefixed by SPC mt
-rw-r--r--README.org27
-rw-r--r--local/bibli-paris/bibli-paris.el22
-rw-r--r--packages.el14
3 files changed, 47 insertions, 16 deletions
diff --git a/README.org b/README.org
index 9fc9dd2..2b4d758 100644
--- a/README.org
+++ b/README.org
@@ -37,18 +37,21 @@ To use the Orgzly mobile app with a reading list, the following searches may be
The following commands are available.
-| Command | Shortcut | Description |
-|---------------------------------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| =bibli-paris/mode= | =SPC mb= | Enable the shortcuts described in this table. |
-| =bibli-paris/import-from-csv= | =SPC mi= | Import entries from the CSV file downloaded on https://bibliotheques.paris.fr/. The first argument is the path to the CSV file, and the second and third (optional) arguments are the tags and state to set the imported entries to. |
-| =bibli-paris/sort= | =SPC ms= | Sort the entries by their quotes. |
-| =bibli-paris/update-entry= | =SPC mu= | Asynchronously update the availability status and quote of the entry at point. |
-| =bibli-paris/update-region= | =SPC mur= | Asynchronously update the availability status and quotes of the entries in the current region. |
-| =bibli-paris/update-buffer= | =SPC mub= | Asynchronously update the availability status and quotes of the entries in the current buffer. |
-| =bibli-paris/archive-all-read= | =SPC mA= | Archive all entries in the =DONE= state. |
-| =bibli-paris/number-of-entries= | =SPC m?= | Display the number of entries in the current buffer. |
-| =bibli-paris/previous-entry= | =SPC mk= | Move the cursor to and put forward the previous entry. |
-| =bibli-paris/next-entry= | =SPC mj= | Move the cursor to and put forward the next entry. |
+| Command | Shortcut | Description | | | | |
+|---------------------------------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---+-----------------------------+-----------+------------------------------------------------------------------------------------------------|
+| =bibli-paris/mode= | =SPC mb= | Enable the shortcuts described in this table. | | | | |
+| =bibli-paris/import-from-csv= | =SPC mi= | Import entries from the CSV file downloaded on https://bibliotheques.paris.fr/. The first argument is the path to the CSV file, and the second and third (optional) arguments are the tags and state to set the imported entries to. | | | | |
+| =bibli-paris/next-entry= | =SPC mj= | Move the cursor to and put forward the next entry. | | | | |
+| =bibli-paris/previous-entry= | =SPC mk= | Move the cursor to and put forward the previous entry. | | | | |
+| =bibli-paris/sort= | =SPC ms= | Sort the entries by their quotes. | | | | |
+| =bibli-paris/set-to-todo= | =SPC mtt= | Switch the entry at point to the =TODO= state. | | | | |
+| =bibli-paris/set-to-next= | =SPC mtn= | Switch the entry at point to the =NEXT= state. | | | | |
+| =bibli-paris/set-to-booked= | =SPC mtb= | Switch the entry at point to the =BOOKED= state. | | | | |
+| =bibli-paris/set-to-done= | =SPC mtd= | Switch the entry at point to the =DONE= state. | | =bibli-paris/update-buffer= | =SPC mub= | Asynchronously update the availability status and quotes of the entries in the current buffer. |
+| =bibli-paris/update-entry= | =SPC mue= | Asynchronously update the availability status and quote of the entry at point. | | | | |
+| =bibli-paris/update-region= | =SPC mur= | Asynchronously update the availability status and quotes of the entries in the current region. | | | | |
+| =bibli-paris/archive-all-read= | =SPC mA= | Archive all entries in the =DONE= state. | | | | |
+| =bibli-paris/number-of-entries= | =SPC m?= | Display the number of entries in the current buffer. | | | | |
* Customization
diff --git a/local/bibli-paris/bibli-paris.el b/local/bibli-paris/bibli-paris.el
index 55483b5..5232b44 100644
--- a/local/bibli-paris/bibli-paris.el
+++ b/local/bibli-paris/bibli-paris.el
@@ -458,6 +458,28 @@ STATE (string)."
(bibli-paris/change-entry 'outline-get-next-sibling))
+;; change the state of an entry
+
+(defun bibli-paris/set-to-todo ()
+ "Switch the entry at point to the TODO state."
+ (interactive)
+ (org-todo "TODO"))
+
+(defun bibli-paris/set-to-next ()
+ "Switch the entry at point to the NEXT state."
+ (interactive)
+ (org-todo "NEXT"))
+
+(defun bibli-paris/set-to-booked ()
+ "Switch the entry at point to the BOOKED state."
+ (interactive)
+ (org-todo "BOOKED"))
+
+(defun bibli-paris/set-to-done ()
+ "Switch the entry at point to the DONE state."
+ (interactive)
+ (org-todo "DONE"))
+
;; minor mode
;;;###autoload
diff --git a/packages.el b/packages.el
index 9d9878d..d2a6f78 100644
--- a/packages.el
+++ b/packages.el
@@ -11,15 +11,21 @@
"m" "bibli-paris")
(spacemacs/declare-prefix-for-minor-mode 'bibli-paris/mode
"mu" "update")
+ (spacemacs/declare-prefix-for-minor-mode 'bibli-paris/mode
+ "mt" "todo")
(spacemacs/set-leader-keys-for-minor-mode 'bibli-paris/mode
- "m?" 'bibli-paris/number-of-entries
+ "mi" 'bibli-paris/import-from-csv
+ "mj" 'bibli-paris/next-entry
+ "mk" 'bibli-paris/previous-entry
"ms" 'bibli-paris/sort
"mue" 'bibli-paris/update-entry
"mur" 'bibli-paris/update-region
"mub" 'bibli-paris/update-buffer
+ "mtt" 'bibli-paris/set-to-todo
+ "mtn" 'bibli-paris/set-to-next
+ "mtb" 'bibli-paris/set-to-booked
+ "mtd" 'bibli-paris/set-to-done
"mA" 'bibli-paris/archive-all-read
- "mi" 'bibli-paris/import-from-csv
- "mk" 'bibli-paris/previous-entry
- "mj" 'bibli-paris/next-entry
+ "m?" 'bibli-paris/number-of-entries
))
))