Re: Anyone doing any fancy customizations of source blocks?

2020-06-19 Thread General discussions about Org-mode.
Hi Bill,

I'm glad you found the example useful. I've been thinking myself of also 
un-hiding the header arguments, which I do find useful to have visible.

Best,
--Diego
On Fri, Jun 19, 2020 at 4:04 AM William Denton  wrote:
“On 3 June 2020, Diego Zamboni wrote:

> I use the config John mentioned and I like it - though I use different
> symbols. Here's my config if you want an example:
> https://github.com/zzamboni/dot-emacs/blob/master/init.org#source-code-blocks

Thanks for this. I used it for a while, and it looks great, but I decided I 
want to see the details on the begin_src line all the time. I do like using the 
⎡and ⎣ character nr prettify-symbols-ali stto replace #+begin_src and 
#+end_src and will keep those.

(My apologies for weirdness in that line---the Unicode threw things off and 
I can't get it back to normal.)

I'll refer to your configuration file when I move my init files into Org. It's 
a great example.

Bill
--
William Denton :: Toronto, Canada --- Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ --- GHG.EARTH: https://ghg.earth/
Caveat lector. --- STAPLR: https://staplr.org/”


Re: Anyone doing any fancy customizations of source blocks?

2020-06-19 Thread Norman Tovey-Walsh
Joost Kremers  writes:
> In Emacs 27, add an `:extend t` property to the face.

Thank you! I somehow failed to connect that with my move to Emacs 27 a
while back.

Be seeing you,
  norm

--
Norman Tovey-Walsh 
https://nwalsh.com/

> Sometimes in life situations develop that only the half-crazy can get
> out of.--La Rochefoucauld


signature.asc
Description: PGP signature


Re: Anyone doing any fancy customizations of source blocks?

2020-06-19 Thread Joost Kremers



On Fri, Jun 19 2020, Norman Tovey-Walsh wrote:
What’s the trick to get the background color to extend across 
the entire line?


In Emacs 27, add an `:extend t` property to the face. In Emacs 26 
and earlier, IIRC, you need to make sure that the newline at the 
end of the line is also fontified. (That may actually be necessary 
in Emacs 27 as well, in addition to the `:extend` property...)


--
Joost Kremers
Life has its moments



Re: Anyone doing any fancy customizations of source blocks?

2020-06-19 Thread Norman Tovey-Walsh
> On 3 June 2020, Diego Zamboni wrote:
>> I use the config John mentioned and I like it - though I use different
>> symbols. Here's my config if you want an example:
>> https://github.com/zzamboni/dot-emacs/blob/master/init.org#source-code-blocks

This example reminded me of something that’s been puzzling me. In the
screenshot, the background color of lines that begin and end a source
block extend all the way across the screen.

When I change the faces for org block begin/end to something with a
background color, the color only extends to the end of the characters on
that line. The same is true if I change the background color of the
content of the block.

This is quite distracting. I thought “this must be the consequence of
some other mode I’m using or something” and I decided to test that. I
fired up “emacs -q” and loaded the code pointed to by the post above.
What I get is:


What’s the trick to get the background color to extend across the entire line?
<
Be seeing you,
  norm

--
Norman Tovey-Walsh 
https://nwalsh.com/

> ...it is significant that we are called the 'information society'—not
> the thinking society, not the deliberative society, not the society of
> reason and rationality.--Lloyd Morrisett


signature.asc
Description: PGP signature


Re: Anyone doing any fancy customizations of source blocks?

2020-06-18 Thread William Denton

On 3 June 2020, Diego Zamboni wrote:


I use the config John mentioned and I like it - though I use different
symbols. Here's my config if you want an example:
https://github.com/zzamboni/dot-emacs/blob/master/init.org#source-code-blocks


Thanks for this.  I used it for a while, and it looks great, but I decided I 
want to see the details on the begin_src line all the time.  I do like using the 
⎡and ⎣ character nr prettify-symbols-ali stto replace #+begin_src and 
#+end_src and will keep those.


(My apologies for weirdness in that line---the Unicode threw things off and 
I can't get it back to normal.)


I'll refer to your configuration file when I move my init files into Org.  It's 
a great example.


Bill
--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
Caveat lector.  ---   STAPLR: https://staplr.org/

Re: Anyone doing any fancy customizations of source blocks?

2020-06-08 Thread Rasmus
John Kitchin  writes:

> Here is one approach:
>
> https://pank.eu/blog/pretty-babel-src-blocks.html

There’s some work to generalize this here:

https://github.com/integral-dw/org-menu-mode

I have not had a chance to try it myself yet.

That being said, the above approach still lives in my setup and doesn’t
bother me too much even if it is hack :)

Stay safe,
Rasmus

-- 
However beautiful the theory, one should occasionally look at the evidence




Re: Anyone doing any fancy customizations of source blocks?

2020-06-04 Thread Diego Zamboni
Hi Brian,

Thanks for the kind words! I wrote a booklet about my setup including
other "literate config" examples, if you are interested:
https://leanpub.com/lit-config/read

I have been fascinated by the idea of literate programming since I got
a copy of The Stanford GraphBase while I was in college. I never used
CWEB directly, but I have tried noweb and other literate programming
tools over the years. However, Emacs + Org-mode + Babel is the first
toolset that I have actually been able to stick with on sustained use
:)

