GNU bug report logs - #4377
allow one to still choose xpdf instead of doc-view

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Tue, 8 Sep 2009 18:35:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4377 in the body.
You can then email your comments to 4377 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Tue, 08 Sep 2009 18:35:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to jidanni <at> jidanni.org:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 08 Sep 2009 18:35:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: jidanni <at> jidanni.org
To: yamaoka <at> jpl.org
Cc: emacs-w3m <at> namazu.org, emacs-pretest-bug <at> gnu.org
Subject: allow one to still choose xpdf instead of doc-view
Date: Wed, 09 Sep 2009 02:28:42 +0800
My god, that's tons and tons of lisp to add to one's .emacs file, just
to say "I wish to have emacs still call xpdf when encountering a .pdf
file, like back before they introduced doc-view".

I'm filing an emacs-pretest-bug so they will make it easier to allow one
to choose if one wants doc-view, or stick with xpdf.

>>>>> "KY" == Katsumi Yamaoka <yamaoka <at> jpl.org> writes:

>>>>> jidanni <at> jidanni.org wrote:

>> The only way to get xpdf called on them is via dired-do-shell-command,
>> which knows about xpdf.

KY> Is what you want the one like this?


KY> (defadvice dired-view-file (around use-xpdf activate)
KY>   "Use xpdf to view a pdf file."
KY>   (unless (let ((file (dired-get-file-for-visit)))
KY> 	    (and (not (file-directory-p file))
KY> 		 (let ((case-fold-search t))
KY> 		   (string-match "\\.pdf\\'" file))
KY> 		 (prog1
KY> 		     t
KY> 		   (call-process "xpdf" nil nil nil file))))
KY>     ad-do-it))


KY> The `v' key in the dired buffer uses xpdf to display a file iff
KY> its extension is ".pdf".

KY> Otherwise,


KY> (autoload 'mailcap-parse-mailcaps "mailcap" nil t)
KY> (autoload 'mm-mailcap-command "mm-decode")
KY> (defadvice dired-view-file (around use-mailcap-mime-data activate)
KY>   "Use an external viewer to view a file according to `mailcap-mime-data'."
KY>   (unless (let ((file (dired-get-file-for-visit))
KY> 		extension type command)
KY> 	    (and (not (file-directory-p file))
KY> 		 (progn
KY> 		   (mailcap-parse-mailcaps)
KY> 		   (setq extension (file-name-extension file)))
KY> 		 (setq type (mailcap-extension-to-mime extension))
KY> 		 (setq command (mailcap-mime-info type))
KY> 		 (setq command (mm-mailcap-command command file nil))
KY> 		 (prog1
KY> 		     t
KY> 		   (shell-command command))))
KY>     ad-do-it))


