unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* SVG image type fixes
@ 2007-08-25 14:16 Juri Linkov
  2007-08-25 19:38 ` Including nXML (was: SVG image type fixes) Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Juri Linkov @ 2007-08-25 14:16 UTC (permalink / raw)
  To: emacs-devel

1. Currently visiting a non-SVG XML file fails with errors from the image
library and memory overflow.  That's because the regexp in
`image-type-header-regexps' detecting the SVG image type of too lax and
recognizes non-SVG XML files as SVG.  I fixed this regexp to be like
regexps that detect XML formats in `magic-fallback-mode-alist'.

This is still not ideal since it can't recognize some SVG types (e.g. when
DOCTYPE contains ENTITY definitions).  Instead of trying to improve an
already overly complex regexp, it's better to use one function
`xmltok-forward-prolog' from the nXML package - another argument
to add this nice package to Emacs!

2. Since SVG is a text-based image format, it should be possible to
use XML mode to edit it.  I fixed image-mode.el to associate the file
extension .svg with xml-mode and image-mode-maybe, exactly like this is
done for another text-based image format .xpm.

But like .xpm, now visiting .svg puts the file in text image mode that
shows the source of the image.  This is bad even for .xpm and for any
text-based image format, because viewing image is more frequent action
than editing it.  This is as inconvenient as if a Web browser displayed
the source HTML code initially, and only after typing a special key like
C-c C-c it rendered it as a HTML page.

Is it OK to change image-mode.el to display text-based image files
as an image initially instead as text?

3. Added support for the compressed .svgz format.  These files get
decompressed by gzip with the help of jka-cmpr.

4. Currently it's difficult to see if Emacs recognized the image type
correctly when it can't display an image.  Another need to know the image
type is when Emacs uses content-based recognition on a file without extension.
To make sure of this, I propose to add image type in square brackets to the
image-mode indicator on the mode line like:

    Image[svg]

5. The node `(elisp)Images' now should mention the image format `svg'.
But before adding it, I propose to split this large node (it's so large
that a menu in the end of this node is not visible after visiting this node),
and to move text starting with `The supported image formats include ...'
to a new node `Image formats'.

-- 
Juri Linkov
http://www.jurta.org/emacs/

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

* Including nXML (was: SVG image type fixes)
  2007-08-25 14:16 SVG image type fixes Juri Linkov
@ 2007-08-25 19:38 ` Stefan Monnier
  2007-08-25 19:55   ` Leo
  2007-08-26  1:08   ` Richard Stallman
  2007-08-25 19:42 ` SVG image type fixes Stefan Monnier
  2007-08-26  1:08 ` Richard Stallman
  2 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2007-08-25 19:38 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

> `xmltok-forward-prolog' from the nXML package - another argument
> to add this nice package to Emacs!

I don't think we lack arguments in favor.


        Stefan

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

* Re: SVG image type fixes
  2007-08-25 14:16 SVG image type fixes Juri Linkov
  2007-08-25 19:38 ` Including nXML (was: SVG image type fixes) Stefan Monnier
@ 2007-08-25 19:42 ` Stefan Monnier
  2007-08-26  1:08 ` Richard Stallman
  2 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2007-08-25 19:42 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

> But like .xpm, now visiting .svg puts the file in text image mode that
> shows the source of the image.  This is bad even for .xpm and for any
> text-based image format, because viewing image is more frequent action
> than editing it.  This is as inconvenient as if a Web browser displayed
> the source HTML code initially, and only after typing a special key like
> C-c C-c it rendered it as a HTML page.

> Is it OK to change image-mode.el to display text-based image files
> as an image initially instead as text?

Sounds good to me, as long as we make it trivially easy/obvious to switch
back from the image to the text (and vice-versa, I guess).

>     Image[svg]

Yes, that's good.


        Stefan

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

* Re: Including nXML (was: SVG image type fixes)
  2007-08-25 19:38 ` Including nXML (was: SVG image type fixes) Stefan Monnier
@ 2007-08-25 19:55   ` Leo
  2007-08-26  1:08   ` Richard Stallman
  1 sibling, 0 replies; 8+ messages in thread
From: Leo @ 2007-08-25 19:55 UTC (permalink / raw)
  To: emacs-devel

On 2007-08-25 20:38 +0100, Stefan Monnier wrote:
>> `xmltok-forward-prolog' from the nXML package - another argument
>> to add this nice package to Emacs!
>
> I don't think we lack arguments in favor.

Any news on the paper assignment?

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

         Gnus is one component of the Emacs operating system.

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

* Re: SVG image type fixes
  2007-08-25 14:16 SVG image type fixes Juri Linkov
  2007-08-25 19:38 ` Including nXML (was: SVG image type fixes) Stefan Monnier
  2007-08-25 19:42 ` SVG image type fixes Stefan Monnier
@ 2007-08-26  1:08 ` Richard Stallman
  2 siblings, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2007-08-26  1:08 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

Thanks for making these changes.

    To make sure of this, I propose to add image type in square brackets to the
    image-mode indicator on the mode line like:

	Image[svg]

    5. The node `(elisp)Images' now should mention the image format `svg'.
    But before adding it, I propose to split this large node (it's so large
    that a menu in the end of this node is not visible after visiting this node),
    and to move text starting with `The supported image formats include ...'
    to a new node `Image formats'.

Those are good ideas too.

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

* Re: Including nXML (was: SVG image type fixes)
  2007-08-25 19:38 ` Including nXML (was: SVG image type fixes) Stefan Monnier
  2007-08-25 19:55   ` Leo
@ 2007-08-26  1:08   ` Richard Stallman
  2007-08-26  9:33     ` Including nXML Lennart Borgman (gmail)
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2007-08-26  1:08 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: juri, emacs-devel

I have sent jclark mail several times, and got no response.
Unless someone can reach him, we are stuck.

If you reach him, please ask for his snail address.

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

* Re: Including nXML
  2007-08-26  1:08   ` Richard Stallman
@ 2007-08-26  9:33     ` Lennart Borgman (gmail)
  2007-08-26 22:46       ` Richard Stallman
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman (gmail) @ 2007-08-26  9:33 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

Richard Stallman wrote:
> I have sent jclark mail several times, and got no response.
> Unless someone can reach him, we are stuck.
> 
> If you reach him, please ask for his snail address.

I can not reach him, but this is the address of his own company on the page

   http://www.thaiopensource.com/

Thai Open Source Software Center Ltd
12th Floor, Srivikorn Building
18/8 Sukhumvit Soi 21
Bangkok 10110
Thailand
Tel: +66 2 661 7834
Fax: +66 2 661 7839

His homepage is here:

   http://www.jclark.com/bio.htm

I believe his blog is here:

   http://blog.jclark.com/

Maybe put a comment on his blog?

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

* Re: Including nXML
  2007-08-26  9:33     ` Including nXML Lennart Borgman (gmail)
@ 2007-08-26 22:46       ` Richard Stallman
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2007-08-26 22:46 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: emacs-devel

Thanks for the other contact info.  FSF people will try to contact him.

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

end of thread, other threads:[~2007-08-26 22:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-25 14:16 SVG image type fixes Juri Linkov
2007-08-25 19:38 ` Including nXML (was: SVG image type fixes) Stefan Monnier
2007-08-25 19:55   ` Leo
2007-08-26  1:08   ` Richard Stallman
2007-08-26  9:33     ` Including nXML Lennart Borgman (gmail)
2007-08-26 22:46       ` Richard Stallman
2007-08-25 19:42 ` SVG image type fixes Stefan Monnier
2007-08-26  1:08 ` Richard Stallman

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