* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf @ 2009-01-25 23:09 ` Drew Adams 2009-01-28 8:25 ` bug#2058: marked as done (23.0.60; bewildering behavior when visit new file throw.pdf) Emacs bug Tracking System 0 siblings, 1 reply; 14+ messages in thread From: Drew Adams @ 2009-01-25 23:09 UTC (permalink / raw To: emacs-pretest-bug emacs -Q I did C-x C-f throw.pdf, with no existing file throw.pdf. The ensuing messages and interaction were bewildering. An extremely long message appeared in the echo area: "No image (png) support available or some conversion utility for pdf files is missing. Type C-c C-c to switch to an editing mode or C-c C-t to open a buffer showing the doc as text." But the new, empty file throw.pdf appeared to be visited with no problem. I tried to type into it. That threw me back to the previous buffer I had been in (Dired), and crazy error msgs were displayed. I tried again, and this time I tried to type `C-c C-t', since the message indicated that that would open the buffer as text. That too led to errors. I don't know exactly what happened, but you will, as soon as you try it. ;-) This is the *Messages* buffer: -----------8<-------------------- For information about GNU Emacs and the GNU system, type C-h C-a. (New file) Wrote c:/DOCUME~1/dradams/LOCALS~1/Temp/docview19729/throw.pdf No image (png) support available or some conversion utility for pdf files is missing. Type C-c C-c to switch to an editing mode or C-c C-t to open a buffer showing the doc as text. Error during redisplay: (wrong-type-argument numberp nil) [2 times] Quit [3 times] (New file) Wrote c:/DOCUME~1/dradams/LOCALS~1/Temp/docview19729/throw.pdf No image (png) support available or some conversion utility for pdf files is missing. Type C-c C-c to switch to an editing mode or C-c C-t to open a buffer showing the doc as text. Error during redisplay: (wrong-type-argument numberp nil) [5 times] Quit [3 times] (New file) Wrote c:/DOCUME~1/dradams/LOCALS~1/Temp/docview19729/throw.pdf No image (png) support available or some conversion utility for pdf files is missing. Type C-c C-c to switch to an editing mode or C-c C-t to open a buffer showing the doc as text. Error during redisplay: (wrong-type-argument numberp nil) [4 times] DocView: process pdf->txt changed status to exited abnormally with code 1 . Error during redisplay: (wrong-type-argument numberp nil) [5 times] QuitError during redisplay: (wrong-type-argument numberp nil) [2 times] Error during redisplay: (wrong-type-argument numberp nil) [5 times] -----------8<-------------------- [Note too that it shows that a temporary file was written.] In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2009-01-04 on LENNART-69DE564 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include -fno-crossjumping' ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: marked as done (23.0.60; bewildering behavior when visit new file throw.pdf) 2009-01-25 23:09 ` bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf Drew Adams @ 2009-01-28 8:25 ` Emacs bug Tracking System 0 siblings, 0 replies; 14+ messages in thread From: Emacs bug Tracking System @ 2009-01-28 8:25 UTC (permalink / raw To: Tassilo Horn [-- Attachment #1: Type: text/plain, Size: 862 bytes --] Your message dated Wed, 28 Jan 2009 09:18:55 +0100 with message-id <87ab9bzvv4.fsf@thinkpad.tsdh.de> and subject line Closing that bug has caused the Emacs bug report #2058, regarding 23.0.60; bewildering behavior when visit new file throw.pdf 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.) -- 2058: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2058 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems [-- Attachment #2: Type: message/rfc822, Size: 5290 bytes --] From: "Drew Adams" <drew.adams@oracle.com> To: <emacs-pretest-bug@gnu.org> Subject: 23.0.60; bewildering behavior when visit new file throw.pdf Date: Sun, 25 Jan 2009 15:09:19 -0800 Message-ID: <004c01c97f41$f45cbd10$0200a8c0@us.oracle.com> emacs -Q I did C-x C-f throw.pdf, with no existing file throw.pdf. The ensuing messages and interaction were bewildering. An extremely long message appeared in the echo area: "No image (png) support available or some conversion utility for pdf files is missing. Type C-c C-c to switch to an editing mode or C-c C-t to open a buffer showing the doc as text." But the new, empty file throw.pdf appeared to be visited with no problem. I tried to type into it. That threw me back to the previous buffer I had been in (Dired), and crazy error msgs were displayed. I tried again, and this time I tried to type `C-c C-t', since the message indicated that that would open the buffer as text. That too led to errors. I don't know exactly what happened, but you will, as soon as you try it. ;-) This is the *Messages* buffer: -----------8<-------------------- For information about GNU Emacs and the GNU system, type C-h C-a. (New file) Wrote c:/DOCUME~1/dradams/LOCALS~1/Temp/docview19729/throw.pdf No image (png) support available or some conversion utility for pdf files is missing. Type C-c C-c to switch to an editing mode or C-c C-t to open a buffer showing the doc as text. Error during redisplay: (wrong-type-argument numberp nil) [2 times] Quit [3 times] (New file) Wrote c:/DOCUME~1/dradams/LOCALS~1/Temp/docview19729/throw.pdf No image (png) support available or some conversion utility for pdf files is missing. Type C-c C-c to switch to an editing mode or C-c C-t to open a buffer showing the doc as text. Error during redisplay: (wrong-type-argument numberp nil) [5 times] Quit [3 times] (New file) Wrote c:/DOCUME~1/dradams/LOCALS~1/Temp/docview19729/throw.pdf No image (png) support available or some conversion utility for pdf files is missing. Type C-c C-c to switch to an editing mode or C-c C-t to open a buffer showing the doc as text. Error during redisplay: (wrong-type-argument numberp nil) [4 times] DocView: process pdf->txt changed status to exited abnormally with code 1 . Error during redisplay: (wrong-type-argument numberp nil) [5 times] QuitError during redisplay: (wrong-type-argument numberp nil) [2 times] Error during redisplay: (wrong-type-argument numberp nil) [5 times] -----------8<-------------------- [Note too that it shows that a temporary file was written.] In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2009-01-04 on LENNART-69DE564 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include -fno-crossjumping' [-- Attachment #3: Type: message/rfc822, Size: 1848 bytes --] From: Tassilo Horn <tassilo@member.fsf.org> To: 2058-close@emacsbugs.donarmstrong.com Subject: Closing that bug Date: Wed, 28 Jan 2009 09:18:55 +0100 Message-ID: <87ab9bzvv4.fsf@thinkpad.tsdh.de> Hi all, I'm closing that bug, cause I think doc-view does TRT now. If you don't agree, please drop me a mail... Bye, Tassilo ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <mailman.5816.1232925816.26697.bug-gnu-emacs@gnu.org>]
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf [not found] <mailman.5816.1232925816.26697.bug-gnu-emacs@gnu.org> @ 2009-01-27 9:55 ` Tassilo Horn 2009-01-27 12:02 ` Alan Mackenzie ` (2 more replies) 0 siblings, 3 replies; 14+ messages in thread From: Tassilo Horn @ 2009-01-27 9:55 UTC (permalink / raw To: Drew Adams; +Cc: emacs-pretest-bug, 2058 "Drew Adams" <drew.adams@oracle.com> writes: Hi Drew, > emacs -Q > > I did C-x C-f throw.pdf, with no existing file throw.pdf. The ensuing > messages and interaction were bewildering. Is that really a use-case? > An extremely long message appeared in the echo area: > "No image (png) support available or some conversion utility for pdf > files is missing. Type C-c C-c to switch to an editing mode or C-c > C-t to open a buffer showing the doc as text." > > But the new, empty file throw.pdf appeared to be visited with no > problem. I tried to type into it. That threw me back to the previous > buffer I had been in (Dired), and crazy error msgs were displayed. The buffer was in doc-view-mode which has its own keymap, and most probably you've hit k or q, which kills/buries the buffer. > I tried again, and this time I tried to type `C-c C-t', since the > message indicated that that would open the buffer as text. That too > led to errors. Yeah, in the background it tries to run pdftotext on the pdf, to extract the plain text contents. > I don't know exactly what happened, but you will, as soon as you try > it. ;-) Sure. So what's your advice how to handle this situation? Check if the file is existent (and non-empty) and if not, print a message and fallback to fundamental mode? Bye, Tassilo ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 9:55 ` bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf Tassilo Horn @ 2009-01-27 12:02 ` Alan Mackenzie 2009-01-27 12:43 ` Tassilo Horn 2009-01-27 15:44 ` Drew Adams 2009-01-27 22:58 ` Richard M Stallman 2 siblings, 1 reply; 14+ messages in thread From: Alan Mackenzie @ 2009-01-27 12:02 UTC (permalink / raw To: Tassilo Horn, 2058; +Cc: emacs-pretest-bug Hi, Tassilo, On Tue, Jan 27, 2009 at 10:55:40AM +0100, Tassilo Horn wrote: > "Drew Adams" <drew.adams@oracle.com> writes: > Hi Drew, > > emacs -Q > > I did C-x C-f throw.pdf, with no existing file throw.pdf. The ensuing > > messages and interaction were bewildering. > Is that really a use-case? No, it's an error case. The user wanted to visit throw.ldf, which is a text based document format used only in his own company. But he mistyped it. He also knows nothing about png images, and really doesn't want to have to learn. > > An extremely long message appeared in the echo area: > > "No image (png) support available or some conversion utility for pdf > > files is missing. Type C-c C-c to switch to an editing mode or C-c > > C-t to open a buffer showing the doc as text." It's particularly long and confusing for a non-existent document. Emacs shouldn't alarm users. > > But the new, empty file throw.pdf appeared to be visited with no > > problem. I tried to type into it. That threw me back to the previous > > buffer I had been in (Dired), and crazy error msgs were displayed. > The buffer was in doc-view-mode which has its own keymap, and most > probably you've hit k or q, which kills/buries the buffer. What on earth is doc-view-mode? Hmm. C-h f doc-view-mode <CR>. ;-( > > I tried again, and this time I tried to type `C-c C-t', since the > > message indicated that that would open the buffer as text. That too > > led to errors. > Yeah, in the background it tries to run pdftotext on the pdf, to extract > the plain text contents. > > I don't know exactly what happened, but you will, as soon as you try > > it. ;-) > Sure. So what's your advice how to handle this situation? Check if the > file is existent (and non-empty) and if not, print a message and > fallback to fundamental mode? Whatever is done, don't force the poor bewildered user to make a decision. Perform whatever error handling is appropriate and display a message, and let her get out without further ado. "... to switch to an editing mode " is particularly bad. It should be less vague, stating the mode (text mode?). "... to open a buffer showing the doc as text" would be better as "to show the doc as text". > Bye, > Tassilo -- Alan Mackenzie (Nürnberg, Germany). ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 12:02 ` Alan Mackenzie @ 2009-01-27 12:43 ` Tassilo Horn 2009-01-27 14:42 ` Alan Mackenzie 0 siblings, 1 reply; 14+ messages in thread From: Tassilo Horn @ 2009-01-27 12:43 UTC (permalink / raw To: Alan Mackenzie; +Cc: emacs-pretest-bug, 2058 Alan Mackenzie <acm@muc.de> writes: Hi Alan, >> > I did C-x C-f throw.pdf, with no existing file throw.pdf. The >> > ensuing messages and interaction were bewildering. > >> Is that really a use-case? > > No, it's an error case. The user wanted to visit throw.ldf, which is > a text based document format used only in his own company. But he > mistyped it. He also knows nothing about png images, and really > doesn't want to have to learn. But how should I know that. The best I can do is to handle non-existing and empty files. >> > But the new, empty file throw.pdf appeared to be visited with no >> > problem. I tried to type into it. That threw me back to the previous >> > buffer I had been in (Dired), and crazy error msgs were displayed. > >> The buffer was in doc-view-mode which has its own keymap, and most >> probably you've hit k or q, which kills/buries the buffer. > > What on earth is doc-view-mode? Hmm. C-h f doc-view-mode <CR>. ;-( Emacs 23. >> Sure. So what's your advice how to handle this situation? Check if >> the file is existent (and non-empty) and if not, print a message and >> fallback to fundamental mode? > > Whatever is done, don't force the poor bewildered user to make a > decision. Perform whatever error handling is appropriate and display > a message, and let her get out without further ado. The message is no problem, but what to do with the open request. Open the (presumably) mistyped file in fundamental-mode? > "... to switch to an editing mode " is particularly bad. It should be > less vague, stating the mode (text mode?). Well, it's ps-mode for PostScript files and fundamental-mode for PDF and DVI files. Making that explicit would enlarge the message even more... > "... to open a buffer showing the doc as text" would be better as "to > show the doc as text". Will be fixed as soon as I come to it. Bye, Tassilo ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 12:43 ` Tassilo Horn @ 2009-01-27 14:42 ` Alan Mackenzie 2009-01-27 14:46 ` Tassilo Horn 2009-01-27 16:03 ` Tassilo Horn 0 siblings, 2 replies; 14+ messages in thread From: Alan Mackenzie @ 2009-01-27 14:42 UTC (permalink / raw To: Tassilo Horn; +Cc: emacs-pretest-bug, 2058 Hi, Tassilo, On Tue, Jan 27, 2009 at 01:43:46PM +0100, Tassilo Horn wrote: > Alan Mackenzie <acm@muc.de> writes: > Hi Alan, > >> > I did C-x C-f throw.pdf, with no existing file throw.pdf. The > >> > ensuing messages and interaction were bewildering. > >> Is that really a use-case? > > No, it's an error case. The user wanted to visit throw.ldf, which is > > a text based document format used only in his own company. But he > > mistyped it. He also knows nothing about png images, and really > > doesn't want to have to learn. > But how should I know that. The best I can do is to handle non-existing > and empty files. Does an empty/non-existent file have any meaning in this mode? Is doc-view-mode an editing mode as well as a viewing mode? > >> > But the new, empty file throw.pdf appeared to be visited with no > >> > problem. I tried to type into it. That threw me back to the previous > >> > buffer I had been in (Dired), and crazy error msgs were displayed. > >> The buffer was in doc-view-mode which has its own keymap, and most > >> probably you've hit k or q, which kills/buries the buffer. > > What on earth is doc-view-mode? Hmm. C-h f doc-view-mode <CR>. ;-( > Emacs 23. Yes, I know. :-) I was looking at the doc string in doc-view.el from 2009-01-05. Here's the output from that C-h f: doc-view-mode is an interactive autoloaded Lisp function in `doc-view.el'. (doc-view-mode) Major mode in DocView buffers. You can use Uses keymap "doc-view-mode-map", which is not currently defined. M-x doc-view-toggle-display to toggle between displaying the document or editing it as text. Uses keymap "doc-view-mode-map", which is not currently defined. It doesn't work well before the `doc-view-mode-map' keymap is loaded. But mainly, it doesn't say at all what doc-view-mode is for. Could you maybe put something about the mode's purpose into the doc string? Possibly this comment from doc-view.el: ;; DocView is a document viewer for Emacs. It converts PDF, PS and DVI files ;; to a set of PNG files, one PNG for each page, and displays the PNG images ;; inside an Emacs buffer. This buffer uses `doc-view-mode' which provides ;; convenient key bindings for browsing the document. , or more succinctly: Doc View Mode is an Emacs document viewer. It displays PDF, PS and DVI files (as PNG images) in Emacs buffers. > >> Sure. So what's your advice how to handle this situation? Check if > >> the file is existent (and non-empty) and if not, print a message and > >> fallback to fundamental mode? > > Whatever is done, don't force the poor bewildered user to make a > > decision. Perform whatever error handling is appropriate and display > > a message, and let her get out without further ado. > The message is no problem, but what to do with the open request. Open > the (presumably) mistyped file in fundamental-mode? That's more or less what the .gzip mode (can't remember it's exact name) does - it displays the raw unintelligible file. > > "... to switch to an editing mode " is particularly bad. It should be > > less vague, stating the mode (text mode?). > Well, it's ps-mode for PostScript files and fundamental-mode for PDF and > DVI files. Making that explicit would enlarge the message even more... Er, "... to switch to ps-mode" and "... to switch to fundamental mode" are shorter. Surely you can determine the exact prompt at run time? > > "... to open a buffer showing the doc as text" would be better as "to > > show the doc as text". > Will be fixed as soon as I come to it. > Bye, > Tassilo Bis später! -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 14:42 ` Alan Mackenzie @ 2009-01-27 14:46 ` Tassilo Horn 2009-01-27 16:03 ` Tassilo Horn 1 sibling, 0 replies; 14+ messages in thread From: Tassilo Horn @ 2009-01-27 14:46 UTC (permalink / raw To: Alan Mackenzie; +Cc: emacs-pretest-bug, 2058 Alan Mackenzie <acm@muc.de> writes: Hi Alan, >> But how should I know that. The best I can do is to handle >> non-existing and empty files. > > Does an empty/non-existent file have any meaning in this mode? No, they'll break it as Drew pointed out. > Is doc-view-mode an editing mode as well as a viewing mode? Only viewing, although you can toggle between viewing in doc-view-mode and editing (fundamental-mode or ps-mode with doc-view-minor-mode) with C-c C-c. >> > What on earth is doc-view-mode? Hmm. C-h f doc-view-mode <CR>. ;-( > >> Emacs 23. > > Yes, I know. :-) I was looking at the doc string in doc-view.el from > 2009-01-05. Here's the output from that C-h f: > > doc-view-mode is an interactive autoloaded Lisp function in > `doc-view.el'. > > (doc-view-mode) > > Major mode in DocView buffers. > You can use > Uses keymap "doc-view-mode-map", which is not currently defined. > M-x doc-view-toggle-display to > toggle between displaying the document or editing it as text. > > Uses keymap "doc-view-mode-map", which is not currently defined. > > It doesn't work well before the `doc-view-mode-map' keymap is loaded. > But mainly, it doesn't say at all what doc-view-mode is for. Could you > maybe put something about the mode's purpose into the doc string? > Possibly this comment from doc-view.el: > > ;; DocView is a document viewer for Emacs. It converts PDF, PS and DVI files > ;; to a set of PNG files, one PNG for each page, and displays the PNG images > ;; inside an Emacs buffer. This buffer uses `doc-view-mode' which provides > ;; convenient key bindings for browsing the document. > > , or more succinctly: > > Doc View Mode is an Emacs document viewer. It displays PDF, PS and > DVI files (as PNG images) in Emacs buffers. Yes, I'll fix that. The current doc-string is really awful. ;-) >> >> Sure. So what's your advice how to handle this situation? Check if >> >> the file is existent (and non-empty) and if not, print a message and >> >> fallback to fundamental mode? > >> > Whatever is done, don't force the poor bewildered user to make a >> > decision. Perform whatever error handling is appropriate and display >> > a message, and let her get out without further ado. > >> The message is no problem, but what to do with the open request. Open >> the (presumably) mistyped file in fundamental-mode? > > That's more or less what the .gzip mode (can't remember it's exact name) > does - it displays the raw unintelligible file. Ok, I will make it so. >> > "... to switch to an editing mode " is particularly bad. It should be >> > less vague, stating the mode (text mode?). > >> Well, it's ps-mode for PostScript files and fundamental-mode for PDF and >> DVI files. Making that explicit would enlarge the message even more... > > Er, "... to switch to ps-mode" and "... to switch to fundamental mode" > are shorter. Surely you can determine the exact prompt at run time? Thanks for your confidence in me. But yes, it can be done easily. ;-) > Bis später! Jawollja! ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 14:42 ` Alan Mackenzie 2009-01-27 14:46 ` Tassilo Horn @ 2009-01-27 16:03 ` Tassilo Horn 2009-01-27 16:20 ` Drew Adams ` (2 more replies) 1 sibling, 3 replies; 14+ messages in thread From: Tassilo Horn @ 2009-01-27 16:03 UTC (permalink / raw To: Alan Mackenzie; +Cc: emacs-pretest-bug, 2058 Hi Alan & Drew, I've made some changes: - I enhanced the docstring to mention what doc-view actually is. - If the file doesn't exist or is empty, then we fallback to ps-mode or fundamental-mode, depending on the file name extension - If the images cannot be displayed (no png support, missing conversion utility, tty frame), then the message is more explicit. Now it says to which mode C-c C-c would switch, the C-c C-t message was enhanced according to Alan's suggestion and it mentions `k' which kills the buffer and stops a possibly running conversion. Please check if those changes DTRT, or if something is still too crappy to be released with 23.1. Bye, Tassilo ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 16:03 ` Tassilo Horn @ 2009-01-27 16:20 ` Drew Adams 2009-01-28 8:48 ` Kevin Rodgers [not found] ` <mailman.6064.1233133417.26697.bug-gnu-emacs@gnu.org> 2 siblings, 0 replies; 14+ messages in thread From: Drew Adams @ 2009-01-27 16:20 UTC (permalink / raw To: 'Tassilo Horn', 'Alan Mackenzie'; +Cc: emacs-pretest-bug, 2058 Thanks, Tassilo. I can't check it, but I'm sure it's much better. Thx - Drew > Hi Alan & Drew, > > I've made some changes: > > - I enhanced the docstring to mention what doc-view actually is. > > - If the file doesn't exist or is empty, then we fallback to ps-mode > or fundamental-mode, depending on the file name extension > > - If the images cannot be displayed (no png support, missing > conversion utility, tty frame), then the message is more explicit. > Now it says to which mode C-c C-c would switch, the C-c > C-t message > was enhanced according to Alan's suggestion and it mentions `k' > which kills the buffer and stops a possibly running conversion. > > Please check if those changes DTRT, or if something is still > too crappy to be released with 23.1. ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 16:03 ` Tassilo Horn 2009-01-27 16:20 ` Drew Adams @ 2009-01-28 8:48 ` Kevin Rodgers [not found] ` <mailman.6064.1233133417.26697.bug-gnu-emacs@gnu.org> 2 siblings, 0 replies; 14+ messages in thread From: Kevin Rodgers @ 2009-01-28 8:48 UTC (permalink / raw To: bug-gnu-emacs; +Cc: emacs-pretest-bug Tassilo Horn wrote: > Hi Alan & Drew, > > I've made some changes: > > - I enhanced the docstring to mention what doc-view actually is. > > - If the file doesn't exist or is empty, then we fallback to ps-mode > or fundamental-mode, depending on the file name extension Why not do something like (let ((auto-mode-alist (remq (rassq 'doc-view-mode auto-mode-alist) auto-mode-alist))) (normal-mode)) > - If the images cannot be displayed (no png support, missing > conversion utility, tty frame), then the message is more explicit. > Now it says to which mode C-c C-c would switch, the C-c C-t message > was enhanced according to Alan's suggestion and it mentions `k' > which kills the buffer and stops a possibly running conversion. -- Kevin Rodgers Denver, Colorado, USA ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <mailman.6064.1233133417.26697.bug-gnu-emacs@gnu.org>]
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf [not found] ` <mailman.6064.1233133417.26697.bug-gnu-emacs@gnu.org> @ 2009-01-28 20:28 ` Tassilo Horn 0 siblings, 0 replies; 14+ messages in thread From: Tassilo Horn @ 2009-01-28 20:28 UTC (permalink / raw To: Kevin Rodgers; +Cc: emacs-pretest-bug, bug-gnu-emacs, 2058 Kevin Rodgers <kevin.d.rodgers@gmail.com> writes: Hi Kevin, >> - If the file doesn't exist or is empty, then we fallback to ps-mode >> or fundamental-mode, depending on the file name extension > > Why not do something like > > (let ((auto-mode-alist (remq (rassq 'doc-view-mode auto-mode-alist) > auto-mode-alist))) > (normal-mode)) Yes, that's better. I'll change that. Bye, Tassilo -- Windows: So easy to admin, even a worm can do it. ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 9:55 ` bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf Tassilo Horn 2009-01-27 12:02 ` Alan Mackenzie @ 2009-01-27 15:44 ` Drew Adams 2009-01-27 22:58 ` Richard M Stallman 2 siblings, 0 replies; 14+ messages in thread From: Drew Adams @ 2009-01-27 15:44 UTC (permalink / raw To: 'Tassilo Horn'; +Cc: emacs-pretest-bug, 2058 Hi Tassilo and Alan, The discussion so far has already covered pretty much everything: - it's typically a user-error case, not a use case - the message is too long (probably for all cases - my guess) - the message is too complex and inappropriate for this error case > Sure. So what's your advice how to handle this situation? > Check if the file is existent (and non-empty) and if not, print a message and > fallback to fundamental mode? Yes, I think so. Dunno if doc-view handles an existing empty file - I'd guess not. If it does not then there are two error cases here: (1) a new, empty buffer and (2) an existing empty file. It would be good to treat each of these error cases specially: differently from the normal doc-view bad-PDF error intended by the current message. In both of these cases, the buffer should not be put in doc-view mode, but just kicked into fundamental mode with an error message. The message should not assume the user knows anything about doc view or PDF files. It should just point out that the file (a) doesn't exist or (b) is empty. An alternative would be not to visit the empty file at all - just display an error. But there might be a (marginal) use case for letting the user edit the file in some non-doc-view mode (e.g. fundamental) and even save it. FWIW, I came upon this by trying to create a few phony files to do some Dired, shell etc. testing with. I wanted files (not just buffers) with different, recognized extensions, and I didn't want to take the time to find real PDF files etc. and copy them. Yes, I could have created files with a different extension (*.el, *.txt) and then renamed them, but I didn't. ;-) Another case is what happens if a user visits a non-empty text file named foo.pdf? Again, the buffer should be put in fundamental mode and an error message raised. The message should say that *.pdf is associated with doc-view mode, but this is not a well-formed PDF file. IOW, the not-valid-PDF message must make sense also to a user unfamiliar with images. If you want to give additional info about the invalid PDF in the case of a normal bad-PDF file, then consider giving first such a short message, but mention that the user can hit some key for more information. When s?he hits that key, pop up a buffer with the detailed diagnosis for the bad PDF. FYI - I filed a similar bug for image file: #2077. ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 9:55 ` bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf Tassilo Horn 2009-01-27 12:02 ` Alan Mackenzie 2009-01-27 15:44 ` Drew Adams @ 2009-01-27 22:58 ` Richard M Stallman 2009-01-28 7:45 ` Tassilo Horn 2 siblings, 1 reply; 14+ messages in thread From: Richard M Stallman @ 2009-01-27 22:58 UTC (permalink / raw To: Tassilo Horn, 2058; +Cc: 2058 > I did C-x C-f throw.pdf, with no existing file throw.pdf. The ensuing > messages and interaction were bewildering. Is that really a use-case? Sure. It is not very useful, but why give a misleading and inaccurate error message? It would be better to do (message "Empty file is not a real PDF file") ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf 2009-01-27 22:58 ` Richard M Stallman @ 2009-01-28 7:45 ` Tassilo Horn 0 siblings, 0 replies; 14+ messages in thread From: Tassilo Horn @ 2009-01-28 7:45 UTC (permalink / raw To: rms; +Cc: 2058 Richard M Stallman <rms@gnu.org> writes: Hi Richard, > > I did C-x C-f throw.pdf, with no existing file throw.pdf. The ensuing > > messages and interaction were bewildering. > > Is that really a use-case? > > Sure. It is not very useful, but why give a misleading and inaccurate > error message? It would be better to do Now I switch to `fundamental-mode' for empty or non-existing PDF/DVI files and to `ps-mode' for empty or non-existing PS files. I think this is appropriate. Bye, Tassilo ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2009-01-28 20:28 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <87ab9bzvv4.fsf@thinkpad.tsdh.de> 2009-01-25 23:09 ` bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf Drew Adams 2009-01-28 8:25 ` bug#2058: marked as done (23.0.60; bewildering behavior when visit new file throw.pdf) Emacs bug Tracking System [not found] <mailman.5816.1232925816.26697.bug-gnu-emacs@gnu.org> 2009-01-27 9:55 ` bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf Tassilo Horn 2009-01-27 12:02 ` Alan Mackenzie 2009-01-27 12:43 ` Tassilo Horn 2009-01-27 14:42 ` Alan Mackenzie 2009-01-27 14:46 ` Tassilo Horn 2009-01-27 16:03 ` Tassilo Horn 2009-01-27 16:20 ` Drew Adams 2009-01-28 8:48 ` Kevin Rodgers [not found] ` <mailman.6064.1233133417.26697.bug-gnu-emacs@gnu.org> 2009-01-28 20:28 ` Tassilo Horn 2009-01-27 15:44 ` Drew Adams 2009-01-27 22:58 ` Richard M Stallman 2009-01-28 7:45 ` Tassilo Horn
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.