Bug in helm-ff-print

14 views
Skip to first unread message

Julien Cubizolles

unread,
Mar 4, 2015, 3:01:55 PM3/4/15
to emacs...@googlegroups.com
When printing from helm, the default command line is
lpr name_of_the_printer
instead of
lpr -Pname_of_the_printer

Thierry Volpiatto

unread,
Mar 4, 2015, 11:27:54 PM3/4/15
to emacs...@googlegroups.com
You have to setup yourself the command line, see the documentation of
helm-ff-print.

--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997

Julien Cubizolles

unread,
Mar 5, 2015, 4:33:39 PM3/5/15
to emacs...@googlegroups.com
Thierry Volpiatto
<thierry....@gmail.com> writes:

> Julien Cubizolles <j.cubi...@free.fr> writes:
>
>> When printing from helm, the default command line is
>> lpr name_of_the_printer
>> instead of
>> lpr -Pname_of_the_printer
>
> You have to setup yourself the command line, see the documentation of
> helm-ff-print.

I have the following set:

(setq printer-name "laserjet")

(setq lpr-command "lpr")

(setq lpr-switches '("-o landscape -o fit-to-page -o sides=two-sided-short-edge -o page-ranges=1-"))

With the previous, dired (according to the lpr-switched docstring
"It is recommended to set `printer-name' instead of including an
explicit switch on this list.") uses

lpr -Plaserjet -o landscape -o fit-to-page -o sides=two-sided-short-edge -o page-ranges=1-"

whereas helm, after prompting for the name of the printer to use, uses

lpr -o landscape -o fit-to-page -o sides=two-sided-short-edge -o page-ranges=1- HP-LaserJet-P2055d-2

missing the -P switch. Of course one can unset printername, and add a -P
switch to have a setup working both from within dired or helm but I'm
not sure that's the best choice.

Julien.



Thierry Volpiatto

unread,
Mar 6, 2015, 1:19:36 AM3/6/15
to emacs...@googlegroups.com
Seems I wasn't using the "-P" switch, but I was using gtklp, here are my
settings:

(setq lpr-command "gtklp")
(setq printer-name "EpsonStylus")
(setq-default ps-print-header nil)
(setq ps-font-size '(10 . 11.5))
(setq ps-font-family 'Courier)

Unfortunately I can't help more because I have no more printer :-(.

Maybe somebody with a printer can help you here ?

Otherwise I will try to print something next time I have access to a
printer, but I don't know when.

Michael Heerdegen

unread,
Mar 6, 2015, 10:45:13 PM3/6/15
to emacs...@googlegroups.com
Hi,

I think the OP is just right. If you configure things as recommended in
the doc of `lpr-switches' and don't specify "-P" in the value of that
var, and you have `printer-name' set, helm builds an illegal command
line.

Can't test it though with a printer, but it seems quite obvious to me.

I guess after that helm code had been written, things have changed in
Emacs.


Michael.

Thierry Volpiatto

unread,
Mar 9, 2015, 4:00:03 AM3/9/15
to emacs...@googlegroups.com
Indeed there is a new var lpr-printer-switch which was not existing.

https://github.com/emacs-helm/helm/pull/900

I have fixed this, but it is fully not tested, if one with a printer can
test this change and confirm it works fine, I will merge this PR.

Thanks.

Thierry Volpiatto

unread,
Mar 10, 2015, 2:05:58 PM3/10/15
to emacs...@googlegroups.com

Thierry Volpiatto <thierry....@gmail.com> writes:

> Michael Heerdegen <michael_...@web.de> writes:
>
>> Hi,
>>
>> I think the OP is just right. If you configure things as recommended in
>> the doc of `lpr-switches' and don't specify "-P" in the value of that
>> var, and you have `printer-name' set, helm builds an illegal command
>> line.
>>
>> Can't test it though with a printer, but it seems quite obvious to me.
>>
>> I guess after that helm code had been written, things have changed in
>> Emacs.
>
> Indeed there is a new var lpr-printer-switch which was not existing.
>
> https://github.com/emacs-helm/helm/pull/900
>
> I have fixed this, but it is fully not tested, if one with a printer can
> test this change and confirm it works fine, I will merge this PR.

For info the bug is referenced here:
https://github.com/emacs-helm/helm/issues/905

Julien Cubizolles

unread,
Mar 25, 2015, 12:22:31 PM3/25/15
to emacs...@googlegroups.com
Thierry Volpiatto
<thierry....@gmail.com> writes:


>> I have fixed this, but it is fully not tested, if one with a printer can
>> test this change and confirm it works fine, I will merge this PR.

It's working fine for me. Thanks.

Julien.

Reply all
Reply to author
Forward
0 new messages