From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: master 0a15956f49: * lisp/outline.el (outline-minor-mode-use-margins): New user option. Date: Mon, 19 Sep 2022 22:52:46 +0300 Organization: LINKOV.NET Message-ID: <86zgev16r5.fsf@mail.linkov.net> References: <166361621622.23438.4967408256154572806@vcs2.savannah.gnu.org> <20220919193656.A2342C00872@vcs2.savannah.gnu.org> <87edw7p2z7.fsf@gnus.org> <864jx32ls0.fsf@mail.linkov.net> <87a66vp2q8.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11240"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 19 21:56:27 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaMsU-0002o1-V7 for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Sep 2022 21:56:26 +0200 Original-Received: from localhost ([::1]:40940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaMsT-0000Zs-Fg for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Sep 2022 15:56:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaMqS-0007NR-Oh for emacs-devel@gnu.org; Mon, 19 Sep 2022 15:54:21 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:51111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaMqQ-0002CL-Qu for emacs-devel@gnu.org; Mon, 19 Sep 2022 15:54:20 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id CF6EA40002; Mon, 19 Sep 2022 19:54:13 +0000 (UTC) In-Reply-To: <87a66vp2q8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 19 Sep 2022 21:45:51 +0200") Received-SPF: pass client-ip=217.70.183.194; envelope-from=juri@linkov.net; helo=relay2-d.mail.gandi.net X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:295747 Archived-At: --=-=-= Content-Type: text/plain >> 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? --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=icon-ascii.patch Content-Transfer-Encoding: 8bit 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) --=-=-=--