KY> There will be other ELisp packages that use external viewers.
KY> `gnus-dired-find-file-mailcap' is it, though it may not be your
KY> taste.



Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Sun, 13 Sep 2009 02:10:05 GMT) Full text and rfc822 format available.

Notification sent to jidanni <at> jidanni.org:
bug acknowledged by developer. (Sun, 13 Sep 2009 02:10:05 GMT) Full text and rfc822 format available.

Message #10 received at 4377-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: jidanni <at> jidanni.org
Cc: yamaoka <at> jpl.org, 4377-done <at> debbugs.gnu.org
Subject: Re: allow one to still choose xpdf instead of doc-view
Date: Sat, 12 Sep 2009 22:06:11 -0400
> My god, that's tons and tons of lisp to add to one's .emacs file, just
> to say "I wish to have emacs still call xpdf when encountering a .pdf
> file, like back before they introduced doc-view".

One line solution:

(setq auto-mode-alist (rassq-delete-all 'doc-view-mode auto-mode-alist))



Message #11 received at 4377-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: jidanni <at> jidanni.org
To: cyd <at> stupidchicken.com
Cc: yamaoka <at> jpl.org, 4377-done <at> debbugs.gnu.org
Subject: Re: allow one to still choose xpdf instead of doc-view
Date: Sun, 13 Sep 2009 10:40:02 +0800
>>>>> "CY" == Chong Yidong <cyd <at> stupidchicken.com> writes:
>> My god, that's tons and tons of lisp to add to one's .emacs file, just
>> to say "I wish to have emacs still call xpdf when encountering a .pdf
>> file, like back before they introduced doc-view".

CY> One line solution:

CY> (setq auto-mode-alist (rassq-delete-all 'doc-view-mode auto-mode-alist))

No.
This only cause the file to appear as binary gibberish.

Please provide the complete solution that will allow:
v and browse-url-of-dired-file in dired to invoke xpdf on the file.
! in dired suggest xpdf.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Sun, 13 Sep 2009 15:20:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 13 Sep 2009 15:20:05 GMT) Full text and rfc822 format available.

Message #16 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: 4377 <at> debbugs.gnu.org
Cc: Chong Yidong <cyd <at> stupidchicken.com>, jidanni <at> jidanni.org, yamaoka <at> jpl.org
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Sun, 13 Sep 2009 16:10:39 +0100
On 2009-09-13 03:10 +0100, Emacs bug Tracking System wrote:
>> My god, that's tons and tons of lisp to add to one's .emacs file,
>> just to say "I wish to have emacs still call xpdf when encountering a
>> .pdf file, like back before they introduced doc-view".
>
> One line solution:
>
> (setq auto-mode-alist (rassq-delete-all 'doc-view-mode auto-mode-alist))

I wonder if it is better not to include doc-view-mode in
auto-mode-alist. Personally, I can't think of an occasion that I would
like doc-view mode to view my pdf files except, perhaps, to brag about
Emacs's capability.

I have this in .emacs for a while.

  (defalias 'doc-view-mode 'ignore)

Leo



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Sun, 13 Sep 2009 15:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to jidanni <at> jidanni.org:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 13 Sep 2009 15:30:04 GMT) Full text and rfc822 format available.

Message #21 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: jidanni <at> jidanni.org
To: sdl.web <at> gmail.com
Cc: 4377 <at> debbugs.gnu.org, cyd <at> stupidchicken.com, yamaoka <at> jpl.org
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Sun, 13 Sep 2009 23:21:00 +0800
>>>>> "L" == Leo  <sdl.web <at> gmail.com> writes:
L>   (defalias 'doc-view-mode 'ignore)
OK, but what else are needed to make
v and browse-url-of-dired-file in dired to invoke xpdf on the file,
and emacs-w3m call xpdf on http://...pdf and file:///...pdf?



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Mon, 14 Sep 2009 01:40:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 14 Sep 2009 01:40:08 GMT) Full text and rfc822 format available.

Message #26 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo <sdl.web <at> gmail.com>
Cc: 4377 <at> debbugs.gnu.org, Chong Yidong <cyd <at> stupidchicken.com>,
        yamaoka <at> jpl.org, jidanni <at> jidanni.org
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Sun, 13 Sep 2009 21:31:15 -0400
>>> My god, that's tons and tons of lisp to add to one's .emacs file,
>>> just to say "I wish to have emacs still call xpdf when encountering a
>>> .pdf file, like back before they introduced doc-view".
>> One line solution:
>> (setq auto-mode-alist (rassq-delete-all 'doc-view-mode auto-mode-alist))

Is it really a solution?  The OP's problem seems to be that he wants
xpdf to be run, but the above will only replace doc-view-mode with
fundamental-mode, right?

> I wonder if it is better not to include doc-view-mode in
> auto-mode-alist.  Personally, I can't think of an occasion that
> I would like doc-view mode to view my pdf files except, perhaps, to
> brag about Emacs's capability.

Is it really better to show the actual underlying PDF file's code in
fundamental-mode?  If you don't want to view PDF files in Emacs, than
don't open them in Emacs.


        Stefan



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Mon, 14 Sep 2009 07:20:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tassilo Horn <tassilo <at> member.fsf.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 14 Sep 2009 07:20:04 GMT) Full text and rfc822 format available.

Message #31 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Tassilo Horn <tassilo <at> member.fsf.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 4377 <at> debbugs.gnu.org, Leo <sdl.web <at> gmail.com>,
        Chong Yidong <cyd <at> stupidchicken.com>, yamaoka <at> jpl.org,
        jidanni <at> jidanni.org
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Mon, 14 Sep 2009 09:13:26 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> I wonder if it is better not to include doc-view-mode in
>> auto-mode-alist.  Personally, I can't think of an occasion that I
>> would like doc-view mode to view my pdf files except, perhaps, to
>> brag about Emacs's capability.
>
> Is it really better to show the actual underlying PDF file's code in
> fundamental-mode?  If you don't want to view PDF files in Emacs, than
> don't open them in Emacs.

IMO, there should be some command in dired to open a file with an
external program.  The `!' command is not appropriate here, cause it
blocks emacs till the command finishes.  I have this code in my .emacs
for that (and bound it to `e' in dired-mode-map):

--8<---------------cut here---------------start------------->8---
(defun th-dired-find-file-externally (arg)
  "Open file or directory with an external application.
If ARG is given use `xdg-open', else query for an app."
  (interactive "P")
  (let ((file (dired-get-file-for-visit)))
    (start-process "dired-external"
                   nil
                   (if arg
                       "xdg-open"
                     (completing-read "Command: "
                                      th-external-command-list))
                   file)))
