Questions tagged [pretty-print]

is the application of styles to source code and markup text content for printing purposes. Styles may be as simple as line wrapping to complex layouts, indentations, coloring, fonts, and syntax highlighting.

15 questions
9
votes
2 answers

Can emacs show formatted backtraces?

When getting an Elisp error and trying to debug the problem, the backtrace buffer is quite hard to read with its long lines. Is there a way to get a pretty-printed backtrace buffer?
Tom
  • 1,190
  • 7
  • 16
4
votes
0 answers

Like JavaScript prettier but for Elisp

(N00b question.) Is there command/package/snippet to format elisp code (like in my init file) in a standard(-ish) way, like what Prettier does for JavaScript? I'm not only concerned about indentation, but keeping lines at max 80 chars, and whatever…
agentofuser
  • 501
  • 3
  • 11
2
votes
1 answer

Prettifying a list

I have the following structure of list and want to prettify it. The list is composed of elements as in: ((p1 . q1) . text) ((p1 . q2) . text) ((p2 . q3) . text) ((p2 . q4) . text) And want to isolate each list with identical p. Thusly, some…
Dilna
  • 1,173
  • 3
  • 10
2
votes
1 answer

Is there an Emacs-specific solution to printing Emails?

I'm using notmuch for reading and writing emails. This works fine, but sometimes I still do need to print emails. Here the available tools don't shine. Out of the box, using #, printing results in an ugly monospaced text. It's OK, but aren't there…
2
votes
1 answer

yaml-mode empties whitespace lines

Our project has a large yaml file edited by multiple developers in multiple environments. When I edit the file in emacs, yaml-mode (I assume?) will trim any whitespace lines: Value: Item: foo Count: 10 --------- …
tenpn
  • 395
  • 2
  • 14
2
votes
3 answers

How pretty format XML in Windows?

Windows 10, Emacs 25.1 Is it possible to pretty format XML file? E.g. here not formatted xml:
a_subscriber
  • 3,854
  • 1
  • 17
  • 47
2
votes
0 answers

To `pp` or not to `pp`?

The pp package is great for pretty-printing Emacs Lisp forms, but can be excruciatingly slow for "large" forms. Is there a general rule-of-thumb for determining whether we should pp a form or not? E.g. if a sequence contains more than X elements, pp…
Tianxiang Xiong
  • 3,848
  • 16
  • 27
1
vote
1 answer

Emacs hangs when saving new file with prettier-mode enabled

I'm editing JavaScript files quite a bit and I have prettier installed and prettier-mode and when I load files and make changes it runs, changes the layout and saves them as expected. However, if I create a new JavaScript file with any amount of…
1
vote
1 answer

Format alist into bullet points

I have this couple of alists: ((melpa . 49) (gnu . 14) (nongnu . 1)) ((nongnu (nongnu . markdown-mode)) (gnu (gnu . adaptive-wrap) (gnu . auctex) (gnu . company) (gnu . consult) (gnu . csv-mode) (gnu . dash) (gnu . diff-hl) (gnu . hydra) (gnu .…
Manuel Uberti
  • 3,150
  • 18
  • 36
1
vote
0 answers

How to pretty print Scheme code in Emacs?

I would like to format Scheme code inside Emacs, I'm developing Scheme interpreter and my formatter don't work quite right, so while I'm working on syntax-rules macro I would like to pretty print the code I'm working on, without the need right not…
jcubic
  • 691
  • 1
  • 4
  • 16
1
vote
1 answer

Working with printed macro expansions

I am trying to write a macro. I have read the manual and learned about macroexpand. However, when I use it, I find the expansion difficult to read and work with. How can I expand a macro in a readable, workable format? Let me illustrate. If I…
Lorem Ipsum
  • 4,327
  • 2
  • 14
  • 35
1
vote
0 answers

How to set ps-end-cut-regexp

I often use ps-print-buffer to print out files, but I don't want the first few lines of the buffer to be printed. Here's the beginning of the buffer: # -*- mode: org; -*- # Last updated: <2017/12/12 18:37> * First header Say I want to cut…
GrB
  • 207
  • 1
  • 6
0
votes
1 answer

Printing each element in list on separate line

I am using \n so that when printing the list, each element in the list gets a new line when calling message. I am trying to have a go at printing a list where each element does not have a \n at the end. What commands would achieve printing each…
Dilna
  • 1,173
  • 3
  • 10
0
votes
1 answer

How to print a Elisp form with a specific prefix string on each line?

I'd like to pretty-print an Elisp form with some arbitrary prefix string inserted at the beginning of each output line. For example, given the following variable: (setq var '((abc . 11) (def . 22) (ghi . 33))) I'd like…
PRouleau
  • 744
  • 3
  • 10
0
votes
1 answer

Emacs, pretty print but showing spaces and \n

I'm making diagrams with plantuml and org mode, when preparing the JSONs, in order to plot well the diagram I need this representation of JSON: (with-temp-buffer (insert (json-encode '((calimero . pato) (gato . 3)))) (json-pretty-print-buffer)…
anquegi
  • 739
  • 5
  • 21