all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Zajcev Evgeny <zevlg@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: Re: master f45ce78 2/2: Explicitly specify svg base_uri using `:base-uri' image property
Date: Sat, 12 Dec 2020 21:42:49 +0200	[thread overview]
Message-ID: <83o8iyerpi.fsf@gnu.org> (raw)
In-Reply-To: <mailman.1938.1607798832.19112.emacs-diffs@gnu.org> (emacs-diffs-request@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 improves the performance of embedding large images.

What is "this" that improves the performance, and how does it do so?
We should at least hint at the improvement, without that this sentence
sounds puzzling.

> +** 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?



       reply	other threads:[~2020-12-12 19:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1938.1607798832.19112.emacs-diffs@gnu.org>
2020-12-12 19:42 ` Eli Zaretskii [this message]
2020-12-12 20:42   ` master f45ce78 2/2: Explicitly specify svg base_uri using `:base-uri' image property Evgeny Zajcev
2020-12-13 15:05     ` Eli Zaretskii
2020-12-16 22:08       ` Evgeny Zajcev
2020-12-19 10:09         ` Eli Zaretskii
2020-12-19 12:24           ` Evgeny Zajcev
2020-12-26  9:19             ` Eli Zaretskii
     [not found] <20201212124845.19694.69782@vcs0.savannah.gnu.org>
     [not found] ` <20201212124847.8879221335@vcs0.savannah.gnu.org>
2020-12-12 22:43   ` Lars Ingebrigtsen
2020-12-12 23:59     ` Alan Third
2020-12-13 12:53       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o8iyerpi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=zevlg@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.