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/
[-- Attachment #1: Type: text/plain, Size: 1885 bytes --] 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 <wtd@pobox.com> 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/ > > [-- Attachment #2: Type: text/html, Size: 3180 bytes --]
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 <jkitchin@andrew.cmu.edu> 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 <wtd@pobox.com> 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/ >>
[-- Attachment #1: Type: text/plain, Size: 2808 bytes --] 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 <diego@zzamboni.org> 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 <jkitchin@andrew.cmu.edu> > 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 <wtd@pobox.com> 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/ > >> > > [-- Attachment #2: Type: text/html, Size: 4601 bytes --]
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 . <briangpowellms@gmail.com> 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 <diego@zzamboni.org> 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 <jkitchin@andrew.cmu.edu> 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 <wtd@pobox.com> 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/ >> >> >>
John Kitchin <jkitchin@andrew.cmu.edu> 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
[-- Attachment #1: Type: TEXT/PLAIN, Size: 957 bytes --] 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/
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --] 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 <wtd@pobox.com> 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/” [-- Attachment #2: Type: text/html, Size: 2955 bytes --]
[-- Attachment #1.1: Type: text/plain, Size: 922 bytes --] > 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: [-- Attachment #1.2: Screen Shot 2020-06-19 at 1.49.40 PM.png --] [-- Type: image/png, Size: 18243 bytes --] [-- Attachment #1.3: Type: text/plain, Size: 450 bytes --] What’s the trick to get the background color to extend across the entire line? < Be seeing you, norm -- Norman Tovey-Walsh <ndw@nwalsh.com> 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 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 832 bytes --]
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
[-- Attachment #1: Type: text/plain, Size: 453 bytes --] Joost Kremers <joostkremers@fastmail.fm> 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 <ndw@nwalsh.com> https://nwalsh.com/ > Sometimes in life situations develop that only the half-crazy can get > out of.--La Rochefoucauld [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 832 bytes --]