emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master f45ce78 2/2: Explicitly specify svg base_uri using `:base-uri


From: Evgeny Zajcev
Subject: Re: master f45ce78 2/2: Explicitly specify svg base_uri using `:base-uri' image property
Date: Sat, 12 Dec 2020 23:42:36 +0300



сб, 12 дек. 2020 г. в 22:43, Eli Zaretskii <eliz@gnu.org>:
Thank you for your contribution, but I noticed a few minor issues with
it:

> +@defun svg-embed-base-uri-image svg relative-filename &rest args
> +To @var{svg} add an embedded (raster) image placed at
> +@var{relative-filename}.  @var{relative-filename} is searched inside
> +@code{file-name-directory} of the @code{:base-uri} svg image property.

This is the only place in the manual where the :base-uri attribute is
mentioned.  Can we please add some minimal description of what that
attribute does and how it is useful?

This is only function, where `:base-uri` could be useful


> +This improves the performance of embedding large images.

What is "this" that improves the performance, and how does it do so?

"this" - having support for `:base_uri`

We should at least hint at the improvement, without that this sentence
sounds puzzling.


I'll try my best in rewording this, however take into account that I'm very bad at wording in English.  Maybe it is better for someone else to write docs for it?

> +** Can explicitly specify base_uri for svg images.

This should say

  It is now possible to explicitly specify base_uri for SVG images.

Please also add a short explanation of what "base_uri" is, or point to
some canonical description on the net.

> +':base-uri' image property can be used to explicitly specify base_uri
> +for embedded images into svg. ':base-uri' is supported for both file
> +and data svg images.        ^^^

Please leave 2 spaces between sentences, per our conventions.

> +** 'svg-embed-base-uri-image' added to embed images

Suggest to reword:

  New function 'svg-embed-base-uri-image'.

> +(defun svg-embed-base-uri-image (svg relative-filename &rest args)
> +  "Insert image placed at RELATIVE-FILENAME into the SVG structure.

"Placed" is not the word I'd use here.  "Located" is better.

> @@ -9782,10 +9786,10 @@ svg_load (struct frame *f, struct image *img)
>         image_error ("Invalid image data `%s'", data);
>         return 0;
>       }
> -      original_filename = BVAR (current_buffer, filename);
> +      if (!STRINGP (base_uri))
> +        base_uri = BVAR (current_buffer, filename);
>        success_p = svg_load_image (f, img, SSDATA (data), SBYTES (data),
> -                                  (NILP (original_filename) ? NULL
> -                                : SSDATA (original_filename)));
> +                                  (NILP (base_uri) ? NULL : SSDATA (base_uri)));

Here you are passing an unencoded file name to svg_load_image, which
expects an encoded file name.  (Yes, the original code was wrong as
well).

Can these minor issues be fixed, please?

I'll compose patch you want a bit later

--
lg

reply via email to

[Prev in Thread] Current Thread [Next in Thread]