Best,
--Diego

On Wed, Jun 3, 2020 at 10:09 PM briangpowell .  wrote:
>
> If you haven't already, you probably know all about it; but, for any 
> newcomers on the subject of Literate Programming & source code blocks, etc.
>
> Highly recommend Knuth's CWEB book & of course NOWEB software {which is CWEB 
> generalized for ALL programming languages}:
>
> https://www-cs-faculty.stanford.edu/~knuth/cweb.html
>
> Thanks Diego, its a very interesting config example
>
> On Wed, Jun 3, 2020 at 2:24 PM Diego Zamboni  wrote:
>>
>> I use the config John mentioned and I like it - though I use different
>> symbols. Here's my config if you want an example:
>> https://github.com/zzamboni/dot-emacs/blob/master/init.org#source-code-blocks
>>
>> --Diego
>>
>> On Tue, Jun 2, 2020 at 9:24 PM John Kitchin  wrote:
>> >
>> > Here is one approach:
>> >
>> > https://pank.eu/blog/pretty-babel-src-blocks.html
>> >
>> > I feel like I have seen some work that used ruby and python icons as 
>> > displays over #+begin_src, but I can't find it now.
>> >
>> > John
>> >
>> > ---
>> > Professor John Kitchin
>> > Doherty Hall A207F
>> > Department of Chemical Engineering
>> > Carnegie Mellon University
>> > Pittsburgh, PA 15213
>> > 412-268-7803
>> > @johnkitchin
>> > http://kitchingroup.cheme.cmu.edu
>> >
>> >
>> >
>> > On Tue, Jun 2, 2020 at 2:54 PM William Denton  wrote:
>> >>
>> >> Is anyone doing any fancy formatting of source blocks, such as putting a 
>> >> line
>> >> in the left fringe, or a box around them, or having some interesting 
>> >> background?
>> >>
>> >> I ask because I recently changed the theme I use to get the dark 
>> >> Solarized look
>> >> I like,[1] and all of a sudden my #+begin_src lines were underlined and
>> >> #+end_src had a line above it.  These come from org-block-begin-line and
>> >> org-block-end-line, and are shown here, but I'd never noticed them in
>> >> documentation or had them on my screen before:
>> >>
>> >> https://orgmode.org/worg/org-contrib/babel/examples/fontify-src-code-blocks.html
>> >>
>> >> Aside from fontifying the source blocks I've never done anything special 
>> >> about
>> >> them (except wonder how I ever did anything without them), but seeing 
>> >> this made
>> >> me wonder if anyone here has really customized them so they look like 
>> >> medieval
>> >> manuscripts or something from a futuristic video game.  (If any of that is
>> >> possible---but in Emacs, anything is possible ...)
>> >>
>> >> Bill
>> >>
>> >> [1] Now I'm using https://github.com/bbatsov/solarized-emacs, with 
>> >> variable
>> >> pitch turned off and Org headline resizing turned off.
>> >>
>> >> --
>> >> William Denton :: Toronto, Canada   ---   Listening to Art: 
>> >> https://listeningtoart.org/
>> >> https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
>> >> Caveat lector.  ---   STAPLR: https://staplr.org/
>> >>
>>



