Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing with emacs: Not working

8 views
Skip to first unread message

DaveLG526

unread,
Feb 26, 2009, 11:04:55 PM2/26/09
to
I have been using emacs for about a month and really like it.
It wasn't till today that I tried to print something. I see this
message but nothig i sever printed: Spooling with options (page
headers are not supported)...done.

I have a wireless HP 6988 printer. I have tried windows emacs and
emacs via my cygwin terminal with the same response. Documents can be
printed via windows notepad and gVim but I would rather not do it that
way.

I use both vista and xp machines and get the same issue.

Is there some setting I need to make?

Thanks..Dave

Jean Magnan de Bornier

unread,
Feb 27, 2009, 12:52:59 AM2/27/09
to
DaveLG526 <David.G...@gmail.com> wrote :

You have to set the value of "printer-name"
--
Jean

Lennart Borgman

unread,
Feb 27, 2009, 3:40:21 AM2/27/09
to Jean Magnan de Bornier, help-gn...@gnu.org

Eli Zaretskii

unread,
Feb 27, 2009, 5:37:51 AM2/27/09
to help-gn...@gnu.org
> Date: Fri, 27 Feb 2009 09:40:21 +0100
> From: Lennart Borgman <lennart...@gmail.com>
> Cc: help-gn...@gnu.org

>
> > You have to set the value of "printer-name"
>
> That does not necessarily help.

But does not necessarily fail, either. No need to discourage a fellow
Emacs users before they even tried.


rustom

unread,
Feb 27, 2009, 8:51:50 AM2/27/09
to
On Feb 27, 3:37 pm, Eli Zaretskii <e...@gnu.org> wrote:
> > Date: Fri, 27 Feb 2009 09:40:21 +0100
> > From: Lennart Borgman <lennart.borg...@gmail.com>
> > Cc: help-gnu-em...@gnu.org

>
> > > You have to set the value of "printer-name"
>
> > That does not necessarily help.
>
> But does not necessarily fail, either.  No need to discourage a fellow
> Emacs users before they even tried.

Well Setting up printing in windows from emacs can be an adventure
The settings that I have are these:

