Re: Putting auto-image-file-mode in Options menu

2005-03-28 Thread Richard Stallman
The case where image-mode isn't equivalent is where you use `insert-file' to insert an image -- auto-image-file will cause the inserted text to be covered with the image, but image-mode won't do anything (unless the user invokes it afterwards, and then it will only work if the i

Re: Putting auto-image-file-mode in Options menu

2005-03-28 Thread Richard Stallman
On MS-Windows, auto-image-mode helps me view image files for which no standard viewer comes with the OS. PPM images are a case in point. Is the new image-mode feature a satisfactory replacement? I think it ought to be. If not, why not? ___ Em

Re: auto-compression-mode (was: Putting auto-image-file-mode in Options menu)

2005-03-28 Thread Richard Stallman
What was the outcome? Can we turn `auto-compression-mode' on by default? I don't know yet. I am trying it nowadays. ___ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel

Re: Putting auto-image-file-mode in Options menu

2005-03-28 Thread Eli Zaretskii
> Date: Tue, 29 Mar 2005 05:44:04 +0900 > From: Miles Bader <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED], emacs-devel@gnu.org, [EMAIL PROTECTED], > [EMAIL PROTECTED] > > On Mon, 28 Mar 2005 11:25:29 -0500, Richard Stallman <[EMAIL PROTECTED]> > wrote: > > BTW, shouldn't "image-file.el" (

Re: Putting auto-image-file-mode in Options menu

2005-03-28 Thread Miles Bader
On Mon, 28 Mar 2005 11:25:29 -0500, Richard Stallman <[EMAIL PROTECTED]> wrote: > BTW, shouldn't "image-file.el" (the source file for `auto-image-mode') > be moved to lisp/obsolete, now that image-mode is preferred? > > I don't know if it is totally obsolete. Does anyone think it isn't?

Re: Putting auto-image-file-mode in Options menu

2005-03-28 Thread Richard Stallman
BTW, shouldn't "image-file.el" (the source file for `auto-image-mode') be moved to lisp/obsolete, now that image-mode is preferred? I don't know if it is totally obsolete. Does anyone think it isn't? ___ Emacs-devel mailing list Emacs-devel@gn

auto-compression-mode (was: Putting auto-image-file-mode in Options menu)

2005-03-27 Thread Juri Linkov
> Can't this program just set the find-file-literally variable to t? > That will prevent auto-compression-mode from trying to compress the > contents > when you save. > > I will see if that works. What was the outcome? Can we turn `auto-compression-mode' on by default? -- Juri Link

Re: Putting auto-image-file-mode in Options menu

2005-03-26 Thread Miles Bader
BTW, shouldn't "image-file.el" (the source file for `auto-image-mode') be moved to lisp/obsolete, now that image-mode is preferred? [I can move it if you like; doing that would help me test some changes in the file addition/deletion code in my arch-CVS sync scripts... :-] Thanks, -Miles -- Do n

Re: Putting auto-image-file-mode in Options menu

2005-03-24 Thread Richard Stallman
I don't like this solution because it is too ad-hoc. It is also local, so it won't break anything else. Please do it that way. But why can't `auto-mode-alist' allow to do the same? Thanks, but this is not the time to consider changing the definition of auto-mode-alist. ___

Re: Putting auto-image-file-mode in Options menu

2005-03-23 Thread Juri Linkov
> So I think you should leave the function `image-mode' unchanged > and define a new function `image-mode-maybe' which does the new job. > Then the entries in auto-mode-alist can call `image-mode-maybe' > and `image-mode-maybe' can conditionally call `image-mode'. > > Want to try it that way? I do

Re: Putting auto-image-file-mode in Options menu

