From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Support showing stars as pretty bullets Date: Tue, 03 Apr 2018 22:33:50 +0200 Message-ID: <87vad8vxld.fsf@nicolasgoaziou.fr> References: <874lkutzg8.fsf@gmail.com> <878ta51m3w.fsf@nicolasgoaziou.fr> <87sh8di0je.fsf@gmail.com> <87woxoztd5.fsf@nicolasgoaziou.fr> <87k1tofjlo.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3nhN-0007ak-4D for emacs-orgmode@gnu.org; Wed, 04 Apr 2018 15:03:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3nhJ-0003ML-Ud for emacs-orgmode@gnu.org; Wed, 04 Apr 2018 15:03:57 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:47743) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3nhJ-0003LT-OA for emacs-orgmode@gnu.org; Wed, 04 Apr 2018 15:03:53 -0400 In-Reply-To: <87k1tofjlo.fsf@gmail.com> (Alex Branham's message of "Tue, 03 Apr 2018 09:30:27 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Alex Branham Cc: Org Mode List > Fair enough. How about the attached patch instead? It only sets up the > two local variables in org.el and puts the rest in org-entities.el since > that file is also concerned with replacing characters with "prettier" > versions of themselves. I don't think it belongs to "org-entities.el" either. While it is true there is some prettification done there, this is not the sole point of the library. IOW, it is more than eye-candy; it affects, e.g., export. I really think it should go into a new "org-art.el" file. More comments follow. > +;; prettify-mode > +(defvar-local org-prettify-alist '(("*" . ?=E2=80=A2)) > + "An alist of symbols to prettify, see `prettify-symbols-alist'. > +Whether the symbol actually gets prettified is controlled by > +`org-pretty-compose-p', which see.") Should this be a defcustom? Also, note that the name space must match library, so if it goes into "org-art.el", it ought to be named, e.g., `org-art-prettify-alist'. > +(defun org-pretty-compose-p (start end match) > + "Return t if the symbol should be prettified. "Non-nil if symbol between START and END should be prettified. MATCH is ..." > +START and END are the start and end points, MATCH is the string > +match. See also `prettify-symbols-compose-predicate'." > + (if (string=3D match "*") > + ;; prettify asterisks in headings > + (org-at-heading-p) Doesn't this mean that any bold object in headline is going to be prettified? Maybe something like this (untested): (and (org-match-line org-outline-regexp-bol) (< end (match-end 0))) > + ;; else rely on the default function Nitpick: ";; Else rely on the default function." =20=20 > + ;; Setup prettify mode Ditto: ";; Setup prettify mode." > + (setq-local prettify-symbols-alist org-prettify-alist) > + (setq-local prettify-symbols-compose-predicate > #'org-pretty-compose-p) This should also go into "org-art.el", which is an optional library. We don't want to activate anything related to it every time Org is loaded. Can it be tested somehow?