Re: Anyone doing any fancy customizations of source blocks?

2020-06-03 Thread briangpowell .
If you haven't already, you probably know all about it; but, for any
newcomers on the subject of Literate Programming & source code blocks, etc.

Highly recommend Knuth's CWEB book & of course NOWEB software {which is
CWEB generalized for ALL programming languages}:

https://www-cs-faculty.stanford.edu/~knuth/cweb.html

Thanks Diego, its a very interesting config example

On Wed, Jun 3, 2020 at 2:24 PM Diego Zamboni  wrote:

> I use the config John mentioned and I like it - though I use different
> symbols. Here's my config if you want an example:
>
> https://github.com/zzamboni/dot-emacs/blob/master/init.org#source-code-blocks
>
> --Diego
>
> On Tue, Jun 2, 2020 at 9:24 PM John Kitchin 
> wrote:
> >
> > Here is one approach:
> >
> > https://pank.eu/blog/pretty-babel-src-blocks.html
> >
> > I feel like I have seen some work that used ruby and python icons as
> displays over #+begin_src, but I can't find it now.
> >
> > John
> >
> > ---
> > Professor John Kitchin
> > Doherty Hall A207F
> > Department of Chemical Engineering
> > Carnegie Mellon University
> > Pittsburgh, PA 15213
> > 412-268-7803
> > @johnkitchin
> > http://kitchingroup.cheme.cmu.edu
> >
> >
> >
> > On Tue, Jun 2, 2020 at 2:54 PM William Denton  wrote:
> >>
> >> Is anyone doing any fancy formatting of source blocks, such as putting
> a line
> >> in the left fringe, or a box around them, or having some interesting
> background?
> >>
> >> I ask because I recently changed the theme I use to get the dark
> Solarized look
> >> I like,[1] and all of a sudden my #+begin_src lines were underlined and
> >> #+end_src had a line above it.  These come from org-block-begin-line and
> >> org-block-end-line, and are shown here, but I'd never noticed them in
> >> documentation or had them on my screen before:
> >>
> >>
> https://orgmode.org/worg/org-contrib/babel/examples/fontify-src-code-blocks.html
> >>
> >> Aside from fontifying the source blocks I've never done anything
> special about
> >> them (except wonder how I ever did anything without them), but seeing
> this made
> >> me wonder if anyone here has really customized them so they look like
> medieval
> >> manuscripts or something from a futuristic video game.  (If any of that
> is
> >> possible---but in Emacs, anything is possible ...)
> >>
> >> Bill
> >>
> >> [1] Now I'm using https://github.com/bbatsov/solarized-emacs, with
> variable
> >> pitch turned off and Org headline resizing turned off.
> >>
> >> --
> >> William Denton :: Toronto, Canada   ---   Listening to Art:
> https://listeningtoart.org/
> >> https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
> >> Caveat lector.  ---   STAPLR: https://staplr.org/
> >>
>
>


Re: Anyone doing any fancy customizations of source blocks?

2020-06-03 Thread Diego Zamboni
I use the config John mentioned and I like it - though I use different
symbols. Here's my config if you want an example:
https://github.com/zzamboni/dot-emacs/blob/master/init.org#source-code-blocks

--Diego

