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

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

[elpa] externals/hiddenquote ef9fb5999e: Allow to mark a syllable after


From: ELPA Syncer
Subject: [elpa] externals/hiddenquote ef9fb5999e: Allow to mark a syllable after an incremental search
Date: Wed, 23 Nov 2022 08:01:24 -0500 (EST)

branch: externals/hiddenquote
commit ef9fb5999ef68fae2ccf549270ca15f12480ad3d
Author: Mauro Aranda <maurooaranda@gmail.com>
Commit: Mauro Aranda <maurooaranda@gmail.com>

    Allow to mark a syllable after an incremental search
    
    * hiddenquote.el (hiddenquote-mark-syllable-after-isearch): New user
      option.
    (hiddenquote-create-grid): Use it.  Add a convenient function to
    isearch-mode-end-hook.
---
 hiddenquote.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hiddenquote.el b/hiddenquote.el
index e0139cd4e6..346a49d207 100644
--- a/hiddenquote.el
+++ b/hiddenquote.el
@@ -183,6 +183,14 @@ to the syllables buffer."
   :type 'hook
   :package-version '(hiddenquote . "1.3"))  
 
+(defcustom hiddenquote-mark-syllable-after-isearch t
+  "Whether to mark a syllable as used/unused after exiting Isearch with RET.
+
+When non-nil, hiddenquote will add a function to `isearch-mode-end-hook' to
+allow running the command after exiting Isearch."
+  :type 'boolean
+  :package-version '(hiddenquote . "1.3"))
+
 (defgroup hiddenquote-faces nil
   "Faces used by `hiddenquote'."
   :group 'hiddenquote)
@@ -600,6 +608,12 @@ Returns the `hiddenquote-grid' widget created."
         (setq buffer-read-only t)
         (setq hiddenquote-buffer cbuff)
         (add-hook 'kill-buffer-hook #'hiddenquote-refuse-kill-buffer nil t)
+        (when hiddenquote-mark-syllable-after-isearch
+          (add-hook 'isearch-mode-end-hook
+                    (lambda ()
+                      (when (equal (this-command-keys) [return])
+                        (widget-button-press (point))))
+                    nil t))
         (when (< emacs-major-version 28)
           (add-hook 'widget-backward-hook
                     #'hiddenquote-widget-backward nil t))



reply via email to

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