X-Loop: help-debbugs@HIDDEN Subject: bug#63385: 30.0.50; [DRAFT PATCH v1] Update eshell defcustom definitions Resent-From: Ruijie Yu <ruijie@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 09 May 2023 04:49:01 +0000 Resent-Message-ID: <handler.63385.B.168360770617713 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 63385 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 63385 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.168360770617713 (code B ref -1); Tue, 09 May 2023 04:49:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 May 2023 04:48:26 +0000 Received: from localhost ([127.0.0.1]:42186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pwFGz-0004ba-36 for submit <at> debbugs.gnu.org; Tue, 09 May 2023 00:48:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:35758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ruijie@HIDDEN>) id 1pwFGw-0004bI-CU for submit <at> debbugs.gnu.org; Tue, 09 May 2023 00:48:23 -0400 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 <ruijie@HIDDEN>) id 1pwFGv-0003Qq-6e for bug-gnu-emacs@HIDDEN; Tue, 09 May 2023 00:48:22 -0400 Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ruijie@HIDDEN>) id 1pwFGr-0006Yv-Sf for bug-gnu-emacs@HIDDEN; Tue, 09 May 2023 00:48:20 -0400 Received: from fw.net.yu.netyu.xyz (<unknown> [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id d33d16ae (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <bug-gnu-emacs@HIDDEN>; Tue, 9 May 2023 04:48:15 +0000 (UTC) User-agent: mu4e 1.11.3; emacs 30.0.50 From: Ruijie Yu <ruijie@HIDDEN> Date: Tue, 09 May 2023 12:47:51 +0800 Message-ID: <sdvjzxif6vc.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@HIDDEN; helo=mail.netyu.xyz X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Hello, When migrating from my old eshell configuration into using `setopt', I noticed a discrepency in the docstring of `eshell-scroll-to-bottom-on-input' and its customization type (the docstring says t and 'all should be equivalent, whereas the type does not allow t at all), hence I started looking into fixing issues around the `defcustom' calls in eshell. Here attached is a draft patch to update eshell defcustoms. The commit message contains a long [TODO] section outlining all my ideas on how to change a given portion, but these ideas probably need more input. Patch based on 34ac7d90876, 4-5 days old master. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=v1-0001-Change-eshell-defcustom-types-and-minor-fixes.patch Content-Transfer-Encoding: quoted-printable From 29989c7e6be3bd3bd58412273f2516f23058e152 Mon Sep 17 00:00:00 2001 From: Ruijie Yu <ruijie@HIDDEN> Date: Tue, 9 May 2023 10:47:51 +0800 Subject: [PATCH v1] Change eshell defcustom types and minor fixes * lisp/eshell/em-alias.el (eshell-bad-command-tolerance): * lisp/eshell/em-dirs.el (eshell-last-dir-ring-size): * lisp/eshell/em-ls.el (eshell-ls-default-blocksize): * lisp/eshell/esh-ext.el (eshell-command-interpreter-max-length): * lisp/eshell/esh-io.el (eshell-error-handle): (eshell-number-of-handles): (eshell-output-handle): (eshell-print-queue-size): * lisp/eshell/esh-proc.el (eshell-kill-process-wait-time): (eshell-process-wait-milliseconds): (eshell-process-wait-seconds): * lisp/eshell/esh-util.el (eshell-private-directory-modes): (eshell-private-file-modes): Change integer types into natnum types, because logically these values must be nonnegative. * lisp/eshell/em-cmpl.el (eshell-command-completions-alist): * lisp/eshell/em-hist.el (eshell-hist-rebind-keys-alist): * lisp/eshell/em-ls.el (eshell-ls-highlight-alist): * lisp/eshell/em-pred.el (eshell-modifier-alist): (eshell-predicate-alist): * lisp/eshell/em-term.el (eshell-visual-options): (eshell-visual-subcommands): * lisp/eshell/esh-ext.el (eshell-interpreter-alist): Change customization type (repeat (cons K V)) into (alist :key-type K :value-type V) to be more descriptive. Supply tags for some of these variables. * lisp/eshell/em-hist.el (eshell-input-filter): * lisp/eshell/esh-arg.el (eshell-parse-argument-hook): Change symbol quotes to function quotes where trivially possible. * lisp/eshell/esh-cmd.el (eshell-subcommand-bindings): Change plain sexp type into a more precise type for what a let-binding should be. (Does it warrant a `define-widget'?) * lisp/eshell/em-glob.el (eshell-glob-translate-alist): Unquote lambdas to allow for compilation. * lisp/eshell/em-hist.el (eshell-hist-ignoredups): * lisp/eshell/esh-mode.el (eshell-scroll-to-bottom-on-input): (eshell-scroll-to-bottom-on-output): Change const to other to follow docstring pedantically. [Note the TODO in esh-mode.el.] * lisp/eshell/esh-ext.el (eshell-force-execution): * lisp/eshell/esh-mode.el (eshell-buffer-maximum-lines): Fix docstring typos. [TODO] * lisp/eshell/em-cmpl.el (eshell-command-completion-function): * lisp/eshell/em-cmpl.el (eshell-default-completion-function): * lisp/eshell/em-glob.el (eshell-glob-translate-alist): * lisp/eshell/em-hist.el (eshell-hist-unload-hook): * lisp/eshell/em-pred.el (eshell-predicate-alist): (eshell-modifier-alist): * lisp/eshell/em-prompt.el (eshell-prompt-function): * lisp/eshell/em-smart.el (eshell-smart-unload-hook): * lisp/eshell/esh-arg.el (eshell-parse-argument-hook): TODO: Do we need to convert lambdas to named internal helper functions? Note that some of these variables are marked as obsolete. * lisp/eshell/em-hist.el (eshell-hist-rebind-keys-alist): * lisp/eshell/em-rebind.el (eshell-rebind-keys-alist): TODO: This customization type is used multiple times, and may warrant using `define-widget'. * lisp/eshell/esh-arg.el (eshell-special-chars-outside-quoting): TODO: Do we need a :set function here to append on change? * lisp/eshell/esh-mode.el (eshell-password-prompt-regexp): TODO: Do we need to let-bind the result of `apply' and re-use it twice when calling `format'? This would save one call to `apply'. * lisp/eshell/esh-util.el (eshell-group-file): (eshell-passwd-file): (eshell-hosts-file): TODO: Should we require the file to exist? (eshell-private-file-modes): TODO: The "file mode" customization type is used multiple times, and may be a general enough type for more packages. In this case, does it warrant a file-mode type in wid-edit.el? * lisp/eshell/esh-util.el (eshell-ange-ls-uids): TODO: docstring unclear, saying it should be list of strings, but type says it is an alist from string to nonempty list of strings. * lisp/eshell/esh-cmd.el (eshell-subcommand-bindings): TODO: The customization type to describe a let-binding is used multiple times. Is it worth it to define a let-binding type in wid-edit.el? If not, maybe we should define in eshell anyways to avoid code duplication. --- lisp/eshell/em-alias.el | 2 +- lisp/eshell/em-cmpl.el | 4 +++- lisp/eshell/em-dirs.el | 2 +- lisp/eshell/em-glob.el | 19 ++++++++++--------- lisp/eshell/em-hist.el | 14 +++++++++----- lisp/eshell/em-ls.el | 8 ++++++-- lisp/eshell/em-pred.el | 7 +++++-- lisp/eshell/em-prompt.el | 1 + lisp/eshell/em-rebind.el | 6 +++++- lisp/eshell/em-smart.el | 1 + lisp/eshell/em-term.el | 8 ++++---- lisp/eshell/esh-arg.el | 16 +++++++++++----- lisp/eshell/esh-cmd.el | 5 ++++- lisp/eshell/esh-ext.el | 9 +++++---- lisp/eshell/esh-io.el | 8 ++++---- lisp/eshell/esh-mode.el | 14 +++++++++++--- lisp/eshell/esh-proc.el | 6 +++--- lisp/eshell/esh-util.el | 9 +++++++-- 18 files changed, 91 insertions(+), 48 deletions(-) diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el index 841982c3425..a1530b0842b 100644 --- a/lisp/eshell/em-alias.el +++ b/lisp/eshell/em-alias.el @@ -112,7 +112,7 @@ eshell-aliases-file =20 (defcustom eshell-bad-command-tolerance 3 "The number of failed commands to ignore before creating an alias." - :type 'integer + :type 'natnum ;; :link '(custom-manual "(eshell)Auto-correction of bad commands") :group 'eshell-alias) =20 diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index 732bbb3f1fa..ede20d53a25 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el @@ -131,7 +131,7 @@ eshell-command-completions-alist "An alist that defines simple argument type correlations. This is provided for common commands, as a simplistic alternative to writing a completion function." - :type '(repeat (cons string regexp))) + :type '(alist :key-type string :value-type regexp)) =20 (defun eshell-cmpl--custom-variable-docstring (pcomplete-var) "Generate the docstring of a variable derived from a pcomplete-* variabl= e." @@ -184,6 +184,7 @@ eshell-cmpl-restore-window-delay (eshell-cmpl--custom-variable-docstring 'pcomplete-restore-window-delay) :type (get 'pcomplete-restore-window-delay 'custom-type)) =20 +;; TODO: convert =CE=BB into named function? (defcustom eshell-command-completion-function (lambda () (pcomplete-here (eshell--complete-commands-list))) @@ -195,6 +196,7 @@ eshell-cmpl-command-name-function (eshell-cmpl--custom-variable-docstring 'pcomplete-command-name-function) :type (get 'pcomplete-command-name-function 'custom-type)) =20 +;; TODO: convert =CE=BB into named function? (defcustom eshell-default-completion-function (lambda () (while (pcomplete-here 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) =20 (defcustom eshell-last-dir-unique t "If non-nil, `eshell-last-dir-ring' contains only unique entries." diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el index d00f8c93cd1..9471003eb7f 100644 --- a/lisp/eshell/em-glob.el +++ b/lisp/eshell/em-glob.el @@ -101,8 +101,9 @@ eshell-glob-chars-list :type '(repeat character) :group 'eshell-glob) =20 +;; TODO: convert the =CE=BB into named function? (defcustom eshell-glob-translate-alist - '((?\] . "]") + `((?\] . "]") (?\[ . "[") (?^ . "^") (?? . ".") @@ -111,14 +112,14 @@ eshell-glob-translate-alist (?\( . "\\(") (?\) . "\\)") (?\| . "\\|") - (?# . (lambda (str pos) - (if (and (< (1+ pos) (length str)) - (memq (aref str (1+ pos)) '(?* ?# ?+ ??))) - (cons (if (eq (aref str (1+ pos)) ??) - "?" - (if (eq (aref str (1+ pos)) ?*) - "*" "+")) (+ pos 2)) - (cons "*" (1+ pos)))))) + (?# . ,(lambda (str pos) + (if (and (< (1+ pos) (length str)) + (memq (aref str (1+ pos)) '(?* ?# ?+ ??))) + (cons (cond ((eq (aref str (1+ pos)) ??) "?") + ((eq (aref str (1+ pos)) ?*) "*") + (t "+")) + (+ pos 2)) + (cons "*" (1+ pos)))))) "An alist for translation of extended globbing characters." :type '(alist :key-type character :value-type (choice string function)) 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 @@ -74,6 +74,7 @@ eshell-hist-load-hook :version "24.1" ; removed eshell-hist-initialize :type 'hook) =20 +;; TODO: named function? Maybe not, obsolete function. (defcustom eshell-hist-unload-hook (list (lambda () @@ -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))) =20 (defcustom eshell-save-history-on-exit t @@ -116,7 +117,7 @@ eshell-save-history-on-exit (const :tag "Ask" ask) (const :tag "Always save" t))) =20 -(defcustom eshell-input-filter 'eshell-input-filter-default +(defcustom eshell-input-filter #'eshell-input-filter-default "Predicate for filtering additions to input history. Takes one argument, the input. If non-nil, the input may be saved on the input history list. Default is to save anything that isn't all @@ -171,6 +172,7 @@ eshell-hist-modifier "The regexp used to identity history modifiers." :type 'regexp) =20 +;; TODO: this type is used in multiple places. (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"))) =20 ;;; Internal Variables: =20 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 @@ -86,7 +86,7 @@ eshell-ls-use-in-dired =20 (defcustom eshell-ls-default-blocksize 1024 "The default blocksize to use when display file sizes with -s." - :type 'integer) + :type 'natnum) =20 (defcustom eshell-ls-exclude-regexp nil "Unless -a is specified, files matching this regexp will not be shown." @@ -214,6 +214,7 @@ eshell-ls-applicable ;; Otherwise call FUNC. (,(eval func) ,file))))) =20 +;; TODO: original type was wrong? (defcustom eshell-ls-highlight-alist nil "This alist correlates test functions to color. The format of the members of this alist is @@ -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)) =20 (defvar block-size) (defvar dereference-links) diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index bfb0dad60ef..fa462e0478e 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -65,6 +65,7 @@ eshell-pred-load-hook :version "24.1" ; removed eshell-pred-initialize :type 'hook) =20 +;; TODO: convert =CE=BB's here into named functions? (defcustom eshell-predicate-alist '((?/ . (eshell-pred-file-type ?d)) ; directories (?. . (eshell-pred-file-type ?-)) ; regular files @@ -107,9 +108,11 @@ eshell-predicate-alist The format of each entry is =20 (CHAR . PREDICATE-FUNC-SEXP)" - :type '(repeat (cons character sexp)) + :type '(alist :key-type character :value-type sexp) :risky t) =20 +;; TODO: convert =CE=BB's here into named functions? Or at least allow +;; compiler to compile the =CE=BB's. (defcustom eshell-modifier-alist '((?E . (lambda (lst) (mapcar #'eshell-eval-argument lst))) (?L . (lambda (lst) (mapcar #'downcase lst))) @@ -138,7 +141,7 @@ eshell-modifier-alist The format of each entry is =20 (CHAR . MODIFIER-FUNC-SEXP)" - :type '(repeat (cons character sexp)) + :type '(alist :key-type character :value-type sexp) :risky t) =20 (defvar eshell-predicate-help-string diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el index 9f9e58e83d7..2bebf5f0bf6 100644 --- a/lisp/eshell/em-prompt.el +++ b/lisp/eshell/em-prompt.el @@ -47,6 +47,7 @@ eshell-prompt-load-hook =20 (autoload 'eshell/pwd "em-dirs") =20 +;; TODO: convert =CE=BB into named function? (defcustom eshell-prompt-function (lambda () (concat (abbreviate-file-name (eshell/pwd)) diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el index 75a2848a9d5..c4df2a5df78 100644 --- a/lisp/eshell/em-rebind.el +++ b/lisp/eshell/em-rebind.el @@ -48,6 +48,8 @@ eshell-rebind-load-hook :type 'hook :group 'eshell-rebind) =20 +;; TODO: this type is used multiple times. Is it worth it to extract +;; it into a `define-widget'? (defcustom eshell-rebind-keys-alist '(([(control ?d)] . eshell-delchar-or-maybe-eof) ([backspace] . eshell-delete-backward-char) @@ -55,8 +57,10 @@ eshell-rebind-keys-alist ([(control ?w)] . backward-kill-word) ([(control ?u)] . eshell-kill-input)) "Bind some keys differently if point is in input text." + ;; Waiting for response on the TODO. The other place has changes to + ;; :type. :type '(repeat (cons (vector :tag "Keys to bind" - (repeat :inline t sexp)) + (repeat :inline t sexp)) (function :tag "Command"))) :group 'eshell-rebind) =20 diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el index d8b7fadc2c2..7110e56ee9f 100644 --- a/lisp/eshell/em-smart.el +++ b/lisp/eshell/em-smart.el @@ -91,6 +91,7 @@ eshell-smart-load-hook :type 'hook :group 'eshell-smart) =20 +;; TODO: =CE=BB's to helper function? Obsolete defcustom though. (defcustom eshell-smart-unload-hook (list (lambda () diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el index ab26da857b7..a8778abeacc 100644 --- a/lisp/eshell/em-term.el +++ b/lisp/eshell/em-term.el @@ -85,8 +85,8 @@ eshell-visual-subcommands because git shows logs and diffs using a pager by default. =20 See also `eshell-visual-commands' and `eshell-visual-options'." - :type '(repeat (cons (string :tag "Command") - (repeat (string :tag "Subcommand")))) + :type '(alist :key-type (string :tag "Command") + :value-type (repeat (string :tag "Subcommand"))) :version "24.4") =20 (defcustom eshell-visual-options @@ -106,8 +106,8 @@ eshell-visual-options always uses a pager for output. =20 See also `eshell-visual-commands' and `eshell-visual-subcommands'." - :type '(repeat (cons (string :tag "Command") - (repeat (string :tag "Option")))) + :type '(alist :key-type (string :tag "Command") + :value-type (repeat (string :tag "Option"))) :version "24.4") =20 ;; If you change this from term-term-name, you need to ensure that the diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el index aa1e8f77ea5..2b8182dfc41 100644 --- a/lisp/eshell/esh-arg.el +++ b/lisp/eshell/esh-arg.el @@ -70,6 +70,10 @@ eshell-special-chars-inside-quoting :type '(repeat character) :group 'eshell-arg) =20 +;; TODO: do we need to add a :set function to auto-append +;; `eshell-delimiter-argument-list'? What if entries are removed from +;; `eshell-delimiter-argument-list'? We can also not care and keep +;; this as-is. (defcustom eshell-special-chars-outside-quoting (append eshell-delimiter-argument-list '(?# ?! ?\\ ?\" ?\')) "Characters that require escaping outside of double quotes. @@ -84,11 +88,13 @@ eshell-arg-delimiter (or (=3D pos (point-max)) (memq (char-after pos) eshell-delimiter-argument-list)))) =20 +;; TODO: a lot of =CE=BB's here. Do we need to convert them into named +;; (internal, helper) functions? (defcustom eshell-parse-argument-hook (list ;; a term such as #<buffer NAME>, or #<process NAME> is a buffer ;; or process reference - 'eshell-parse-special-reference + #'eshell-parse-special-reference =20 ;; numbers convert to numbers if they stand alone (lambda () @@ -135,16 +141,16 @@ eshell-parse-argument-hook (eshell-finish-arg)))) =20 ;; parse backslash and the character after - 'eshell-parse-backslash + #'eshell-parse-backslash =20 ;; text beginning with ' is a literally quoted - 'eshell-parse-literal-quote + #'eshell-parse-literal-quote =20 ;; text beginning with " is interpolably quoted - 'eshell-parse-double-quote + #'eshell-parse-double-quote =20 ;; argument delimiter - 'eshell-parse-delimiter) + #'eshell-parse-delimiter) "Define how to process Eshell command line arguments. When each function on this hook is called, point will be at the current position within the argument list. The function should either diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 94aa2ed8906..895f7951baa 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -258,13 +258,16 @@ eshell-deferrable-commands the command." :type '(repeat function)) =20 +;; TODO: let-binding used multiple times. Convert to `define-widget'? (defcustom eshell-subcommand-bindings '((eshell-in-subcommand-p t) (eshell-in-pipeline-p nil) (default-directory default-directory)) "A list of `let' bindings for subcommand environments." :version "29.1" ; removed `process-environment' - :type 'sexp + :type '(repeat (choice (symbol :tag "Bind symbol to nil") + (list (symbol :tag "Symbol name") + (sexp :tag "Bound value")))) :risky t) =20 (defvar eshell-ensure-newline-p nil diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index f350622e78c..dca04669c02 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -63,7 +63,7 @@ eshell-force-execution This can be useful on systems like Windows, where the operating system doesn't support the execution bit for shell scripts; or in cases where you want to associate an interpreter with a particular kind of script -file, but the language won't let you but a `#!' interpreter line in +file, but the language won't let you put a `#!' interpreter line in the file, and you don't want to make it executable since nothing else but Eshell will be able to understand `eshell-interpreter-alist'." @@ -139,8 +139,9 @@ eshell-interpreter-alist functions should throw `eshell-replace-command' with the alternate command form, or they should return a value compatible with the possible return values of `eshell-external-command', which see." - :type '(repeat (cons (choice regexp (function :tag "Predicate")) - (choice string (function :tag "Interpreter")))) + :type '(alist + :key-type (choice regexp (function :tag "Predicate")) + :value-type (choice string (function :tag "Interpreter"))) :group 'eshell-ext) =20 (defcustom eshell-alternate-command-hook nil @@ -158,7 +159,7 @@ eshell-alternate-command-hook =20 (defcustom eshell-command-interpreter-max-length 256 "The maximum length of any command interpreter string, plus args." - :type 'integer + :type 'natnum :group 'eshell-ext) =20 (defcustom eshell-explicit-command-char ?* diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index cccdb49ce2a..1167b00f55a 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -97,24 +97,24 @@ eshell-number-of-handles these Emacs does not currently support with asynchronous processes \(which is what eshell uses so that you can continue doing work in other buffers)." - :type 'integer + :type 'natnum :group 'eshell-io) =20 (defcustom eshell-output-handle 1 "The index of the standard output handle." - :type 'integer + :type 'natnum :group 'eshell-io) =20 (defcustom eshell-error-handle 2 "The index of the standard error handle." - :type 'integer + :type 'natnum :group 'eshell-io) =20 (defcustom eshell-print-queue-size 5 "The size of the print queue, for doing buffered printing. This is basically a speed enhancement, to avoid blocking the Lisp code from executing while Emacs is redisplaying." - :type 'integer + :type 'natnum :group 'eshell-io) =20 (defcustom eshell-virtual-targets diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 0c381dbb86a..a615809ef4d 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -124,7 +124,12 @@ eshell-scroll-to-bottom-on-input =20 See `eshell-preinput-scroll-to-bottom'." :type '(radio (const :tag "Do not scroll Eshell windows" nil) - (const :tag "Scroll all windows showing the buffer" all) + ;; TODO: this looks weird, but matches exactly what + ;; docstring says. Should we update docstring to say + ;; that anything unrecognized is considered "all", and + ;; we can use (other :tag "Tag" all) here? + (choice :tag "Scroll all windows showing the buffer" + (const all) (const t)) (const :tag "Scroll only the selected window" this))) =20 (defcustom eshell-scroll-to-bottom-on-output nil @@ -136,7 +141,9 @@ eshell-scroll-to-bottom-on-output See variable `eshell-scroll-show-maximum-output' and function `eshell-postoutput-scroll-to-bottom'." :type '(radio (const :tag "Do not scroll Eshell windows" nil) - (const :tag "Scroll all windows showing the buffer" all) + ;; TODO: see `eshell-scroll-to-bottom-on-input'. + (choice :tag "Scroll all windows showing the buffer" + (const all) (const t)) (const :tag "Scroll only the selected window" this) (const :tag "Scroll all windows other than selected" other= s))) =20 @@ -151,7 +158,7 @@ eshell-scroll-show-maximum-output (defcustom eshell-buffer-maximum-lines 1024 "The maximum size in lines for eshell buffers. Eshell buffers are truncated from the top to be no greater than this -number, if the function `eshell-truncate-buffer' is on +number, if the function `eshell-truncate-buffer' is in `eshell-output-filter-functions'." :type 'natnum) =20 @@ -172,6 +179,7 @@ eshell-preoutput-filter-functions inserted. They return the string as it should be inserted." :type 'hook) =20 +;; TODO: let-bind result of `apply'? (defcustom eshell-password-prompt-regexp (format "%s[^%s]*[%s]\\s *\\'" (regexp-opt password-word-equivalents t) diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index 00e0c8014e1..838306cb906 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -42,11 +42,11 @@ eshell-proc-load-hook =20 (defcustom eshell-process-wait-seconds 0 "The number of seconds to delay waiting for a synchronous process." - :type 'integer) + :type 'natnum) =20 (defcustom eshell-process-wait-milliseconds 50 "The number of milliseconds to delay waiting for a synchronous process." - :type 'integer) + :type 'natnum) =20 (defcustom eshell-done-messages-in-minibuffer t "If non-nil, subjob \"Done\" messages will display in minibuffer." @@ -526,7 +526,7 @@ eshell-process-interact =20 (defcustom eshell-kill-process-wait-time 5 "Seconds to wait between sending termination signals to a subprocess." - :type 'integer) + :type 'natnum) =20 (defcustom eshell-kill-process-signals '(SIGINT SIGQUIT SIGKILL) "Signals used to kill processes when an Eshell buffer exits. diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 3608c78ba2b..ded020152f4 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -40,14 +40,17 @@ eshell-stringify-t similarly to external commands, as far as successful result output." :type 'boolean) =20 +;; TODO: should we require existing file? (defcustom eshell-group-file "/etc/group" "If non-nil, the name of the group file on your system." :type '(choice (const :tag "No group file" nil) file)) =20 +;; TODO: should we require existing file? (defcustom eshell-passwd-file "/etc/passwd" "If non-nil, the name of the passwd file on your system." :type '(choice (const :tag "No passwd file" nil) file)) =20 +;; TODO: should we require existing file? (defcustom eshell-hosts-file "/etc/hosts" "The name of the /etc/hosts file. Use `pcomplete-hosts-file' instead; this variable is obsolete and @@ -63,13 +66,14 @@ eshell-handle-errors Setting this to nil is offered as an aid to debugging only." :type 'boolean) =20 +;; TODO: could wid-edit.el define a "file-mode" customization type? (defcustom eshell-private-file-modes #o600 ; umask 177 "The file-modes value to use for creating \"private\" files." - :type 'integer) + :type 'natnum) =20 (defcustom eshell-private-directory-modes #o700 ; umask 077 "The file-modes value to use for creating \"private\" directories." - :type 'integer) + :type 'natnum) =20 (defcustom eshell-tar-regexp "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|xz\\|Z\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'" @@ -94,6 +98,7 @@ eshell-convert-numeric-arguments argument matches `eshell-number-regexp'." :type 'boolean) =20 +;; TODO: docstring is unclear; maybe change to an alist type? (defcustom eshell-ange-ls-uids nil "List of user/host/id strings, used to determine remote ownership." :type '(repeat (cons :tag "Host for User/UID map" --=20 2.40.1 --=-=-= Content-Type: text/plain -- Best, RY --=-=-=--
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Ruijie Yu <ruijie@HIDDEN> Subject: bug#63385: Acknowledgement (30.0.50; [DRAFT PATCH v1] Update eshell defcustom definitions) Message-ID: <handler.63385.B.168360770617713.ack <at> debbugs.gnu.org> References: <sdvjzxif6vc.fsf@HIDDEN> X-Gnu-PR-Message: ack 63385 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 63385 <at> debbugs.gnu.org Date: Tue, 09 May 2023 04:49:01 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 63385 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 63385: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63385 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#63385: 30.0.50; [DRAFT PATCH v1] Update eshell defcustom definitions Resent-From: Jim Porter <jporterbugs@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 15 May 2023 04:41:02 +0000 Resent-Message-ID: <handler.63385.B63385.168412560424847 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 63385 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Ruijie Yu <ruijie@HIDDEN>, 63385 <at> debbugs.gnu.org Received: via spool by 63385-submit <at> debbugs.gnu.org id=B63385.168412560424847 (code B ref 63385); Mon, 15 May 2023 04:41:02 +0000 Received: (at 63385) by debbugs.gnu.org; 15 May 2023 04:40:04 +0000 Received: from localhost ([127.0.0.1]:42439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pyQ0B-0006Sf-DE for submit <at> debbugs.gnu.org; Mon, 15 May 2023 00:40:03 -0400 Received: from mail-pf1-f176.google.com ([209.85.210.176]:48178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jporterbugs@HIDDEN>) id 1pyQ09-0006S7-L1 for 63385 <at> debbugs.gnu.org; Mon, 15 May 2023 00:40:02 -0400 Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-643846c006fso13023264b3a.0 for <63385 <at> debbugs.gnu.org>; Sun, 14 May 2023 21:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684125596; x=1686717596; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=rqD9lCkTIuxXh8EyE/Au4wyqwPHCiGeE6RebyCPkCgE=; b=Ly0pbzVDLlkFwt6LnfeqC+dZe2wVewoFTNPiXpXl5LeEKaQ02F2YTJ84XIK610I/cs c63JtQIPZE4/J6SiRWkc/aHN6LpatxR2vD478xKGKoI7SUy3kWynGZEOVHiQJp/MGihK 894OrI7qUKNHLg52hT7KuupTS5edYkHRAjFwF7teStbsn0n0ZmT7AMcJUe7ApmwZzSSg 4qEQGPfhW7Y1es3Qng6BfTE2okFeHwmcZlN7PbBTW4ucMd1ElwGkvEuRX1ZWL01/hOo0 wBPTBN7qJQ9VZPSOS3q1/hZHe80rSrF7Vxt4YwyCFyWmrJaiQa5ZpNBSpAATmyNAFyNi XWQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684125596; x=1686717596; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rqD9lCkTIuxXh8EyE/Au4wyqwPHCiGeE6RebyCPkCgE=; b=N8zZLJ8aR4PoAph8diTbLxE9MX7lXCtmdkZgeAQFcqlDU3i0l4IJVjC3juPPT2Pzt1 5Yl0hZP45yMMjwrJedC0mz6F3qW97wc9XRMWvNB37IxWsuTm6Xcewko+S82M0gQ20HcK VI1MVGd8GBT9qMrPxXQGuI7+/RLag+YXCsx3whJOdl8kHXhFcF4dymxPEgR5WGp1s4pC q5s9EBgAPQr/NPDA0KvtBw5wk6uQ87/vtFg41zuxbJywEwpjBKD3ACW7SvBsxW3ripfk x1hnvAljfEkB+BIm9PVNJTLr+0HQ6tRWt3iQpYPZSjH/b5Bs3y+LPT+kA7HXjP+ku9fu ioJg== X-Gm-Message-State: AC+VfDyHIbL3VG3o4yGAiHzZcN2PL4QWAtUOa8CzR2BFOOg3nHvKwzuG NOkNKAinKxeVSw91CXHIK6855+aupU0= X-Google-Smtp-Source: ACHHUZ4N4m1IJmVQT/2jXzslZAD14tlkmIqAL3l3klbHG1GWHg4dAKD71ziqWyfgr+ECaKEujxAscQ== X-Received: by 2002:a05:6a00:8c5:b0:647:4dee:62a4 with SMTP id s5-20020a056a0008c500b006474dee62a4mr26740151pfu.34.1684125595666; Sun, 14 May 2023 21:39:55 -0700 (PDT) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id v6-20020a63d546000000b004fbd91d9716sm10483695pgi.15.2023.05.14.21.39.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 May 2023 21:39:55 -0700 (PDT) Message-ID: <1750da77-a6c2-dc6d-53ef-fba3e0f68034@HIDDEN> Date: Sun, 14 May 2023 21:39:55 -0700 MIME-Version: 1.0 Content-Language: en-US References: <sdvjzxif6vc.fsf@HIDDEN> From: Jim Porter <jporterbugs@HIDDEN> In-Reply-To: <sdvjzxif6vc.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 5/8/2023 9:47 PM, Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Here attached is a draft patch to update eshell defcustoms. The commit > message contains a long [TODO] section outlining all my ideas on how to > change a given portion, but these ideas probably need more input. Thanks, I think most of these make sense. I'm not too sure what to do about the parts you marked with "TODO" though; it'll take some thought for each of them. (For example, I feel like there's a better way to let users customize the keys in em-rebind.el and elsewhere.) How about removing them from the patch, and then we can merge the remainder?
X-Loop: help-debbugs@HIDDEN Subject: bug#63385: 30.0.50; [DRAFT PATCH v1] Update eshell defcustom definitions Resent-From: Stefan Kangas <stefankangas@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 01 Sep 2023 19:34:01 +0000 Resent-Message-ID: <handler.63385.B63385.16935968304195 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 63385 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Jim Porter <jporterbugs@HIDDEN> Cc: Ruijie Yu <ruijie@HIDDEN>, 63385 <at> debbugs.gnu.org Received: via spool by 63385-submit <at> debbugs.gnu.org id=B63385.16935968304195 (code B ref 63385); Fri, 01 Sep 2023 19:34:01 +0000 Received: (at 63385) by debbugs.gnu.org; 1 Sep 2023 19:33:50 +0000 Received: from localhost ([127.0.0.1]:33981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qc9tt-00015b-Ln for submit <at> debbugs.gnu.org; Fri, 01 Sep 2023 15:33:49 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]:55368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1qc9ts-00015P-4O for 63385 <at> debbugs.gnu.org; Fri, 01 Sep 2023 15:33:48 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-500c63c9625so4262380e87.2 for <63385 <at> debbugs.gnu.org>; Fri, 01 Sep 2023 12:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693596813; x=1694201613; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yhjUSqWLq4qiOJFri8GPBG22AMpg09JxiJZQuY/YYn8=; b=hT4pIa5PwLLFO7a0qKgX7ebNqFAz7awsfE9g2VXjfNUKpjko2eAh+TNCknSNUY1DRf doUb65zXTScPXBOG1ezy62ednKfGqjRj5iOo6TL+iMeYnx4Slx2WB/y697RtPQHVuzaf oJvNrGCoRKNswKrVjd+bAYYYySzsIbeNG1FrkjFEYMu73QMtxasRiM9bCP1eEXKgXfxT usZ1xe4j5xaw80scFRzQGNH8hCbnZw+7ehIxZciBPxGXN2/O0ydeJSEPnVz2xAj0pcgw 5Y7slsRgeY6Nezp1xN2du7P/Ipk7HWiaK9zA0tGdkPeIN6Xur6IX2xAW76kqS/5RDhgi ybWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693596813; x=1694201613; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yhjUSqWLq4qiOJFri8GPBG22AMpg09JxiJZQuY/YYn8=; b=OSfliCx2hPxElcFxtFOsRyidD7Wi9h2Z7m9lNj4bTHaTM3tlleCaxSyW64BgzoxT80 D+/Zfj5SugvGHUQrPFhTUaBPJWjrgEX/Og5ghQQQEbNUWSi8gagptB11agN6G4kBw2tl klEfrlzN6AE57ptcmvYiXyFDQd3R3XkF4LAwvEGflMzer5murLPJjZeTKZW5ojJRND2I qo1N+8SMT1BBdOeUwAHNsvDFd75h2MgJJoqxe+yUgDK2Jm+jQQqaBLq1lpv5lpo58kW4 1q/SPOxcQexTY0wRCZnHT22/+QIx5FFwGAuRJjtmJP5TiMIe8TREg511a45rkl+W5u8k 73Pg== X-Gm-Message-State: AOJu0YxdCZQD6CntdjL6EhYc4+7RhgHKDaAzlf4eiG1fieWA+r0RVNDt aIcxqYRof4nH/d6zIB1X177kx0iB0kCUOfszPGuMSHz/ X-Google-Smtp-Source: AGHT+IFsvDIPwfALDiHgPXhiBQRFtb/aOfLzwCnUv0Wxo5Pi4j6DSRXNgYWLZL5n5hspDDv8NE1CjFde8pyeOJm+bwk= X-Received: by 2002:a05:6512:1143:b0:4fd:faa5:64ed with SMTP id m3-20020a056512114300b004fdfaa564edmr2207174lfg.11.1693596812558; Fri, 01 Sep 2023 12:33:32 -0700 (PDT) MIME-Version: 1.0 References: <sdvjzxif6vc.fsf@HIDDEN> <1750da77-a6c2-dc6d-53ef-fba3e0f68034@HIDDEN> In-Reply-To: <1750da77-a6c2-dc6d-53ef-fba3e0f68034@HIDDEN> From: Stefan Kangas <stefankangas@HIDDEN> Date: Fri, 1 Sep 2023 21:33:21 +0200 Message-ID: <CADwFkmkuWArKGxss=fxJo4CGtSxECYgZ1QeMeNCV9MweBxUFwA@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Jim Porter <jporterbugs@HIDDEN> writes: > > On 5/8/2023 9:47 PM, Ruijie Yu via Bug reports for GNU Emacs, the Swiss > army knife of text editors wrote: > > Here attached is a draft patch to update eshell defcustoms. The commit > > message contains a long [TODO] section outlining all my ideas on how to > > change a given portion, but these ideas probably need more input. > > Thanks, I think most of these make sense. I'm not too sure what to do > about the parts you marked with "TODO" though; it'll take some thought > for each of them. (For example, I feel like there's a better way to let > users customize the keys in em-rebind.el and elsewhere.) > > How about removing them from the patch, and then we can merge the remainder? Sounds good to me.
X-Loop: help-debbugs@HIDDEN Subject: bug#63385: 30.0.50; [DRAFT PATCH v1] Update eshell defcustom definitions Resent-From: Mauro Aranda <maurooaranda@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 02 Sep 2023 11:34:01 +0000 Resent-Message-ID: <handler.63385.B63385.169365441516844 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 63385 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Ruijie Yu <ruijie@HIDDEN> Cc: Jim Porter <jporterbugs@HIDDEN>, 63385 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> Received: via spool by 63385-submit <at> debbugs.gnu.org id=B63385.169365441516844 (code B ref 63385); Sat, 02 Sep 2023 11:34:01 +0000 Received: (at 63385) by debbugs.gnu.org; 2 Sep 2023 11:33:35 +0000 Received: from localhost ([127.0.0.1]:35329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qcOsh-0004Nb-60 for submit <at> debbugs.gnu.org; Sat, 02 Sep 2023 07:33:35 -0400 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 <maurooaranda@HIDDEN>) id 1qcOsf-0004NO-83 for 63385 <at> debbugs.gnu.org; Sat, 02 Sep 2023 07:33:34 -0400 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1c11d53221cso1895310fac.2 for <63385 <at> 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) 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) Message-ID: <0ffda98e-e8b2-5318-92f1-038f6e67f519@HIDDEN> Date: Sat, 2 Sep 2023 08:33:13 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US References: <sdvjzxif6vc.fsf@HIDDEN> <1750da77-a6c2-dc6d-53ef-fba3e0f68034@HIDDEN> <CADwFkmkuWArKGxss=fxJo4CGtSxECYgZ1QeMeNCV9MweBxUFwA@HIDDEN> From: Mauro Aranda <maurooaranda@HIDDEN> In-Reply-To: <CADwFkmkuWArKGxss=fxJo4CGtSxECYgZ1QeMeNCV9MweBxUFwA@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.5 (---) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -4.5 (----) Ruijie Yu <ruijie@HIDDEN> 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.
Received: (at control) by debbugs.gnu.org; 4 Sep 2023 08:29:21 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 04 04:29:20 2023 Received: from localhost ([127.0.0.1]:48334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qd4xU-0005Jy-L5 for submit <at> debbugs.gnu.org; Mon, 04 Sep 2023 04:29:20 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:59619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1qd4xT-0005Jk-Eq for control <at> debbugs.gnu.org; Mon, 04 Sep 2023 04:29:19 -0400 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2bc63e0d8cdso16495741fa.2 for <control <at> debbugs.gnu.org>; Mon, 04 Sep 2023 01:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693816153; x=1694420953; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=/LqaIdnIOHZHlIQZbqp7o4AicTIBpLit3+t7oalgCZk=; b=nGR5wJy4ThaXLarV5iAwEWI8mfCYvFZaCF/3f/af0IeSvIZ2w8yMsFGW1TIya7Yo6g oj3YLFqxX6iYlmhu5ZNzNkqUMFImLef4FqmMsBhnfE1C8pXBoOTxC5BWX4ZDI1Er7TbI vcGy4gVhvPsBnS8ysyR+/LB5FWOAiaVbZfqhQn+Var5iu9xxn1LBQmdyyVErboKHGorC yw+0wJ143CpXyaGJSO2A+eo6iSjT2bSQ/f29nBlZ8ZvdvbNJ+UE0vbANfLYEB5MuOSl0 q3G6JFyzqCX7IOjHdFF4EyCaE+6R/5CTG/Kif4XzmoDCRyeBCTTNIxNwd9HMcEQzcn1C s5gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693816153; x=1694420953; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/LqaIdnIOHZHlIQZbqp7o4AicTIBpLit3+t7oalgCZk=; b=gtSGClDkLpACWhWFg4BJMS36h6NV7Vjjs6aimv3vu5EIeXTgWIdfWAXzrtVWKfPeL+ 1zYdjoffKJyG063Wmx+RpU6PmGLs1YLY3PXOejvMgDBBBPGj9bBeAZpKIJo1Wlkcy0tx YH1YUw8krIiKgdz4pCi9vptCTf2Tlw8J/EvQThMbrh7rxRhQIs4tS2qezm9BP1aQ0uEw fwUllEcSOsXKoDrkQtXIsq5tSZqDTg+TaEvNjL1jGzY4SoyvkwBTDigrdm/85WC08D1B vN9qQFRypab+024cpRB3nKUrAl0s4KRaWDx1uW0yiFI/bwHncDUFjbWZ8TM+dDuhWJDa NqQA== X-Gm-Message-State: AOJu0YyqCOZSf6tJM8ytv30vkhy9Kc1dF00u70KKImZ6qOchPn8EmMAI vk/ZevYl/DG7ZJ5kLo0umEPczPUdTTNUDjYuS1FPyHhf44I= X-Google-Smtp-Source: AGHT+IFOIp3YB6b4ADHLbH5YQfkPYu3y9Ok9yNziUQC9UhuEvfyLrw/iYDJFDw6H5czEDDv5k1jW3HRiHjZ0Oma/vvc= X-Received: by 2002:a05:6512:48d4:b0:500:9f03:9157 with SMTP id er20-20020a05651248d400b005009f039157mr5713003lfb.65.1693816153459; Mon, 04 Sep 2023 01:29:13 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 4 Sep 2023 01:29:13 -0700 From: Stefan Kangas <stefankangas@HIDDEN> MIME-Version: 1.0 Date: Mon, 4 Sep 2023 01:29:13 -0700 Message-ID: <CADwFkmm9N2GeWQEabpKCp9NZdB6kO6XFyShSenyiGja3va-H0w@HIDDEN> Subject: control message for bug #63385 To: control <at> debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) severity 63385 minor quit
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.