I'm trying to get to grips with printing from emacs.
I've added the following to my .emacs file:
(add-to-list 'lpr-switches "-P HP_ENVY_Photo_6200_series_685E88_")
(add-to-list 'lpr-switches "-o sides=two-sided-long-edge")
(add-to-list 'lpr-switches "-o number-up=2")
When I try to print (so far I've only tried with M-x print-region), the following is written to * Messages * (after a prompt about printing to the default destination):
Spooling with options -P HP_ENVY_Photo_6200_series_685E88_... user-error: Spooling with options -P HP_ENVY_Photo_6200_series_685E88_...done: /usr/bin/lpr: No such file or directory
If I cut the displayed command and paste it to the command line, prefixed by lpr
and suffixed by a space and the name of an existing file, that file is printed without problem, which makes me think that I haven't mistyped the over-long printer name. What's going wrong?
I'm running Linux Mint Ulyana 20 and GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian
UPDATE
From * Help * in response to C-h v exec-path
exec-path is a variable defined in ‘C source code’. Its value is ("/opt/Qt/Tools/QtCreator/bin" "/opt/chromedriver" "/opt/fossil" "/opt/ActiveTcl-8.6/bin" "/usr/local/sbin" "/usr/local/bin" "/usr/sbin" "/usr/bin" "/sbin" "/bin" "/usr/games" "/usr/local/games" "/snap/bin" "/usr/lib/emacs/26.3/x86_64-linux-gnu")
From the command line:
$ which lpr
/usr/bin/lpr
lpr -P HP_ENVY_Photo_6200_series_685E88_ <filename>
Which packages am I missing? – nurdglaw Oct 12 '20 at 14:22/usr/bin/lpr
for some reason. Checkexec-path
and post its value in your question. – NickD Oct 12 '20 at 14:46add-to-list
, which according to the docstring, will "Add ELEMENT to the value of LIST-VAR if it isn’t there yet." At most your first call toadd-to-list
will work, unlesslpr-switches
is already non-nil
, at which points none of your calls will work. – Dan Oct 12 '20 at 16:31