(require 'printing)
(setq printer-name "//network/path/to/printer")
(setq ps-printer-name t)
(setenv "GS_LIB" "D:/Program Files/gs/gs8.63/lib")
(setq ps-lpr-command "D:/Program Files/gs/gs8.63/bin/gswin32c.exe")
(setq ps-lpr-switches '( "-dNOPAUSE" "-dBATCH" "-sDEVICE=mswinpr2"))

and it seems to work (remember to modify your gs paths and network (or
otherwise) printer paths suitably)
The stuff associated with the require 'printing was completely
confusing to me and this worked only when I gave up on that. But this
(at least the ps-(B/W printing) only works with that included

Eli Zaretskii

unread,
Feb 27, 2009, 10:58:49 AM2/27/09
to help-gn...@gnu.org
> From: rustom <rusto...@gmail.com>
> Date: Fri, 27 Feb 2009 05:51:50 -0800 (PST)

>
> Well Setting up printing in windows from emacs can be an adventure
> The settings that I have are these:
>
> (require 'printing)
> (setq printer-name "//network/path/to/printer")
> (setq ps-printer-name t)
> (setenv "GS_LIB" "D:/Program Files/gs/gs8.63/lib")
> (setq ps-lpr-command "D:/Program Files/gs/gs8.63/bin/gswin32c.exe")
> (setq ps-lpr-switches '( "-dNOPAUSE" "-dBATCH" "-sDEVICE=mswinpr2"))

These are all described in the Emacs manual, AFAICS, except perhaps
the setenv part. Is it really needed?

I don't know why you needed `(require 'printing)', I don't see how it
could be necessary.


Lennart Borgman

unread,
Feb 27, 2009, 11:03:38 AM2/27/09
to Eli Zaretskii, help-gn...@gnu.org
On Fri, Feb 27, 2009 at 11:37 AM, Eli Zaretskii <el...@gnu.org> wrote:
>> Date: Fri, 27 Feb 2009 09:40:21 +0100
>> From: Lennart Borgman <lennart...@gmail.com>
>> Cc: help-gn...@gnu.org

>>
>> > You have to set the value of "printer-name"
>>
>> That does not necessarily help.
>
> But does not necessarily fail, either.  No need to discourage a fellow
> Emacs users before they even tried.

I did not try to discourage. As you know there is a very simple
solution: Use the web browser for printing. For details see the page
on EmacsWiki I pointed to.


B. T. Raven

unread,
Feb 27, 2009, 12:31:08 PM2/27/09
to

It's certainly much easier to get something out of Emacs and down in
black and white (color too) using printing through the browser rather
than through ghost-script. Virtually every w32 user has a browser but
very many don't have ghost-script installed. I think that I once had the
latter method working since I have lines similar to rustom's commented
out in my .emacs. To get printing through Firefox all I had to do was
download:

hfyview.el
htmlfontify.el

These are in my emacs/lisp directory but they could probably go in
emacs/emacs-lisp instead, where the other piece of the puzzle,
easymenu.el resides.

Then add to .emacs:

(require 'hfyview)

After restarting (or maybe just rereading .emacs) a new item appears in
the File menu:

Quick Printing (Using Web Browser)

Ed

Lennart Borgman

unread,
Feb 27, 2009, 1:13:43 PM2/27/09
to B. T. Raven, help-gn...@gnu.org

Yes, that setup is right. If you use nXhtml it does that for you.
Otherwise you can find the latest hfyfview.el and htmlfontify.el in
the nXhtml repository. (Or, at the moment it is not the latest
htmlfontify.el, I forgot to add that. Will add it.)


Eli Zaretskii

unread,
Feb 27, 2009, 1:15:13 PM2/27/09
to help-gn...@gnu.org
> Date: Fri, 27 Feb 2009 11:31:08 -0600
> From: "B. T. Raven" <ni...@nihilo.net>

>
> It's certainly much easier to get something out of Emacs and down in
> black and white (color too) using printing through the browser rather
> than through ghost-script. Virtually every w32 user has a browser but
> very many don't have ghost-script installed.

If your printer supports PostScript, you don't need Ghostscript.


Lennart Borgman

unread,
Feb 27, 2009, 1:20:22 PM2/27/09
to Eli Zaretskii, help-gn...@gnu.org
On Fri, Feb 27, 2009 at 7:15 PM, Eli Zaretskii <el...@gnu.org> wrote:
>> Date: Fri, 27 Feb 2009 11:31:08 -0600
>> From: "B. T. Raven" <ni...@nihilo.net>
>>
>> It's certainly much easier to get something out of Emacs and down in
>> black and white (color too) using printing through the browser rather
>> than through ghost-script. Virtually every w32 user has a browser but
>> very many don't have ghost-script installed.
>
> If your printer supports PostScript, you don't need Ghostscript.

You also need to be able to set the printer in PostScript mode by
default. This is not always possible.


DaveLG526

unread,
Feb 27, 2009, 1:44:25 PM2/27/09
to
On Feb 27, 2:37 am, Eli Zaretskii <e...@gnu.org> wrote:
> > Date: Fri, 27 Feb 2009 09:40:21 +0100
> > From: Lennart Borgman <lennart.borg...@gmail.com>
> > Cc: help-gnu-em...@gnu.org

>
> > > You have to set the value of "printer-name"
>
> > That does not necessarily help.
>
> But does not necessarily fail, either.  No need to discourage a fellow
> Emacs users before they even tried.

Thanks for all the good suggestions and different ways to attack the
issue. I will be trying them out over the weekend. I have downloaded
and installed all the ghostscript etc files but the web browser
method seems attractive as it seem simple. It would probably also work
on both a Windows (XP and Vista) as well as my Ubunto netbook.

One other question. When you need to set the value of "printer name"
where does one find the "printer name" in windows XP. Is it the name
given to the printer in the Windows XP printer control panel or the
Port Name in the printers Advanced properties menu.

Regards..Dave

Eli Zaretskii

unread,
Feb 27, 2009, 4:36:34 PM2/27/09
to help-gn...@gnu.org
> From: DaveLG526 <David.G...@gmail.com>
> Date: Fri, 27 Feb 2009 10:44:25 -0800 (PST)

>
> One other question. When you need to set the value of "printer name"
> where does one find the "printer name" in windows XP. Is it the name
> given to the printer in the Windows XP printer control panel or the
> Port Name in the printers Advanced properties menu.

Not necessarily. The node "Windows Printing" in the Emacs manual
gives advice on how to find out this name.


Eli Zaretskii

unread,
Feb 27, 2009, 4:37:29 PM2/27/09
to help-gn...@gnu.org
> Date: Fri, 27 Feb 2009 19:20:22 +0100

> From: Lennart Borgman <lennart...@gmail.com>
> Cc: help-gn...@gnu.org
>
> On Fri, Feb 27, 2009 at 7:15 PM, Eli Zaretskii <el...@gnu.org> wrote:
> >> Date: Fri, 27 Feb 2009 11:31:08 -0600
> >> From: "B. T. Raven" <ni...@nihilo.net>
> >>
> >> It's certainly much easier to get something out of Emacs and down in
> >> black and white (color too) using printing through the browser rather
> >> than through ghost-script. Virtually every w32 user has a browser but
> >> very many don't have ghost-script installed.
> >
> > If your printer supports PostScript, you don't need Ghostscript.
>
> You also need to be able to set the printer in PostScript mode by
> default. This is not always possible.

That's got to be fairly rare, because I have yet to see such a
situation.


Lennart Borgman

unread,
Feb 27, 2009, 4:48:34 PM2/27/09
to Eli Zaretskii, help-gn...@gnu.org
On Fri, Feb 27, 2009 at 10:37 PM, Eli Zaretskii <el...@gnu.org> wrote:
>> Date: Fri, 27 Feb 2009 19:20:22 +0100

>> From: Lennart Borgman <lennart...@gmail.com>
>> Cc: help-gn...@gnu.org
>>
>> On Fri, Feb 27, 2009 at 7:15 PM, Eli Zaretskii <el...@gnu.org> wrote:
>> >> Date: Fri, 27 Feb 2009 11:31:08 -0600
>> >> From: "B. T. Raven" <ni...@nihilo.net>
>> >>
>> >> It's certainly much easier to get something out of Emacs and down in
>> >> black and white (color too) using printing through the browser rather
>> >> than through ghost-script. Virtually every w32 user has a browser but
>> >> very many don't have ghost-script installed.
>> >
>> > If your printer supports PostScript, you don't need Ghostscript.
>>
>> You also need to be able to set the printer in PostScript mode by
>> default. This is not always possible.
>
> That's got to be fairly rare, because I have yet to see such a
> situation.


I think your memory is failing you. You and I have had a long
discussion over this on Emacs Devel. You gave me varying instructions
that you thought would help. I know they would not, but to convince
you I followed the instructions.

And they did not work in this particular case.


Eli Zaretskii

unread,
Feb 27, 2009, 4:58:37 PM2/27/09
to help-gn...@gnu.org
> Date: Fri, 27 Feb 2009 22:48:34 +0100

> From: Lennart Borgman <lennart...@gmail.com>
> Cc: help-gn...@gnu.org
>
> >> You also need to be able to set the printer in PostScript mode by
> >> default. This is not always possible.
> >
> > That's got to be fairly rare, because I have yet to see such a
> > situation.
>
>
> I think your memory is failing you.

Not in this case. I said _I_ have yet to see such a situation. I
remember you telling me about your case, but that's you. I myself
have never encountered such a printer, in my 30+ years of experience
in several large organizations.

I'm not saying these situations do not exist, I'm saying that they are
rare. Why can't you accept that?


Lennart Borgman

unread,
Feb 27, 2009, 5:14:59 PM2/27/09
to Eli Zaretskii, help-gn...@gnu.org
On Fri, Feb 27, 2009 at 10:58 PM, Eli Zaretskii <el...@gnu.org> wrote:
>> Date: Fri, 27 Feb 2009 22:48:34 +0100

>> From: Lennart Borgman <lennart...@gmail.com>
>> Cc: help-gn...@gnu.org
>>
>> >> You also need to be able to set the printer in PostScript mode by
>> >> default. This is not always possible.
>> >
>> > That's got to be fairly rare, because I have yet to see such a
>> > situation.
>>
>>
>> I think your memory is failing you.
>
> Not in this case.  I said _I_ have yet to see such a situation.  I
> remember you telling me about your case, but that's you.  I myself
> have never encountered such a printer, in my 30+ years of experience
> in several large organizations.
>
> I'm not saying these situations do not exist, I'm saying that they are
> rare.  Why can't you accept that?

I thought you said you had not heard of any such case, sorry. I for
sure know you have not seen them where you are. Maybe that is a good
indication that they are rare, but I actually doubt that. You know
that better than me, maybe you have been working on very many
different places.


Joe Fineman

unread,
Feb 27, 2009, 8:24:21 PM2/27/09
to
DaveLG526 <David.G...@gmail.com> writes:

> I have been using emacs for about a month and really like it. It
> wasn't till today that I tried to print something. I see this
> message but nothig i sever printed: Spooling with options (page
> headers are not supported)...done.

I Am Not A Programmer. I have gotten so consistently frustrated
trying to make lpr-buffer, lpr-region, tex-buffer, & tex-print work
that I have resorted to the following workarounds:

(defun lprl (r/b)
"Print all or part of buffer with TeX literal mode."
(interactive "cr(egion) or b(uffer)?")
(save-window-excursion
(let ((passage (if (equal r/b ?r)
(buffer-substring (region-beginning) (region-end))
(buffer-substring (point-min) (point-max)))))
(find-file "/usr/own/f/hdwe/printer/hp/Lpr-scratch.tex")
(delete-region (point-min) (point-max))
(insert-file "~/tex/Tex-literal-hdr")
(goto-char (point-max))
(insert passage)
(goto-char (point-max))
(insert-file "~/tex/Tex-literal-ftr")
(untabify (point-min) (point-max))
(goto-char (point-min))
(replace-regexp "\e.\\|\C-r" "")
(save-buffer)
(shell-command "latex /usr/own/f/hdwe/printer/hp/Lpr-scratch.tex") ;Doesn't understand tilde
(shell-command "dvips -f /usr/own/f/hdwe/printer/hp/Lpr-scratch.dvi | gsprint - color - ")
)))

----------------------------------------------------------------------
Tex-literal-hdr:
\documentclass[12pt]{article}
\pagestyle{empty}
\setlength{\oddsidemargin}{-.25in}
\setlength{\topmargin}{-.75in}
\setlength{\textheight}{9.5in}
\setlength{\textwidth}{7in}
----------------------------------------------------------------------
Tex-literal-ftr:
\end{verbatim}

\end{document}
----------------------------------------------------------------------

\begin{document}
\setlength{\baselineskip}{.1667in}
\noindent
\begin{verbatim}

(defun lprt ()
"Print the TeX file in the current buffer."
(interactive)
(save-window-excursion
(let ((file (buffer-string)))
(find-file "~/hdwe/printer/hp/Lpr-scratch.tex")
(delete-region (point-min) (point-max))
(insert file))
(save-buffer)
(shell-command "latex /usr/own/f/hdwe/printer/hp/Lpr-scratch.tex") ;Doesn't understand tilde
(shell-command "dvips -f /usr/own/f/hdwe/printer/hp/Lpr-scratch.dvi | gsprint - color - ")
))
--
--- Joe Fineman jo...@verizon.net

||: First you go to hell, then your body rots, and then you die. :||

rustom

unread,
Feb 28, 2009, 2:38:03 AM2/28/09
to
On Feb 27, 8:58 pm, Eli Zaretskii <e...@gnu.org> wrote:
> > From: rustom <rustompm...@gmail.com>

Strange!
Yesterday I commented out the require line and the postscript print
buffer(B+W) stopped working
Today its again working with the line commented out.
As for the GS_LIB -- got it from http://www.emacswiki.org/cgi-bin/wiki/PrintingFromEmacs
but yes its also probably not needed (so much for the content of the
wiki :-)

DaveLG526

unread,
Mar 1, 2009, 2:26:39 PM3/1/09
to
On Feb 27, 9:31 am, "B. T. Raven" <ni...@nihilo.net> wrote:
> Lennart Borgman wrote:
> > On Fri, Feb 27, 2009 at 11:37 AM, Eli Zaretskii <e...@gnu.org> wrote:
> >>> Date: Fri, 27 Feb 2009 09:40:21 +0100
> >>> From: Lennart Borgman <lennart.borg...@gmail.com>
> >>> Cc: help-gnu-em...@gnu.org

Well I gave it a try but I must be missing something as a new Item
does not appear in the emacs File menu and no printing occurs.

Here is my .emacs file:

(require 'hfyview)


;;Org-mode settings
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-font-lock-mode 1)

This is the version of emacs I am using now.
This is GNU Emacs 23.0.91.1 (i386-mingw-nt5.1.2600)
of 2009-02-26 on LENNART-69DE564 (patched)

I will keep investigating this. I like the org application in Emacs
too but occasionally need to print.

Thanks..dave

Lennart Borgman

unread,
Mar 1, 2009, 4:01:22 PM3/1/09
to DaveLG526, help-gn...@gnu.org
> Well I gave it a try but I must be missing something as a new Item
> does not appear in the emacs File menu and no printing occurs.
>
> Here is my .emacs file:
>
> (require 'hfyview)

See the beginning of the file hfyview.el.


DaveLG526

unread,
Mar 1, 2009, 11:04:40 PM3/1/09
to

(require 'hfyview)

(require 'easymenu)

(require 'htmlfontify)

;;Org-mode settings
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-font-lock-mode 1)


========================================
This is from my hfyview.el . With the hfyview-quick-print-in-files-
menu t
line thought this would add the menu items but no luck so far.

I have the hffview.el file in my lisp folder under EmacsW32 diretory.
My .emacs file is in the EmacsW32 directoty.

From hfyview.el
===============================================================


(defcustom hfyview-quick-print-in-files-menu t)
"Add Quick print entries to File menu if non-nil.
If you set this to nil you have to restart Emacs to get rid of
the Quick Print entry."
:type 'boolean
:set (lambda (sym val)
(set-default sym val)
(if val
(hfyview-add-to-files-menu)))
:group 'hfy-view)

(defvar hfyview-print-visible t
"Non-nil means show Quick Print entry on the file menu.")

===============================================================


Maybe my emacs file is not being read on startup..still investigating
that.

Regards.. Dave

0 new messages