mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-26 07:33:47 +00:00
lisp/*.el: Fix typos; use string-match-p, looking-at-p, setq-local, defvar-local.
* lisp/allout-widgets.el (allout-widgets-mode-off) (allout-widgets-mode-on, allout-widgets-pre-command-business) (allout-widgets-post-command-business) (allout-widgets-after-copy-or-kill-function) (allout-widgets-after-undo-function, allout-test-range-overlaps) (allout-decorate-item-and-context) (allout-graphics-modification-handler): Fix typos in docstrings. (allout-get-or-create-parent-widget): Use `looking-at-p'. * lisp/cmuscheme.el (scheme-start-file): Doc fix. (inferior-scheme-mode, switch-to-scheme): Fix typos in docstrings. (scheme-input-filter): Use `string-match-p'. * lisp/composite.el (compose-gstring-for-terminal): Fix typo in docstring. * lisp/dired-x.el: Use Dired consistently in docstrings. * lisp/dired.el: Use Dired consistently in docstrings. (dired-readin, dired-mode): Use `setq-local'. (dired-switches-alist): Make defvar-local. (dired-buffers-for-dir): Use `zerop'. (dired-safe-switches-p, dired-switches-escape-p) (dired-insert-old-subdirs, dired-move-to-end-of-filename) (dired-glob-regexp, dired-in-this-tree, dired-goto-file-1) (dired-sort-set-mode-line, dired-sort-toggle, dired-sort-R-check): (dired-goto-next-nontrivial-file): Use `string-match-p'. (dired-align-file, dired-insert-directory, dired-mark-files-in-region) (dired-toggle-marks, dired-mark-files-containing-regexp) (dired-mark-symlinks, dired-mark-directories, dired-mark-executables) (dired-flag-auto-save-files, dired-flag-backup-files): Use `looking-at-p'. (dired-mark-files-regexp, dired-build-subdir-alist): Use `string-match-p', `looking-at-p'. * lisp/dos-w32.el (untranslated-canonical-name, untranslated-file-p) (direct-print-region-helper): Use `string-match-p'.
This commit is contained in:
parent
4628c0bf57
commit
cedf5c9dbe
@ -1,7 +1,46 @@
|
||||
2013-06-21 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* allout-widgets.el (allout-widgets-mode-off)
|
||||
(allout-widgets-mode-on, allout-widgets-pre-command-business)
|
||||
(allout-widgets-post-command-business)
|
||||
(allout-widgets-after-copy-or-kill-function)
|
||||
(allout-widgets-after-undo-function, allout-test-range-overlaps)
|
||||
(allout-decorate-item-and-context)
|
||||
(allout-graphics-modification-handler): Fix typos in docstrings.
|
||||
(allout-get-or-create-parent-widget): Use `looking-at-p'.
|
||||
|
||||
* cmuscheme.el (scheme-start-file): Doc fix.
|
||||
(inferior-scheme-mode, switch-to-scheme): Fix typos in docstrings.
|
||||
(scheme-input-filter): Use `string-match-p'.
|
||||
|
||||
* composite.el (compose-gstring-for-terminal): Fix typo in docstring.
|
||||
|
||||
* dired-x.el: Use Dired consistently in docstrings.
|
||||
|
||||
* dired.el: Use Dired consistently in docstrings.
|
||||
(dired-readin, dired-mode): Use `setq-local'.
|
||||
(dired-switches-alist): Make defvar-local.
|
||||
(dired-buffers-for-dir): Use `zerop'.
|
||||
(dired-safe-switches-p, dired-switches-escape-p)
|
||||
(dired-insert-old-subdirs, dired-move-to-end-of-filename)
|
||||
(dired-glob-regexp, dired-in-this-tree, dired-goto-file-1)
|
||||
(dired-sort-set-mode-line, dired-sort-toggle, dired-sort-R-check):
|
||||
(dired-goto-next-nontrivial-file): Use `string-match-p'.
|
||||
(dired-align-file, dired-insert-directory, dired-mark-files-in-region)
|
||||
(dired-toggle-marks, dired-mark-files-containing-regexp)
|
||||
(dired-mark-symlinks, dired-mark-directories, dired-mark-executables)
|
||||
(dired-flag-auto-save-files, dired-flag-backup-files):
|
||||
Use `looking-at-p'.
|
||||
(dired-mark-files-regexp, dired-build-subdir-alist):
|
||||
Use `string-match-p', `looking-at-p'.
|
||||
|
||||
* dos-w32.el (untranslated-canonical-name, untranslated-file-p)
|
||||
(direct-print-region-helper): Use `string-match-p'.
|
||||
|
||||
2013-06-21 Leo Liu <sdl.web@gmail.com>
|
||||
|
||||
* comint.el (comint-redirect-results-list-from-process): Fix
|
||||
infinite loop.
|
||||
* comint.el (comint-redirect-results-list-from-process):
|
||||
Fix infinite loop.
|
||||
|
||||
2013-06-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
|
@ -293,8 +293,8 @@ The number varies according to the evanescence of objects on a
|
||||
"If non-nil, show cursor position of each item decoration.
|
||||
|
||||
This is for debugging purposes, and generally set at need in a
|
||||
buffer rather than as a prevailing configuration \(but it's handy
|
||||
to publicize it by making it a customization variable\)."
|
||||
buffer rather than as a prevailing configuration (but it's handy
|
||||
to publicize it by making it a customization variable)."
|
||||
:version "24.1"
|
||||
:type 'boolean
|
||||
:group 'allout-widgets-developer)
|
||||
@ -346,7 +346,7 @@ to `allout-body-modification-handler', and is always reset by
|
||||
"Cache allout icon images, as an association list.
|
||||
|
||||
`allout-fetch-icon-image' uses this cache transparently, keying
|
||||
images with lists containing the name of the icon directory \(as
|
||||
images with lists containing the name of the icon directory (as
|
||||
found on the `load-path') and the icon name.
|
||||
|
||||
Set this variable to `nil' to empty the cache, and have it replenish from the
|
||||
@ -485,7 +485,7 @@ including things like:
|
||||
- encryption '~'
|
||||
- numbering '#'
|
||||
- indirect reference '@'
|
||||
- distinctive bullets - see `allout-distinctive-bullets-string'.\)")
|
||||
- distinctive bullets - see `allout-distinctive-bullets-string'.)")
|
||||
;;;_ = allout-span-to-category
|
||||
(defvar allout-span-to-category
|
||||
'((:guides-span . allout-guides-span-category)
|
||||
@ -534,7 +534,7 @@ The graphics include:
|
||||
|
||||
The bullet-icon and guide line graphics provide keybindings and mouse
|
||||
bindings for easy outline navigation and exposure control, extending
|
||||
outline hot-spot navigation \(see `allout-mode')."
|
||||
outline hot-spot navigation (see `allout-mode')."
|
||||
|
||||
:lighter nil
|
||||
:keymap nil
|
||||
@ -646,11 +646,11 @@ outline hot-spot navigation \(see `allout-mode')."
|
||||
(set-buffer-modified-p was-modified))))
|
||||
;;;_ > allout-widgets-mode-off
|
||||
(defun allout-widgets-mode-off ()
|
||||
"Explicitly disable allout-widgets-mode."
|
||||
"Explicitly disable `allout-widgets-mode'."
|
||||
(allout-widgets-mode -1))
|
||||
;;;_ > allout-widgets-mode-off
|
||||
(defun allout-widgets-mode-on ()
|
||||
"Explicitly disable allout-widgets-mode."
|
||||
"Explicitly enable `allout-widgets-mode'."
|
||||
(allout-widgets-mode 1))
|
||||
;;;_ > allout-setup-text-properties ()
|
||||
(defun allout-setup-text-properties ()
|
||||
@ -714,18 +714,18 @@ outline hot-spot navigation \(see `allout-mode')."
|
||||
(defvar allout-container-item-widget nil
|
||||
"A widget for the current outline's overarching container as an item.
|
||||
|
||||
The item has settings \(of the file/connection\) and maybe a body, but no
|
||||
The item has settings (of the file/connection) and maybe a body, but no
|
||||
icon/bullet.")
|
||||
(make-variable-buffer-local 'allout-container-item-widget)
|
||||
;;;_ . Hooks and hook helpers
|
||||
;;;_ , major command-loop business:
|
||||
;;;_ > allout-widgets-pre-command-business (&optional recursing)
|
||||
(defun allout-widgets-pre-command-business (&optional recursing)
|
||||
"Handle actions pending before allout-mode activity."
|
||||
"Handle actions pending before `allout-mode' activity."
|
||||
)
|
||||
;;;_ > allout-widgets-post-command-business (&optional recursing)
|
||||
(defun allout-widgets-post-command-business (&optional recursing)
|
||||
"Handle actions pending after any allout-mode commands.
|
||||
"Handle actions pending after any `allout-mode' commands.
|
||||
|
||||
Optional RECURSING is for internal use, to limit recursion."
|
||||
;; - check changed text for nesting discontinuities and escape anything
|
||||
@ -1155,14 +1155,14 @@ Dispatched by `allout-widgets-post-command-business' in response to
|
||||
(defun allout-widgets-after-copy-or-kill-function ()
|
||||
"Do allout-widgets processing of text just placed in the kill ring.
|
||||
|
||||
Intended for use on allout-after-copy-or-kill-hook."
|
||||
Intended for use on `allout-after-copy-or-kill-hook'."
|
||||
(if (car kill-ring)
|
||||
(setcar kill-ring (allout-widgets-undecorate-text (car kill-ring)))))
|
||||
;;;_ > allout-widgets-after-undo-function ()
|
||||
(defun allout-widgets-after-undo-function ()
|
||||
"Do allout-widgets processing of text after an undo.
|
||||
|
||||
Intended for use on allout-post-undo-hook."
|
||||
Intended for use on `allout-post-undo-hook'."
|
||||
(save-excursion
|
||||
(if (allout-goto-prefix)
|
||||
(allout-redecorate-item (allout-get-or-create-item-widget)))))
|
||||
@ -1359,7 +1359,7 @@ FROM and TO must be in increasing order, as must be the pairs in RANGES."
|
||||
(list (if included-from t) new-ranges)))
|
||||
;;;_ > allout-test-range-overlaps ()
|
||||
(defun allout-test-range-overlaps ()
|
||||
"allout-range-overlaps unit tests."
|
||||
"`allout-range-overlaps' unit tests."
|
||||
(let* (ranges
|
||||
got
|
||||
(try (lambda (from to)
|
||||
@ -1557,7 +1557,7 @@ recursive operation."
|
||||
|
||||
The neighbors include its siblings and parent.
|
||||
|
||||
ITEM-WIDGET can be a created or converted allout-item-widget.
|
||||
ITEM-WIDGET can be a created or converted `allout-item-widget'.
|
||||
|
||||
If you're only trying to get or create a widget for an item, use
|
||||
`allout-get-or-create-item-widget'. If you have the item-widget, applying
|
||||
@ -1565,7 +1565,7 @@ If you're only trying to get or create a widget for an item, use
|
||||
|
||||
Optional BLANK-CONTAINER is for internal use. It is used to fabricate a
|
||||
container widget for an empty-bodied container, in the course of decorating
|
||||
a proper \(non-container\) item which starts at the beginning of the file.
|
||||
a proper (non-container) item which starts at the beginning of the file.
|
||||
|
||||
Optional REDECORATE causes redecoration of the item-widget and
|
||||
its siblings, even if already decorated in this cycle of the command loop.
|
||||
@ -1737,8 +1737,8 @@ If optional AT-BEGINNING is t, then point is assumed to be at the start of
|
||||
the item prefix.
|
||||
|
||||
If optional BLANK-CONTAINER is true, then the parameters of a container
|
||||
which has an empty body are set. \(Though the body is blank, the object
|
||||
may have subitems.\)"
|
||||
which has an empty body are set. (Though the body is blank, the object
|
||||
may have subitems.)"
|
||||
|
||||
;; Uncomment this sit-for to notice where decoration is happening:
|
||||
;; (sit-for .1)
|
||||
@ -1857,8 +1857,8 @@ the various element spans."
|
||||
&optional parent-widget has-successor)
|
||||
"Add ITEM-WIDGET guide icon-prefix descender and connector text properties.
|
||||
|
||||
Optional arguments provide context for deriving the guides. In
|
||||
their absence, the current guide column flags are used.
|
||||
Optional arguments provide context for deriving the guides.
|
||||
In their absence, the current guide column flags are used.
|
||||
|
||||
Optional PARENT-WIDGET is the widget for the item's parent item.
|
||||
|
||||
@ -2222,7 +2222,7 @@ and decorate its siblings and parent, as well.
|
||||
|
||||
Optional BLANK-CONTAINER is for internal use, to fabricate a
|
||||
meta-container item with an empty body when the first proper
|
||||
\(non-container\) item starts at the beginning of the file.
|
||||
\(non-container) item starts at the beginning of the file.
|
||||
|
||||
Optional REDECORATE, if non-nil, means to redecorate the widget
|
||||
if it already exists."
|
||||
@ -2254,7 +2254,7 @@ Point will wind up positioned on the beginning of the parent or beginning
|
||||
of the buffer."
|
||||
;; use existing widget, if there, else establish it
|
||||
(if (or (bobp) (and (not (allout-ascend))
|
||||
(looking-at allout-regexp)))
|
||||
(looking-at-p allout-regexp)))
|
||||
(allout-get-or-create-item-widget redecorate 'blank-container)
|
||||
(allout-get-or-create-item-widget redecorate)))
|
||||
;;;_ : X- Item ancillaries
|
||||
@ -2270,7 +2270,7 @@ Operation is inhibited by `allout-inhibit-body-modification-handler'."
|
||||
;; - removal and replacement of the settings
|
||||
;; - maintenance of beginning-of-line guide lines
|
||||
;;
|
||||
;; ?? Escapes removal \(before changes\) is not done when edits span multiple
|
||||
;; ?? Escapes removal (before changes) is not done when edits span multiple
|
||||
;; items, recognizing that item structure is being preserved, including
|
||||
;; escaping of item-prefix-like text within bodies. See
|
||||
;; `allout-before-modification-handler' and
|
||||
@ -2284,7 +2284,7 @@ Operation is inhibited by `allout-inhibit-body-modification-handler'."
|
||||
(defun allout-graphics-modification-handler (beg end)
|
||||
"Protect against incoherent deletion of decoration graphics.
|
||||
|
||||
Deletes allowed only when inhibit-read-only is t."
|
||||
Deletes allowed only when `inhibit-read-only' is t."
|
||||
(cond
|
||||
(undo-in-progress (when (eq (get-text-property beg 'category)
|
||||
'allout-icon-span-category)
|
||||
|
@ -170,22 +170,22 @@ The following commands are available:
|
||||
|
||||
A Scheme process can be fired up with M-x run-scheme.
|
||||
|
||||
Customization: Entry to this mode runs the hooks on comint-mode-hook and
|
||||
inferior-scheme-mode-hook (in that order).
|
||||
Customization: Entry to this mode runs the hooks on `comint-mode-hook' and
|
||||
`inferior-scheme-mode-hook' (in that order).
|
||||
|
||||
You can send text to the inferior Scheme process from other buffers containing
|
||||
Scheme source.
|
||||
switch-to-scheme switches the current buffer to the Scheme process buffer.
|
||||
scheme-send-definition sends the current definition to the Scheme process.
|
||||
scheme-compile-definition compiles the current definition.
|
||||
scheme-send-region sends the current region to the Scheme process.
|
||||
scheme-compile-region compiles the current region.
|
||||
`switch-to-scheme' switches the current buffer to the Scheme process buffer.
|
||||
`scheme-send-definition' sends the current definition to the Scheme process.
|
||||
`scheme-compile-definition' compiles the current definition.
|
||||
`scheme-send-region' sends the current region to the Scheme process.
|
||||
`scheme-compile-region' compiles the current region.
|
||||
|
||||
scheme-send-definition-and-go, scheme-compile-definition-and-go,
|
||||
scheme-send-region-and-go, and scheme-compile-region-and-go
|
||||
`scheme-send-definition-and-go', `scheme-compile-definition-and-go',
|
||||
`scheme-send-region-and-go', and `scheme-compile-region-and-go'
|
||||
switch to the Scheme process buffer after sending their text.
|
||||
For information on running multiple processes in multiple buffers, see
|
||||
documentation for variable scheme-buffer.
|
||||
documentation for variable `scheme-buffer'.
|
||||
|
||||
Commands:
|
||||
Return after the end of the process' output sends the text from the
|
||||
@ -214,7 +214,7 @@ Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters."
|
||||
|
||||
(defun scheme-input-filter (str)
|
||||
"Don't save anything matching `inferior-scheme-filter-regexp'."
|
||||
(not (string-match inferior-scheme-filter-regexp str)))
|
||||
(not (string-match-p inferior-scheme-filter-regexp str)))
|
||||
|
||||
(defun scheme-get-old-input ()
|
||||
"Snarf the sexp ending at point."
|
||||
@ -233,7 +233,7 @@ If the file `~/.emacs_SCHEMENAME' or `~/.emacs.d/init_SCHEMENAME.scm' exists,
|
||||
it is given as initial input.
|
||||
Note that this may lose due to a timing error if the Scheme processor
|
||||
discards input when it starts up.
|
||||
Runs the hook `inferior-scheme-mode-hook' \(after the `comint-mode-hook'
|
||||
Runs the hook `inferior-scheme-mode-hook' (after the `comint-mode-hook'
|
||||
is run).
|
||||
\(Type \\[describe-mode] in the process buffer for a list of commands.)"
|
||||
|
||||
@ -251,8 +251,8 @@ is run).
|
||||
|
||||
(defun scheme-start-file (prog)
|
||||
"Return the name of the start file corresponding to PROG.
|
||||
Search in the directories \"~\" and \"~/.emacs.d\", in this
|
||||
order. Return nil if no start file found."
|
||||
Search in the directories \"~\" and `user-emacs-directory',
|
||||
in this order. Return nil if no start file found."
|
||||
(let* ((progname (file-name-nondirectory prog))
|
||||
(start-file (concat "~/.emacs_" progname))
|
||||
(alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
|
||||
@ -367,7 +367,7 @@ For Scheme 48 and Scsh use \",expand %s\"."
|
||||
(scheme-form-at-point)))))
|
||||
|
||||
(defun switch-to-scheme (eob-p)
|
||||
"Switch to the scheme process buffer.
|
||||
"Switch to the Scheme process buffer.
|
||||
With argument, position cursor at end of buffer."
|
||||
(interactive "P")
|
||||
(if (or (and scheme-buffer (get-buffer scheme-buffer))
|
||||
|
@ -57,8 +57,8 @@ The meaning of glyph reference point codes is as follows:
|
||||
| | 7:bc or bottom-center
|
||||
6----7----8 <---- descent 8:br or bottom-right
|
||||
|
||||
Glyph reference point symbols are to be used to specify composition
|
||||
rule of the form \(GLOBAL-REF-POINT . NEW-REF-POINT), where
|
||||
Glyph reference point symbols are to be used to specify a composition
|
||||
rule of the form (GLOBAL-REF-POINT . NEW-REF-POINT), where
|
||||
GLOBAL-REF-POINT is a reference point in the overall glyphs already
|
||||
composed, and NEW-REF-POINT is a reference point in the new glyph to
|
||||
be added.
|
||||
@ -71,13 +71,13 @@ follows (the point `*' corresponds to both reference points):
|
||||
| | |
|
||||
| global| |
|
||||
| glyph | |
|
||||
-- | | |-- <--- baseline \(doesn't change)
|
||||
-- | | |-- <--- baseline (doesn't change)
|
||||
+----+--*--+
|
||||
| | new |
|
||||
| |glyph|
|
||||
+----+-----+ <--- new descent
|
||||
|
||||
A composition rule may have the form \(GLOBAL-REF-POINT
|
||||
A composition rule may have the form (GLOBAL-REF-POINT
|
||||
NEW-REF-POINT XOFF YOFF), where XOFF and YOFF specify how much
|
||||
to shift NEW-REF-POINT from GLOBAL-REF-POINT. In this case, XOFF
|
||||
and YOFF are integers in the range -100..100 representing the
|
||||
@ -279,8 +279,8 @@ text in the composition."
|
||||
(defun compose-chars (&rest args)
|
||||
"Return a string from arguments in which all characters are composed.
|
||||
For relative composition, arguments are characters.
|
||||
For rule-based composition, Mth \(where M is odd) arguments are
|
||||
characters, and Nth \(where N is even) arguments are composition rules.
|
||||
For rule-based composition, Mth (where M is odd) arguments are
|
||||
characters, and Nth (where N is even) arguments are composition rules.
|
||||
A composition rule is a cons of glyph reference points of the form
|
||||
\(GLOBAL-REF-POINT . NEW-REF-POINT). See the documentation of
|
||||
`reference-point-alist' for more detail."
|
||||
@ -387,7 +387,7 @@ This function is the default value of `compose-chars-after-function'."
|
||||
(defun compose-last-chars (args)
|
||||
"Compose last characters.
|
||||
The argument is a parameterized event of the form
|
||||
\(compose-last-chars N COMPONENTS),
|
||||
(compose-last-chars N COMPONENTS),
|
||||
where N is the number of characters before point to compose,
|
||||
COMPONENTS, if non-nil, is the same as the argument to `compose-region'
|
||||
\(which see). If it is nil, `compose-chars-after' is called,
|
||||
@ -640,7 +640,7 @@ All non-spacing characters have this function in
|
||||
unicode-category-table))
|
||||
|
||||
(defun compose-gstring-for-terminal (gstring)
|
||||
"Compose glyph string GSTRING for terminal display.
|
||||
"Compose glyph-string GSTRING for terminal display.
|
||||
Non-spacing characters are composed with the preceding base
|
||||
character. If the preceding character is not a base character,
|
||||
each non-spacing character is composed as a spacing character by
|
||||
|
@ -95,7 +95,7 @@ use \\[customize]."
|
||||
:group 'dired-keys)
|
||||
|
||||
(defcustom dired-bind-man t
|
||||
"Non-nil means bind `dired-man' to \"N\" in dired-mode, otherwise do not.
|
||||
"Non-nil means bind `dired-man' to \"N\" in Dired, otherwise do not.
|
||||
Setting this variable directly after dired-x is loaded has no effect -
|
||||
use \\[customize]."
|
||||
:type 'boolean
|
||||
@ -107,7 +107,7 @@ use \\[customize]."
|
||||
:group 'dired-keys)
|
||||
|
||||
(defcustom dired-bind-info t
|
||||
"Non-nil means bind `dired-info' to \"I\" in dired-mode, otherwise do not.
|
||||
"Non-nil means bind `dired-info' to \"I\" in Dired, otherwise do not.
|
||||
Setting this variable directly after dired-x is loaded has no effect -
|
||||
use \\[customize]."
|
||||
:type 'boolean
|
||||
@ -163,7 +163,7 @@ See Info node `(dired-x) Omitting Variables' for more information."
|
||||
(defcustom dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$"
|
||||
"Filenames matching this regexp will not be displayed.
|
||||
This only has effect when `dired-omit-mode' is t. See interactive function
|
||||
`dired-omit-mode' \(\\[dired-omit-mode]\) and variable
|
||||
`dired-omit-mode' (\\[dired-omit-mode]) and variable
|
||||
`dired-omit-extensions'. The default is to omit `.', `..', auto-save
|
||||
files and lock files."
|
||||
:type 'regexp
|
||||
@ -181,7 +181,7 @@ When nil, don't show messages."
|
||||
If nil, Dired finds the directory as a subdirectory in some other buffer
|
||||
if it is present as one.
|
||||
|
||||
If there are several dired buffers for a directory, the most recently
|
||||
If there are several Dired buffers for a directory, the most recently
|
||||
used is chosen.
|
||||
|
||||
Dired avoids switching to the current buffer, so that if you have
|
||||
@ -345,7 +345,7 @@ A `.' is *not* automatically prepended to the string entered."
|
||||
marker-char))
|
||||
|
||||
(defun dired-flag-extension (extension)
|
||||
"In dired, flag all files with a certain EXTENSION for deletion.
|
||||
"In Dired, flag all files with a certain EXTENSION for deletion.
|
||||
A `.' is *not* automatically prepended to the string entered."
|
||||
(interactive "sFlagging extension: ")
|
||||
(dired-mark-extension extension dired-del-marker))
|
||||
@ -406,17 +406,17 @@ See variables `dired-texinfo-unclean-extensions',
|
||||
|
||||
;;;###autoload
|
||||
(defun dired-jump (&optional other-window file-name)
|
||||
"Jump to dired buffer corresponding to current buffer.
|
||||
If in a file, dired the current directory and move to file's line.
|
||||
"Jump to Dired buffer corresponding to current buffer.
|
||||
If in a file, Dired the current directory and move to file's line.
|
||||
If in Dired already, pop up a level and goto old directory's line.
|
||||
In case the proper dired file line cannot be found, refresh the dired
|
||||
In case the proper Dired file line cannot be found, refresh the dired
|
||||
buffer and try again.
|
||||
When OTHER-WINDOW is non-nil, jump to dired buffer in other window.
|
||||
When OTHER-WINDOW is non-nil, jump to Dired buffer in other window.
|
||||
Interactively with prefix argument, read FILE-NAME and
|
||||
move to its line in dired."
|
||||
(interactive
|
||||
(list nil (and current-prefix-arg
|
||||
(read-file-name "Jump to dired file: "))))
|
||||
(read-file-name "Jump to Dired file: "))))
|
||||
(let* ((file (or file-name buffer-file-name))
|
||||
(dir (if file (file-name-directory file) default-directory)))
|
||||
(if (and (eq major-mode 'dired-mode) (null file-name))
|
||||
@ -446,7 +446,7 @@ move to its line in dired."
|
||||
"Like \\[dired-jump] (`dired-jump') but in other window."
|
||||
(interactive
|
||||
(list (and current-prefix-arg
|
||||
(read-file-name "Jump to dired file: "))))
|
||||
(read-file-name "Jump to Dired file: "))))
|
||||
(dired-jump t file-name))
|
||||
|
||||
;;; OMITTING.
|
||||
@ -486,12 +486,12 @@ Should never be used as marker by the user or other packages.")
|
||||
dired-latex-unclean-extensions
|
||||
dired-bibtex-unclean-extensions
|
||||
dired-texinfo-unclean-extensions)
|
||||
"If non-nil, a list of extensions \(strings\) to omit from Dired listings.
|
||||
"If non-nil, a list of extensions (strings) to omit from Dired listings.
|
||||
Defaults to elements of `completion-ignored-extensions',
|
||||
`dired-latex-unclean-extensions', `dired-bibtex-unclean-extensions', and
|
||||
`dired-texinfo-unclean-extensions'.
|
||||
|
||||
See interactive function `dired-omit-mode' \(\\[dired-omit-mode]\) and
|
||||
See interactive function `dired-omit-mode' (\\[dired-omit-mode]) and
|
||||
variables `dired-omit-mode' and `dired-omit-files'."
|
||||
:type '(repeat string)
|
||||
:group 'dired-x)
|
||||
@ -583,8 +583,8 @@ filesystem will work.
|
||||
|
||||
This is useful if you want to peruse and move around in an ls -lR
|
||||
output file, for example one you got from an ftp server. With
|
||||
ange-ftp, you can even dired a directory containing an ls-lR file,
|
||||
visit that file and turn on virtual dired mode. But don't try to save
|
||||
ange-ftp, you can even Dired a directory containing an ls-lR file,
|
||||
visit that file and turn on Virtual Dired mode. But don't try to save
|
||||
this file, as dired-virtual indents the listing and thus changes the
|
||||
buffer.
|
||||
|
||||
@ -593,7 +593,7 @@ resume it in a later session.
|
||||
|
||||
Type \\<dired-mode-map>\\[revert-buffer] \
|
||||
in the Virtual Dired buffer and answer `y' to convert
|
||||
the virtual to a real dired buffer again. You don't have to do this, though:
|
||||
the virtual to a real Dired buffer again. You don't have to do this, though:
|
||||
you can relist single subdirs using \\[dired-do-redisplay]."
|
||||
|
||||
;; DIRNAME is the top level directory of the buffer. It will become
|
||||
@ -682,7 +682,7 @@ Useful on `magic-mode-alist' with the regexp
|
||||
|
||||
\"^ \\\\(/[^ /]+\\\\)+/?:$\"
|
||||
|
||||
to put saved dired buffers automatically into Virtual Dired mode.
|
||||
to put saved Dired buffers automatically into Virtual Dired mode.
|
||||
|
||||
Also useful for `auto-mode-alist' like this:
|
||||
|
||||
@ -769,7 +769,7 @@ If none, return `default-directory'."
|
||||
;; Dired Buffer.
|
||||
|
||||
(defcustom dired-local-variables-file (convert-standard-filename ".dired")
|
||||
"Filename, as string, containing local dired buffer variables to be hacked.
|
||||
"Filename, as string, containing local Dired buffer variables to be hacked.
|
||||
If this file found in current directory, then it will be inserted into dired
|
||||
buffer and `hack-local-variables' will be run. See Info node
|
||||
`(emacs)File Variables' for more information on local variables.
|
||||
@ -780,7 +780,7 @@ See also `dired-enable-local-variables'."
|
||||
(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1")
|
||||
|
||||
(defun dired-hack-local-variables ()
|
||||
"Evaluate local variables in `dired-local-variables-file' for dired buffer."
|
||||
"Evaluate local variables in `dired-local-variables-file' for Dired buffer."
|
||||
(declare (obsolete hack-dir-local-variables-non-file-buffer "24.1"))
|
||||
(and (stringp dired-local-variables-file)
|
||||
(file-exists-p dired-local-variables-file)
|
||||
@ -984,7 +984,7 @@ replace it with a dir-locals-file `./%s'"
|
||||
" " dired-guess-shell-znew-switches))
|
||||
'("\\.pod\\'" "perldoc" "pod2man * | nroff -man")
|
||||
|
||||
'("\\.dvi\\'" "xdvi" "dvips") ; preview and printing
|
||||
'("\\.dvi\\'" "xdvi" "dvips") ; preview and printing
|
||||
'("\\.au\\'" "play") ; play Sun audiofiles
|
||||
'("\\.mpe?g\\'\\|\\.avi\\'" "xine -p")
|
||||
'("\\.ogg\\'" "ogg123")
|
||||
@ -1000,7 +1000,7 @@ replace it with a dir-locals-file `./%s'"
|
||||
'("\\.tif\\'" "xloadimage")
|
||||
'("\\.png\\'" "display") ; xloadimage 4.1 doesn't grok PNG
|
||||
'("\\.jpe?g\\'" "xloadimage")
|
||||
'("\\.fig\\'" "xfig") ; edit fig pictures
|
||||
'("\\.fig\\'" "xfig") ; edit fig pictures
|
||||
'("\\.out\\'" "xgraph") ; for plotting purposes.
|
||||
'("\\.tex\\'" "latex" "tex")
|
||||
'("\\.texi\\(nfo\\)?\\'" "makeinfo" "texi2dvi")
|
||||
@ -1044,7 +1044,7 @@ These rules take precedence over the predefined rules in the variable
|
||||
|
||||
Each element of this list looks like
|
||||
|
||||
\(REGEXP COMMAND...\)
|
||||
(REGEXP COMMAND...)
|
||||
|
||||
where each COMMAND can either be a string or a Lisp expression that evaluates
|
||||
to a string. If several COMMANDs are given, the first one will be the default
|
||||
@ -1057,7 +1057,7 @@ REGEXP is matched case-sensitively.
|
||||
You can set this variable in your ~/.emacs. For example, to add rules for
|
||||
`.foo' and `.bar' files, write
|
||||
|
||||
\(setq dired-guess-shell-alist-user
|
||||
(setq dired-guess-shell-alist-user
|
||||
'((\"\\\\.foo\\\\'\" \"FOO-COMMAND\")
|
||||
(\"\\\\.bar\\\\'\"
|
||||
(if condition
|
||||
@ -1258,7 +1258,7 @@ Remaining lines go to bottom-most window. The number of files that can be
|
||||
displayed this way is restricted by the height of the current window and
|
||||
`window-min-height'.
|
||||
|
||||
To keep dired buffer displayed, type \\[split-window-below] first.
|
||||
To keep Dired buffer displayed, type \\[split-window-below] first.
|
||||
To display just marked files, type \\[delete-other-windows] first."
|
||||
(interactive "P")
|
||||
(dired-simultaneous-find-file (dired-get-marked-files) noselect))
|
||||
|
222
lisp/dired.el
222
lisp/dired.el
@ -87,8 +87,8 @@ will fail to parse some \"unusual\" file names, e.g. those with leading
|
||||
spaces. You might want to install ls from GNU Coreutils, which does
|
||||
support this option. Alternatively, you might want to use Emacs's
|
||||
own emulation of \"ls\", by using:
|
||||
\(setq ls-lisp-use-insert-directory-program nil)
|
||||
\(require 'ls-lisp)
|
||||
(setq ls-lisp-use-insert-directory-program nil)
|
||||
(require 'ls-lisp)
|
||||
This is used by default on MS Windows, which does not have an \"ls\" program.
|
||||
Note that `ls-lisp' does not support as many options as GNU ls, though.
|
||||
For more details, see Info node `(emacs)ls in Lisp'."
|
||||
@ -204,7 +204,7 @@ You can customize key bindings or load extensions with this."
|
||||
:type 'hook)
|
||||
|
||||
(defcustom dired-before-readin-hook nil
|
||||
"This hook is run before a dired buffer is read in (created or reverted)."
|
||||
"This hook is run before a Dired buffer is read in (created or reverted)."
|
||||
:group 'dired
|
||||
:type 'hook)
|
||||
|
||||
@ -231,7 +231,7 @@ It is run the function `dired-initial-position'."
|
||||
"The functions to call when a drop in `dired-mode' is made.
|
||||
See `dnd-protocol-alist' for more information. When nil, behave
|
||||
as in other buffers. Changing this option is effective only for
|
||||
new dired buffers."
|
||||
new Dired buffers."
|
||||
:type '(choice (repeat (cons (regexp) (function)))
|
||||
(const :tag "Behave as in other buffers" nil))
|
||||
:version "22.1"
|
||||
@ -279,18 +279,18 @@ action argument symbol is `window-height' and its value is nil." "24.3")
|
||||
|
||||
;;;###autoload
|
||||
(defvar dired-directory nil
|
||||
"The directory name or wildcard spec that this dired directory lists.
|
||||
Local to each dired buffer. May be a list, in which case the car is the
|
||||
"The directory name or wildcard spec that this Dired directory lists.
|
||||
Local to each Dired buffer. May be a list, in which case the car is the
|
||||
directory name and the cdr is the list of files to mention.
|
||||
The directory name must be absolute, but need not be fully expanded.")
|
||||
|
||||
;; Beware of "-l;reboot" etc. See bug#3230.
|
||||
(defun dired-safe-switches-p (switches)
|
||||
"Return non-nil if string SWITCHES does not look risky for dired."
|
||||
"Return non-nil if string SWITCHES does not look risky for Dired."
|
||||
(or (not switches)
|
||||
(and (stringp switches)
|
||||
(< (length switches) 100) ; arbitrary
|
||||
(string-match "\\` *-[- [:alnum:]]+\\'" switches))))
|
||||
(string-match-p "\\` *-[- [:alnum:]]+\\'" switches))))
|
||||
|
||||
(defvar dired-actual-switches nil
|
||||
"The value of `dired-listing-switches' used to make this buffer's text.")
|
||||
@ -330,10 +330,9 @@ Each subdirectory has an element: (DIRNAME . STARTMARKER).
|
||||
The order of elements is the reverse of the order in the buffer.
|
||||
In simple cases, this list contains one element.")
|
||||
|
||||
(defvar dired-switches-alist nil
|
||||
(defvar-local dired-switches-alist nil
|
||||
"Keeps track of which switches to use for inserted subdirectories.
|
||||
This is an alist of the form (SUBDIR . SWITCHES).")
|
||||
(make-variable-buffer-local 'dired-switches-alist)
|
||||
|
||||
(defvaralias 'dired-move-to-filename-regexp
|
||||
'directory-listing-before-filename-regexp)
|
||||
@ -360,11 +359,11 @@ Subexpression 2 must end right before the \\n or \\r.")
|
||||
|
||||
(defface dired-mark
|
||||
'((t (:inherit font-lock-constant-face)))
|
||||
"Face used for dired marks."
|
||||
"Face used for Dired marks."
|
||||
:group 'dired-faces
|
||||
:version "22.1")
|
||||
(defvar dired-mark-face 'dired-mark
|
||||
"Face name used for dired marks.")
|
||||
"Face name used for Dired marks.")
|
||||
|
||||
(defface dired-marked
|
||||
'((t (:inherit warning)))
|
||||
@ -563,8 +562,8 @@ For any other non-nil value of ARG, use the current file.
|
||||
If optional third arg SHOW-PROGRESS evaluates to non-nil,
|
||||
redisplay the dired buffer after each file is processed.
|
||||
|
||||
No guarantee is made about the position on the marked line. BODY
|
||||
must ensure this itself if it depends on this.
|
||||
No guarantee is made about the position on the marked line.
|
||||
BODY must ensure this itself if it depends on this.
|
||||
|
||||
Search starts at the beginning of the buffer, thus the car of the
|
||||
list corresponds to the line nearest to the buffer's bottom.
|
||||
@ -753,7 +752,7 @@ You can flag files for deletion with \\[dired-flag-file-deletion] and then
|
||||
delete them by typing \\[dired-do-flagged-delete].
|
||||
Type \\[describe-mode] after entering Dired for more info.
|
||||
|
||||
If DIRNAME is already in a dired buffer, that buffer is used without refresh."
|
||||
If DIRNAME is already in a Dired buffer, that buffer is used without refresh."
|
||||
;; Cannot use (interactive "D") because of wildcards.
|
||||
(interactive (dired-read-dir-and-switches ""))
|
||||
(switch-to-buffer (dired-noselect dirname switches)))
|
||||
@ -774,7 +773,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
|
||||
|
||||
;;;###autoload
|
||||
(defun dired-noselect (dir-or-list &optional switches)
|
||||
"Like `dired' but returns the dired buffer as value, does not select it."
|
||||
"Like `dired' but returns the Dired buffer as value, does not select it."
|
||||
(or dir-or-list (setq dir-or-list default-directory))
|
||||
;; This loses the distinction between "/foo/*/" and "/foo/*" that
|
||||
;; some shells make:
|
||||
@ -812,9 +811,9 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
|
||||
(equal (nth 5 attributes) modtime)))))
|
||||
|
||||
(defun dired-buffer-stale-p (&optional noconfirm)
|
||||
"Return non-nil if current dired buffer needs updating.
|
||||
"Return non-nil if current Dired buffer needs updating.
|
||||
If NOCONFIRM is non-nil, then this function always returns nil
|
||||
for a remote directory. This feature is used by Auto Revert Mode."
|
||||
for a remote directory. This feature is used by Auto Revert mode."
|
||||
(let ((dirname
|
||||
(if (consp dired-directory) (car dired-directory) dired-directory)))
|
||||
(and (stringp dirname)
|
||||
@ -826,8 +825,8 @@ for a remote directory. This feature is used by Auto Revert Mode."
|
||||
(dired-directory-changed-p dirname))))
|
||||
|
||||
(defcustom dired-auto-revert-buffer nil
|
||||
"Automatically revert dired buffer on revisiting.
|
||||
If t, revisiting an existing dired buffer automatically reverts it.
|
||||
"Automatically revert Dired buffer on revisiting.
|
||||
If t, revisiting an existing Dired buffer automatically reverts it.
|
||||
If its value is a function, call this function with the directory
|
||||
name as single argument and revert the buffer if it returns non-nil.
|
||||
Otherwise, a message offering to revert the changed dired buffer
|
||||
@ -836,8 +835,8 @@ Note that this is not the same as `auto-revert-mode' that
|
||||
periodically reverts at specified time intervals."
|
||||
:type '(choice
|
||||
(const :tag "Don't revert" nil)
|
||||
(const :tag "Always revert visited dired buffer" t)
|
||||
(const :tag "Revert changed dired buffer" dired-directory-changed-p)
|
||||
(const :tag "Always revert visited Dired buffer" t)
|
||||
(const :tag "Revert changed Dired buffer" dired-directory-changed-p)
|
||||
(function :tag "Predicate function"))
|
||||
:group 'dired
|
||||
:version "23.2")
|
||||
@ -910,7 +909,7 @@ periodically reverts at specified time intervals."
|
||||
;; Enlarged by dired-advertise
|
||||
;; Queried by function dired-buffers-for-dir. When this detects a
|
||||
;; killed buffer, it is removed from this list.
|
||||
"Alist of expanded directories and their associated dired buffers.")
|
||||
"Alist of expanded directories and their associated Dired buffers.")
|
||||
|
||||
(defvar dired-find-subdir)
|
||||
|
||||
@ -958,7 +957,7 @@ periodically reverts at specified time intervals."
|
||||
;; Read in a new dired buffer
|
||||
|
||||
(defun dired-readin ()
|
||||
"Read in a new dired buffer.
|
||||
"Read in a new Dired buffer.
|
||||
Differs from `dired-insert-subdir' in that it accepts
|
||||
wildcards, erases the buffer, and builds the subdir-alist anew
|
||||
\(including making it buffer-local and clearing it first)."
|
||||
@ -981,9 +980,8 @@ wildcards, erases the buffer, and builds the subdir-alist anew
|
||||
(run-hooks 'dired-before-readin-hook)
|
||||
(if (consp buffer-undo-list)
|
||||
(setq buffer-undo-list nil))
|
||||
(make-local-variable 'file-name-coding-system)
|
||||
(setq file-name-coding-system
|
||||
(or coding-system-for-read file-name-coding-system))
|
||||
(setq-local file-name-coding-system
|
||||
(or coding-system-for-read file-name-coding-system))
|
||||
(let ((inhibit-read-only t)
|
||||
;; Don't make undo entries for readin.
|
||||
(buffer-undo-list t))
|
||||
@ -993,7 +991,7 @@ wildcards, erases the buffer, and builds the subdir-alist anew
|
||||
(goto-char (point-min))
|
||||
;; Must first make alist buffer local and set it to nil because
|
||||
;; dired-build-subdir-alist will call dired-clear-alist first
|
||||
(set (make-local-variable 'dired-subdir-alist) nil)
|
||||
(setq-local dired-subdir-alist nil)
|
||||
(dired-build-subdir-alist)
|
||||
(let ((attributes (file-attributes dirname)))
|
||||
(if (eq (car attributes) t)
|
||||
@ -1092,7 +1090,7 @@ BEG..END is the line where the file info is located."
|
||||
;; We're now just in front of a field, with a space behind us.
|
||||
(let* ((curcol (current-column))
|
||||
;; Nums are right-aligned.
|
||||
(num-align (looking-at "[0-9]"))
|
||||
(num-align (looking-at-p "[0-9]"))
|
||||
;; Let's look at the other line, in the same column: we
|
||||
;; should be either near the end of the previous field, or
|
||||
;; in the space between that field and the next.
|
||||
@ -1141,7 +1139,7 @@ BEG..END is the line where the file info is located."
|
||||
(defun dired-switches-escape-p (switches)
|
||||
"Return non-nil if the string SWITCHES contains -b or --escape."
|
||||
;; Do not match things like "--block-size" that happen to contain "b".
|
||||
(string-match "\\(\\`\\| \\)-[[:alnum:]]*b\\|--escape\\>" switches))
|
||||
(string-match-p "\\(\\`\\| \\)-[[:alnum:]]*b\\|--escape\\>" switches))
|
||||
|
||||
(defun dired-insert-directory (dir switches &optional file-list wildcard hdr)
|
||||
"Insert a directory listing of DIR, Dired style.
|
||||
@ -1219,7 +1217,7 @@ see `dired-use-ls-dired' for more details.")
|
||||
;; Otherwise, indent them.
|
||||
(unless (save-excursion
|
||||
(goto-char opoint)
|
||||
(looking-at " "))
|
||||
(looking-at-p " "))
|
||||
(let ((indent-tabs-mode nil))
|
||||
(indent-rigidly opoint (point) 2)))
|
||||
;; Insert text at the beginning to standardize things.
|
||||
@ -1227,7 +1225,7 @@ see `dired-use-ls-dired' for more details.")
|
||||
(save-excursion
|
||||
(goto-char opoint)
|
||||
(when (and (or hdr wildcard)
|
||||
(not (and (looking-at "^ \\(.*\\):$")
|
||||
(not (and (looking-at-p "^ \\(.*\\):$")
|
||||
(file-name-absolute-p (match-string 1)))))
|
||||
;; Note that dired-build-subdir-alist will replace the name
|
||||
;; by its expansion, so it does not matter whether what we insert
|
||||
@ -1269,7 +1267,7 @@ see `dired-use-ls-dired' for more details.")
|
||||
;; Reverting a dired buffer
|
||||
|
||||
(defun dired-revert (&optional _arg _noconfirm)
|
||||
"Reread the dired buffer.
|
||||
"Reread the Dired buffer.
|
||||
Must also be called after `dired-actual-switches' have changed.
|
||||
Should not fail even on completely garbaged buffers.
|
||||
Preserves old cursor, marks/flags, hidden-p.
|
||||
@ -1320,7 +1318,7 @@ ARG and NOCONFIRM, passed from `revert-buffer', are ignored."
|
||||
"Return current positions in the buffer and all windows with this directory.
|
||||
The positions have the form (BUFFER-POSITION WINDOW-POSITIONS).
|
||||
|
||||
BUFFER-POSITION is the point position in the current dired buffer.
|
||||
BUFFER-POSITION is the point position in the current Dired buffer.
|
||||
It has the form (BUFFER DIRED-FILENAME BUFFER-POINT).
|
||||
|
||||
WINDOW-POSITIONS are current positions in all windows displaying
|
||||
@ -1397,7 +1395,7 @@ Each element of ALIST looks like (FILE . MARKERCHAR)."
|
||||
(defun dired-insert-old-subdirs (old-subdir-alist)
|
||||
"Try to insert all subdirs that were displayed before.
|
||||
Do so according to the former subdir alist OLD-SUBDIR-ALIST."
|
||||
(or (string-match "R" dired-actual-switches)
|
||||
(or (string-match-p "R" dired-actual-switches)
|
||||
(let (elt dir)
|
||||
(while old-subdir-alist
|
||||
(setq elt (car old-subdir-alist)
|
||||
@ -1636,7 +1634,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
|
||||
:help "Incrementally search for string in file names only."))
|
||||
(define-key map [menu-bar immediate compare-directories]
|
||||
'(menu-item "Compare Directories..." dired-compare-directories
|
||||
:help "Mark files with different attributes in two dired buffers"))
|
||||
:help "Mark files with different attributes in two Dired buffers"))
|
||||
(define-key map [menu-bar immediate backup-diff]
|
||||
'(menu-item "Compare with Backup" dired-backup-diff
|
||||
:help "Diff file at cursor with its latest backup"))
|
||||
@ -1660,7 +1658,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
|
||||
:help "Create a directory"))
|
||||
(define-key map [menu-bar immediate wdired-mode]
|
||||
'(menu-item "Edit File Names" wdired-change-to-wdired-mode
|
||||
:help "Put a dired buffer in a mode in which filenames are editable"
|
||||
:help "Put a Dired buffer in a mode in which filenames are editable"
|
||||
:keys "C-x C-q"
|
||||
:filter (lambda (x) (if (eq major-mode 'dired-mode) x))))
|
||||
|
||||
@ -1867,7 +1865,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
|
||||
:help "Copy current file or all marked files"))
|
||||
|
||||
map)
|
||||
"Local keymap for `dired-mode' buffers.")
|
||||
"Local keymap for Dired mode buffers.")
|
||||
|
||||
;; Dired mode is suitable only for specially formatted data.
|
||||
(put 'dired-mode 'mode-class 'special)
|
||||
@ -1878,7 +1876,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
|
||||
"\
|
||||
Mode for \"editing\" directory listings.
|
||||
In Dired, you are \"editing\" a list of the files in a directory and
|
||||
\(optionally) its subdirectories, in the format of `ls -lR'.
|
||||
(optionally) its subdirectories, in the format of `ls -lR'.
|
||||
Each directory is a page: use \\[backward-page] and \\[forward-page] to move pagewise.
|
||||
\"Editing\" means that you can run shell commands on files, visit,
|
||||
compress, load or byte-compile them, change their file attributes
|
||||
@ -1900,7 +1898,7 @@ Type \\[dired-unmark-backward] to back up one line and unmark or unflag.
|
||||
Type \\[dired-do-flagged-delete] to delete (eXecute) the files flagged `D'.
|
||||
Type \\[dired-find-file] to Find the current line's file
|
||||
(or dired it in another buffer, if it is a directory).
|
||||
Type \\[dired-find-file-other-window] to find file or dired directory in Other window.
|
||||
Type \\[dired-find-file-other-window] to find file or Dired directory in Other window.
|
||||
Type \\[dired-maybe-insert-subdir] to Insert a subdirectory in this buffer.
|
||||
Type \\[dired-do-rename] to Rename a file or move the marked files to another directory.
|
||||
Type \\[dired-do-copy] to Copy files.
|
||||
@ -1952,31 +1950,25 @@ Keybindings:
|
||||
;; Ignore dired-hide-details-* value of invisible text property by default.
|
||||
(when (eq buffer-invisibility-spec t)
|
||||
(setq buffer-invisibility-spec (list t)))
|
||||
(set (make-local-variable 'revert-buffer-function)
|
||||
(function dired-revert))
|
||||
(set (make-local-variable 'buffer-stale-function)
|
||||
(function dired-buffer-stale-p))
|
||||
(set (make-local-variable 'page-delimiter)
|
||||
"\n\n")
|
||||
(set (make-local-variable 'dired-directory)
|
||||
(or dirname default-directory))
|
||||
(setq-local revert-buffer-function (function dired-revert))
|
||||
(setq-local buffer-stale-function (function dired-buffer-stale-p))
|
||||
(setq-local page-delimiter "\n\n")
|
||||
(setq-local dired-directory (or dirname default-directory))
|
||||
;; list-buffers uses this to display the dir being edited in this buffer.
|
||||
(setq list-buffers-directory
|
||||
(expand-file-name (if (listp dired-directory)
|
||||
(car dired-directory)
|
||||
dired-directory)))
|
||||
(set (make-local-variable 'dired-actual-switches)
|
||||
(or switches dired-listing-switches))
|
||||
(set (make-local-variable 'font-lock-defaults)
|
||||
'(dired-font-lock-keywords t nil nil beginning-of-line))
|
||||
(set (make-local-variable 'desktop-save-buffer)
|
||||
'dired-desktop-buffer-misc-data)
|
||||
(setq-local dired-actual-switches (or switches dired-listing-switches))
|
||||
(setq-local font-lock-defaults
|
||||
'(dired-font-lock-keywords t nil nil beginning-of-line))
|
||||
(setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
|
||||
(setq dired-switches-alist nil)
|
||||
(hack-dir-local-variables-non-file-buffer) ; before sorting
|
||||
(dired-sort-other dired-actual-switches t)
|
||||
(when (featurep 'dnd)
|
||||
(set (make-local-variable 'dnd-protocol-alist)
|
||||
(append dired-dnd-protocol-alist dnd-protocol-alist)))
|
||||
(setq-local dnd-protocol-alist
|
||||
(append dired-dnd-protocol-alist dnd-protocol-alist)))
|
||||
(add-hook 'file-name-at-point-functions 'dired-file-name-at-point nil t)
|
||||
(add-hook 'isearch-mode-hook 'dired-isearch-filenames-setup nil t)
|
||||
(run-mode-hooks 'dired-mode-hook))
|
||||
@ -1984,7 +1976,7 @@ Keybindings:
|
||||
;; Idiosyncratic dired commands that don't deal with marks.
|
||||
|
||||
(defun dired-summary ()
|
||||
"Summarize basic Dired commands and show recent dired errors."
|
||||
"Summarize basic Dired commands and show recent Dired errors."
|
||||
(interactive)
|
||||
(dired-why)
|
||||
;>> this should check the key-bindings and use substitute-command-keys if non-standard
|
||||
@ -1992,14 +1984,14 @@ Keybindings:
|
||||
"d-elete, u-ndelete, x-punge, f-ind, o-ther window, R-ename, C-opy, h-elp"))
|
||||
|
||||
(defun dired-undo ()
|
||||
"Undo in a dired buffer.
|
||||
"Undo in a Dired buffer.
|
||||
This doesn't recover lost files, it just undoes changes in the buffer itself.
|
||||
You can use it to recover marks, killed lines or subdirs."
|
||||
(interactive)
|
||||
(let ((inhibit-read-only t))
|
||||
(undo))
|
||||
(dired-build-subdir-alist)
|
||||
(message "Change in dired buffer undone.
|
||||
(message "Change in Dired buffer undone.
|
||||
Actual changes in files cannot be undone by Emacs."))
|
||||
|
||||
(defun dired-toggle-read-only ()
|
||||
@ -2032,7 +2024,7 @@ Optional prefix ARG says how many lines to move; default is one line."
|
||||
(dired-next-line (- (or arg 1))))
|
||||
|
||||
(defun dired-next-dirline (arg &optional opoint)
|
||||
"Goto ARG'th next directory file line."
|
||||
"Goto ARGth next directory file line."
|
||||
(interactive "p")
|
||||
(or opoint (setq opoint (point)))
|
||||
(if (if (> arg 0)
|
||||
@ -2044,7 +2036,7 @@ Optional prefix ARG says how many lines to move; default is one line."
|
||||
(error "No more subdirectories")))
|
||||
|
||||
(defun dired-prev-dirline (arg)
|
||||
"Goto ARG'th previous directory file line."
|
||||
"Goto ARGth previous directory file line."
|
||||
(interactive "p")
|
||||
(dired-next-dirline (- arg)))
|
||||
|
||||
@ -2078,7 +2070,7 @@ Creates a buffer if necessary."
|
||||
file-name
|
||||
(if (file-symlink-p file-name)
|
||||
(error "File is a symlink to a nonexistent target")
|
||||
(error "File no longer exists; type `g' to update dired buffer")))))
|
||||
(error "File no longer exists; type `g' to update Dired buffer")))))
|
||||
|
||||
;; Force C-m keybinding rather than `f' or `e' in the mode doc:
|
||||
(define-obsolete-function-alias 'dired-advertised-find-file 'dired-find-file "23.2")
|
||||
@ -2091,7 +2083,7 @@ Creates a buffer if necessary."
|
||||
(find-file (dired-get-file-for-visit))))
|
||||
|
||||
(defun dired-find-alternate-file ()
|
||||
"In Dired, visit this file or directory instead of the dired buffer."
|
||||
"In Dired, visit this file or directory instead of the Dired buffer."
|
||||
(interactive)
|
||||
(set-buffer-modified-p nil)
|
||||
(find-alternate-file (dired-get-file-for-visit)))
|
||||
@ -2276,7 +2268,7 @@ unchanged."
|
||||
;;; Minor mode for hiding details
|
||||
;;;###autoload
|
||||
(define-minor-mode dired-hide-details-mode
|
||||
"Hide details in `dired-mode'."
|
||||
"Hide details in Dired mode."
|
||||
:group 'dired
|
||||
(unless (derived-mode-p 'dired-mode)
|
||||
(error "Not a Dired buffer"))
|
||||
@ -2348,7 +2340,7 @@ Return the position of the beginning of the filename, or nil if none found."
|
||||
(goto-char (next-single-property-change (point) 'dired-filename))
|
||||
(let (opoint file-type executable symlink hidden case-fold-search used-F eol)
|
||||
;; case-fold-search is nil now, so we can test for capital F:
|
||||
(setq used-F (string-match "F" dired-actual-switches)
|
||||
(setq used-F (string-match-p "F" dired-actual-switches)
|
||||
opoint (point)
|
||||
eol (line-end-position)
|
||||
hidden (and selective-display
|
||||
@ -2408,7 +2400,7 @@ Return the position of the beginning of the filename, or nil if none found."
|
||||
"Copy names of marked (or next ARG) files into the kill ring.
|
||||
The names are separated by a space.
|
||||
With a zero prefix arg, use the absolute file name of each marked file.
|
||||
With \\[universal-argument], use the file name relative to the dired buffer's
|
||||
With \\[universal-argument], use the file name relative to the Dired buffer's
|
||||
`default-directory'. (This still may contain slashes if in a subdirectory.)
|
||||
|
||||
If on a subdir headerline, use absolute subdirname instead;
|
||||
@ -2459,9 +2451,9 @@ You can then feed the file name(s) to other commands with \\[yank]."
|
||||
(if (stringp dired-directory)
|
||||
(let ((wildcards (file-name-nondirectory
|
||||
dired-directory)))
|
||||
(or (= 0 (length wildcards))
|
||||
(string-match (dired-glob-regexp wildcards)
|
||||
file)))
|
||||
(or (zerop (length wildcards))
|
||||
(string-match-p (dired-glob-regexp wildcards)
|
||||
file)))
|
||||
(member (expand-file-name file dir)
|
||||
(cdr dired-directory))))
|
||||
(setq result (cons buf result)))))))
|
||||
@ -2488,7 +2480,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
|
||||
(if (= (aref pattern (1+ set-start)) ?^)
|
||||
(+ 3 set-start)
|
||||
(+ 2 set-start)))
|
||||
(set-end (string-match "]" pattern set-cont))
|
||||
(set-end (string-match-p "]" pattern set-cont))
|
||||
(set (substring pattern set-start (1+ set-end))))
|
||||
(setq regexp (concat regexp set))
|
||||
(setq matched-in-pattern (1+ set-end))))
|
||||
@ -2528,7 +2520,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
|
||||
(defun dired-in-this-tree (file dir)
|
||||
;;"Is FILE part of the directory tree starting at DIR?"
|
||||
(let (case-fold-search)
|
||||
(string-match (concat "^" (regexp-quote dir)) file)))
|
||||
(string-match-p (concat "^" (regexp-quote dir)) file)))
|
||||
|
||||
(defun dired-normalize-subdir (dir)
|
||||
;; Prepend default-directory to DIR if relative file name.
|
||||
@ -2610,7 +2602,7 @@ instead of `dired-actual-switches'."
|
||||
(R-ftp-base-dir-regex
|
||||
;; Used to expand subdirectory names correctly in recursive
|
||||
;; ange-ftp listings.
|
||||
(and (string-match "R" switches)
|
||||
(and (string-match-p "R" switches)
|
||||
(string-match "\\`/.*:\\(/.*\\)" default-directory)
|
||||
(concat "\\`" (match-string 1 default-directory)))))
|
||||
(goto-char (point-min))
|
||||
@ -2622,7 +2614,7 @@ instead of `dired-actual-switches'."
|
||||
(goto-char (match-beginning 0))
|
||||
(beginning-of-line)
|
||||
(forward-char 2)
|
||||
(save-match-data (looking-at dired-re-perms)))
|
||||
(looking-at-p dired-re-perms))
|
||||
(save-excursion
|
||||
(goto-char (match-beginning 1))
|
||||
(setq new-dir-name
|
||||
@ -2680,9 +2672,9 @@ instead of `dired-actual-switches'."
|
||||
(dired-goto-next-file);; so there is a file to compare with
|
||||
(if (stringp dired-trivial-filenames)
|
||||
(while (and (not (eobp))
|
||||
(string-match dired-trivial-filenames
|
||||
(file-name-nondirectory
|
||||
(or (dired-get-filename nil t) ""))))
|
||||
(string-match-p dired-trivial-filenames
|
||||
(file-name-nondirectory
|
||||
(or (dired-get-filename nil t) ""))))
|
||||
(forward-line 1)
|
||||
(dired-move-to-filename))))
|
||||
|
||||
@ -2692,7 +2684,7 @@ instead of `dired-actual-switches'."
|
||||
(forward-line 1))))
|
||||
|
||||
(defun dired-goto-file (file)
|
||||
"Go to line describing file FILE in this dired buffer."
|
||||
"Go to line describing file FILE in this Dired buffer."
|
||||
;; Return value of point on success, else nil.
|
||||
;; FILE must be an absolute file name.
|
||||
;; Loses if FILE contains control chars like "\007" for which ls
|
||||
@ -2741,7 +2733,7 @@ as returned by `dired-get-filename'. LIMIT is the search limit."
|
||||
(setq str (replace-regexp-in-string "\^m" "\\^m" file nil t))
|
||||
(setq str (replace-regexp-in-string "\\\\" "\\\\" str nil t))
|
||||
(and (dired-switches-escape-p dired-actual-switches)
|
||||
(string-match "[ \t\n]" str)
|
||||
(string-match-p "[ \t\n]" str)
|
||||
;; FIXME: to fix this for embedded control characters etc, we
|
||||
;; should escape everything that `ls -b' does.
|
||||
(setq str (replace-regexp-in-string " " "\\ " str nil t)
|
||||
@ -2989,7 +2981,7 @@ also offers to kill buffers visiting deleted files and directories."
|
||||
(kill-buffer buf)))
|
||||
(let ((buf-list (dired-buffers-for-dir (expand-file-name fn))))
|
||||
(and buf-list
|
||||
(y-or-n-p (format "Kill dired buffer%s of %s, too? "
|
||||
(y-or-n-p (format "Kill Dired buffer%s of %s, too? "
|
||||
(dired-plural-s (length buf-list))
|
||||
(file-name-nondirectory fn)))
|
||||
(dolist (buf buf-list)
|
||||
@ -3078,7 +3070,7 @@ FILES is the list of marked files. It can also be (t FILENAME)
|
||||
in the case of one marked file, to distinguish that from using
|
||||
just the current file.
|
||||
|
||||
FUNCTION should not manipulate files, just read input \(an
|
||||
FUNCTION should not manipulate files, just read input (an
|
||||
argument or confirmation)."
|
||||
(if (or (eq dired-no-confirm t)
|
||||
(memq op-symbol dired-no-confirm)
|
||||
@ -3183,7 +3175,7 @@ argument or confirmation)."
|
||||
;; Skip subdir line and following garbage like the `total' line:
|
||||
(while (and (< (point) end) (dired-between-files))
|
||||
(forward-line 1))
|
||||
(if (and (not (looking-at dired-re-dot))
|
||||
(if (and (not (looking-at-p dired-re-dot))
|
||||
(dired-get-filename nil t))
|
||||
(progn
|
||||
(delete-char 1)
|
||||
@ -3264,7 +3256,7 @@ As always, hidden subdirs are not affected."
|
||||
(let ((inhibit-read-only t))
|
||||
(while (not (eobp))
|
||||
(or (dired-between-files)
|
||||
(looking-at dired-re-dot)
|
||||
(looking-at-p dired-re-dot)
|
||||
;; use subst instead of insdel because it does not move
|
||||
;; the gap and thus should be faster and because
|
||||
;; other characters are left alone automatically
|
||||
@ -3296,10 +3288,10 @@ object files--just `.o' will mark more than you might think."
|
||||
(if current-prefix-arg ?\040)))
|
||||
(let ((dired-marker-char (or marker-char dired-marker-char)))
|
||||
(dired-mark-if
|
||||
(and (not (looking-at dired-re-dot))
|
||||
(and (not (looking-at-p dired-re-dot))
|
||||
(not (eolp)) ; empty line
|
||||
(let ((fn (dired-get-filename t t)))
|
||||
(and fn (string-match regexp fn))))
|
||||
(and fn (string-match-p regexp fn))))
|
||||
"matching file")))
|
||||
|
||||
(defun dired-mark-files-containing-regexp (regexp &optional marker-char)
|
||||
@ -3312,7 +3304,7 @@ A prefix argument means to unmark them instead.
|
||||
(if current-prefix-arg ?\040)))
|
||||
(let ((dired-marker-char (or marker-char dired-marker-char)))
|
||||
(dired-mark-if
|
||||
(and (not (looking-at dired-re-dot))
|
||||
(and (not (looking-at-p dired-re-dot))
|
||||
(not (eolp)) ; empty line
|
||||
(let ((fn (dired-get-filename nil t)))
|
||||
(when (and fn (file-readable-p fn)
|
||||
@ -3346,15 +3338,15 @@ The match is against the non-directory part of the filename. Use `^'
|
||||
With prefix argument, unmark or unflag all those files."
|
||||
(interactive "P")
|
||||
(let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
|
||||
(dired-mark-if (looking-at dired-re-sym) "symbolic link")))
|
||||
(dired-mark-if (looking-at-p dired-re-sym) "symbolic link")))
|
||||
|
||||
(defun dired-mark-directories (unflag-p)
|
||||
"Mark all directory file lines except `.' and `..'.
|
||||
With prefix argument, unmark or unflag all those files."
|
||||
(interactive "P")
|
||||
(let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
|
||||
(dired-mark-if (and (looking-at dired-re-dir)
|
||||
(not (looking-at dired-re-dot)))
|
||||
(dired-mark-if (and (looking-at-p dired-re-dir)
|
||||
(not (looking-at-p dired-re-dot)))
|
||||
"directory file")))
|
||||
|
||||
(defun dired-mark-executables (unflag-p)
|
||||
@ -3362,7 +3354,7 @@ With prefix argument, unmark or unflag all those files."
|
||||
With prefix argument, unmark or unflag all those files."
|
||||
(interactive "P")
|
||||
(let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
|
||||
(dired-mark-if (looking-at dired-re-exe) "executable file")))
|
||||
(dired-mark-if (looking-at-p dired-re-exe) "executable file")))
|
||||
|
||||
;; dired-x.el has a dired-mark-sexp interactive command: mark
|
||||
;; files for which PREDICATE returns non-nil.
|
||||
@ -3386,7 +3378,7 @@ A prefix argument says to unmark or unflag those files instead."
|
||||
(progn
|
||||
(forward-char -1)
|
||||
(eq (preceding-char) ?#)))))
|
||||
(not (looking-at dired-re-dir))
|
||||
(not (looking-at-p dired-re-dir))
|
||||
(let ((fn (dired-get-filename t t)))
|
||||
(if fn (auto-save-file-name-p
|
||||
(file-name-nondirectory fn)))))
|
||||
@ -3424,7 +3416,7 @@ With prefix argument, unmark or unflag these files."
|
||||
(if (eq (preceding-char) ?*)
|
||||
(forward-char -1))
|
||||
(eq (preceding-char) ?~))
|
||||
(not (looking-at dired-re-dir))
|
||||
(not (looking-at-p dired-re-dir))
|
||||
(let ((fn (dired-get-filename t t)))
|
||||
(if fn (backup-file-name-p fn))))
|
||||
"backup file")))
|
||||
@ -3453,7 +3445,7 @@ OLD and NEW are both characters used to mark files."
|
||||
(match-end 0) old new)))))))
|
||||
|
||||
(defun dired-unmark-all-marks ()
|
||||
"Remove all marks from all files in the dired buffer."
|
||||
"Remove all marks from all files in the Dired buffer."
|
||||
(interactive)
|
||||
(dired-unmark-all-files ?\r))
|
||||
|
||||
@ -3560,12 +3552,12 @@ or nil if file names are not applicable."
|
||||
;; So anything that does not contain these is sort "by name".
|
||||
|
||||
(defvar dired-ls-sorting-switches "SXU"
|
||||
"String of `ls' switches \(single letters\) except \"t\" that influence sorting.
|
||||
"String of `ls' switches (single letters) except \"t\" that influence sorting.
|
||||
|
||||
This indicates to Dired which option switches to watch out for because they
|
||||
will change the sorting order behavior of `ls'.
|
||||
|
||||
To change the default sorting order \(e.g. add a `-v' option\), see the
|
||||
To change the default sorting order (e.g. add a `-v' option), see the
|
||||
variable `dired-listing-switches'. To temporarily override the listing
|
||||
format, use `\\[universal-argument] \\[dired]'.")
|
||||
|
||||
@ -3584,7 +3576,7 @@ format, use `\\[universal-argument] \\[dired]'.")
|
||||
|
||||
(defvar dired-sort-inhibit nil
|
||||
"Non-nil means the Dired sort command is disabled.
|
||||
The idea is to set this buffer-locally in special dired buffers.")
|
||||
The idea is to set this buffer-locally in special Dired buffers.")
|
||||
|
||||
(defun dired-sort-set-mode-line ()
|
||||
;; Set mode line display according to dired-actual-switches.
|
||||
@ -3594,10 +3586,10 @@ The idea is to set this buffer-locally in special dired buffers.")
|
||||
(when (eq major-mode 'dired-mode)
|
||||
(setq mode-name
|
||||
(let (case-fold-search)
|
||||
(cond ((string-match
|
||||
(cond ((string-match-p
|
||||
dired-sort-by-name-regexp dired-actual-switches)
|
||||
"Dired by name")
|
||||
((string-match
|
||||
((string-match-p
|
||||
dired-sort-by-date-regexp dired-actual-switches)
|
||||
"Dired by date")
|
||||
(t
|
||||
@ -3612,7 +3604,7 @@ The idea is to set this buffer-locally in special dired buffers.")
|
||||
With a prefix argument, edit the current listing switches instead."
|
||||
(interactive "P")
|
||||
(when dired-sort-inhibit
|
||||
(error "Cannot sort this dired buffer"))
|
||||
(error "Cannot sort this Dired buffer"))
|
||||
(if arg
|
||||
(dired-sort-other
|
||||
(read-string "ls switches (must contain -l): " dired-actual-switches))
|
||||
@ -3620,8 +3612,8 @@ With a prefix argument, edit the current listing switches instead."
|
||||
|
||||
(defun dired-sort-toggle ()
|
||||
;; Toggle between sort by date/name. Reverts the buffer.
|
||||
(let ((sorting-by-date (string-match dired-sort-by-date-regexp
|
||||
dired-actual-switches))
|
||||
(let ((sorting-by-date (string-match-p dired-sort-by-date-regexp
|
||||
dired-actual-switches))
|
||||
;; Regexp for finding (possibly embedded) -t switches.
|
||||
(switch-regexp "\\(\\`\\| \\)-\\([a-su-zA-Z]*\\)\\(t\\)\\([^ ]*\\)")
|
||||
case-fold-search)
|
||||
@ -3662,7 +3654,7 @@ With a prefix argument, edit the current listing switches instead."
|
||||
(concat result (substring string start))))
|
||||
|
||||
(defun dired-sort-other (switches &optional no-revert)
|
||||
"Specify new `ls' SWITCHES for current dired buffer.
|
||||
"Specify new `ls' SWITCHES for current Dired buffer.
|
||||
Values matching `dired-sort-by-date-regexp' or `dired-sort-by-name-regexp'
|
||||
set the minor mode accordingly, others appear literally in the mode line.
|
||||
With optional second arg NO-REVERT, don't refresh the listing afterwards."
|
||||
@ -3671,9 +3663,8 @@ With optional second arg NO-REVERT, don't refresh the listing afterwards."
|
||||
(dired-sort-set-mode-line)
|
||||
(or no-revert (revert-buffer)))
|
||||
|
||||
(defvar dired-subdir-alist-pre-R nil
|
||||
(defvar-local dired-subdir-alist-pre-R nil
|
||||
"Value of `dired-subdir-alist' before -R switch added.")
|
||||
(make-variable-buffer-local 'dired-subdir-alist-pre-R)
|
||||
|
||||
(defun dired-sort-R-check (switches)
|
||||
"Additional processing of -R in ls option string SWITCHES.
|
||||
@ -3681,12 +3672,12 @@ Saves `dired-subdir-alist' when R is set and restores saved value
|
||||
minus any directories explicitly deleted when R is cleared.
|
||||
To be called first in body of `dired-sort-other', etc."
|
||||
(cond
|
||||
((and (string-match "R" switches)
|
||||
(not (string-match "R" dired-actual-switches)))
|
||||
((and (string-match-p "R" switches)
|
||||
(not (string-match-p "R" dired-actual-switches)))
|
||||
;; Adding -R to ls switches -- save `dired-subdir-alist':
|
||||
(setq dired-subdir-alist-pre-R dired-subdir-alist))
|
||||
((and (string-match "R" dired-actual-switches)
|
||||
(not (string-match "R" switches)))
|
||||
((and (string-match-p "R" dired-actual-switches)
|
||||
(not (string-match-p "R" switches)))
|
||||
;; Deleting -R from ls switches -- revert to pre-R subdirs
|
||||
;; that are still present:
|
||||
(setq dired-subdir-alist
|
||||
@ -3754,7 +3745,7 @@ Any other value means to ask for each directory."
|
||||
(defvar dired-overwrite-confirmed) ;Defined in dired-aux.
|
||||
|
||||
(defun dired-dnd-handle-local-file (uri action)
|
||||
"Copy, move or link a file to the dired directory.
|
||||
"Copy, move or link a file to the Dired directory.
|
||||
URI is the file to handle, ACTION is one of copy, move, link or ask.
|
||||
Ask means pop up a menu for the user to select one of copy, move or link."
|
||||
(require 'dired-aux)
|
||||
@ -3801,7 +3792,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
|
||||
action))))))
|
||||
|
||||
(defun dired-dnd-handle-file (uri action)
|
||||
"Copy, move or link a file to the dired directory if it is a local file.
|
||||
"Copy, move or link a file to the Dired directory if it is a local file.
|
||||
URI is the file to handle. If the hostname in the URI isn't local, do nothing.
|
||||
ACTION is one of copy, move, link or ask.
|
||||
Ask means pop up a menu for the user to select one of copy, move or link."
|
||||
@ -3835,7 +3826,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
|
||||
(defun dired-restore-desktop-buffer (_file-name
|
||||
_buffer-name
|
||||
misc-data)
|
||||
"Restore a dired buffer specified in a desktop file."
|
||||
"Restore a Dired buffer specified in a desktop file."
|
||||
;; First element of `misc-data' is the value of `dired-directory'.
|
||||
;; This value is a directory name, optionally with shell wildcard or
|
||||
;; a directory name followed by list of files.
|
||||
@ -4376,17 +4367,16 @@ instead.
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump)
|
||||
;;;;;; "dired-x" "dired-x.el" "90ba5245f6f5df3bdbda6303c725ef45")
|
||||
;;;### (autoloads nil "dired-x" "dired-x.el" "4b863621846609105c0371f8ffb8c1cf")
|
||||
;;; Generated autoloads from dired-x.el
|
||||
|
||||
(autoload 'dired-jump "dired-x" "\
|
||||
Jump to dired buffer corresponding to current buffer.
|
||||
If in a file, dired the current directory and move to file's line.
|
||||
Jump to Dired buffer corresponding to current buffer.
|
||||
If in a file, Dired the current directory and move to file's line.
|
||||
If in Dired already, pop up a level and goto old directory's line.
|
||||
In case the proper dired file line cannot be found, refresh the dired
|
||||
In case the proper Dired file line cannot be found, refresh the dired
|
||||
buffer and try again.
|
||||
When OTHER-WINDOW is non-nil, jump to dired buffer in other window.
|
||||
When OTHER-WINDOW is non-nil, jump to Dired buffer in other window.
|
||||
Interactively with prefix argument, read FILE-NAME and
|
||||
move to its line in dired.
|
||||
|
||||
|
@ -86,7 +86,7 @@ and whether the file exists:
|
||||
If the file does not exist default value of `buffer-file-coding-system'
|
||||
|
||||
Note that the CAR of arguments to `insert-file-contents' operation could
|
||||
be a cons cell of the form \(FILENAME . BUFFER\), where BUFFER is a buffer
|
||||
be a cons cell of the form (FILENAME . BUFFER), where BUFFER is a buffer
|
||||
into which the file's contents were already read, but not yet decoded.
|
||||
|
||||
If operation is `write-region', the coding system is chosen based
|
||||
@ -203,8 +203,8 @@ dealing with untranslated filesystems."
|
||||
;; with bare drive letters (which would have the cwd appended).
|
||||
;; Avoid expanding names that could trigger ange-ftp to prompt
|
||||
;; for passwords, though.
|
||||
(if (or (string-match "^.:$" name)
|
||||
(string-match "^/[^/:]+:" name))
|
||||
(if (or (string-match-p "^.:$" name)
|
||||
(string-match-p "^/[^/:]+:" name))
|
||||
name
|
||||
(expand-file-name name)))
|
||||
filename))
|
||||
@ -216,7 +216,7 @@ CR/LF translation, and nil otherwise."
|
||||
(ufs-list untranslated-filesystem-list)
|
||||
(found nil))
|
||||
(while (and (not found) ufs-list)
|
||||
(if (string-match (concat "^" (car ufs-list)) fs)
|
||||
(if (string-match-p (concat "^" (car ufs-list)) fs)
|
||||
(setq found t)
|
||||
(setq ufs-list (cdr ufs-list))))
|
||||
found))
|
||||
@ -288,19 +288,19 @@ filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
|
||||
;; asking command.com to copy the file.
|
||||
;; No action is needed for UNC printer names, which is just as well
|
||||
;; because `expand-file-name' doesn't support UNC names on MS-DOS.
|
||||
(if (and (stringp printer) (not (string-match "^\\\\" printer)))
|
||||
(if (and (stringp printer) (not (string-match-p "^\\\\" printer)))
|
||||
(setq printer
|
||||
(subst-char-in-string ?/ ?\\ (expand-file-name printer safe-dir))))
|
||||
;; Handle known programs specially where necessary.
|
||||
(unwind-protect
|
||||
(cond
|
||||
;; nprint.exe is the standard print command on Netware
|
||||
((string-match "^nprint\\(\\.exe\\)?$" (file-name-nondirectory lpr-prog))
|
||||
((string-match-p "^nprint\\(\\.exe\\)?$" (file-name-nondirectory lpr-prog))
|
||||
(write-region start end tempfile nil 0)
|
||||
(call-process lpr-prog nil errbuf nil
|
||||
tempfile (concat "P=" printer)))
|
||||
;; print.exe is a standard command on NT
|
||||
((string-match "^print\\(\\.exe\\)?$" (file-name-nondirectory lpr-prog))
|
||||
((string-match-p "^print\\(\\.exe\\)?$" (file-name-nondirectory lpr-prog))
|
||||
;; Be careful not to invoke print.exe on MS-DOS or Windows 9x
|
||||
;; though, because it is a TSR program there (hangs Emacs).
|
||||
(or (and (eq system-type 'windows-nt)
|
||||
@ -355,7 +355,7 @@ filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
|
||||
&rest rest)
|
||||
"DOS/Windows-specific function to print the region on a printer.
|
||||
Writes the region to the device or file which is a value of
|
||||
`printer-name' \(which see\), unless the value of `lpr-command'
|
||||
`printer-name' (which see), unless the value of `lpr-command'
|
||||
indicates a specific program should be invoked."
|
||||
|
||||
;; DOS printers need the lines to end with CR-LF pairs, so make
|
||||
@ -405,7 +405,7 @@ indicates a specific program should be invoked."
|
||||
&rest rest)
|
||||
"DOS/Windows-specific function to print the region on a PostScript printer.
|
||||
Writes the region to the device or file which is a value of
|
||||
`ps-printer-name' \(which see\), unless the value of `ps-lpr-command'
|
||||
`ps-printer-name' (which see), unless the value of `ps-lpr-command'
|
||||
indicates a specific program should be invoked."
|
||||
|
||||
(let ((printer (or (and (boundp 'dos-ps-printer)
|
||||
|
Loading…
Reference in New Issue
Block a user