all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: make a drawing with Emacs
Date: Thu, 03 Sep 2020 12:59:01 -0400	[thread overview]
Message-ID: <jwvh7sekdz3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: 874koehonj.fsf@logand.com

>>> 1) It is not clear upfront, when it does not work, as demonstrated with
>>>    svg-image vs svg-print.
>>>    This is general problem with foreign dependencies.
>> I believe svg-image is the only exception and it's an intuitive one at

It seems `svg-insert-image` is another exception.

> Sorry it wasn't intuitive to me as I don't know emacs internals (yet?).

;-)

>> since it is used to create an internal Emacs image object whose only
>> use is to display the image inside an Emacs buffer.
> There seem to be other uses as well, e.g. to save the image (image-save
> function).  Maybe other uses like create a screenshot?

That doesn't seem related to `svg.el` which focuses on generating the
XML representation of an SVG image (with one or two extra help functions
like `svg-image` which also tries to help *display* that image).
Searching for `save` only finds a single match (and it's for
`save-excursion` and it's not even in the code but in a comment).

> image.el also has some questionable constraints.

`svg.el` is unrelated to `image.el` (except via `svg-image`, AFAIK).

>> Or maybe you can improve the package instead of writing a new one.
>> Code is sometimes called "software" because presumably it's more
>> malleable than "hardware".
> Maybe.  svg.el seems to be 4 years old and likely has many users
> already.

Probably not "many", but then again, the more users it has, the higher
the benefit of improving it rather than writing another one.

> The fake keyword args as rest args plist was a bad choice 4
> years ago which will be hard to fix.  What would be the right way to do
> this if not writing svg2.el?  Perhaps to implement proper keyword
> support in Elisp?

The answer probably depends on exactly how else you want to handle
those properties.  I don't know what "proper keyword support" you're
thinking of, but if you're thinking of Common List keywords, then you
can simply change `defun` into `cl-defun` and then use `&key`.

BTW, if you're only concerned about the Eldoc and `C-h o` info, then you
can also just provide the more precise info in the docstring e.g.:

    (defun svg-create (width height &rest args)
      "Create a new, empty SVG image with dimensions WIDTH x HEIGHT.
    ARGS can be used to provide `stroke' and `stroke-width' parameters to
    any further elements added.

    \(fn WIDTH HEIGHT &key STROKE STROKE-WIDTH)"
      ...)


-- Stefan




  reply	other threads:[~2020-09-03 16:59 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-31  3:05 make a drawing with Emacs Emanuel Berg via Users list for the GNU Emacs text editor
2020-08-31  7:36 ` tomas
2020-08-31 20:29   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-08-31 20:49     ` Yuri Khan
2020-08-31 20:52       ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-08-31 21:01         ` Yuri Khan
2020-08-31 21:04           ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-08-31 22:48             ` Perry Smith
2020-08-31 23:09               ` Ulrich Deiters
2020-09-01  8:22           ` tomas
2020-09-01  8:38             ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-01  9:04               ` tomas
2020-09-01 17:22                 ` Marcin Borkowski
2020-09-01 20:48                   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-02  8:25                     ` tomas
2020-09-01 12:22             ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-01 14:58               ` tomas
2020-09-01 20:45                 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-02 21:10                 ` Tomas Hlavaty
2020-09-02 21:51                   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-03  1:26                     ` Leo Butler
2020-09-02 22:28                   ` Stefan Monnier
2020-09-03  5:13                     ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-03  7:34                     ` Tomas Hlavaty
2020-09-03 13:38                       ` Stefan Monnier
2020-09-03 15:21                         ` Tomas Hlavaty
2020-09-03 16:59                           ` Stefan Monnier [this message]
     [not found]                             ` <87tuwen4mo.fsf@logand.com>
     [not found]                               ` <jwvimcuiqur.fsf-monnier+emacs@gnu.org>
2020-09-04  8:42                                 ` Tomas Hlavaty
     [not found]                       ` <mailman.2156.1599118473.2469.help-gnu-emacs@gnu.org>
2020-09-03 17:23                         ` Lars Magne Ingebrigtsen
     [not found]                           ` <mailman.2212.1599153847.2469.help-gnu-emacs@gnu.org>
2020-09-03 17:28                             ` Lars Magne Ingebrigtsen
2020-09-03 17:41                               ` Stefan Monnier
     [not found]                                 ` <mailman.2217.1599154928.2469.help-gnu-emacs@gnu.org>
2020-09-03 17:45                                   ` Lars Magne Ingebrigtsen
2020-09-03 18:23                                     ` Tomas Hlavaty
     [not found]                                       ` <mailman.2224.1599157422.2469.help-gnu-emacs@gnu.org>
2020-09-03 19:43                                         ` Lars Magne Ingebrigtsen
2020-09-03 19:50                                           ` Tomas Hlavaty
2020-09-04  8:43                                             ` tomas
2020-09-04  8:59                                               ` Tomas Hlavaty
2020-09-04  9:26                                                 ` tomas
2020-09-04  9:48                                                   ` Tomas Hlavaty
2020-09-03 17:55                               ` Tomas Hlavaty
     [not found]                                 ` <mailman.2221.1599155709.2469.help-gnu-emacs@gnu.org>
2020-09-03 18:04                                   ` Lars Magne Ingebrigtsen
     [not found]                                     ` <mailman.2222.1599156265.2469.help-gnu-emacs@gnu.org>
2020-09-03 18:09                                       ` Lars Magne Ingebrigtsen
2020-09-03 18:29                                         ` Tomas Hlavaty
2020-09-03 18:32                                           ` Tomas Hlavaty
2020-09-03  7:14                   ` tomas
2020-09-03  8:03                     ` Tomas Hlavaty
2020-09-01  8:32           ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-01  8:58             ` tomas
2020-09-01  8:18         ` tomas
2020-09-24 15:09           ` Jean Louis
2020-09-24 16:53             ` Leo Butler
2020-09-24 20:14             ` tomas
2020-08-31 17:41 ` Marcin Borkowski
2020-08-31 20:30   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-08-31 19:40 ` Carlo Tambuatco
2020-08-31 20:33   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-08-31 20:56 ` Gregory Heytings via Users list for the GNU Emacs text editor
2020-08-31 21:00   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-01  8:40     ` Gregory Heytings via Users list for the GNU Emacs text editor
2020-09-01  5:37   ` Peter Münster

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=jwvh7sekdz3.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /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.