unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: master 0a15956f49: * lisp/outline.el (outline-minor-mode-use-margins): New user option.
Date: Mon, 19 Sep 2022 22:52:46 +0300	[thread overview]
Message-ID: <86zgev16r5.fsf@mail.linkov.net> (raw)
In-Reply-To: <87a66vp2q8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 19 Sep 2022 21:45:51 +0200")

[-- Attachment #1: Type: text/plain, Size: 158 bytes --]

>> 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?


[-- Attachment #2: icon-ascii.patch --]
[-- Type: text/x-diff, Size: 2600 bytes --]

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	other threads:[~2022-09-19 19:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <166361621622.23438.4967408256154572806@vcs2.savannah.gnu.org>
     [not found] ` <20220919193656.A2342C00872@vcs2.savannah.gnu.org>
2022-09-19 19:40   ` master 0a15956f49: * lisp/outline.el (outline-minor-mode-use-margins): New user option Lars Ingebrigtsen
2022-09-19 19:42     ` Juri Linkov
2022-09-19 19:45       ` Lars Ingebrigtsen
2022-09-19 19:52         ` Juri Linkov [this message]
2022-09-19 19:56           ` Lars Ingebrigtsen
2022-09-19 20:12             ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86zgev16r5.fsf@mail.linkov.net \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).