all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Printing questions concerning lpr-switches and printer-name
@ 2013-05-22 19:21 Marius Hofert
  2013-05-22 20:04 ` Peter Dyballa
  0 siblings, 1 reply; 6+ messages in thread
From: Marius Hofert @ 2013-05-22 19:21 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I have the following settings for printing on 'P' from dired-mode:

(setq printer-name "myPrinter")
(setq lpr-switches '("-o sides=one-sided -o number-up=2"))

If I hit 'P' on a file foo.pdf in dired-mode, I get

Print foo.pdf with: lpr -o sides=one-sided -o number-up=2

According to the manual, the printer is then added via -P.

1) How can I adjust the printer if I want to print foo.pdf
on a different printer (I use about 3 different printers)?

I am wondering if it wouldn't be better to specify "-P myPrinter" as
part of lpr-switches so that I can at least adjust it manually when
receiving the message:

Print foo.pdf with: lpr -o sides=one-sided -o number-up=2 -P myPrinter

This is also not so convenient of course (and that's the reason why I'm
asking... is there a better approach?)

2) I would like to print files of certain types (like .c, .R) by 'a2ps'
instead of 'lpr'. How can this be dealt with (or is again the best
solution to adjust the print command manually [in this case completely
replace it]?).

My current work around is to use '!' with a predefined printing command
for such files (not very elegant, though).


Cheers,

Marius




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Printing questions concerning lpr-switches and printer-name
  2013-05-22 19:21 Printing questions concerning lpr-switches and printer-name Marius Hofert
@ 2013-05-22 20:04 ` Peter Dyballa
  2013-05-22 21:11   ` Marius Hofert
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Dyballa @ 2013-05-22 20:04 UTC (permalink / raw)
  To: Marius Hofert; +Cc: help-gnu-emacs


Am 22.05.2013 um 21:21 schrieb Marius Hofert:

> 2) I would like to print files of certain types (like .c, .R) by 'a2ps'
> instead of 'lpr'. How can this be dealt with (or is again the best
> solution to adjust the print command manually [in this case completely
> replace it]?).

You could use an universal shell or Perl or Python or whatever script that handles the printing based on their extension and on internal rules…

In GNU Emacs you can also set lpr-command. Why not press f1, f2, f3, with modifiers, to select a printer and modify its way of printing?

--
Mit friedvollen Grüßen

  Pete

Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we.
				– Georges W. Bush




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Printing questions concerning lpr-switches and printer-name
  2013-05-22 20:04 ` Peter Dyballa
@ 2013-05-22 21:11   ` Marius Hofert
  2013-05-22 22:52     ` Peter Dyballa
  0 siblings, 1 reply; 6+ messages in thread
From: Marius Hofert @ 2013-05-22 21:11 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs


Peter Dyballa writes:

> Am 22.05.2013 um 21:21 schrieb Marius Hofert:
>
>> 2) I would like to print files of certain types (like .c, .R) by 'a2ps'
>> instead of 'lpr'. How can this be dealt with (or is again the best
>> solution to adjust the print command manually [in this case completely
>> replace it]?).
>
> You could use an universal shell or Perl or Python or whatever script
> that handles the printing based on their extension and on internal
> rules…

This is a good idea.

>
>
> In GNU Emacs you can also set lpr-command. Why not press f1, f2, f3,
> with modifiers, to select a printer and modify its way of printing?

I think I roughly know what you mean, but a) not 100% sure and b) no
glue how to do this...

An 'ido' completion of available printers would also be
great. Theoretically that should be possible, but I rather have to learn
elisp first...

Maybe someone already has a similar setup / requirements?

Cheers,

Marius


