emacs-devel
[Top][All Lists]
Advanced

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

Re: master 0a15956f49: * lisp/outline.el (outline-minor-mode-use-margins


From: Juri Linkov
Subject: Re: master 0a15956f49: * lisp/outline.el (outline-minor-mode-use-margins): New user option.
Date: Mon, 19 Sep 2022 22:52:46 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> Ok, will do.  But should we have an option for ASCII art when no images
>> and no Unicode characters are available?
>
> Sure.

Maybe something like this?

diff --git a/lisp/outline.el b/lisp/outline.el
index ab37e398e9..efebd46d69 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -315,7 +315,8 @@ outline-open
   '((image "outline-open.svg" "outline-open.pbm" :height 15)
     (emoji "🔽")
     (symbol " ▼ ")
-    (text " v "))
+    (ascii " v ")
+    (text " open "))
   "Icon used for buttons for opened sections in outline buffers."
   :version "29.1"
   :help-echo "Close this section")
@@ -324,7 +325,8 @@ outline-close
   '((image "outline-close.svg" "outline-close.pbm" :height 15)
     (emoji "▶️")
     (symbol " ▶ ")
-    (text " > "))
+    (ascii " > ")
+    (text " close "))
   "Icon used for buttons for closed sections in outline buffers."
   :version "29.1"
   :help-echo "Open this section")
@@ -333,7 +335,8 @@ outline-close-rtl
   '((image "outline-close.svg" "outline-close.pbm" :height 15 :rotation 180)
     (emoji "◀️")
     (symbol " ◀ ")
-    (text " < "))
+    (ascii " < ")
+    (text " close "))
   "Right-to-left icon used for buttons in closed outline sections."
   :version "29.1")
 
diff --git a/lisp/emacs-lisp/icons.el b/lisp/emacs-lisp/icons.el
index ccc3657793..732b2181bb 100644
--- a/lisp/emacs-lisp/icons.el
+++ b/lisp/emacs-lisp/icons.el
@@ -42,7 +42,7 @@ icon-button
   :version "29.1"
   :group 'customize)
 
-(defcustom icon-preference '(image emoji symbol text)
+(defcustom icon-preference '(image emoji symbol ascii text)
   "List of icon types to use, in order of preference.
 Emacs will choose the icon of the highest preference possible
 on the current display, and \"degrade\" gracefully to an icon
@@ -52,6 +52,7 @@ icon-preference
   :type '(repeat (choice (const :tag "Images" image)
                          (const :tag "Colorful Emojis" emoji)
                          (const :tag "Monochrome Symbols" symbol)
+                         (const :tag "ASCII art" ascii)
                          (const :tag "Text Only" text))))
 
 (defmacro define-icon (name parent specification documentation &rest keywords)
@@ -61,7 +62,7 @@ define-icon
 
 SPECIFICATION is an alist of entries where the first element is
 the type, and the rest are icons of that type.  Valid types are
-`image', `emoji', `symbol' and `text'.
+`image', `emoji', `symbol', 'ascii' and `text'.
 
 KEYWORDS specify additional information.  Valid keywords are:
 
@@ -221,6 +222,9 @@ icons--create
   (and (cl-every #'char-displayable-p icon)
        icon))
 
+(cl-defmethod icons--create ((_type (eql 'ascii)) icon _keywords)
+  icon)
+
 (cl-defmethod icons--create ((_type (eql 'text)) icon _keywords)
   icon)
 

reply via email to

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