Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's not the "proper" way, but I've been doing it this way for years and it works wonderfully. I use <a href="http://www.lerup.com/printfile/" rel="nofollow noreferrer">PrintFile</a>, a freeware print program (which can also be used stand-alone). Then I have this in my .emacs:</p> <pre><code>(defun joc-make-fname-from-buffer-name (buffer-name-in) "Returns a valid filename from a given buffer name" (interactive "b") (save-match-data (let* ((start (string-match "[^ \*]" buffer-name-in)) (end (string-match "[ \*]*$" buffer-name-in (match-end 0))) (rc (substring buffer-name-in start end))) ;; remove some special characters (while (string-match "[:]+" rc) (setq rc (replace-match "_" t t rc))) rc))) (when is-win32 (defun joc-print-buffer-or-region (prefix) "Prints buffer or region via PrintFile32. If a prefix arg is set (via C-u) then the current region is printed, otherwise the current buffer is printed." (interactive "P") ;; ----- set the print directory, fname and args ----- (let* ((print-dir (expand-file-name "~/emacs/print")) (print-fname (joc-make-fname-from-buffer-name (buffer-name))) (print-fullpath (concat print-dir "/" print-fname)) (print-args "/delete") ;; ----- set rstart and rend to the current region ----- (rstart (point-min)) (rend (point-max))) ;; ----- if prefix given, set them to region ----- (if (and prefix) (if (and (point) (mark) (/= (point) (mark))) (progn (setq rstart (min (point) (mark))) (setq rend (max (point) (mark)))) (error "No region defined"))) ;; ----- make the directory ----- (if (not (file-directory-p print-dir)) (make-directory print-dir)) ;; ----- write buffer/region to a temp file, print it, delete directory ----- (write-region rstart rend print-fullpath) (call-process "prfile32" nil t nil print-args print-fullpath) (delete-directory print-dir)))) </code></pre> <p>I haven't looked at it in years cause it just works, so I'm sure it could be improved.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload