From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#63385: 30.0.50; [DRAFT PATCH v1] Update eshell defcustom definitions Date: Sat, 2 Sep 2023 08:33:13 -0300 Message-ID: <0ffda98e-e8b2-5318-92f1-038f6e67f519@gmail.com> References: <1750da77-a6c2-dc6d-53ef-fba3e0f68034@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29971"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Jim Porter , 63385@debbugs.gnu.org, Stefan Kangas To: Ruijie Yu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 02 13:34:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qcOtP-0007aG-L1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Sep 2023 13:34:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcOt0-0007Gq-3U; Sat, 02 Sep 2023 07:33:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qcOsy-0007GA-Ls for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 07:33:52 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qcOsy-0001Xj-Du for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 07:33:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcOt7-0004OL-PU for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 07:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Sep 2023 11:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63385 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 63385-submit@debbugs.gnu.org id=B63385.169365441516844 (code B ref 63385); Sat, 02 Sep 2023 11:34:01 +0000 Original-Received: (at 63385) by debbugs.gnu.org; 2 Sep 2023 11:33:35 +0000 Original-Received: from localhost ([127.0.0.1]:35329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcOsh-0004Nb-60 for submit@debbugs.gnu.org; Sat, 02 Sep 2023 07:33:35 -0400 Original-Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]:61574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcOsf-0004NO-83 for 63385@debbugs.gnu.org; Sat, 02 Sep 2023 07:33:34 -0400 Original-Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1c11d53221cso1895310fac.2 for <63385@debbugs.gnu.org>; Sat, 02 Sep 2023 04:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693654397; x=1694259197; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=FAACQ6TR1GVgjK3l9cgSQw73QldJYXfSQTz9Uyf/pBw=; b=AGqmpz4IT1cfY8bMVddfC4IpZ6nC8wMCYC6i7IW7Vc3jiJAXLZR0z/GXxyu1D1P1wm n7wU1JxdH4m5EntC+FhcsIqOl710JrUcKGF++AKKUNXkRs2VtM77EwW8dPgMG4x/B4Cv tZ28FWHf+YGEZYrRsy/hVRCDQ6qjZRQr8aE2I7mdfv7qLOP4XYGzPGj6JBiN6d1UDTAY xR8MG6xOWLMBjPrAkhmb0k1sTkZqnz+bvjz1569BFfPgnxuxRv8ye/nQN4/LpU4S/X58 j1Ix+mVfSIXA7AdMI52KB9V0yE99RSu7YLrN82DH8JYLjw/veVz5CaXXhlY5HO/azYaT RICA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693654397; x=1694259197; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FAACQ6TR1GVgjK3l9cgSQw73QldJYXfSQTz9Uyf/pBw=; b=Xm4KOIqd2dhq/HYuH8WcvURWul7wvIyu1mS7YzRboNUVxdNTPAVPsrW5ONyyaTgWQn wcPg24T6oZPh8Z+gJ4SMteT2pJ3/kLwyGdzyyAizNGaCoeR++/BHWRoUAsz4LMnA4aFo l3vmyxEKK5/xx+idI3/63xxCjv7sHZrErKURnqLSUYDobSl66g3GS+ZeLSpkOa7bomHu O+qIWPmXZwycxkTMz96c4r4Jr1MbRTFGOnz+OW6mO4giqq2EPuqtecW/8hjJtMpLbdIO SF+EvGIve6gzIuNsOFnznrAfZ64kmR7B8dL/FHZDdXAcbSqSQ+WVjPBElJrAwxUiy+lt 5X6A== X-Gm-Message-State: AOJu0Yz4pYBYJxgDrMVsgwV4uly3pieywRKiIRI0G5GOAzrVUsEZPqiN uwg+HaBiiEMzPLrf5W8nIhi31/WdfJ3DZA== X-Google-Smtp-Source: AGHT+IGJIfR3+qgteTHzCA0I9TaPqiTWjTvwgOulbXbTgTijyqNsDwKSTIi2VSiO9jbNwiZ4hox44A== X-Received: by 2002:a05:6870:548f:b0:1bb:742a:4f62 with SMTP id f15-20020a056870548f00b001bb742a4f62mr5658511oan.45.1693654397522; Sat, 02 Sep 2023 04:33:17 -0700 (PDT) Original-Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id a7-20020a056870b14700b001cce851c7basm3245390oal.11.2023.09.02.04.33.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Sep 2023 04:33:16 -0700 (PDT) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268979 Archived-At: Ruijie Yu 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.