2005-03-22 Thread Richard Stallman
Your code looks good to me, except for one point: every major mode's symbol name should be a function that *unconditionally* switches to that mode. You've set it up so that `image-mode' is a function that usually switches to Image mode, but not always. That's not right. So I think you should lea

Re: Putting auto-image-file-mode in Options menu

2005-03-22 Thread Juri Linkov
Richard Stallman <[EMAIL PROTECTED]> writes: > 2. Perhaps image-mode should be minor mode for extensions like >.xbm and .xpm which already have associated major mode c-mode >in auto-mode-alist. > > Someone else can do that. I can't find a solution better than below. With this

Re: Putting auto-image-file-mode in Options menu

2005-03-21 Thread Richard Stallman
> That is true. However, copying the image to another buffer would only > get you text. Which is what would be appropriate when copying an XPM icon into a C source file. I see no problem here. If you prefer to copy it as text, type C-c C-c so that you see the text, then copy it

Re: Putting auto-image-file-mode in Options menu

2005-03-21 Thread Richard Stallman
> 3. By default this mode should be enabled for non-ascii based >image format files like .png, .jpg. This could be achieved >by enabling auto-image-file-mode by default and turning >image-mode off by default for ascii based formats. Sorry, I disagree.

Re: Putting auto-image-file-mode in Options menu

2005-03-20 Thread Juri Linkov
Richard Stallman <[EMAIL PROTECTED]> writes: > 3. By default this mode should be enabled for non-ascii based >image format files like .png, .jpg. This could be achieved >by enabling auto-compression-mode by default and turning >image-mode off by default for ascii based

Re: Putting auto-image-file-mode in Options menu

2005-03-20 Thread David Kastrup
Richard Stallman <[EMAIL PROTECTED]> writes: > If you used an overlay instead of text properties, there would be no > necessity to modify the buffer. > > That is true. However, copying the image to another buffer would only > get you text. Which is what would be appropriate when copying

Re: Putting auto-image-file-mode in Options menu

2005-03-20 Thread Richard Stallman
If you used an overlay instead of text properties, there would be no necessity to modify the buffer. That is true. However, copying the image to another buffer would only get you text. That's why I decided to make it a text property. ___ Emac

Re: Putting auto-image-file-mode in Options menu

2005-03-19 Thread David Kastrup
Richard Stallman <[EMAIL PROTECTED]> writes: > 3. By default this mode should be enabled for non-ascii based >image format files like .png, .jpg. This could be achieved >by enabling auto-compression-mode by default and turning >image-mode off by default for ascii based

Re: Putting auto-image-file-mode in Options menu

2005-03-19 Thread Richard Stallman
3. By default this mode should be enabled for non-ascii based image format files like .png, .jpg. This could be achieved by enabling auto-compression-mode by default and turning image-mode off by default for ascii based formats. I am completely lost here. What does auto-

Re: Putting auto-image-file-mode in Options menu

2005-03-18 Thread Richard Stallman
Can't this program just set the find-file-literally variable to t? That will prevent auto-compression-mode from trying to compress the contents when you save. I will see if that works. ___ Emacs-devel mailing list Emacs-devel@gnu.org http:

Re: Putting auto-image-file-mode in Options menu

2005-03-17 Thread Miles Bader
> What do people think? Here's the code to do it. > (But I wonder, was there some reason why Miles implemented > this feature using a file name handler instead of with a major mode?) There was an explicit reason, but I don't remember what it is anymore; perhaps some google searching would reveal

Re: Putting auto-image-file-mode in Options menu

2005-03-17 Thread Stefan Monnier
> What is buffer-file-coding-system set to in that buffer? > nil. It is a unibyte buffer. > How > do you insert the compressed data into it? > With a Lisp program that copies text from another buffer and then does > base64-decod

Re: Putting auto-image-file-mode in Options menu

2005-03-17 Thread Richard Stallman
What is buffer-file-coding-system set to in that buffer? nil. It is a unibyte buffer. How do you insert the compressed data into it? With a Lisp program that copies text from another buffer and then does base64-decode-region.

Re: Putting auto-image-file-mode in Options menu

2005-03-16 Thread Juri Linkov
Richard Stallman <[EMAIL PROTECTED]> writes: > What do people think? Here's the code to do it. I looked at the code and have a few comments: 1. .xpm file extension is missing from the list of autoload cookies. 2. Perhaps image-mode should be minor mode for extensions like .xbm and .xpm which

Re: Putting auto-image-file-mode in Options menu

2005-03-16 Thread Kevin Rodgers
Richard Stallman wrote: I would like to ask the same question for auto-compression-mode too. What is the reason not to turn it on by default? How often people visit compressed files for editing without uncompressing? I often save a buffer of compressed data into a file name FOO.gz. If

Re: Putting auto-image-file-mode in Options menu

2005-03-15 Thread Richard Stallman
If you are working through a slow X connection, accidentally visiting an image file could be a very expensive mistake. We could solve that, perhaps, by introducing preemption into the display of a large image. I think that is too big a change to make just now, but it could be made some da

Re: Putting auto-image-file-mode in Options menu

2005-03-15 Thread Richard Stallman
I would like to ask the same question for auto-compression-mode too. What is the reason not to turn it on by default? How often people visit compressed files for editing without uncompressing? I often save a buffer of compressed data into a file name FOO.gz. If Auto Compression mode i

Re: Putting auto-image-file-mode in Options menu

2005-03-15 Thread Juri Linkov
Stefan <[EMAIL PROTECTED]> writes: > As I said, it's probably true for "binary" image formats (like PNG). > But auto-image-file-mode, as it currently stands, applies to more formats > than just those. I guess there should be a special mode `image-file-mode' to switch between textual and graphical