--8<---------------cut here---------------end--------------->8---

th-external-command-list is a list of all executables in PATH, which I
use in several places.  I think that could be taken out.  A default
value with the appropriate external app taken from mailcap could be
used instead.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Mon, 14 Sep 2009 15:35:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 14 Sep 2009 15:35:05 GMT) Full text and rfc822 format available.

Message #36 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Tassilo Horn <tassilo <at> member.fsf.org>
Cc: 4377 <at> debbugs.gnu.org, Leo <sdl.web <at> gmail.com>,
        Chong Yidong <cyd <at> stupidchicken.com>, yamaoka <at> jpl.org,
        jidanni <at> jidanni.org
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Mon, 14 Sep 2009 11:27:45 -0400
>> Is it really better to show the actual underlying PDF file's code in
>> fundamental-mode?  If you don't want to view PDF files in Emacs, than
>> don't open them in Emacs.

> IMO, there should be some command in dired to open a file with an
> external program.

But there is, it's bound to "&".


        Stefan



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Mon, 14 Sep 2009 18:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tassilo Horn <tassilo <at> member.fsf.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 14 Sep 2009 18:15:04 GMT) Full text and rfc822 format available.

Message #41 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Tassilo Horn <tassilo <at> member.fsf.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 4377 <at> debbugs.gnu.org, Leo <sdl.web <at> gmail.com>,
        Chong Yidong <cyd <at> stupidchicken.com>, yamaoka <at> jpl.org,
        jidanni <at> jidanni.org
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Mon, 14 Sep 2009 20:09:38 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>>> Is it really better to show the actual underlying PDF file's code in
>>> fundamental-mode?  If you don't want to view PDF files in Emacs,
>>> than don't open them in Emacs.
>
>> IMO, there should be some command in dired to open a file with an
>> external program.
>
> But there is, it's bound to "&".

Wow, how could I miss that?  It's not in the "Operate" menu, but it
definitively should!

Dired is one of the few modes where I rely on the menu bar.

Bye,
Tassilo



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Tue, 15 Sep 2009 12:25:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to James Cloos <cloos <at> jhcloos.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 15 Sep 2009 12:25:07 GMT) Full text and rfc822 format available.

