From 5b6c3a20a32273d094c72bb1b84fb3ada196eef4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 24 Dec 2021 03:24:44 +0100 Subject: [PATCH] Prefer the defcustom :risky property in eshell * lisp/eshell/em-banner.el (eshell-banner-message): * lisp/eshell/em-hist.el (eshell-input-filter): * lisp/eshell/em-pred.el (eshell-predicate-alist) (eshell-modifier-alist): * lisp/eshell/esh-cmd.el (eshell-subcommand-bindings): * lisp/eshell/esh-io.el (eshell-virtual-targets): * lisp/eshell/esh-var.el (eshell-variable-aliases-list): Prefer defcustom :risky property to setting 'risky-local-variable manually. --- lisp/eshell/em-banner.el | 3 +-- lisp/eshell/em-hist.el | 5 ++--- lisp/eshell/em-pred.el | 10 ++++------ lisp/eshell/esh-cmd.el | 5 ++--- lisp/eshell/esh-io.el | 3 +-- lisp/eshell/esh-var.el | 5 ++--- 6 files changed, 12 insertions(+), 19 deletions(-) diff --git a/lisp/eshell/em-banner.el b/lisp/eshell/em-banner.el index 034fa059b16..cebb030deda 100644 --- a/lisp/eshell/em-banner.el +++ b/lisp/eshell/em-banner.el @@ -61,10 +61,9 @@ modules may have a simple template to begin with." "The banner message to be displayed when Eshell is loaded. This can be any sexp, and should end with at least two newlines." :type 'sexp + :risky t :group 'eshell-banner) -(put 'eshell-banner-message 'risky-local-variable t) - (defcustom eshell-banner-load-hook nil "A list of functions to run when `eshell-banner' is loaded." :version "24.1" ; removed eshell-banner-initialize diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index d01e763b3ea..ea9b820bcd0 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -125,9 +125,8 @@ the input history list. Default is to save anything that isn't all whitespace." :type '(radio (function-item eshell-input-filter-default) (function-item eshell-input-filter-initial-space) - (function :tag "Other function"))) - -(put 'eshell-input-filter 'risky-local-variable t) + (function :tag "Other function")) + :risky t) (defun eshell-hist--update-keymap (symbol value) "Update `eshell-hist-mode-map' for `eshell-hist-match-partial'." diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index fc41bb82980..41afcc3dce4 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -107,9 +107,8 @@ ordinary strings." The format of each entry is (CHAR . PREDICATE-FUNC-SEXP)" - :type '(repeat (cons character sexp))) - -(put 'eshell-predicate-alist 'risky-local-variable t) + :type '(repeat (cons character sexp)) + :risky t) (defcustom eshell-modifier-alist '((?E . (lambda (lst) @@ -144,9 +143,8 @@ The format of each entry is The format of each entry is (CHAR ENTRYWISE-P MODIFIER-FUNC-SEXP)" - :type '(repeat (cons character sexp))) - -(put 'eshell-modifier-alist 'risky-local-variable t) + :type '(repeat (cons character sexp)) + :risky t) (defvar eshell-predicate-help-string "Eshell predicate quick reference: diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 213b7ab2893..1ddcc50f6fd 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -258,9 +258,8 @@ the command." (default-directory default-directory) (process-environment (eshell-copy-environment))) "A list of `let' bindings for subcommand environments." - :type 'sexp) - -(put 'risky-local-variable 'eshell-subcommand-bindings t) + :type 'sexp + :risky t) (defvar eshell-ensure-newline-p nil "If non-nil, ensure that a newline is emitted after a Lisp form. diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index c2471912ab8..205275154b8 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -147,10 +147,9 @@ not be added to this variable." function (choice (const :tag "Func returns output-func" t) (const :tag "Func is output-func" nil)))) + :risky t :group 'eshell-io) -(put 'eshell-virtual-targets 'risky-local-variable t) - ;;; Internal Variables: (defvar eshell-current-handles nil) diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 9aa50f2bd0f..1c5a2f28cb7 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -205,9 +205,8 @@ Additionally, each member may specify if it should be copied to the environment of created subprocesses." :type '(repeat (list string sexp (choice (const :tag "Copy to environment" t) - (const :tag "Use only in Eshell" nil))))) - -(put 'eshell-variable-aliases-list 'risky-local-variable t) + (const :tag "Use only in Eshell" nil)))) + :risky t) (defvar-keymap eshell-var-mode-map "C-c M-v" #'eshell-insert-envvar) -- 2.39.2