branch: externals/transient commit 202271f755497bacb50a1f2b3c93566e816f447e Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Resurrect transient-files class Deprecating it in the previous commit was premature. However to make it actually useful it has to derive from `transient-option' and set some default values. --- docs/transient.org | 9 ++++----- docs/transient.texi | 9 ++++----- lisp/transient.el | 12 ++++++++---- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/docs/transient.org b/docs/transient.org index 4941a8a434..85da5d94ce 100644 --- a/docs/transient.org +++ b/docs/transient.org @@ -8,7 +8,7 @@ #+TEXINFO_DIR_CATEGORY: Emacs #+TEXINFO_DIR_TITLE: Transient: (transient). #+TEXINFO_DIR_DESC: Transient Commands -#+SUBTITLE: for version 0.3.7 (v0.3.7-8-gc9ab648e+1) +#+SUBTITLE: for version 0.3.7 (v0.3.7-9-g667488eb+1) #+TEXINFO_DEFFN: t #+OPTIONS: H:4 num:4 toc:2 @@ -37,7 +37,7 @@ Calling a suffix command usually causes the transient to be exited but suffix commands can also be configured to not exit the transient. #+TEXINFO: @noindent -This manual is for Transient version 0.3.7 (v0.3.7-8-gc9ab648e+1). +This manual is for Transient version 0.3.7 (v0.3.7-9-g667488eb+1). #+BEGIN_QUOTE Copyright (C) 2018-2021 Jonas Bernoulli <jo...@bernoul.li> @@ -1421,9 +1421,8 @@ object should not affect later invocations. - The ~transient-switches~ class can be used for a set of mutually exclusive command-line switches. -- The ~transient-files~ class is deprecated in favor of - ~transient-option'~, which learned all the tricks of this class. - Just switch the class and you are ready to go. +- The ~transient-files~ class can be used for a "--" argument that + indicates that all remaining arguments are files. - Classes used for infix commands that represent variables should derived from the abstract ~transient-variables~ class. diff --git a/docs/transient.texi b/docs/transient.texi index 8c8ea9d166..ae44d41aa6 100644 --- a/docs/transient.texi +++ b/docs/transient.texi @@ -31,7 +31,7 @@ General Public License for more details. @finalout @titlepage @title Transient User and Developer Manual -@subtitle for version 0.3.7 (v0.3.7-8-gc9ab648e+1) +@subtitle for version 0.3.7 (v0.3.7-9-g667488eb+1) @author Jonas Bernoulli @page @vskip 0pt plus 1filll @@ -65,7 +65,7 @@ Calling a suffix command usually causes the transient to be exited but suffix commands can also be configured to not exit the transient. @noindent -This manual is for Transient version 0.3.7 (v0.3.7-8-gc9ab648e+1). +This manual is for Transient version 0.3.7 (v0.3.7-9-g667488eb+1). @quotation Copyright (C) 2018-2021 Jonas Bernoulli <jonas@@bernoul.li> @@ -1751,9 +1751,8 @@ exclusive command-line switches. @item -The @code{transient-files} class is deprecated in favor of -@code{transient-option'}, which learned all the tricks of this class. -Just switch the class and you are ready to go. +The @code{transient-files} class can be used for a "--" argument that +indicates that all remaining arguments are files. @item diff --git a/lisp/transient.el b/lisp/transient.el index afde84e3c2..c364c127b9 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -741,10 +741,14 @@ slot is non-nil." (argument-regexp :initarg :argument-regexp)) "Class used for sets of mutually exclusive command-line switches.") -(defclass transient-files (transient-infix) () - "This class is deprecated in favor of `transient-option'. -`transient-option' learned all the tricks of this class. -Just switch the class and you are ready to go.") +(defclass transient-files (transient-option) () + ((key :initform "--") + (argument :initform "--") + (multi-value :initform rest) + (reader :initform transient-read-files)) + "Class used for the \"--\" argument or similar. +All remaining arguments are treated as files. +They become the value of this argument.") ;;;; Group