[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hiddenquote 0a49fca229 15/15: Add new handy hook
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hiddenquote 0a49fca229 15/15: Add new handy hook |
Date: |
Wed, 26 Oct 2022 11:57:52 -0400 (EDT) |
branch: externals/hiddenquote
commit 0a49fca2294f01fc455e07019efa21efcc3998c2
Author: Mauro Aranda <maurooaranda@gmail.com>
Commit: Mauro Aranda <maurooaranda@gmail.com>
Add new handy hook
* hiddenquote.el (hiddenquote-after-last-character-hook): New hook.
(hiddenquote-word-notify): Run it.
---
hiddenquote.el | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/hiddenquote.el b/hiddenquote.el
index 9e045a82a1..5bbecc4b65 100644
--- a/hiddenquote.el
+++ b/hiddenquote.el
@@ -938,6 +938,14 @@ Notify the widget between FROM and TO about a change."
(error "Change in different fields"))
(widget-apply field :notify field (list 'after-change from to)))))
+(defvar hiddenquote-after-last-character-hook nil
+ "Hook that runs after entering the last character in a word.
+
+Note that this doesn't mean the word is the right word.
+
+It can be handy to run `other-window' in this hook, so you can go directly
+to the syllables buffer.")
+
(defun hiddenquote-word-notify (widget child event)
"Notify the `hiddenquote-word' widget WIDGET about a change in CHILD.
@@ -948,9 +956,11 @@ advance point to some other widget and maybe check the
answer."
(when (and (eq (car-safe event) 'after-change)
(not (eql (nth 1 event) (nth 2 event))))
(if (eq child (car (last (widget-get widget :children))))
- (goto-char (overlay-start
- (widget-get (car (widget-get widget :children))
- :field-overlay)))
+ (progn
+ (goto-char (overlay-start
+ (widget-get (car (widget-get widget :children))
+ :field-overlay)))
+ (run-hooks 'hiddenquote-after-last-character-hook))
(widget-forward 1)))
(when (and (eq (car-safe event) 'after-change)
(or hiddenquote-automatic-check
- [elpa] externals/hiddenquote updated (422e45ad71 -> 0a49fca229), ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote 934208f22b 05/15: Improve navigation commands in the syllables buffer, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote 7c0c5f07b2 07/15: ; Comment fixes, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote eb132d8bac 02/15: Publish new puzzle, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote a80dfde438 03/15: ; Minor fixes to data in the ipuz files, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote e77836f974 06/15: ; Docstring fix, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote 47ae1572d0 04/15: Add command to toggle hiddenquote-skip-used-syllables, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote 5324aeb8c8 11/15: Make the prompt in hiddenquote-quit optional, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote 6f555f3699 14/15: Add command to complete the quote, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote 0a49fca229 15/15: Add new handy hook,
ELPA Syncer <=
- [elpa] externals/hiddenquote a1f04745c6 01/15: ; Docstring fixes, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote 6f150e2745 10/15: ; Update Makefile copyright, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote 856438ee29 08/15: Bump version, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote f8f6b1e020 12/15: Make the prompt in hiddenquote-give-up optional, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote 4f719862a1 13/15: ; Fix some docstrings, ELPA Syncer, 2022/10/26
- [elpa] externals/hiddenquote b9337a7de2 09/15: ; Update copyright, ELPA Syncer, 2022/10/26