>
>
> --
> Mit friedvollen Grüßen
>
>   Pete
>
> Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we.
> 				– Georges W. Bush





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Printing questions concerning lpr-switches and printer-name
  2013-05-22 21:11   ` Marius Hofert
@ 2013-05-22 22:52     ` Peter Dyballa
  2013-05-23 14:53       ` Marius Hofert
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Dyballa @ 2013-05-22 22:52 UTC (permalink / raw)
  To: Marius Hofert; +Cc: help-gnu-emacs


Am 22.05.2013 um 23:11 schrieb Marius Hofert:

> An 'ido' completion of available printers would also be
> great. Theoretically that should be possible, but I rather have to learn
> elisp first...

With f1…fn you select one of the n printers you have (maybe there exists a clear relation between the printer's type number and the n of the function key). So you bind a simple variable setting function (for printer-name) to a key press event.

With one modifier key down, for example Control, while you press one of the function keys now two things happen: you set printer n active and you also select particular lpr-switches – if needed.

With two modifier keys down, for example Control + Shift, while you press one of the function keys now three things happen: you set printer n active and you also select particular lpr-switches for it and you choose an lpr-command with enscript, a2ps, or whatever.

This should not be too complicated. With printing set-up that way you can simply print a file (or more?) from dired with P.

--
Mit friedvollen Grüßen

  Pete

Atheism is a non prophet organisation.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Printing questions concerning lpr-switches and printer-name
  2013-05-22 22:52     ` Peter Dyballa
@ 2013-05-23 14:53       ` Marius Hofert
  2013-05-23 16:14         ` Peter Dyballa
  0 siblings, 1 reply; 6+ messages in thread
From: Marius Hofert @ 2013-05-23 14:53 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs


Peter Dyballa writes:

> Am 22.05.2013 um 23:11 schrieb Marius Hofert:
>
>> An 'ido' completion of available printers would also be
>> great. Theoretically that should be possible, but I rather have to learn
>> elisp first...
>
> With f1…fn you select one of the n printers you have (maybe there
> exists a clear relation between the printer's type number and the n of
> the function key). So you bind a simple variable setting function (for
> printer-name) to a key press event.

How?

I looked around (e.g., here
http://www.masteringemacs.org/articles/2011/02/08/mastering-key-bindings-emacs/),
but couldn't find a solution to this problem. But then I'm no expert
here, so I might have overlooked it.

>
>
> With one modifier key down, for example Control, while you press one
> of the function keys now two things happen: you set printer n active
> and you also select particular lpr-switches – if needed.
>
> With two modifier keys down, for example Control + Shift, while you
> press one of the function keys now three things happen: you set
> printer n active and you also select particular lpr-switches for it
> and you choose an lpr-command with enscript, a2ps, or whatever.
>

this indeed sounds like a nice approach.

Cheers,

Marius

>
> This should not be too complicated. With printing set-up that way you
> can simply print a file (or more?) from dired with P.
>
> --
> Mit friedvollen Grüßen
>
>   Pete
>
> Atheism is a non prophet organisation.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Printing questions concerning lpr-switches and printer-name
  2013-05-23 14:53       ` Marius Hofert
@ 2013-05-23 16:14         ` Peter Dyballa
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2013-05-23 16:14 UTC (permalink / raw)
  To: Marius Hofert; +Cc: help-gnu-emacs


Am 23.05.2013 um 16:53 schrieb Marius Hofert:

> How?

Create a function in which the variable is being set, bind it to a key!

A simple function I wrote to have one init file for a few GNU Emacs versions is this:

      (defun window-full-width-p ()
	"Return false for old Emacsen"
	nil)

Maybe it's necessary to have (interactive) instead of (). Instead of my nil "action" you would have to set variables. More can be found in the documentation.

--
Mit friedvollen Grüßen

  Pete

Wer nichts zu verbergen hat, hat schon alles verloren.
				(Juli Zeh)




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-05-23 16:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 19:21 Printing questions concerning lpr-switches and printer-name Marius Hofert
2013-05-22 20:04 ` Peter Dyballa
2013-05-22 21:11   ` Marius Hofert
2013-05-22 22:52     ` Peter Dyballa
2013-05-23 14:53       ` Marius Hofert
2013-05-23 16:14         ` Peter Dyballa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.