From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel E. Doherty" Subject: Re: Pretty org-entities in org-mode buffers Date: Sat, 05 Jun 2010 13:36:15 -0500 Message-ID: <4C0A991F.90102@ddoherty.net> References: <87zl0e2ue7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=34705 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKyEN-00022d-W0 for emacs-orgmode@gnu.org; Sat, 05 Jun 2010 14:36:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKyEM-0000wL-Ih for emacs-orgmode@gnu.org; Sat, 05 Jun 2010 14:36:27 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:42409) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKyEM-0000w8-F0 for emacs-orgmode@gnu.org; Sat, 05 Jun 2010 14:36:26 -0400 Received: by vws13 with SMTP id 13so3376764vws.0 for ; Sat, 05 Jun 2010 11:36:25 -0700 (PDT) In-Reply-To: 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: emacs-orgmode@gnu.org Eric and Carsten, This is a really swell feature, Mr. Cleaver. Just a reminder to those who might be reading this list, enabling CDLateX and org-pretty-entities make typing greek characters *really* easy. Backquote a (`a) is enough to give you alpha, `b beta, etc. These two features work really nicely together. Regards, ==================================================== Daniel E. Doherty 7300 W. 110th Street, Suite 930 Overland Park, KS 66210 913.338.7182 (Phone) 913,338.7164 (FAX) Up the airy mountain, Down the rushy glen, We daren't go a-hunting, For fear of little men. --- William Allingham (Donegal, Ireland) On 05/16/2010 12:51 AM, Carsten Dominik wrote: > Hi everyone, > > a modified version of Eric's code is now included into Org, I 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 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 buffer will >> have the effect of fontifying all org-entities text strings as the >> character which they represent, so \Delta is replaced with Δ, \lambda >> with λ, \in with ∈, 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]" "\\)") >> `(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-defuns.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 > > > > > _______________________________________________ > 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