unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: "Paul W. Rankin" <hello@paulwrankin.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: [PATCH] Improve find-sibling-rules option type
Date: Mon, 25 Sep 2023 06:52:30 -0300	[thread overview]
Message-ID: <222df93c-cc06-ef0a-6449-b15c03bb8f91@gmail.com> (raw)
In-Reply-To: <c2b59a5f7fb66f14d4219eb751497f57@purelymail.com>

On 24/9/23 22:17, Paul W. Rankin wrote:
 >
 > On 2023-09-24 19:44, Mauro Aranda wrote:
 >> In particular, AFAICT there could be more than one EXPANSION.  In that
 >> case, :value-type should be a repeat of strings, not just a string.  In
 >> addition, regexp should be used as the :key-type type. (I see that
 >> Philip already spotted this)
 >
 > Just looking at `find-sibling-file-search' and it looks like maybe? 
But if this is the case I think the docstring should be rewritten. 
Looking at it from a user's perspective if the docstring says "a string" 
but there's a repeat of strings, that would be confusing.

My clue was (MATCH EXPANSION...) and then it says EXPANSIONS.  And each
EXPANSION is a string, hence we have a repeat of strings.

 >> In general, when converting from sexp to a more specific type, I think
 >> we have to take extra precaution and check the code for how the
 >> variable it's used (i.e., the docstring might not tell the whole story).
 >> If ever in doubt, then it might be better and safer to offer a choice
 >> with the more specific type first, and keep sexp as a catch-all
 >> alternative.
 >
 > Customize already provides for this! The user can click [State] > 
Show Saved Lisp Expression to edit/override the value with their own sexp.

That was not my point.  My point was that in a "sexp to
more-specific-type" change, there's always a risk to introduce a minor
regression: that the user starts seeing a MISMATCH instead of SET/SAVED
as a message in Customize.  IMO, that needs to be avoided as much as
possible.

But AFAICS, there will be no trouble here, provided that :value-type is
a repeat of strings.

 > I think the main thing is not to have user options that demand sexps.

I agree.  I'm in favor of avoiding sexp as much as possible, be it by
providing a more specific type, or a not-that-complicated user option.




  reply	other threads:[~2023-09-25  9:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-24  1:03 [PATCH] Improve find-sibling-rules option type Paul W. Rankin via Emacs development discussions.
2023-09-24  5:33 ` Eli Zaretskii
2023-09-24  9:44   ` Mauro Aranda
2023-09-25  1:17     ` Paul W. Rankin via Emacs development discussions.
2023-09-25  9:52       ` Mauro Aranda [this message]
2023-09-24  8:34 ` Philip Kaludercic

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=222df93c-cc06-ef0a-6449-b15c03bb8f91@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=hello@paulwrankin.com \
    /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 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).