Hello emacs and Lisp enthusiasts,

I remember seeing an article that talked about the superfluity of parenthesis in Lisp code, and how non-Lisp programmers were overwhelmed by them, but Lisp programmers had trained their eyes to look at indentation structure and didn’t see the parenthesis, and it showed an image of Lisp code without and with the parenthesis faded. I don’t have a link to the article, but even as a slightly seasoned Lisper I thought the fainter parenthesis improved readability.

So I’m wondering if/how it’s possible to achieve this effect in emacs. Is there already a minor-mode for it? Would it involve a font-lock/face for parenthesis? I’ve tried to navigate the syntax highlighting code before and was a bit turned off by the apparent complexity, so any form of introduction would be greatly appreciated.

    • centzon400@alien.topB
      link
      fedilink
      English
      arrow-up
      2
      ·
      11 months ago

      9?

      Holy cow. It may have been RMS who said if you are even “four-deep” it’s time to refactor.

    • JDRiverRun@alien.topB
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      I also use rainbow-delimiters, but they are a bit too bright in my dark theme, so I:

      (use-package rainbow-delimiters
        :config
        ;; Darken them a bit
        (cl-loop for f in (face-list)
      	   if (and (string-prefix-p "rainbow-delimiters" (symbol-name f)) 
      		   (face-foreground f)) do
      	   (set-face-foreground f (color-darken-name (face-foreground f) 15))))
      

      See also color-lighten-name to go the other way.

  • fuzzbomb23@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    See the paren-face package. The diagram you mention sounds like the one in the repository README. (I think the diagram has been used in longer article too, but I’m not sure where it originated.)