help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: triple-backquote (was: Re: transient questions)


From: Ruijie Yu
Subject: Re: triple-backquote (was: Re: transient questions)
Date: Wed, 15 Mar 2023 17:25:55 +0800
User-agent: mu4e 1.8.14; emacs 30.0.50

Emanuel Berg <incal@dataswamp.org> writes:

> Joost Kremers wrote:
>
>> ```
>> [...]
>> ```
>
> Alright, so what is this syntax/feature called, you put Elisp
> between an opening/closing triplet backquote and you get font
> lock with `gnus-article-mode'?
>
> I like it, let's try it!
>
> ```
> [...]
> ```
>
> So did it work?

Curiously, yours was not colored by my mu4e viewer, whereas Joost's was.
The triple quotes notation originates from markdown (who may have
inherited it from another source, IDK).

Apparently specifying the language explicitly also helps to color your
code block.

    This is not colored:
```
;;; -*- lexical-binding: t -*-
;;
(defun foo ()
  (message "Bar"))
```

    But this is:
```emacs-lisp
;;; -*- lexical-binding: t -*-
;;
(defun foo ()
  (message "Bar"))
```

For other languages it's kind of hit-and-miss -- this only depends on
whether the mail client dev(s) feels like coloring these languages.
Mu4e doesn't color the following blocks, but maybe gnus would.

```c
int main(void) { return 1; }
```

```rust
fn main() { println!(); }
```

--
Best,


RY



reply via email to

[Prev in Thread] Current Thread [Next in Thread]