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

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

[elpa] externals/org 85ab64c2b3 1/2: org-clock-select-task: Do not offer


From: ELPA Syncer
Subject: [elpa] externals/org 85ab64c2b3 1/2: org-clock-select-task: Do not offer non-printable characters in selection
Date: Fri, 21 Oct 2022 02:57:51 -0400 (EDT)

branch: externals/org
commit 85ab64c2b3487b1e16d3174448ff980b56007e80
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-clock-select-task: Do not offer non-printable characters in selection
    
    * lisp/org-clock.el (org-clock-insert-selection-line): Display N/A
    when non-printable character selection is requested.  Non-printable
    characters cannot be entered through `read-char'.
    
    Reported-by: Kevin Brubeck Unhammer <unhammer@fsfe.org>
    Link: https://orgmode.org/list/87y2krmzol.fsf@trigram.no
---
 lisp/org-clock.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 5aa44309ab..6332399bbb 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -701,7 +701,10 @@ pointing to it."
                        org-odd-levels-only)
                       (length prefix))))))
       (when (and cat task)
-       (insert (format "[%c] %-12s  %s\n" i cat task))
+        (if (string-match-p "[[:print:]]" (make-string 1 i))
+           (insert (format "[%c] %-12s  %s\n" i cat task))
+          ;; Avoid non-printable characters.
+          (insert (format "[N/A] %-12s  %s\n" cat task)))
        (cons i marker)))))
 
 (defvar org-clock-task-overrun nil



reply via email to

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