From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.devel Subject: Re: strange "feature" Date: Sun, 14 Oct 2012 07:59:02 +0200 Message-ID: References: <20121013162016.GA10794@Wes.ec.rr.com> <83r4p25mqn.fsf@gnu.org> <20121013194705.GA26873@Wes.ec.rr.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec501634b6300cf04cbfe9f03 X-Trace: ger.gmane.org 1350194373 20388 80.91.229.3 (14 Oct 2012 05:59:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Oct 2012 05:59:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tekk Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 14 07:59:41 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TNHEc-00080q-H4 for ged-emacs-devel@m.gmane.org; Sun, 14 Oct 2012 07:59:34 +0200 Original-Received: from localhost ([::1]:46799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNHEV-0005kP-NG for ged-emacs-devel@m.gmane.org; Sun, 14 Oct 2012 01:59:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNHET-0005kI-Eo for emacs-devel@gnu.org; Sun, 14 Oct 2012 01:59:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNHES-0005OR-1D for emacs-devel@gnu.org; Sun, 14 Oct 2012 01:59:25 -0400 Original-Received: from mail-vb0-f41.google.com ([209.85.212.41]:35085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNHER-0005OM-Rm for emacs-devel@gnu.org; Sun, 14 Oct 2012 01:59:23 -0400 Original-Received: by mail-vb0-f41.google.com with SMTP id v13so4892247vbk.0 for ; Sat, 13 Oct 2012 22:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=LhhArEAqmoqU76XW2QtkEn+Q1Ij0SYRSWgxmWe8KbbI=; b=QToPBZD0XOX0Z4UhC9vXK42ljZL05tnTJrm5jmNVczN/PCDA7wRihR6rOSpy+cMef4 l8uNwuUz09BwZ7/qQXDXW60Uss+wjFWJaXUWxL38x8w0iVmZTt2tWg001SPC9qoV1xNV C5CcbfgfATWb8vNp6I1s2CiIdiR7pqsOmephtAP+iP3UI+XFDSxE/I7ULeTXoDaqGvB5 NqDQBRj0I7NBoXA9pWMvrD/4qsxl7hVzrj6tRvG/GC6LE4qIaMSeVtP6nuZcr7EzSP3b QaA8v8yuNSyuSZArdjRynZzTvsPQQ/QSt0lH5iKFGFOurBkvD/Qr8u1tri8VDS5m8vW1 i+TQ== Original-Received: by 10.52.74.135 with SMTP id t7mr1032783vdv.18.1350194363039; Sat, 13 Oct 2012 22:59:23 -0700 (PDT) Original-Received: by 10.58.114.194 with HTTP; Sat, 13 Oct 2012 22:59:02 -0700 (PDT) In-Reply-To: <20121013194705.GA26873@Wes.ec.rr.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154322 Archived-At: --bcaec501634b6300cf04cbfe9f03 Content-Type: text/plain; charset=ISO-8859-1 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 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 > > > > > > 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 :) > > > --bcaec501634b6300cf04cbfe9f03 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Maybe you can use something like this:

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

=
When you have the PDF file open in Emacs, do M-x xdg-open RET. T= hen 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 c= ould make a more advanced command that checks for some common PDF applicati= ons and sends them the correct Print command, if available. An exercise for= the reader :)

/Mathias

On S= at, Oct 13, 2012 at 9:47 PM, Tekk <tekk@parlementum.net> = wrote:
On S= at, Oct 13, 2012 at 07:02:24PM +0200, Eli Zaretskii wrote:
> > Date: Sat, 13 Oct 2012 12:20:16 -0400
> > From: danny <danny@Wes.= ec.rr.com>
> >
> > 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 t= ry to
> > > print it it will happily
> > > print out a gazilion of text pages -- the pdf code. This beh= aviour
> > > 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 pd= f)?
> > > Immanuel
> > >
> > I've had issues with this "feature" as well, they k= eep me from printing most things in emacs. Does anyone at least know of a f= ix for this?(I think it's to do with docview not actually overriding th= e default print function)
>
> If this is on MS-Windows, you should be able to print a PDF file with<= br> > this Lisp one-liner:
>
> =A0 (w32-shell-execute "print" "/path/to/file.pdf"= )
>
> This will work assuming that you have some program installed that can<= br> > display and print PDF files, and that this program is associated with<= br> > 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 :)



--bcaec501634b6300cf04cbfe9f03--