[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hiddenquote 8f5ffd27b9: Make hiddenquote-after-last-cha
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hiddenquote 8f5ffd27b9: Make hiddenquote-after-last-character-hook a defcustom |
Date: |
Thu, 27 Oct 2022 07:57:47 -0400 (EDT) |
branch: externals/hiddenquote
commit 8f5ffd27b950f704ecacdcc46c9c3d4a8c02bfe9
Author: Mauro Aranda <maurooaranda@gmail.com>
Commit: Mauro Aranda <maurooaranda@gmail.com>
Make hiddenquote-after-last-character-hook a defcustom
* hiddenquote.el (hiddenquote-after-last-character-hook): Move it and
make it a defcustom.
---
hiddenquote.el | 52 +++++++++++++++++++++++++++-------------------------
1 file changed, 27 insertions(+), 25 deletions(-)
diff --git a/hiddenquote.el b/hiddenquote.el
index 4b35099d8b..ed22d637b0 100644
--- a/hiddenquote.el
+++ b/hiddenquote.el
@@ -173,6 +173,16 @@ Syllables window."
do (set-window-parameter (get-buffer-window buff)
'no-other-window val)))))
+(defcustom 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."
+ :type 'hook
+ :package-version '(hiddenquote . "1.3"))
+
(defgroup hiddenquote-faces nil
"Faces used by `hiddenquote'."
:group 'hiddenquote)
@@ -381,23 +391,6 @@ Used locally in the definitions buffer, to
highlight/unhighlight them.")
(unless (eobp)
(forward-char 1)))
-(defun hiddenquote--get-quote-length ()
- "Return the quote length, by looking each word in the widget."
- ;; We have to do this when the qquote slot is empty.
- (let* ((puzzle (widget-get hiddenquote-current :hiddenquote))
- (words (widget-get hiddenquote-current :children))
- (arrows (split-string (oref puzzle arrows) ","))
- (len (* (length arrows) (length words)))
- (first-word (car words))
- (last-word (car (last words))))
- (unless (> (widget-get last-word :hiddenquote-word-length)
- (string-to-number (car (last arrows))))
- (setq len (1- len)))
- (unless (> (widget-get first-word :hiddenquote-word-length)
- (string-to-number (car arrows)))
- (setq len (1- len)))
- len))
-
;; Classes.
;; A `hiddenquote-hidden-quote-puzzle' represents a hidden quote puzzle,
;; following closely its ipuz spec.
@@ -938,14 +931,6 @@ 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.
@@ -1132,6 +1117,23 @@ Return `hiddenquote-used-syllable' if WIDGET's value is
non-nil,
(hiddenquote-timer-stop-timer)))
;; Functions.
+(defun hiddenquote--get-quote-length ()
+ "Return the quote length, by looking each word in the widget."
+ ;; We have to do this when the qquote slot is empty.
+ (let* ((puzzle (widget-get hiddenquote-current :hiddenquote))
+ (words (widget-get hiddenquote-current :children))
+ (arrows (split-string (oref puzzle arrows) ","))
+ (len (* (length arrows) (length words)))
+ (first-word (car words))
+ (last-word (car (last words))))
+ (unless (> (widget-get last-word :hiddenquote-word-length)
+ (string-to-number (car (last arrows))))
+ (setq len (1- len)))
+ (unless (> (widget-get first-word :hiddenquote-word-length)
+ (string-to-number (car arrows)))
+ (setq len (1- len)))
+ len))
+
(defun hiddenquote-puzzle-from-ipuz (ipuz)
"Return a `hiddenquote-hidden-quote-puzzle' instance specified by IPUZ."
(let* ((json (json-read-from-string ipuz))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/hiddenquote 8f5ffd27b9: Make hiddenquote-after-last-character-hook a defcustom,
ELPA Syncer <=