我使用这个函数将缓冲区的内容打印到PDF中
(来自我的.emacs文件:)
(defun print-to-pdf ()
(interactive)
(ps-spool-buffer-with-faces)
(switch-to-buffer "*PostScript*")
(write-file "/tmp/tmp.ps")
(kill-buffer "tmp.ps")
(setq cmd (concat "ps2pdf14 /tmp/tmp.ps /home/user/" (buffer-name) ".pdf"))
(shell-command cmd)
(shell-command "rm /tmp/tmp.ps")
(message (concat "Saved to: /home/user/" (buffer-name) ".pdf"))
)
然而,我找不到一种方法在将PostScript缓冲区写入磁盘之前启用或应用可视化行小模式,以便在输出中启用自动换行。