From 9b73c8a121275b4659c6f6456c9fb9afa8b65aed Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 6 Feb 2026 15:17:08 -0600 Subject: [PATCH] adding color to my printing function --- README.org | 6 +++++- init.el | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 549994dd..e457d99a 100644 --- a/README.org +++ b/README.org @@ -5094,11 +5094,15 @@ Let's use pdf-tools for a lot better interaction with pdfs. (interactive) (let* ((copies (completing-read "How many copies: " '("1" "2" "3"))) (sides (completing-read "Print both sides or one? " '("two sided" "one sided"))) + (color (y-or-n-p "Print with color?")) (printer (completing-read "Which printer do you want to use?" (chris/list-printers))) (pdf-misc-print-program-args `("-o media=Letter" ,(format "-# %s" copies) ,(format "-P %s" printer) "-o fit-to-page" ,(if (string= sides "two sided") "-o sides=two-sided-long-edge" - "")))) + "") + ,(if color + "-o ColorModel=RGB" + "-o ColorModel=Gray")))) (message "printing %s copies." copies) (async-shell-command (format "lpr %s '%s'" (string-join pdf-misc-print-program-args " ") (buffer-file-name))))) diff --git a/init.el b/init.el index 9d8dc69c..3be15dfa 100644 --- a/init.el +++ b/init.el @@ -3741,11 +3741,15 @@ current buffer's, reload dir-locals." (interactive) (let* ((copies (completing-read "How many copies: " '("1" "2" "3"))) (sides (completing-read "Print both sides or one? " '("two sided" "one sided"))) + (color (y-or-n-p "Print with color?")) (printer (completing-read "Which printer do you want to use?" (chris/list-printers))) (pdf-misc-print-program-args `("-o media=Letter" ,(format "-# %s" copies) ,(format "-P %s" printer) "-o fit-to-page" ,(if (string= sides "two sided") "-o sides=two-sided-long-edge" - "")))) + "") + ,(if color + "-o ColorModel=RGB" + "-o ColorModel=Gray")))) (message "printing %s copies." copies) (async-shell-command (format "lpr %s '%s'" (string-join pdf-misc-print-program-args " ") (buffer-file-name)))))