On Tue, Jun 2, 2020 at 9:24 PM John Kitchin  wrote:
>
> Here is one approach:
>
> https://pank.eu/blog/pretty-babel-src-blocks.html
>
> I feel like I have seen some work that used ruby and python icons as displays 
> over #+begin_src, but I can't find it now.
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Tue, Jun 2, 2020 at 2:54 PM William Denton  wrote:
>>
>> Is anyone doing any fancy formatting of source blocks, such as putting a line
>> in the left fringe, or a box around them, or having some interesting 
>> background?
>>
>> I ask because I recently changed the theme I use to get the dark Solarized 
>> look
>> I like,[1] and all of a sudden my #+begin_src lines were underlined and
>> #+end_src had a line above it.  These come from org-block-begin-line and
>> org-block-end-line, and are shown here, but I'd never noticed them in
>> documentation or had them on my screen before:
>>
>> https://orgmode.org/worg/org-contrib/babel/examples/fontify-src-code-blocks.html
>>
>> Aside from fontifying the source blocks I've never done anything special 
>> about
>> them (except wonder how I ever did anything without them), but seeing this 
>> made
>> me wonder if anyone here has really customized them so they look like 
>> medieval
>> manuscripts or something from a futuristic video game.  (If any of that is
>> possible---but in Emacs, anything is possible ...)
>>
>> Bill
>>
>> [1] Now I'm using https://github.com/bbatsov/solarized-emacs, with variable
>> pitch turned off and Org headline resizing turned off.
>>
>> --
>> William Denton :: Toronto, Canada   ---   Listening to Art: 
>> https://listeningtoart.org/
>> https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
>> Caveat lector.  ---   STAPLR: https://staplr.org/
>>



Re: Anyone doing any fancy customizations of source blocks?

2020-06-02 Thread John Kitchin
Here is one approach:

https://pank.eu/blog/pretty-babel-src-blocks.html

I feel like I have seen some work that used ruby and python icons as
displays over #+begin_src, but I can't find it now.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Tue, Jun 2, 2020 at 2:54 PM William Denton  wrote:

> Is anyone doing any fancy formatting of source blocks, such as putting a
> line
> in the left fringe, or a box around them, or having some interesting
> background?
>
> I ask because I recently changed the theme I use to get the dark Solarized
> look
> I like,[1] and all of a sudden my #+begin_src lines were underlined and
> #+end_src had a line above it.  These come from org-block-begin-line and
> org-block-end-line, and are shown here, but I'd never noticed them in
> documentation or had them on my screen before:
>
>
> https://orgmode.org/worg/org-contrib/babel/examples/fontify-src-code-blocks.html
>
> Aside from fontifying the source blocks I've never done anything special
> about
> them (except wonder how I ever did anything without them), but seeing this
> made
> me wonder if anyone here has really customized them so they look like
> medieval
> manuscripts or something from a futuristic video game.  (If any of that is
> possible---but in Emacs, anything is possible ...)
>
> Bill
>
> [1] Now I'm using https://github.com/bbatsov/solarized-emacs, with
> variable
> pitch turned off and Org headline resizing turned off.
>
> --
> William Denton :: Toronto, Canada   ---   Listening to Art:
> https://listeningtoart.org/
> https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
> Caveat lector.  ---   STAPLR: https://staplr.org/
>
>


Anyone doing any fancy customizations of source blocks?

2020-06-02 Thread William Denton

Is anyone doing any fancy formatting of source blocks, such as putting a line
in the left fringe, or a box around them, or having some interesting background?

I ask because I recently changed the theme I use to get the dark Solarized look 
I like,[1] and all of a sudden my #+begin_src lines were underlined and 
#+end_src had a line above it.  These come from org-block-begin-line and 
org-block-end-line, and are shown here, but I'd never noticed them in 
documentation or had them on my screen before:


https://orgmode.org/worg/org-contrib/babel/examples/fontify-src-code-blocks.html

Aside from fontifying the source blocks I've never done anything special about 
them (except wonder how I ever did anything without them), but seeing this made 
me wonder if anyone here has really customized them so they look like medieval 
manuscripts or something from a futuristic video game.  (If any of that is 
possible---but in Emacs, anything is possible ...)


Bill

[1] Now I'm using https://github.com/bbatsov/solarized-emacs, with variable 
pitch turned off and Org headline resizing turned off.


--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
Caveat lector.  ---   STAPLR: https://staplr.org/