From 0ecf176446f405eee4f3d5aa3c94bf6e5d1d337d Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 6 Feb 2022 12:06:42 +0100 Subject: Move patch away from Org source block Org gets confused by unpaired characters. --- itches/emacs/read-passwd-reveal.patch | 28 ++++++++++++++++++++++++++++ itches/emacs/tracker.org | 34 +--------------------------------- 2 files changed, 29 insertions(+), 33 deletions(-) create mode 100644 itches/emacs/read-passwd-reveal.patch (limited to 'itches') diff --git a/itches/emacs/read-passwd-reveal.patch b/itches/emacs/read-passwd-reveal.patch new file mode 100644 index 0000000..09eba80 --- /dev/null +++ b/itches/emacs/read-passwd-reveal.patch @@ -0,0 +1,28 @@ +diff --git a/lisp/subr.el b/lisp/subr.el +index 06ea503da6..da9253cedd 100644 +--- a/lisp/subr.el ++++ b/lisp/subr.el +@@ -2820,6 +2820,7 @@ read-passwd-map + ;; minibuffer-local-map along the way! + (let ((map (make-sparse-keymap))) + (set-keymap-parent map minibuffer-local-map) ++ (define-key map "\C-c\C-c" #'read-passwd-toggle-visibility) + (define-key map "\C-u" #'delete-minibuffer-contents) ;bug#12570 + map) + "Keymap used while reading passwords.") +@@ -2830,6 +2831,14 @@ read-password--hide-password + (put-text-property (+ i beg) (+ 1 i beg) + 'display (string (or read-hide-char ?*)))))) + ++(defun read-passwd-toggle-visibility () ++ (interactive) ++ (if (member #'read-password--hide-password post-command-hook) ++ (progn ++ (remove-hook 'post-command-hook #'read-password--hide-password t) ++ (remove-text-properties (minibuffer-prompt-end) (point-max) '(display))) ++ (add-hook 'post-command-hook #'read-password--hide-password nil t))) ++ + (defun read-passwd (prompt &optional confirm default) + "Read a password, prompting with PROMPT, and return it. + If optional CONFIRM is non-nil, read the password twice to make sure. + diff --git a/itches/emacs/tracker.org b/itches/emacs/tracker.org index 734ad38..1fcad99 100644 --- a/itches/emacs/tracker.org +++ b/itches/emacs/tracker.org @@ -165,39 +165,7 @@ documentation should be added for C-u as well). Thank you for your time. -TODO:attach -**** "serving suggestion" patch -#+begin_src diff -diff --git a/lisp/subr.el b/lisp/subr.el -index 06ea503da6..da9253cedd 100644 ---- a/lisp/subr.el -+++ b/lisp/subr.el -@@ -2820,6 +2820,7 @@ read-passwd-map - ;; minibuffer-local-map along the way! - (let ((map (make-sparse-keymap))) - (set-keymap-parent map minibuffer-local-map) -+ (define-key map "\C-c\C-c" #'read-passwd-toggle-visibility) - (define-key map "\C-u" #'delete-minibuffer-contents) ;bug#12570 - map) - "Keymap used while reading passwords.") -@@ -2830,6 +2831,14 @@ read-password--hide-password - (put-text-property (+ i beg) (+ 1 i beg) - 'display (string (or read-hide-char ?*)))))) - -+(defun read-passwd-toggle-visibility () -+ (interactive) -+ (if (member #'read-password--hide-password post-command-hook) -+ (progn -+ (remove-hook 'post-command-hook #'read-password--hide-password t) -+ (remove-text-properties (minibuffer-prompt-end) (point-max) '(display))) -+ (add-hook 'post-command-hook #'read-password--hide-password nil t))) -+ - (defun read-passwd (prompt &optional confirm default) - "Read a password, prompting with PROMPT, and return it. - If optional CONFIRM is non-nil, read the password twice to make sure. - -#+end_src - +TODO:[[file:read-passwd-reveal.patch][attach]]. *** TODO Make cursor appearance context-dependent E.g. add a customizable list of (PREDICATE . PROPERTIES) pairs; the cursor gets the PROPERTIES from the first PREDICATE which matches. -- cgit v1.2.3