branch: externals/hiddenquote
commit 8e22eaea70bae693c3e86fb9d16769534b549a61
Author: Mauro Aranda <maurooara...@gmail.com>
Commit: Mauro Aranda <maurooara...@gmail.com>

    New command: hiddenquote-delete-char
    
    This change improves the management of characters in the
    hiddenquote-character widget, so its size stays consistently at 1
    space.
    
    * lisp/hiddenquote.el (hiddenquote-delete-char): New command.
    (hiddenquote-character-map): Bind it to C-d.
---
 hiddenquote.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hiddenquote.el b/hiddenquote.el
index 534d12e85a..49b16a920b 100644
--- a/hiddenquote.el
+++ b/hiddenquote.el
@@ -315,6 +315,7 @@ allow running the command after exiting Isearch."
     (define-key map [end] #'hiddenquote-move-end-of-word)
     (define-key map "\C-j" #'hiddenquote-next)
     ;; Editing.
+    (define-key map "\C-d" #'hiddenquote-delete-char)
     (define-key map "\C-k" #'hiddenquote-kill-word)
     (define-key map [(control shift backspace)] #'hiddenquote-kill-whole-word)
     (define-key map [backspace] #'hiddenquote-delete-backward-char)
@@ -1422,6 +1423,14 @@ Character cell bindings:
     (setq-local tool-bar-map hiddenquote-tool-bar-map)))
 
 ;; Commands.
+(defun hiddenquote-delete-char ()
+  "Replacement for `delete-char' inside `hiddenquote-character' widgets.
+
+Doesn't really delete the character, rather it changes it for an empty space."
+  (interactive)
+  (let ((w (widget-at)))
+    (widget-value-set w " ")))
+
 (defun hiddenquote-kill-word ()
   "Starting at point, delete the rest of the characters of the current word."
   (interactive)

Reply via email to