LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-31-2009, 01:42 PM   #1
blastradius
Member
 
Registered: Oct 2004
Location: Cheshire, England
Distribution: Debian Stable
Posts: 269

Rep: Reputation: 39
Emacs won't print!


Hi All

I'm running Fedora 12 (new to me as I was always Ubuntu until recently), I have an Epson SX115 which works ok with the 105 driver (scanner won't work though). All my programmes including Vim print fine but Emacs just says 'spooling done' and then nothing happens.

How do I get this to work, I'd actually worked all the way through the tutorial only to crash and burn when I tried to print.

Thanks

Eric
 
Old 01-01-2010, 09:40 AM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
I think you should do more debugging.

If the problem is emacs specific, then it will be a new bug
 
Old 01-02-2010, 03:25 PM   #3
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221

Rep: Reputation: 36
Quote:
Originally Posted by amani View Post
I think you should do more debugging.
Having myself just given the Emacs Printing Info manual a skim, it seems to me that if you are running on a Linux distribution that controls the default printer (i.e., what is printed to when the -P option is not specified to lpr), then that is where you need to look first, and to test first before you figure out what Emacs is, or is not, doing wrong. Perhaps you are running the GNOME Desktop or some other desktop such as KDE, and if so, then that would be the first place to look for anything involving Printing in its System Administration menus or equivalent.

But supposing that it is an Emacs configuration issue, I'll reply with a follow-up post in a bit with a more long-winded response since I wrote it up before I realized your issue probably is not an Emacs issue, per se., but that the long-winded answer would be of some use to others.

Do you know which version of Emacs you are running? What does M-x emacs-version show you?

bg
 
Old 01-02-2010, 03:38 PM   #4
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221

Rep: Reputation: 36
The wind-baggy long-in-the-tooth reply about Emacs printing

Quote:
Originally Posted by bgoodr View Post
But supposing that it is an Emacs configuration issue, I'll reply with a follow-up post in a bit with a more long-winded response since I wrote it up before I realized your issue probably is not an Emacs issue, per se., but that the long-winded answer would be of some use to others.
In the explanation below, I am spelling everything out since I have no clue as to your level of Emacs knowledge. I don't mean to insult you in any way, and besides, others that run across this thread with less knowledge might find it be of some use. The key sequences are in bold face below. Pardon the verbosity here.

Supposing that your issue is related to some Emacs configuration problem ...

