aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorStefan Kangas2022-08-16 17:14:33 +0200
committerStefan Kangas2022-08-17 16:21:09 +0200
commita6412b96e72c32ee981f469a564c8d2155d575aa (patch)
treea2342cddcb5a3a9e1849363f3f03c78e900a7a29 /doc/misc
parentd214dd67cd5910c4c9ecefdf879886c4d01b0c27 (diff)
downloademacs-a6412b96e72c32ee981f469a564c8d2155d575aa.tar.gz
emacs-a6412b96e72c32ee981f469a564c8d2155d575aa.zip
Move dired-guess commands from dired-x to dired
* lisp/dired-x.el (dired-shell-command-history) (dired-guess-shell-alist-default, dired-guess-default) (dired-guess-shell-command): Move from here... * lisp/dired-aux.el (dired-shell-command-history) (dired-guess-shell-alist-default, dired-guess-default) (dired-guess-shell-command): ...to here. (Bug#21981) * lisp/dired-x.el (dired-guess-shell-gnutar) (dired-guess-shell-gzip-quiet, dired-guess-shell-znew-switches) (dired-guess-shell-case-fold-search, dired-guess-shell-alist-user): Move from here... * lisp/dired.el (dired-guess-shell-gnutar) (dired-guess-shell-gzip-quiet, dired-guess-shell-znew-switches) (dired-guess-shell-case-fold-search, dired-guess-shell-alist-user): ...to here. Change :group to dired-guess. (dired-guess): New defgroup. * test/lisp/dired-x-tests.el (dired-guess-default): Move from here... * test/lisp/dired-aux-tests.el (dired-guess-default): ...to here. * doc/misc/dired-x.texi (Features, Technical Details, Installation): Delete any mention of shell command guessing. (Shell Command Guessing): Move from here... * doc/emacs/dired.texi (Shell Command Guessing): ...to here. Adapt to better fit the Emacs Manual conventions. * lisp/dired-aux.el (dired-do-shell-command): Doc fix to adjust for above changes. * etc/NEWS: Announce the above change.
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/dired-x.texi112
1 files changed, 0 insertions, 112 deletions
diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi
index 50d9914081c..002164ed91f 100644
--- a/doc/misc/dired-x.texi
+++ b/doc/misc/dired-x.texi
@@ -92,7 +92,6 @@ For @file{dired-x.el} as distributed with GNU Emacs @value{EMACSVER}.
92* Introduction:: 92* Introduction::
93* Installation:: 93* Installation::
94* Omitting Files in Dired:: 94* Omitting Files in Dired::
95* Shell Command Guessing::
96* Virtual Dired:: 95* Virtual Dired::
97* Advanced Mark Commands:: 96* Advanced Mark Commands::
98* Multiple Dired Directories:: 97* Multiple Dired Directories::
@@ -135,9 +134,6 @@ Some features provided by Dired Extra:
135Omitting uninteresting files from Dired listing 134Omitting uninteresting files from Dired listing
136(@pxref{Omitting Files in Dired}). 135(@pxref{Omitting Files in Dired}).
137@item 136@item
138Guessing shell commands in Dired buffers
139(@pxref{Shell Command Guessing}).
140@item
141Running Dired command in non-Dired buffers 137Running Dired command in non-Dired buffers
142(@pxref{Virtual Dired}). 138(@pxref{Virtual Dired}).
143@item 139@item
@@ -165,8 +161,6 @@ When @file{dired-x.el} is loaded, some standard Dired functions from
165Dired}), if it is active. @code{dired-find-buffer-nocreate} and 161Dired}), if it is active. @code{dired-find-buffer-nocreate} and
166@code{dired-initial-position} respect the value of 162@code{dired-initial-position} respect the value of
167@code{dired-find-subdir} (@pxref{Miscellaneous Commands}). 163@code{dired-find-subdir} (@pxref{Miscellaneous Commands}).
168@code{dired-read-shell-command} uses @code{dired-guess-shell-command}
169(@pxref{Shell Command Guessing}) to offer a smarter default command.
170 164
171@node Installation 165@node Installation
172@chapter Installation 166@chapter Installation
@@ -184,7 +178,6 @@ In your @file{~/.emacs} file, or in the system-wide initialization file
184(with-eval-after-load 'dired 178(with-eval-after-load 'dired
185 (require 'dired-x) 179 (require 'dired-x)
186 ;; Set dired-x global variables here. For example: 180 ;; Set dired-x global variables here. For example:
187 ;; (setq dired-guess-shell-gnutar "gtar")
188 ;; (setq dired-x-hands-off-my-keys nil) 181 ;; (setq dired-x-hands-off-my-keys nil)
189 )) 182 ))
190(add-hook 'dired-mode-hook 183(add-hook 'dired-mode-hook
@@ -436,111 +429,6 @@ Loading @file{dired-x.el} will install Dired Omit by putting
436call @code{dired-extra-startup}, which in turn calls @code{dired-omit-startup} 429call @code{dired-extra-startup}, which in turn calls @code{dired-omit-startup}
437in your @code{dired-mode-hook}. 430in your @code{dired-mode-hook}.
438 431
439@node Shell Command Guessing
440@chapter Shell Command Guessing
441@cindex guessing shell commands for files.
442
443Based upon the name of a file, Dired tries to guess what shell
444command you might want to apply to it. For example, if you have point
445on a file named @file{foo.tar} and you press @kbd{!}, Dired will guess
446you want to @samp{tar xvf} it and suggest that as the default shell
447command.
448
449The default is mentioned in brackets and you can type @kbd{M-n} to get
450the default into the minibuffer and then edit it, e.g., to change
451@samp{tar xvf} to @samp{tar tvf}. If there are several commands for a given
452file, e.g., @samp{xtex} and @samp{dvips} for a @file{.dvi} file, you can type
453@kbd{M-n} several times to see each of the matching commands.
454
455Dired only tries to guess a command for a single file, never for a list
456of marked files.
457
458The following variables control guessing of shell commands:
459
460@defvar dired-guess-shell-alist-default
461This variable specifies the predefined rules for guessing shell
462commands suitable for certain files. Set this to @code{nil} to turn
463guessing off. The elements of @code{dired-guess-shell-alist-user}
464(defined by the user) will override these rules.
465@end defvar
466
467@defvar dired-guess-shell-alist-user
468If non-@code{nil}, this variables specifies the user-defined alist of
469file regexps and their suggested commands. These rules take
470precedence over the predefined rules in the variable
471@code{dired-guess-shell-alist-default} (to which they are prepended)
472when @code{dired-do-shell-command} is run). The default is
473@code{nil}.
474
475Each element of the alist looks like
476
477@example
478(@var{regexp} @var{command}@dots{})
479@end example
480
481@noindent
482where each @var{command} can either be a string or a Lisp expression
483that evaluates to a string. If several commands are given, all of
484them will temporarily be pushed onto the history.
485
486A @samp{*} in the shell command stands for the file name that matched
487@var{regexp}. When Emacs invokes the @var{command}, it replaces each
488instance of @samp{*} with the matched file name.
489
490You can set this variable in your @file{~/.emacs}. For example,
491to add rules for @samp{.foo} and @samp{.bar} file extensions, write
492
493@example
494(setq dired-guess-shell-alist-user
495 (list
496 (list "\\.foo$" "@var{foo-command}");; fixed rule
497 ;; possibly more rules...
498 (list "\\.bar$";; rule with condition test
499 '(if @var{condition}
500 "@var{bar-command-1}"
501 "@var{bar-command-2}"))))
502@end example
503
504@noindent
505This will override any predefined rules for the same extensions.
506@end defvar
507
508@defvar dired-guess-shell-case-fold-search
509If this variable is non-@code{nil},
510@code{dired-guess-shell-alist-default} and
511@code{dired-guess-shell-alist-user} are matched case-insensitively.
512The default is @code{t}.
513@end defvar
514
515@cindex passing GNU Tar its @samp{z} switch.
516@defvar dired-guess-shell-gnutar
517If this variable is non-@code{nil}, it specifies the name of the GNU
518Tar executable (e.g., @file{tar} or @file{gnutar}). GNU Tar's
519@samp{z} switch is used for compressed archives. If you don't have
520GNU Tar, set this to @code{nil}: a pipe using @command{zcat} is then
521used instead. The default is @code{nil}.
522@end defvar
523
524@cindex @code{gzip}
525@defvar dired-guess-shell-gzip-quiet
526A non-@code{nil} value of this variable means that @samp{-q} is passed
527to @command{gzip}, possibly overriding a verbose option in the @env{GZIP}
528environment variable. The default is @code{t}.
529@end defvar
530
531@cindex @code{znew}
532@defvar dired-guess-shell-znew-switches nil
533This variable specifies a string of switches passed to @command{znew}.
534An example is @samp{-K} which will make @command{znew} keep a @file{.Z}
535file when it is smaller than the @file{.gz} file. The default is
536@code{nil}: no additional switches are passed to @command{znew}.
537@end defvar
538
539@defvar dired-shell-command-history nil
540This variable holds the history list for commands that read
541dired-shell commands.
542@end defvar
543
544@node Virtual Dired 432@node Virtual Dired
545@chapter Virtual Dired 433@chapter Virtual Dired
546 434