Re: Putting auto-image-file-mode in Options menu

2005-03-15 Thread Stefan
>> I admit that I've never opened a png file in Emacs, so for png it might be >> OK, but in general there are several "image formats" which are quite >> viewable/editable in Emacs. >> >> OTOH I find auto-image-file-mode of very dubious utility: you can barely >> look at the image (it's a bit bette

Re: Putting auto-image-file-mode in Options menu

2005-03-15 Thread Juri Linkov
David Kastrup <[EMAIL PROTECTED]> writes: > If you are working through a slow X connection, accidentally visiting > an image file could be a very expensive mistake. In the past, > displaying an image that was overtall could really confuse Emacs. > This has become much better recently, but I don't

Re: Putting auto-image-file-mode in Options menu

2005-03-15 Thread Juri Linkov
Stefan Monnier <[EMAIL PROTECTED]> writes: > I admit that I've never opened a png file in Emacs, so for png it might be > OK, but in general there are several "image formats" which are quite > viewable/editable in Emacs. > > OTOH I find auto-image-file-mode of very dubious utility: you can barely >

Re: Putting auto-image-file-mode in Options menu

2005-03-14 Thread Stefan Monnier
> Indeed, auto-image-file-mode is useful only for viewing images. > OTOH, editing image files as plain text in Emacs is a rare > operation too. Not that rare, especially for text-based image format, or to view/edit the text in the header of a non-text image format. > And even with auto-image-file

Re: Putting auto-image-file-mode in Options menu

2005-03-14 Thread David Kastrup
Juri Linkov <[EMAIL PROTECTED]> writes: > Stefan Monnier <[EMAIL PROTECTED]> writes: >>> There is already "Automatic File De/compression" menu item >>> for auto-compression-mode in the Options menu, but no menu item >>> for auto-image-file-mode. This looks like an unintentional omission. >> >> I

Re: Putting auto-image-file-mode in Options menu

2005-03-13 Thread Juri Linkov
Stefan Monnier <[EMAIL PROTECTED]> writes: >> There is already "Automatic File De/compression" menu item >> for auto-compression-mode in the Options menu, but no menu item >> for auto-image-file-mode. This looks like an unintentional omission. > > I think it's omitted because it's a very rarely us

Re: Putting auto-image-file-mode in Options menu

2005-03-13 Thread Richard Stallman
There is already "Automatic File De/compression" menu item for auto-compression-mode in the Options menu, but no menu item for auto-image-file-mode. This looks like an unintentional omission. There is no such thing as an "unintentional omission" from the menu bar. Putting anything in

Re: Putting auto-image-file-mode in Options menu

2005-03-13 Thread Stefan Monnier
> There is already "Automatic File De/compression" menu item > for auto-compression-mode in the Options menu, but no menu item > for auto-image-file-mode. This looks like an unintentional omission. I think it's omitted because it's a very rarely used feature. Stefan __

Putting auto-image-file-mode in Options menu

2005-03-12 Thread Juri Linkov
There is already "Automatic File De/compression" menu item for auto-compression-mode in the Options menu, but no menu item for auto-image-file-mode. This looks like an unintentional omission. Index: lisp/menu-bar.el === RCS file: /cv