unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
       [not found] ` <878wgpb89x.fsf@jidanni.org>
@ 2009-09-13  2:10   ` Emacs bug Tracking System
  2009-09-13 15:10     ` Leo
  0 siblings, 1 reply; 11+ messages in thread
From: Emacs bug Tracking System @ 2009-09-13  2:10 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

Your message dated Sat, 12 Sep 2009 22:06:11 -0400
with message-id <87skerbnu4.fsf@cyd.mit.edu>
and subject line Re: allow one to still choose xpdf instead of doc-view
has caused the Emacs bug report #4377,
regarding allow one to still choose xpdf instead of doc-view
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4377: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4377
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3949 bytes --]

From: jidanni@jidanni.org
To: yamaoka@jpl.org
Cc: emacs-w3m@namazu.org, emacs-pretest-bug@gnu.org
Subject: allow one to still choose xpdf instead of doc-view
Date: Wed, 09 Sep 2009 02:28:42 +0800
Message-ID: <878wgpb89x.fsf@jidanni.org>

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@jpl.org> writes:

>>>>> jidanni@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.


[-- Attachment #3: Type: message/rfc822, Size: 1350 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: jidanni@jidanni.org
Cc: yamaoka@jpl.org, 4377-done@emacsbugs.donarmstrong.com
Subject: Re: allow one to still choose xpdf instead of doc-view
Date: Sat, 12 Sep 2009 22:06:11 -0400
Message-ID: <87skerbnu4.fsf@cyd.mit.edu>

> 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))

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
  2009-09-13  2:10   ` bug#4377: marked as done (allow one to still choose xpdf instead of doc-view) Emacs bug Tracking System
@ 2009-09-13 15:10     ` Leo
  2009-09-13 15:21       ` jidanni
                         ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Leo @ 2009-09-13 15:10 UTC (permalink / raw)
  To: 4377; +Cc: Chong Yidong, yamaoka, jidanni

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
  2009-09-13 15:10     ` Leo
@ 2009-09-13 15:21       ` jidanni
  2009-09-14  1:31       ` Stefan Monnier
       [not found]       ` <mailman.6626.1252892829.2239.bug-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 11+ messages in thread
From: jidanni @ 2009-09-13 15:21 UTC (permalink / raw)
  To: sdl.web; +Cc: 4377, cyd, yamaoka

>>>>> "L" == Leo  <sdl.web@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?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
  2009-09-13 15:10     ` Leo
  2009-09-13 15:21       ` jidanni
@ 2009-09-14  1:31       ` Stefan Monnier
  2009-09-14 14:55         ` James Cloos
       [not found]       ` <mailman.6626.1252892829.2239.bug-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2009-09-14  1:31 UTC (permalink / raw)
  To: Leo; +Cc: 4377, Chong Yidong, yamaoka, jidanni

>>> 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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
       [not found]       ` <mailman.6626.1252892829.2239.bug-gnu-emacs@gnu.org>
@ 2009-09-14  7:13         ` Tassilo Horn
  2009-09-14 15:27           ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Tassilo Horn @ 2009-09-14  7:13 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4377, Chong Yidong, jidanni, Leo, yamaoka

Stefan Monnier <monnier@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
  2009-09-14  1:31       ` Stefan Monnier
@ 2009-09-14 14:55         ` James Cloos
  2009-09-15 13:31           ` Chong Yidong
       [not found]           ` <mailman.6712.1253022430.2239.bug-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 11+ messages in thread
From: James Cloos @ 2009-09-14 14:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4377, Chong Yidong, jidanni, Leo, yamaoka

>>>>> "Stefan" == Stefan Monnier <monnier@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@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
  2009-09-14  7:13         ` Tassilo Horn
@ 2009-09-14 15:27           ` Stefan Monnier
  2009-09-14 18:09             ` Tassilo Horn
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2009-09-14 15:27 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: 4377, Chong Yidong, jidanni, Leo, yamaoka

>> 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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
  2009-09-14 15:27           ` Stefan Monnier
@ 2009-09-14 18:09             ` Tassilo Horn
  0 siblings, 0 replies; 11+ messages in thread
From: Tassilo Horn @ 2009-09-14 18:09 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4377, Chong Yidong, jidanni, Leo, yamaoka

Stefan Monnier <monnier@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
  2009-09-14 14:55         ` James Cloos
@ 2009-09-15 13:31           ` Chong Yidong
  2009-09-16  1:01             ` Stefan Monnier
       [not found]           ` <mailman.6712.1253022430.2239.bug-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 11+ messages in thread
From: Chong Yidong @ 2009-09-15 13:31 UTC (permalink / raw)
  To: James Cloos; +Cc: 4377, yamaoka, jidanni, Leo

James Cloos <cloos@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
       [not found]           ` <mailman.6712.1253022430.2239.bug-gnu-emacs@gnu.org>
@ 2009-09-15 19:25             ` Tassilo Horn
  0 siblings, 0 replies; 11+ messages in thread
From: Tassilo Horn @ 2009-09-15 19:25 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 4377, yamaoka, Leo, jidanni

Chong Yidong <cyd@stupidchicken.com> writes:

> James Cloos <cloos@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4377: marked as done (allow one to still choose xpdf instead of doc-view)
  2009-09-15 13:31           ` Chong Yidong
@ 2009-09-16  1:01             ` Stefan Monnier
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2009-09-16  1:01 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 4377, yamaoka, Leo, jidanni

> James Cloos <cloos@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-09-16  1:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87skerbnu4.fsf@cyd.mit.edu>
     [not found] ` <878wgpb89x.fsf@jidanni.org>
2009-09-13  2:10   ` bug#4377: marked as done (allow one to still choose xpdf instead of doc-view) Emacs bug Tracking System
2009-09-13 15:10     ` Leo
2009-09-13 15:21       ` jidanni
2009-09-14  1:31       ` Stefan Monnier
2009-09-14 14:55         ` James Cloos
2009-09-15 13:31           ` Chong Yidong
2009-09-16  1:01             ` Stefan Monnier
     [not found]           ` <mailman.6712.1253022430.2239.bug-gnu-emacs@gnu.org>
2009-09-15 19:25             ` Tassilo Horn
     [not found]       ` <mailman.6626.1252892829.2239.bug-gnu-emacs@gnu.org>
2009-09-14  7:13         ` Tassilo Horn
2009-09-14 15:27           ` Stefan Monnier
2009-09-14 18:09             ` Tassilo Horn

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).