From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Pretty org-entities in org-mode buffers Date: Thu, 3 Jun 2010 23:50:33 +0200 Message-ID: <8415E657-8FA3-4C6F-AA2D-B8DAC815184E@gmail.com> References: <87zl0e2ue7.fsf@gmail.com> <87bpcfh7ug.fsf@gmail.com> <3A7EAF5A-4F8C-4C88-94E9-9F2B1F66BE9B@gmail.com> <871vdafu85.fsf@gmail.com> <53A6365D-CBCF-4C33-B4B1-B6EF81713752@gmail.com> <877hmg2eeo.fsf@gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=59083 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKIJC-0001G6-VS for emacs-orgmode@gnu.org; Thu, 03 Jun 2010 17:50:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKIJB-00085q-Am for emacs-orgmode@gnu.org; Thu, 03 Jun 2010 17:50:38 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:37586) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKIJB-00085a-1w for emacs-orgmode@gnu.org; Thu, 03 Jun 2010 17:50:37 -0400 Received: by ewy6 with SMTP id 6so285944ewy.32 for ; Thu, 03 Jun 2010 14:50:36 -0700 (PDT) In-Reply-To: <877hmg2eeo.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Org Mode On Jun 3, 2010, at 7:51 PM, Eric Schulte wrote: > Hi Carsten, > > This appears to be an issue in the HEAD (as of two weeks ago) of the > Emacs git repository. I was able to get around this issue (and a =20 > couple > of other font-lock related issues) by stepping back to an older =20 > version > of Emacs (tag EMACS_23_2 in the git repository). > > I haven't tried to go back to the Emacs development HEAD, but I assume > that they'll take care of this issue sooner or later, either way it's > not a problem with any of the code in Org-mode. OK, thanks. I actually did pull the latest git mirror, and I did not see any =20 problems.... - Carsten > > Best -- Eric > > Carsten Dominik writes: > >> Hi Eric, >> >> have you been able to get past this issue? >> >> - Carsten >> >> On May 17, 2010, at 5:01 PM, Eric Schulte wrote: >> >>> So looking into this slightly deeper, >>> >>> I do have org-pretty-entities set to t in my config. >>> >>> Toggling entities display with C-c C-x \ has no effect. >>> >>> The value of org-highlight-latex-fragments-and-specials is nil. >>> >>> Entities are only displayed when I search for the "\\" character, no >>> other searches result in displayed entities. >>> >>> Interestingly, when starting with a fresh "emacs -Q" and only =20 >>> loading >>> >>> --8<---------------cut here---------------start------------->8--- >>> (load-file "~/src/org/lisp/org-install.el") >>> (setq org-pretty-entities t) >>> --8<---------------cut here---------------end--------------->8--- >>> >>> I have the same problem, so maybe my version of Emacs is to blame, =20= >>> I'm >>> using the latest from the emacs git/bzr repo >>> >>> --8<---------------cut here---------------start------------->8--- >>> ~/src/emacs/src/emacs --version >>> GNU Emacs 24.0.50.1 >>> Copyright (C) 2010 Free Software Foundation, Inc. >>> GNU Emacs comes with ABSOLUTELY NO WARRANTY. >>> You may redistribute copies of Emacs >>> under the terms of the GNU General Public License. >>> For more information about these matters, see the file named =20 >>> COPYING. >>> --8<---------------cut here---------------end--------------->8--- >>> >>> When I get some more time, I'll look into this further. >>> >>> Thanks -- Eric >>> >>> Carsten Dominik writes: >>> >>>> On May 16, 2010, at 11:09 PM, Eric Schulte wrote: >>>> >>>>> Hi Carsten, >>>>> >>>>> Thanks for folding in this feature. >>>>> >>>>> I'm having some weird issues using the new entities display. The >>>>> entities are not fontified in my org-mode buffers despite having =20= >>>>> set >>>>> the >>>>> org-pretty-entities variable to t. However if I search >>>>> `isearch-forward-regexp' for the "\\" character in the buffer then >>>>> all >>>>> of the entities are displayed (e.g. \sum is replaced with =E2=88=91)= . >>>>> >>>>> Any idea why the entity display is only working during a search? >>>> >>>> One idea: Do you have turned on org-highlight-latex-fragments-and- >>>> specials? >>>> >>>> - Carsten >>>> >>>> >>>>> >>>>> Thanks -- Eric >>>>> >>>>> Carsten Dominik writes: >>>>> >>>>>> Hi everyone, >>>>>> >>>>>> a modified version of Eric's code is now included into Org, I =20 >>>>>> just >>>>>> pushed it >>>>>> to the git repo. >>>>>> >>>>>> You can use the command `C-c C-x \' to toggle this feature. >>>>>> >>>>>> The variable `org-pretty-entities' determines if this mode is =20 >>>>>> on by >>>>>> default. >>>>>> >>>>>> Finally, you can use >>>>>> >>>>>> #+STARTUP: entitiespretty >>>>>> #+STARTUP: entitiesplain >>>>>> >>>>>> to change things on a per-file base. >>>>>> >>>>>> Thanks to Eric for this great idea. >>>>>> >>>>>> - Carsten >>>>>> >>>>>> On May 5, 2010, at 6:19 PM, Eric Schulte wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Recently I've been making use of org-entites for exporting my >>>>>>> greek/ >>>>>>> math >>>>>>> heavy class notes to HTML. I'm really loving the results. >>>>>>> >>>>>>> This morning I've started playing around with the below function >>>>>>> `org-pretty-entities', which is adapted from Phil Hagelberg's >>>>>>> `pretty-lambdas'[1]. Calling this function in an org-mode =20 >>>>>>> buffer >>>>>>> will >>>>>>> have the effect of fontifying all org-entities text strings as =20= >>>>>>> the >>>>>>> character which they represent, so \Delta is replaced with =CE=94,= >>>>>>> \lambda >>>>>>> with =CE=BB, \in with =E2=88=88, and so forth. >>>>>>> >>>>>>> I've just started playing with this, and I make no guarantees as >>>>>>> to >>>>>>> it's >>>>>>> safety or utility, but I was very pleasantly surprised by the >>>>>>> simplicity >>>>>>> of the function, and how nice it's been to see my special >>>>>>> characters >>>>>>> appear in org-mode buffers as I type. >>>>>>> >>>>>>> #+begin_src emacs-lisp :results silent >>>>>>> (defun org-pretty-entities () >>>>>>> (interactive) >>>>>>> (font-lock-add-keywords >>>>>>> nil (mapcar >>>>>>> (lambda (el) >>>>>>> (list >>>>>>> (concat "(?\\(" (regexp-quote "\\") (nth 0 el) "[\s]" =20= >>>>>>> "\ >>>>>>> \)") >>>>>>> `(0 (progn (compose-region (match-beginning 1) (- >>>>>>> (match- >>>>>>> end 1) 1) >>>>>>> ,(nth 6 el)) nil)))) >>>>>>> org-entities))) >>>>>>> >>>>>>> (org-pretty-entities) >>>>>>> #+end_src >>>>>>> >>>>>>> To try this out, just evaluate the above code block inside of an >>>>>>> org-mode buffer, then starting typing out org-entities. >>>>>>> >>>>>>> Hope others find this useful. >>>>>>> >>>>>>> Best -- Eric >>>>>>> >>>>>>> Footnotes: >>>>>>> [1] = http://github.com/technomancy/emacs-starter-kit/blob/master/starter-kit-de= funs.el#L135 >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Emacs-orgmode mailing list >>>>>>> Please use `Reply All' to send replies to the list. >>>>>>> Emacs-orgmode@gnu.org >>>>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>>>>> >>>>>> - Carsten >>>> >>>> - Carsten >> >> - Carsten - Carsten