emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange "feature"


From: Mathias Dahl
Subject: Re: strange "feature"
Date: Sun, 14 Oct 2012 07:59:02 +0200

Maybe you can use something like this:

(defun xdg-open (file)
 "Open FILE in its default application."
  (interactive "fSelect file: ")
  (shell-command 
   (format 
    "xdg-open %s" 
    (shell-quote-argument (expand-file-name file)))))

When you have the PDF file open in Emacs, do M-x xdg-open RET. Then just arrow down to get the file name of the PDF open in Emacs, and RET. Then print from the default PDF application that opens. I'm sure one could make a more advanced command that checks for some common PDF applications and sends them the correct Print command, if available. An exercise for the reader :)

/Mathias

On Sat, Oct 13, 2012 at 9:47 PM, Tekk <address@hidden> wrote:
On Sat, Oct 13, 2012 at 07:02:24PM +0200, Eli Zaretskii wrote:
> > Date: Sat, 13 Oct 2012 12:20:16 -0400
> > From: danny <address@hidden>
> >
> > On Sat, Oct 13, 2012 at 04:58:27PM +0200, immanuel litzroth wrote:
> > > Opening a pdf file in emacs works really well. If you then try to
> > > print it it will happily
> > > print out a gazilion of text pages -- the pdf code. This behaviour
> > > seems strange in that is
> > > is almost certainly not what the user wants (he can
> > > find-file-literally and print that).
> > > I'm on emacs 23.3.1.
> > > Is there a way to print the pdf directly from emacs (as a pdf)?
> > > Immanuel
> > >
> > I've had issues with this "feature" as well, they keep me from printing most things in emacs. Does anyone at least know of a fix for this?(I think it's to do with docview not actually overriding the default print function)
>
> If this is on MS-Windows, you should be able to print a PDF file with
> this Lisp one-liner:
>
>   (w32-shell-execute "print" "/path/to/file.pdf")
>
> This will work assuming that you have some program installed that can
> display and print PDF files, and that this program is associated with
> the .PDF extension.
>
No, sorry; I'm on debian. Also sorry for the bad from: line before, I thought that mutt would automatically pick up my smtp stuff but apparently not :)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]