all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* printing from within emacs, without having "lpr"
@ 2016-06-24 13:25 martin.sputnik
  2016-06-25  0:09 ` Emanuel Berg
  0 siblings, 1 reply; 4+ messages in thread
From: martin.sputnik @ 2016-06-24 13:25 UTC (permalink / raw)
  To: help-gnu-emacs

Hi, I have the following printing problem. 

The local sys-administration, in their wisdom, has deactivated "lpr" and
related commands, insofar they introduced a new ``improved'' print-system
(via some Windows-servers) that requires I have to give my passwords (I
work under Linux though.)

As a consequence, I cannot 

           currently print from within emacs. 

In this post here, I concentrate on the ``standard'' printing capabilities
(like M-x lpr-buffer M-x ps-print-buffer and related commands) not on more
complex stuff like printing the a dvi-file or similar from within inside a
LaTeX buffer. I can ``export'' buffers to the file system and then invoke
print on the export, but it's not a dignified way and I don't get much
support (I guess as long as one can print from the Office-Suite, the
computer is defined as ``up-and-running'') .


Now: currently, the value of the  variable 

	     lpr-command  is "lpr"

Unfortunately, doing

(setq lpr-command "print")

and changing the lpr-add-switches to avoid lpr-specifics there does not help. The message for M-x print-buffer is

Usage: print [-a{1,2,3,4}] .... [-v] [file...]
  More information available from 'man print'.


which perhaps indicates that the buffer I intended to print were now
``piped'' correctly into the print commant.


Any ideas what I could do? I think I found a way around the problem that
print wants a password, that seems not the problem, but I wonder if
fiddling with the lpr-command will do any good?  Where should I look? There are on the emacs-manual some tips how to print using some scripts, but that seems for Windows users, I work under linux, but lpr etc is decativated.


thanks, Martin



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

* Re: printing from within emacs, without having "lpr"
  2016-06-24 13:25 printing from within emacs, without having "lpr" martin.sputnik
@ 2016-06-25  0:09 ` Emanuel Berg
  2016-06-25  6:38   ` martin.sputnik
  0 siblings, 1 reply; 4+ messages in thread
From: Emanuel Berg @ 2016-06-25  0:09 UTC (permalink / raw)
  To: help-gnu-emacs

martin.sputnik@gmail.com writes:

> I can ``export'' buffers to the file system
> and then invoke print on the export, but it's
> not a dignified way

... why not?

> and I don't get much support

Perhaps not, but you can create it with
shell programming. Anything you like.

Here is an example (the second part of the
file, mostly).

    http://user.it.uu.se/~embe8573/conf/.zsh/printers

> (setq lpr-command "print")
>
> and changing the lpr-add-switches to avoid
> lpr-specifics there does not help. The message
> for M-x print-buffer is
>
> Usage: print [-a{1,2,3,4}] .... [-v] [file...]
> More information available from 'man print'.
>
> which perhaps indicates that the buffer
> I intended to print were now ``piped''
> correctly into the print commant.
>
> Any ideas what I could do? I think I found
> a way around the problem that print wants
> a password, that seems not the problem, but
> I wonder if fiddling with the lpr-command will
> do any good?

Even if it did, what will happen if the admins
put lpr back on line? Will you change all the
print stuff back?

No, it is much better to just not use the lpr
stuff while it is inoperational.

As for the print stuff, start by getting it to
work from the shell. Print text files and PDFs
for starters. When you have that, you can stop
to think how to have that invokable from Emacs
with the buffer data as input.

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 55 Blogomatic articles -                   


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

* Re: printing from within emacs, without having "lpr"
  2016-06-25  0:09 ` Emanuel Berg
@ 2016-06-25  6:38   ` martin.sputnik
  2016-06-25  9:27     ` Emanuel Berg
  0 siblings, 1 reply; 4+ messages in thread
From: martin.sputnik @ 2016-06-25  6:38 UTC (permalink / raw)
  To: help-gnu-emacs

On Saturday, June 25, 2016 at 2:09:19 AM UTC+2, Emanuel Berg wrote:

> ... why not?
> 

I meant, it'smore dignified to print a buffer directly from emacs (as it is intended  to be) as opposed to write to file, and then print from a shell or similar.


> > and I don't get much support
> 
> Perhaps not, but you can create it with
> shell programming. Anything you like.
> 

I guessed so, I thought perhaps there's a more direct way. 

And actually I solved it.

Very silly actually: the problem was: the new print command was "print". But it turned out not to be the ``real'' print command, it's a shell-script wrapper
for the real command "pushprint", perhaps print was deemed more "userfriendly" terminology. Unfortunately, the parameter passing does not work properly in the wrapper, which means, using "print" as "lpr-command" results in that the buffer content gets lost on the way  and is not printed. With pushprint it works (as long as I can avoid being asked for password).

Thanks.

Martin 


> Here is an example (the second part of the
> file, mostly).
> 
>     http://user.it.uu.se/~embe8573/conf/.zsh/printers
> 
> > (setq lpr-command "print")
> >
> > and changing the lpr-add-switches to avoid
> > lpr-specifics there does not help. The message
> > for M-x print-buffer is
> >
> > Usage: print [-a{1,2,3,4}] .... [-v] [file...]
> > More information available from 'man print'.
> >
> > which perhaps indicates that the buffer
> > I intended to print were now ``piped''
> > correctly into the print commant.
> >
> > Any ideas what I could do? I think I found
> > a way around the problem that print wants
> > a password, that seems not the problem, but
> > I wonder if fiddling with the lpr-command will
> > do any good?
> 
> Even if it did, what will happen if the admins
> put lpr back on line? Will you change all the
> print stuff back?
> 
> No, it is much better to just not use the lpr
> stuff while it is inoperational.
> 
> As for the print stuff, start by getting it to
> work from the shell. Print text files and PDFs
> for starters. When you have that, you can stop
> to think how to have that invokable from Emacs
> with the buffer data as input.
> 
> -- 
> underground experts united .... http://user.it.uu.se/~embe8573
> Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
>                    - so far: 55 Blogomatic articles -



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

* Re: printing from within emacs, without having "lpr"
  2016-06-25  6:38   ` martin.sputnik
@ 2016-06-25  9:27     ` Emanuel Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Emanuel Berg @ 2016-06-25  9:27 UTC (permalink / raw)
  To: help-gnu-emacs

martin.sputnik@gmail.com writes:

> I meant, it'smore dignified to print a buffer
> directly from emacs (as it is intended to be)
> as opposed to write to file, and then print
> from a shell or similar.

Both ways are fine ways to do it.

> Very silly actually: the problem was: the new
> print command was "print". But it turned out
> not to be the ``real'' print command,
> it's a shell-script wrapper for the real
> command "pushprint", perhaps print was deemed
> more "userfriendly" terminology.

Because 'print' is already often a built-in
shell command (similar to echo) *and* and
a symlink to a specific usage of mailcap
(run-mailcap), shadowing it with yet another
layer is bound to create confusion.

> Unfortunately, the parameter passing does not
> work properly in the wrapper, which means,
> using "print" as "lpr-command" results in
> that the buffer content gets lost on the way
> and is not printed. With pushprint it works
> (as long as I can avoid being asked for
> password).

Actually, the error message you got looked like
mailcap! If the admins didn't set up the
"pushprint" wrapper/alias in the -env file
(e.g., .zshenv for zsh; should be something
similar for bash) - if they didn't do that,
even tho "print" is "pushprint" in the shell,
it is still mailcap in Emacs!

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 55 Blogomatic articles -                   


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

end of thread, other threads:[~2016-06-25  9:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-24 13:25 printing from within emacs, without having "lpr" martin.sputnik
2016-06-25  0:09 ` Emanuel Berg
2016-06-25  6:38   ` martin.sputnik
2016-06-25  9:27     ` Emanuel Berg

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.