all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Ruijie Yu <ruijie@netyu.xyz>
Cc: Jim Porter <jporterbugs@gmail.com>,
	63385@debbugs.gnu.org, Stefan Kangas <stefankangas@gmail.com>
Subject: bug#63385: 30.0.50; [DRAFT PATCH v1] Update eshell defcustom definitions
Date: Sat, 2 Sep 2023 08:33:13 -0300	[thread overview]
Message-ID: <0ffda98e-e8b2-5318-92f1-038f6e67f519@gmail.com> (raw)
In-Reply-To: <CADwFkmkuWArKGxss=fxJo4CGtSxECYgZ1QeMeNCV9MweBxUFwA@mail.gmail.com>

Ruijie Yu <ruijie@netyu.xyz> writes:

I have some comments/questions about the :type proposed changes.

 > diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
 > index 5284df9ab59..375a1356af4 100644
 > --- a/lisp/eshell/em-dirs.el
 > +++ b/lisp/eshell/em-dirs.el
 > @@ -153,7 +153,7 @@ eshell-last-dir-ring-size
 >  explicitly very much, but every once in a while would like to return to
 >  a previously visited directory without having to type in the whole
 >  thing again."
 > -  :type 'integer)
 > +  :type 'natnum)

The docstring says "If non-nil ...".  Should the :type be adapted to
allow for a nil value, or should the docstring be changed?

 > diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
 > index 2c199ec160f..f9fdbde9f19 100644
 > --- a/lisp/eshell/em-hist.el
 > +++ b/lisp/eshell/em-hist.el
 > @@ -101,7 +102,7 @@ eshell-hist-ignoredups
 >  in bash, and any other non-nil value mirrors the \"ignoredups\"
 >  value."
 >    :type '(choice (const :tag "Don't ignore anything" nil)
 > -                 (const :tag "Ignore consecutive duplicates" t)
 > +                 (other :tag "Ignore consecutive duplicates" t)
 >                   (const :tag "Only keep last duplicate" erase)))

Inside a choice, the other option should come last.  Otherwise, it will
always match, even when the value set is erase, in this case.

 >  (defcustom eshell-hist-rebind-keys-alist
 >    '(([(control ?p)]   . eshell-previous-input)
 >      ([(control ?n)]   . eshell-next-input)
 > @@ -185,9 +187,11 @@ eshell-hist-rebind-keys-alist
 >      ([up]             . eshell-previous-matching-input-from-input)
 >      ([down]           . eshell-next-matching-input-from-input))
 >    "History keys to bind differently if point is in input text."
 > -  :type '(repeat (cons (vector :tag "Keys to bind"
 > -			       (repeat :inline t sexp))
 > -		       (function :tag "Command"))))
 > +  :type '(alist :key-type (vector :tag "Keys to bind"
 > +                                  (repeat :inline t sexp))
 > +                ;; TODO: isn't there a key or key-sequencec type that
 > +                ;; can be used for the purpose of the :key-type?
 > +                :value-type (function :tag "Command")))

There is a key type.  Maybe it's worth taking a look if it works well
for this option?

 > diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
 > index 9b53bf29559..07f2d54fb5b 100644
 > --- a/lisp/eshell/em-ls.el
 > +++ b/lisp/eshell/em-ls.el
 > @@ -223,7 +224,10 @@ eshell-ls-highlight-alist
 >  If TEST-SEXP evals to non-nil, that face will be used to highlight the
 >  name of the file.  The first match wins.  `file' and `attrs' are in
 >  scope during the evaluation of TEST-SEXP."
 > -  :type '(repeat (cons function face)))
 > +  :type
 > +  '(alist
 > +    :key-type (sexp :tag "Test sexp, `file' and `attrs' in scope")
 > +    :value-type face))

Is sexp really necessary here? I feel like it should be used as a last
resource.







      reply	other threads:[~2023-09-02 11:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  4:47 bug#63385: 30.0.50; [DRAFT PATCH v1] Update eshell defcustom definitions Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-15  4:39 ` Jim Porter
2023-09-01 19:33   ` Stefan Kangas
2023-09-02 11:33     ` Mauro Aranda [this message]

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=0ffda98e-e8b2-5318-92f1-038f6e67f519@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=63385@debbugs.gnu.org \
    --cc=jporterbugs@gmail.com \
    --cc=ruijie@netyu.xyz \
    --cc=stefankangas@gmail.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 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.