For detailed info on printing done inside Emacs, do the following (See footnote [2] for the idiom I'm using for key sequences):
Inside Emacs, type C-h r to open up the Emacs Manual [1].

Then type s (no shift or control key, just the letter s), then the minibuffer prompt will popup at the bottom of the Emacs X window, at which point you need to type in a search phrase, and here type just print and hit the RETurn key. At this point you should be on the line:

Code:
* Printing::            Printing hardcopies of buffers or regions.
Your cursor (called "point" in Emacs parlance) should be blinking right on the second "i" in the word Printing above, which is handy (if it was not, you need to move the cursor until it is inside the highlighted and/or underlined Printing word which is a "link" to another manual page. Then hit the RETurn key to open up the Printing page.

You should see down in the middle of the page a discussion about lpr command-line switches for customization:

Code:
   The hardcopy commands (aside from the PostScript commands) pass extra
switches to the `lpr' program based on the value of the variable
`lpr-switches'.  Its value should be a list of strings, each string an
option starting with `-'.  For example, to specify a line width of 80
columns for all the printing you do in Emacs, set `lpr-switches' like
this:

     (setq lpr-switches '("-w80"))

   You can specify the printer to use by setting the variable
`printer-name'.
So the lpr-switches variable is one of the control points you will need to set. In my case, I had mine hardcoded to be:

Code:
(setq lpr-switches '("-Plpc23"))
You will need to set that to be some other printer other than "lpc23" in your case.

I suggest you learn how to use those Info pages, as they took a lot of energy and effort to write them up for the rest of us to benefit from, and by and large, they are complete and good.
If you used a key sequence to print the current buffer, identify what Emacs Lisp function is doing the printing for you, since that ultimately will call some print spooler like "lpr" or something else depending upon your configuration [5]. To find out the name of the Elisp function that is going to execute for a given key sequence in Emacs, type C-h k followed by the key sequence you typed in.

You can identify what version of Emacs you are running. You can do this by:
Type ESC x emacs-version RET (explanation: That means type ESC key, release it, type x, then release it, then type emacs-version, and then type the RETurn key). At this point, the message will show up at the bottom of the Emacs window in what is called the "minibuffer". To be able to cut and paste it into some other X window, you need to get into the *Messages* buffer which keeps a limited number of messages such as the one emitted from the emacs-version function called above. Type C-h e then you should see the *Messages* buffer shown in one of the "windows" inside Emacs. [6]

Code:
GNU Emacs 23.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.18.3) of 2009-12-05 on blitzed
My version will be different from yours since I build GNU Emacs from scratch.
Once you have the name of the function, you can find out more info about that function either by looking it up in the Emacs Manual (type C-h F print-buffer RET (notice that is a capital F, so hold down shift when typing it)), or its more detailed Elisp manual (C-h i d g (Elisp) RET s then type in the name of the function, and hit RET; note that print-buffer will not be discussed in the Elisp manual), or by examining any help documentation that is on the function itself. For the latter, type C-h f print-buffer RET to see the help doc for the print-buffer Elisp function.

Thanks,
bg

Footnotes:
  1. You might be running a Linux distribution which does not provide the Info pages all set up for you. Those Linux distributions make you install the Emacs and Elisp manuals separate from the application, which is an abomination, IMO, which leads some users (myself included) to always build GNU Emacs from top-of-trunk CVS source. See footnote [4].
  2. A key sequence such as C-h k followed means to hold down the CTRL key, then type in h, and then release both keys, and then type k key without any shift or control key held down. C-h C-k would be different in that you would hold down the CTRL key while typing in the k key.
  3. An explanation of how to use the Info manuals from inside Emacs is near the top of the first page you see when you type C-h i. (or hit the d key anytime you are inside the Info buffers), and then search down using the s key for the "Info" node, and then hit the RETurn key while the cursor is on it.
  4. If you are learning Emacs for the first time, you need to be very patient with yourself: Emacs has turned into its own operating system and is a very large and complex animal nowadays. But there will be a pot of gold at the end of the rainbow, as there are levels of efficiency that you can obtain in Emacs that you can't get in any other non-customizable editor (think: "I can have it my way").
  5. By configuration, that could be something the Linux distribution "did to" your Emacs, or it could be something you did to your own setup inside your .emacs.
  6. Emacs has a bit of history: It calls the outer X window a "frame", and the "windows" the divisions of those frames.
 
1 members found this post helpful.
Old 10-15-2012, 02:57 PM   #5
alanf01
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
printer-name

It's probably better to use the Emacs printer-name variable than the lpr-switches variable. It's more intuitive and more specific, and frees you to use lpr-switches for other purposes. If your printer was called abc, you would set the value of the printer-name variable to "abc".

To get there quickly, type "C-h v" to be prompted for a variable name to edit, then type "printer-name" (no quotes). At the bottom of the page, you'll see "You can customize this variable." The underlined word "customize" on that page is a link. Click it, and you'll be taken to a page that allows you to customize the variable. Click on the "Value Menu" button. Type the printer name (e.g., "abc") into the gray field to the right of the "Name:" prompt. Then click the "State" button and select "Save for future sessions".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alt no longer META key when using in-terminal option of Emacs (emacs -nw) frznchckn Linux - Software 1 06-02-2007 02:41 AM
where is the .emacs file in the emacs source code tarball? aizkorri Programming 2 01-13-2007 02:05 PM
LXer: Emacs tips: Cross-platform Emacs LXer Syndicated Linux News 0 08-16-2006 11:12 PM
emacs not responding to .emacs file in Mandriva 2005 LE. Please help LaptopLinux Mandriva 1 06-08-2005 08:36 AM
edb (emacs database) won't open file - emacs 20 & 21 tip184 Linux - Software 0 04-03-2004 07:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration