27

The function ps-print-buffer-with-faces prints an Emacs buffer. Is there a way to print a frame with more than one buffer in it? I would like to print an Emacs calc frame both with the RPN stack and the trail buffer.

The Dude
  • 463
  • 3
  • 6
  • 7
    Why not just take a screenshot and print that if the entirety of what you want to print is visible on the screen? – Kaushal Modi May 14 '15 at 18:23
  • If you print it to file (PostScript), you could later use some program (for example Inkscape) to place the contents of both files next to each other. But this won't print the fringe / the rest of the chrome of the program. – wvxvw May 14 '15 at 21:37
  • 2
    @kaushalmodi Because a printed screenshot with text has terrible resolution. – Gilles 'SO- stop being evil' May 27 '15 at 12:34
  • 1
    @Gilles Saving screencaps as .png instead of .jpg (very lossy) gives a good enough quality image for me ( example: http://i.imgur.com/NHcDP5h.png ). – Kaushal Modi May 27 '15 at 12:47
  • 2
    There is a package in Ubuntu/Debian called `gtk-vector-screenshot`. It produces PS/PDF/SVG screenshots for GTK3 applications. The Github repo is here: https://github.com/nomeata/gtk-vector-screenshot. An overview is here: http://www.joachim-breitner.de/blog/494-Better_PDF_screenshots_with_gtk_3. You would have to configure Emacs via `./configure --with-x-toolkit=gtk3`. **Caveat: I'm sorry to tell you that I could not get it working! Since it's packaged in Ubuntu, it was clearly working for someone at some point in time.** If someone gets it working, please expand this comment as an answer. – Joe Corneli May 31 '15 at 10:20

3 Answers3

1

What about frameshot by tarsius? I haven't tried it myself, but it seems to do what you want. According to its release history on GitHub, the package was born into this world on February 26, 2018 — later than the most recent update to this post.

https://github.com/tarsius/frameshot

Give it a shot! ;)

eeowaa
  • 342
  • 1
  • 11
0

Instead of trying to print a frame, you should create a new buffer whose contents are created from copies of what's in the two calc buffers.

db48x
  • 15,741
  • 1
  • 19
  • 23
  • Is the asker's Emacs running in an xterm or similar? If so, could we create an Emacs Lisp function to do the job. That should result in an acceptable answer. – D A Vincent Dec 28 '15 at 02:21
0

You can use hfyview from https://github.com/jwiegley/nxhtml/blob/master/util/hfyview.el. It constructs a html facsimile of the Emacs frame that you can print from your web browser.

Ista
  • 1,148
  • 8
  • 12
  • On Emacs 25.1 `hfyview-frame` (the function needed here) fails with "Wrong type argument"). `hfyview-buffer` still works though. – halloleo Jun 29 '18 at 06:59