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.

Filter by
Sorted by
Tagged with
2 votes
1 answer
150 views

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 ...
Dilna's user avatar
  • 1,183
0 votes
1 answer
162 views

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 ...
Dilna's user avatar
  • 1,183
1 vote
1 answer
139 views

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 ...
Richard Wheeldon's user avatar
0 votes
1 answer
59 views

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) (...
PRouleau's user avatar
  • 754
2 votes
1 answer
61 views

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 ...
Public Image Ltd.'s user avatar
1 vote
1 answer
115 views

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 ...
Manuel Uberti's user avatar
1 vote
0 answers
186 views

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 ...
jcubic's user avatar
  • 691
1 vote
1 answer
812 views

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 ...
Lorem Ipsum's user avatar
  • 4,347
9 votes
2 answers
555 views

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's user avatar
  • 1,190
0 votes
1 answer
681 views

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 . ...
anquegi's user avatar
  • 749
2 votes
1 answer
343 views

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: ...
tenpn's user avatar
  • 395
2 votes
3 answers
1k views

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: <?xml version="1.0" encoding="UTF-8"?><items xmlns:xsd="http://www.w3.org/2001/XMLSchema" ...
a_subscriber's user avatar
  • 3,884
1 vote
0 answers
49 views

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/...
GrB's user avatar
  • 207
4 votes
0 answers
331 views

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 ...
agentofuser's user avatar
2 votes
0 answers
136 views

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....
Tianxiang Xiong's user avatar