From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dov Grobgeld Subject: Re: org-src-fontify-natively (was: org-mode in the press) Date: Sat, 28 Jan 2012 20:17:51 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=90e6ba6e8f70a92e4704b79aa1fa Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrCqZ-0002r3-14 for emacs-orgmode@gnu.org; Sat, 28 Jan 2012 13:17:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrCqW-0006Zu-TY for emacs-orgmode@gnu.org; Sat, 28 Jan 2012 13:17:55 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:35877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrCqW-0006Zq-Kh for emacs-orgmode@gnu.org; Sat, 28 Jan 2012 13:17:52 -0500 Received: by iadk27 with SMTP id k27so4395775iad.0 for ; Sat, 28 Jan 2012 10:17:52 -0800 (PST) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Christian Wittern , emacs-orgmode@gnu.org --90e6ba6e8f70a92e4704b79aa1fa Content-Type: text/plain; charset=UTF-8 I investigated this and found that this may almost be fixed by doing: ;; Make all font-lock faces fonts use inconsolata (dolist (face '(font-lock-builtin-face font-lock-comment-delimiter-face font-lock-comment-face font-lock-constant-face font-lock-doc-face font-lock-function-name-face font-lock-keyword-face font-lock-negation-char-face font-lock-preprocessor-face font-lock-regexp-grouping-backslash font-lock-regexp-grouping-construct font-lock-string-face font-lock-type-face font-lock-variable-name-face font-lock-warning-face)) (set-face-attribute face nil :family my-default-family)) But unfortunately not fully, because both source code (at least in python) and org-mode make use of the default font. And since I change this at org-mode startup to the "variable-pitch" the result is that I inherit this in the source code blocks as well. A solution would be that all org-mode faces would inherit a common org-mode-face. You could then customize this font to a variable-pitch without using the ~variable-pitch-mode~ command. Is this feasible? Regards, Dov On Sat, Jan 28, 2012 at 19:30, Dov Grobgeld wrote: > Great! That must be a new addition that I missed. It is not perfect > though, as I use a variable font for org-mode, which is inherited by the > embedded source code block when I turn on org-src-fontify-natively . Is > there any way of preventing that so blocks are always in e.g. Inconsolata? > > I found that the block background color may be changed by > org-block-background which is nice to make a visual distinction of source > code sections! > > Regards, > Dov > > On Sat, Jan 28, 2012 at 19:06, Eric Schulte wrote: > >> >> > I also love the embedded code (though I wish it was possible to syntax >> > highlight it!), >> >> It is possible, just add the following to your Emacs configuration. >> >> (setq org-src-fontify-natively t) >> >> Cheers, >> >> > external links, and tables. >> > >> > Thanks again! >> > Dov >> > >> > On Sat, Jan 28, 2012 at 18:18, Thomas S. Dye wrote: >> > >> >> Aloha Christian, >> >> >> >> Thanks for your comments. It is great to have feedback. >> >> >> >> Christian Wittern writes: >> >> >> >> > I think this is an excellent article, introducing an aspect of >> >> > org-mode, which I think fills a gap that no other software I know of >> >> > comes even close to approach. I already started mentioning it in >> >> > conversations and am sure it will be very useful to many members of >> >> > the academic community. >> >> > >> >> > Just to make sure I could answer any follow up questions, I >> downloaded >> >> > the replication bundle and started installing the dependencies. I >> >> > encountered a few problems and hope this is the right place to >> discuss >> >> > them. BTW, I am working with this on a Mac OS X 10.6 machine. >> >> > >> >> > Most of the dependencies I already had or installed them from >> >> > macports. One problem I encountered was with installing the RSQLite >> >> > package. Executing the installation command from the README file did >> >> > not work because of permission issues, the command needs to run with >> >> > superuser rights. Is it possible to give these rights to commands >> run >> >> > from babel? Since I did not find a way to do that, I installed from >> >> > the R commandline, where I found that the name of the package is >> >> > RSQLite, not 'RSQlite' as given in the readme file. >> >> > >> >> > The one dependency I could not solve was the 'dot' executable. I >> >> > assume this is an interpreter for the dot language, for which it >> seems >> >> > the program on the Mac is named graphviz. However, I am not sure how >> >> > to make that work with org/babel. Should I simply symlink to >> >> > graphviz? Or is there a babel variable to be set? This is a point >> >> > that probably needs some explanation, at least for Mac users (I >> >> > realize that the articel might not have been intended as such a >> >> > general introduction with details for all common OSses, but it would >> >> > be nice if this can be gradually supplemented). >> >> > >> >> > One last remark; since this is an online publication, I think using >> >> > proper fontification for the examples and org source code would be >> >> > even more appealing, especially for people who encounter org for the >> >> > first time. >> >> >> >> Could you be more specific here? It might be obvious to others, but I >> >> don't understand what you mean by "proper fontification." >> >> >> >> All the best, >> >> Tom >> >> >> >> > >> >> > Keep up the excellent work!! >> >> > >> >> > Christian >> >> > >> >> > >> >> > >> >> > On 2012-01-27 23:43, Eric Schulte wrote: >> >> >> Hopefully this will serve as the canonical introduction to working >> with >> >> >> code blocks in Org-mode. >> >> >> >> >> >> As we acknowledge in the paper this work would not have been >> possible >> >> >> without the ideas and feedback of the Org-mode community, so thanks >> all! >> >> >> >> >> >> Nick Dokos writes: >> >> >> >> >> >>> Andreas Leha wrote: >> >> >>> >> >> >>>> Hi all, >> >> >>>> >> >> >>>> this just came into my inbox: >> >> >>>> http://www.jstatsoft.org/v46/i03 >> >> >>>> >> >> >>>> Great work! Big thanks to the authors. >> >> >>>> >> >> >>> I remember reading it with great pleasure back when Eric posted it >> to >> >> >>> the list: beautiful stuff. I look forward to rereading it. >> >> >>> >> >> >>> Congratulations! >> >> >>> >> >> >>> Nick >> >> >>> >> >> >>> >> >> >> >> -- >> >> Thomas S. Dye >> >> http://www.tsdye.com >> >> >> >> >> >> -- >> Eric Schulte >> http://cs.unm.edu/~eschulte/ >> > > --90e6ba6e8f70a92e4704b79aa1fa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I investigated t= his and found that this may almost be fixed by doing:

;; Make all font-lock faces fonts use i= nconsolata
(dolist (face '(font-= lock-builtin-face =C2=A0=C2=A0=C2=A0
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 font-lock-comment-delimiter-face
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 font-loc= k-comment-face =C2=A0=C2=A0=C2=A0
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 font-lock-constant-face
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 font-loc= k-doc-face =C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= font-lock-function-name-face
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 font-loc= k-keyword-face =C2=A0=C2=A0=C2=A0
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 font-lock-negation-char-face
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 font-loc= k-preprocessor-face =C2=A0=C2=A0=C2=A0
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 font-lock-regexp-grouping-backslash
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 font-loc= k-regexp-grouping-construct =C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 font-loc= k-type-face =C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 font-lock-variable-name-face
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 font-loc= k-warning-face))
=C2=A0 (set-face-attribute fa= ce nil :family my-default-family))


But unfortunately not fully, because both source code (at least in pyth= on) and org-mode make use of the default font. And since I change this at o= rg-mode startup to the "variable-pitch" the result is that I inhe= rit this in the source code blocks as well.

A solution would be that all org-mode faces would inherit a common org-= mode-face. You could then customize this font to a variable-pitch without u= sing the ~variable-pitch-mode~ command. Is this feasible?

Regards, Dov


On Sat, Jan 28, 2012 at 19= :30, Dov Grobgeld <dov.grobgeld@gmail.com> wrote:
Great! That must= be a new addition that I missed. It is not perfect though, as I use a vari= able font for org-mode, which is inherited by the embedded source code bloc= k when I turn on org-src-fontify-natively . Is there any way of preventing = that so blocks are always in e.g. Inconsolata?

I found that the block background color may be changed by org-block-bac= kground which is nice to make a visual distinction of source code sections!=

Regards,
Dov

On Sat, Ja= n 28, 2012 at 19:06, Eric Schulte <eric.schulte@gmx.com> = wrote:

> I also love the embedded code (though I wish it was possible to syntax=
> highlight it!),

It is possible, just add the following to your Emacs configuration.
(setq org-src-fontify-natively t)

Cheers,

> external links, and tables.
>
> Thanks again!
> Dov
>
> On Sat, Jan 28, 2012 at 18:18, Thomas S. Dye <tsd@tsdye.com> wrote:
>
>> Aloha Christian,
>>
>> Thanks for your comments. =C2=A0It is great to have feedback.
>>
>> Christian Wittern <cwittern@gmail.com> writes:
>>
>> > I think this is an excellent article, introducing an aspect o= f
>> > org-mode, which I think fills a gap that no other software I = know of
>> > comes even close to approach. =C2=A0I already started mention= ing it in
>> > conversations and am sure it will be very useful to many memb= ers of
>> > the academic community.
>> >
>> > Just to make sure I could answer any follow up questions, I d= ownloaded
>> > the replication bundle and started installing the dependencie= s. =C2=A0I
>> > encountered a few problems and hope this is the right place t= o discuss
>> > them. =C2=A0BTW, I am working with this on a Mac OS X 10.6 ma= chine.
>> >
>> > Most of the dependencies I already had or =C2=A0installed the= m from
>> > macports. =C2=A0One problem I encountered was with installing= the RSQLite
>> > package. =C2=A0Executing the installation command from the RE= ADME file did
>> > not work because of permission issues, the command needs to r= un with
>> > superuser rights. =C2=A0Is it possible to give these rights t= o commands run
>> > from babel? =C2=A0Since I did not find a way to do that, I in= stalled from
>> > the R commandline, where I found that the name of the package= is
>> > RSQLite, not 'RSQlite' as given in the readme file. >> >
>> > The one dependency I could not solve was the 'dot' ex= ecutable. =C2=A0I
>> > assume this is an interpreter for the dot language, for which= it seems
>> > the program on the Mac is named graphviz. =C2=A0However, I am= not sure how
>> > to make that work with org/babel. =C2=A0Should I simply symli= nk to
>> > graphviz? =C2=A0Or is there a babel variable to be set? =C2= =A0This is a point
>> > that probably needs some explanation, at least for Mac users = (I
>> > realize that the articel might not have been intended as such= a
>> > general introduction with details for all common OSses, but i= t would
>> > be nice if this can be gradually supplemented).
>> >
>> > One last remark; since this is an online publication, I think= using
>> > proper fontification for the examples and org source code wou= ld be
>> > even more appealing, especially for people who encounter org = for the
>> > first time.
>>
>> Could you be more specific here? =C2=A0It might be obvious to othe= rs, but I
>> don't understand what you mean by "proper fontification.&= quot;
>>
>> All the best,
>> Tom
>>
>> >
>> > Keep up the excellent work!!
>> >
>> > Christian
>> >
>> >
>> >
>> > On 2012-01-27 23:43, Eric Schulte wrote:
>> >> Hopefully this will serve as the canonical introduction t= o working with
>> >> code blocks in Org-mode.
>> >>
>> >> As we acknowledge in the paper this work would not have b= een possible
>> >> without the ideas and feedback of the Org-mode community,= so thanks all!
>> >>
>> >> Nick Dokos<nicholas.dokos@hp.com> =C2=A0writes:
>> >>
>> >>> Andreas Leha<andreas.leha@med.uni-goettingen.de&g= t; =C2=A0wrote:
>> >>>
>> >>>> Hi all,
>> >>>>
>> >>>> this just came into my inbox:
>> >>>> http://www.jstatsoft.org/v46/i03
>> >>>>
>> >>>> Great work! =C2=A0Big thanks to the authors.
>> >>>>
>> >>> I remember reading it with great pleasure back when E= ric posted it to
>> >>> the list: beautiful stuff. I look forward to rereadin= g it.
>> >>>
>> >>> Congratulations!
>> >>>
>> >>> Nick
>> >>>
>> >>>
>>
>> --
>> Thomas S. Dye
>> http://www.tsdy= e.com
>>
>>



--90e6ba6e8f70a92e4704b79aa1fa--