Message #46 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: James Cloos <cloos <at> jhcloos.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 4377 <at> debbugs.gnu.org, Leo <sdl.web <at> gmail.com>,
        Chong Yidong <cyd <at> stupidchicken.com>, yamaoka <at> jpl.org,
        jidanni <at> jidanni.org
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Mon, 14 Sep 2009 10:55:21 -0400
>>>>> "Stefan" == Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

Stefan> Is it really better to show the actual underlying PDF file's
Stefan> code in fundamental-mode?  If you don't want to view PDF files
Stefan> in Emacs, than don't open them in Emacs.

There are occasions were editing a PDF in a text editor is needed.
Emacs should not make that difficult to do.

-JimC
-- 
James Cloos <cloos <at> jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Tue, 15 Sep 2009 13:40:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 15 Sep 2009 13:40:06 GMT) Full text and rfc822 format available.

Message #51 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: James Cloos <cloos <at> jhcloos.com>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 4377 <at> debbugs.gnu.org,
        Leo <sdl.web <at> gmail.com>, yamaoka <at> jpl.org, jidanni <at> jidanni.org
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Tue, 15 Sep 2009 09:31:39 -0400
James Cloos <cloos <at> jhcloos.com> writes:

> Stefan> Is it really better to show the actual underlying PDF file's
> Stefan> code in fundamental-mode?  If you don't want to view PDF files
> Stefan> in Emacs, than don't open them in Emacs.
>
> There are occasions were editing a PDF in a text editor is needed.
> Emacs should not make that difficult to do.

The command find-file-literally is for such situations.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Tue, 15 Sep 2009 19:35:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tassilo Horn <tassilo <at> member.fsf.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 15 Sep 2009 19:35:05 GMT) Full text and rfc822 format available.

Message #56 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Tassilo Horn <tassilo <at> member.fsf.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 4377 <at> debbugs.gnu.org, James Cloos <cloos <at> jhcloos.com>,
        yamaoka <at> jpl.org, jidanni <at> jidanni.org, Leo <sdl.web <at> gmail.com>
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Tue, 15 Sep 2009 21:25:13 +0200
Chong Yidong <cyd <at> stupidchicken.com> writes:

> James Cloos <cloos <at> jhcloos.com> writes:
>
>> Stefan> Is it really better to show the actual underlying PDF file's
>> Stefan> code in fundamental-mode?  If you don't want to view PDF files
>> Stefan> in Emacs, than don't open them in Emacs.
>>
>> There are occasions were editing a PDF in a text editor is needed.
>> Emacs should not make that difficult to do.
>
> The command find-file-literally is for such situations.

And `C-c C-c' in doc-view will switch to fundamental-mode, too.  With
another `C-c C-c' you can jump back to doc-view and directly view the
changes you made.

Bye,
Tassilo



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4377; Package emacs. (Wed, 16 Sep 2009 01:10:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 16 Sep 2009 01:10:05 GMT) Full text and rfc822 format available.

Message #61 received at 4377 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: James Cloos <cloos <at> jhcloos.com>, 4377 <at> debbugs.gnu.org,
        Leo <sdl.web <at> gmail.com>, yamaoka <at> jpl.org, jidanni <at> jidanni.org
Subject: Re: bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
Date: Tue, 15 Sep 2009 21:01:17 -0400
> James Cloos <cloos <at> jhcloos.com> writes:
Stefan> Is it really better to show the actual underlying PDF file's
Stefan> code in fundamental-mode?  If you don't want to view PDF files
Stefan> in Emacs, than don't open them in Emacs.
>> 
>> There are occasions were editing a PDF in a text editor is needed.
>> Emacs should not make that difficult to do.

> The command find-file-literally is for such situations.

You don't even need that: as the message in the echo-area explains, you
can simply hit C-c C-c to toggle between viewing the document or viewing
the underlying PDF code.


        Stefan



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Wed, 14 Oct 2009 14:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.