aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJuanma Barranquero2013-06-21 14:24:37 +0200
committerJuanma Barranquero2013-06-21 14:24:37 +0200
commitcedf5c9dbe66fecc37979e133f06d8bf4db3814f (patch)
tree1a71f618d4f6125582ace064c8eadf4fafb8bb15 /lisp
parent4628c0bf57a62949c617dc28777b5afe21d1ca78 (diff)
downloademacs-cedf5c9dbe66fecc37979e133f06d8bf4db3814f.tar.gz
emacs-cedf5c9dbe66fecc37979e133f06d8bf4db3814f.zip
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'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog43
-rw-r--r--lisp/allout-widgets.el46
-rw-r--r--lisp/cmuscheme.el32
-rw-r--r--lisp/composite.el16
-rw-r--r--lisp/dired-x.el48
-rw-r--r--lisp/dired.el222
-rw-r--r--lisp/dos-w32.el18
7 files changed, 227 insertions, 198 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c79fcbd903f..a64c2868462 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,46 @@
12013-06-21 Juanma Barranquero <lekktu@gmail.com>
2
3 * allout-widgets.el (allout-widgets-mode-off)
4 (allout-widgets-mode-on, allout-widgets-pre-command-business)
5 (allout-widgets-post-command-business)
6 (allout-widgets-after-copy-or-kill-function)
7 (allout-widgets-after-undo-function, allout-test-range-overlaps)
8 (allout-decorate-item-and-context)
9 (allout-graphics-modification-handler): Fix typos in docstrings.
10 (allout-get-or-create-parent-widget): Use `looking-at-p'.
11
12 * cmuscheme.el (scheme-start-file): Doc fix.
13 (inferior-scheme-mode, switch-to-scheme): Fix typos in docstrings.
14 (scheme-input-filter): Use `string-match-p'.
15
16 * composite.el (compose-gstring-for-terminal): Fix typo in docstring.
17
18 * dired-x.el: Use Dired consistently in docstrings.
19
20 * dired.el: Use Dired consistently in docstrings.
21 (dired-readin, dired-mode): Use `setq-local'.
22 (dired-switches-alist): Make defvar-local.
23 (dired-buffers-for-dir): Use `zerop'.
24 (dired-safe-switches-p, dired-switches-escape-p)
25 (dired-insert-old-subdirs, dired-move-to-end-of-filename)
26 (dired-glob-regexp, dired-in-this-tree, dired-goto-file-1)
27 (dired-sort-set-mode-line, dired-sort-toggle, dired-sort-R-check):
28 (dired-goto-next-nontrivial-file): Use `string-match-p'.
29 (dired-align-file, dired-insert-directory, dired-mark-files-in-region)
30 (dired-toggle-marks, dired-mark-files-containing-regexp)
31 (dired-mark-symlinks, dired-mark-directories, dired-mark-executables)
32 (dired-flag-auto-save-files, dired-flag-backup-files):
33 Use `looking-at-p'.
34 (dired-mark-files-regexp, dired-build-subdir-alist):
35 Use `string-match-p', `looking-at-p'.
36
37 * dos-w32.el (untranslated-canonical-name, untranslated-file-p)
38 (direct-print-region-helper): Use `string-match-p'.
39
12013-06-21 Leo Liu <sdl.web@gmail.com> 402013-06-21 Leo Liu <sdl.web@gmail.com>
2 41
3 * comint.el (comint-redirect-results-list-from-process): Fix 42 * comint.el (comint-redirect-results-list-from-process):
4 infinite loop. 43 Fix infinite loop.
5 44
62013-06-21 Lars Magne Ingebrigtsen <larsi@gnus.org> 452013-06-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7 46
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index eed125907b6..fd8e5f8ff94 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -293,8 +293,8 @@ The number varies according to the evanescence of objects on a
293 "If non-nil, show cursor position of each item decoration. 293 "If non-nil, show cursor position of each item decoration.
294 294
295This is for debugging purposes, and generally set at need in a 295This is for debugging purposes, and generally set at need in a
296buffer rather than as a prevailing configuration \(but it's handy 296buffer rather than as a prevailing configuration (but it's handy
297to publicize it by making it a customization variable\)." 297to publicize it by making it a customization variable)."
298 :version "24.1" 298 :version "24.1"
299 :type 'boolean 299 :type 'boolean
300 :group 'allout-widgets-developer) 300 :group 'allout-widgets-developer)
@@ -346,7 +346,7 @@ to `allout-body-modification-handler', and is always reset by
346 "Cache allout icon images, as an association list. 346 "Cache allout icon images, as an association list.
347 347
348`allout-fetch-icon-image' uses this cache transparently, keying 348`allout-fetch-icon-image' uses this cache transparently, keying
349images with lists containing the name of the icon directory \(as 349images with lists containing the name of the icon directory (as
350found on the `load-path') and the icon name. 350found on the `load-path') and the icon name.
351 351
352Set this variable to `nil' to empty the cache, and have it replenish from the 352Set this variable to `nil' to empty the cache, and have it replenish from the
@@ -485,7 +485,7 @@ including things like:
485 - encryption '~' 485 - encryption '~'
486 - numbering '#' 486 - numbering '#'
487 - indirect reference '@' 487 - indirect reference '@'
488 - distinctive bullets - see `allout-distinctive-bullets-string'.\)") 488 - distinctive bullets - see `allout-distinctive-bullets-string'.)")
489;;;_ = allout-span-to-category 489;;;_ = allout-span-to-category
490(defvar allout-span-to-category 490(defvar allout-span-to-category
491 '((:guides-span . allout-guides-span-category) 491 '((:guides-span . allout-guides-span-category)
@@ -534,7 +534,7 @@ The graphics include:
534 534
535The bullet-icon and guide line graphics provide keybindings and mouse 535The bullet-icon and guide line graphics provide keybindings and mouse
536bindings for easy outline navigation and exposure control, extending 536bindings for easy outline navigation and exposure control, extending
537outline hot-spot navigation \(see `allout-mode')." 537outline hot-spot navigation (see `allout-mode')."
538 538
539 :lighter nil 539 :lighter nil
540 :keymap nil 540 :keymap nil
@@ -646,11 +646,11 @@ outline hot-spot navigation \(see `allout-mode')."
646 (set-buffer-modified-p was-modified)))) 646 (set-buffer-modified-p was-modified))))
647;;;_ > allout-widgets-mode-off 647;;;_ > allout-widgets-mode-off
648(defun allout-widgets-mode-off () 648(defun allout-widgets-mode-off ()
649 "Explicitly disable allout-widgets-mode." 649 "Explicitly disable `allout-widgets-mode'."
650 (allout-widgets-mode -1)) 650 (allout-widgets-mode -1))
651;;;_ > allout-widgets-mode-off 651;;;_ > allout-widgets-mode-off
652(defun allout-widgets-mode-on () 652(defun allout-widgets-mode-on ()
653 "Explicitly disable allout-widgets-mode." 653 "Explicitly enable `allout-widgets-mode'."
654 (allout-widgets-mode 1)) 654 (allout-widgets-mode 1))
655;;;_ > allout-setup-text-properties () 655;;;_ > allout-setup-text-properties ()
656(defun allout-setup-text-properties () 656(defun allout-setup-text-properties ()
@@ -714,18 +714,18 @@ outline hot-spot navigation \(see `allout-mode')."
714(defvar allout-container-item-widget nil 714(defvar allout-container-item-widget nil
715 "A widget for the current outline's overarching container as an item. 715 "A widget for the current outline's overarching container as an item.
716 716
717The item has settings \(of the file/connection\) and maybe a body, but no 717The item has settings (of the file/connection) and maybe a body, but no
718icon/bullet.") 718icon/bullet.")
719(make-variable-buffer-local 'allout-container-item-widget) 719(make-variable-buffer-local 'allout-container-item-widget)
720;;;_ . Hooks and hook helpers 720;;;_ . Hooks and hook helpers
721;;;_ , major command-loop business: 721;;;_ , major command-loop business:
722;;;_ > allout-widgets-pre-command-business (&optional recursing) 722;;;_ > allout-widgets-pre-command-business (&optional recursing)
723(defun allout-widgets-pre-command-business (&optional recursing) 723(defun allout-widgets-pre-command-business (&optional recursing)
724 "Handle actions pending before allout-mode activity." 724 "Handle actions pending before `allout-mode' activity."
725) 725)
726;;;_ > allout-widgets-post-command-business (&optional recursing) 726;;;_ > allout-widgets-post-command-business (&optional recursing)
727(defun allout-widgets-post-command-business (&optional recursing) 727(defun allout-widgets-post-command-business (&optional recursing)
728 "Handle actions pending after any allout-mode commands. 728 "Handle actions pending after any `allout-mode' commands.
729 729
730Optional RECURSING is for internal use, to limit recursion." 730Optional RECURSING is for internal use, to limit recursion."
731 ;; - check changed text for nesting discontinuities and escape anything 731 ;; - check changed text for nesting discontinuities and escape anything
@@ -1155,14 +1155,14 @@ Dispatched by `allout-widgets-post-command-business' in response to
1155(defun allout-widgets-after-copy-or-kill-function () 1155(defun allout-widgets-after-copy-or-kill-function ()
1156 "Do allout-widgets processing of text just placed in the kill ring. 1156 "Do allout-widgets processing of text just placed in the kill ring.
1157 1157
1158Intended for use on allout-after-copy-or-kill-hook." 1158Intended for use on `allout-after-copy-or-kill-hook'."
1159 (if (car kill-ring) 1159 (if (car kill-ring)
1160 (setcar kill-ring (allout-widgets-undecorate-text (car kill-ring))))) 1160 (setcar kill-ring (allout-widgets-undecorate-text (car kill-ring)))))
1161;;;_ > allout-widgets-after-undo-function () 1161;;;_ > allout-widgets-after-undo-function ()
1162(defun allout-widgets-after-undo-function () 1162(defun allout-widgets-after-undo-function ()
1163 "Do allout-widgets processing of text after an undo. 1163 "Do allout-widgets processing of text after an undo.
1164 1164
1165Intended for use on allout-post-undo-hook." 1165Intended for use on `allout-post-undo-hook'."
1166 (save-excursion 1166 (save-excursion
1167 (if (allout-goto-prefix) 1167 (if (allout-goto-prefix)
1168 (allout-redecorate-item (allout-get-or-create-item-widget))))) 1168 (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."
1359 (list (if included-from t) new-ranges))) 1359 (list (if included-from t) new-ranges)))
1360;;;_ > allout-test-range-overlaps () 1360;;;_ > allout-test-range-overlaps ()
1361(defun allout-test-range-overlaps () 1361(defun allout-test-range-overlaps ()
1362 "allout-range-overlaps unit tests." 1362 "`allout-range-overlaps' unit tests."
1363 (let* (ranges 1363 (let* (ranges
1364 got 1364 got
1365 (try (lambda (from to) 1365 (try (lambda (from to)
@@ -1557,7 +1557,7 @@ recursive operation."
1557 1557
1558The neighbors include its siblings and parent. 1558The neighbors include its siblings and parent.
1559 1559
1560ITEM-WIDGET can be a created or converted allout-item-widget. 1560ITEM-WIDGET can be a created or converted `allout-item-widget'.
1561 1561
1562If you're only trying to get or create a widget for an item, use 1562If you're only trying to get or create a widget for an item, use
1563`allout-get-or-create-item-widget'. If you have the item-widget, applying 1563`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
1565 1565
1566Optional BLANK-CONTAINER is for internal use. It is used to fabricate a 1566Optional BLANK-CONTAINER is for internal use. It is used to fabricate a
1567container widget for an empty-bodied container, in the course of decorating 1567container widget for an empty-bodied container, in the course of decorating
1568a proper \(non-container\) item which starts at the beginning of the file. 1568a proper (non-container) item which starts at the beginning of the file.
1569 1569
1570Optional REDECORATE causes redecoration of the item-widget and 1570Optional REDECORATE causes redecoration of the item-widget and
1571its siblings, even if already decorated in this cycle of the command loop. 1571its 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
1737the item prefix. 1737the item prefix.
1738 1738
1739If optional BLANK-CONTAINER is true, then the parameters of a container 1739If optional BLANK-CONTAINER is true, then the parameters of a container
1740which has an empty body are set. \(Though the body is blank, the object 1740which has an empty body are set. (Though the body is blank, the object
1741may have subitems.\)" 1741may have subitems.)"
1742 1742
1743 ;; Uncomment this sit-for to notice where decoration is happening: 1743 ;; Uncomment this sit-for to notice where decoration is happening:
1744;; (sit-for .1) 1744;; (sit-for .1)
@@ -1857,8 +1857,8 @@ the various element spans."
1857 &optional parent-widget has-successor) 1857 &optional parent-widget has-successor)
1858 "Add ITEM-WIDGET guide icon-prefix descender and connector text properties. 1858 "Add ITEM-WIDGET guide icon-prefix descender and connector text properties.
1859 1859
1860Optional arguments provide context for deriving the guides. In 1860Optional arguments provide context for deriving the guides.
1861their absence, the current guide column flags are used. 1861In their absence, the current guide column flags are used.
1862 1862
1863Optional PARENT-WIDGET is the widget for the item's parent item. 1863Optional PARENT-WIDGET is the widget for the item's parent item.
1864 1864
@@ -2222,7 +2222,7 @@ and decorate its siblings and parent, as well.
2222 2222
2223Optional BLANK-CONTAINER is for internal use, to fabricate a 2223Optional BLANK-CONTAINER is for internal use, to fabricate a
2224meta-container item with an empty body when the first proper 2224meta-container item with an empty body when the first proper
2225\(non-container\) item starts at the beginning of the file. 2225\(non-container) item starts at the beginning of the file.
2226 2226
2227Optional REDECORATE, if non-nil, means to redecorate the widget 2227Optional REDECORATE, if non-nil, means to redecorate the widget
2228if it already exists." 2228if it already exists."
@@ -2254,7 +2254,7 @@ Point will wind up positioned on the beginning of the parent or beginning
2254of the buffer." 2254of the buffer."
2255 ;; use existing widget, if there, else establish it 2255 ;; use existing widget, if there, else establish it
2256 (if (or (bobp) (and (not (allout-ascend)) 2256 (if (or (bobp) (and (not (allout-ascend))
2257 (looking-at allout-regexp))) 2257 (looking-at-p allout-regexp)))
2258 (allout-get-or-create-item-widget redecorate 'blank-container) 2258 (allout-get-or-create-item-widget redecorate 'blank-container)
2259 (allout-get-or-create-item-widget redecorate))) 2259 (allout-get-or-create-item-widget redecorate)))
2260;;;_ : X- Item ancillaries 2260;;;_ : X- Item ancillaries
@@ -2270,7 +2270,7 @@ Operation is inhibited by `allout-inhibit-body-modification-handler'."
2270;; - removal and replacement of the settings 2270;; - removal and replacement of the settings
2271;; - maintenance of beginning-of-line guide lines 2271;; - maintenance of beginning-of-line guide lines
2272;; 2272;;
2273;; ?? Escapes removal \(before changes\) is not done when edits span multiple 2273;; ?? Escapes removal (before changes) is not done when edits span multiple
2274;; items, recognizing that item structure is being preserved, including 2274;; items, recognizing that item structure is being preserved, including
2275;; escaping of item-prefix-like text within bodies. See 2275;; escaping of item-prefix-like text within bodies. See
2276;; `allout-before-modification-handler' and 2276;; `allout-before-modification-handler' and
@@ -2284,7 +2284,7 @@ Operation is inhibited by `allout-inhibit-body-modification-handler'."
2284(defun allout-graphics-modification-handler (beg end) 2284(defun allout-graphics-modification-handler (beg end)
2285 "Protect against incoherent deletion of decoration graphics. 2285 "Protect against incoherent deletion of decoration graphics.
2286 2286
2287Deletes allowed only when inhibit-read-only is t." 2287Deletes allowed only when `inhibit-read-only' is t."
2288 (cond 2288 (cond
2289 (undo-in-progress (when (eq (get-text-property beg 'category) 2289 (undo-in-progress (when (eq (get-text-property beg 'category)
2290 'allout-icon-span-category) 2290 'allout-icon-span-category)
diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el
index 0f89eae8828..b78b8decfa6 100644
--- a/lisp/cmuscheme.el
+++ b/lisp/cmuscheme.el
@@ -170,22 +170,22 @@ The following commands are available:
170 170
171A Scheme process can be fired up with M-x run-scheme. 171A Scheme process can be fired up with M-x run-scheme.
172 172
173Customization: Entry to this mode runs the hooks on comint-mode-hook and 173Customization: Entry to this mode runs the hooks on `comint-mode-hook' and
174inferior-scheme-mode-hook (in that order). 174`inferior-scheme-mode-hook' (in that order).
175 175
176You can send text to the inferior Scheme process from other buffers containing 176You can send text to the inferior Scheme process from other buffers containing
177Scheme source. 177Scheme source.
178 switch-to-scheme switches the current buffer to the Scheme process buffer. 178 `switch-to-scheme' switches the current buffer to the Scheme process buffer.
179 scheme-send-definition sends the current definition to the Scheme process. 179 `scheme-send-definition' sends the current definition to the Scheme process.
180 scheme-compile-definition compiles the current definition. 180 `scheme-compile-definition' compiles the current definition.
181 scheme-send-region sends the current region to the Scheme process. 181 `scheme-send-region' sends the current region to the Scheme process.
182 scheme-compile-region compiles the current region. 182 `scheme-compile-region' compiles the current region.
183 183
184 scheme-send-definition-and-go, scheme-compile-definition-and-go, 184 `scheme-send-definition-and-go', `scheme-compile-definition-and-go',
185 scheme-send-region-and-go, and scheme-compile-region-and-go 185 `scheme-send-region-and-go', and `scheme-compile-region-and-go'
186 switch to the Scheme process buffer after sending their text. 186 switch to the Scheme process buffer after sending their text.
187For information on running multiple processes in multiple buffers, see 187For information on running multiple processes in multiple buffers, see
188documentation for variable scheme-buffer. 188documentation for variable `scheme-buffer'.
189 189
190Commands: 190Commands:
191Return after the end of the process' output sends the text from the 191Return 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."
214 214
215(defun scheme-input-filter (str) 215(defun scheme-input-filter (str)
216 "Don't save anything matching `inferior-scheme-filter-regexp'." 216 "Don't save anything matching `inferior-scheme-filter-regexp'."
217 (not (string-match inferior-scheme-filter-regexp str))) 217 (not (string-match-p inferior-scheme-filter-regexp str)))
218 218
219(defun scheme-get-old-input () 219(defun scheme-get-old-input ()
220 "Snarf the sexp ending at point." 220 "Snarf the sexp ending at point."
@@ -233,7 +233,7 @@ If the file `~/.emacs_SCHEMENAME' or `~/.emacs.d/init_SCHEMENAME.scm' exists,
233it is given as initial input. 233it is given as initial input.
234Note that this may lose due to a timing error if the Scheme processor 234Note that this may lose due to a timing error if the Scheme processor
235discards input when it starts up. 235discards input when it starts up.
236Runs the hook `inferior-scheme-mode-hook' \(after the `comint-mode-hook' 236Runs the hook `inferior-scheme-mode-hook' (after the `comint-mode-hook'
237is run). 237is run).
238\(Type \\[describe-mode] in the process buffer for a list of commands.)" 238\(Type \\[describe-mode] in the process buffer for a list of commands.)"
239 239
@@ -251,8 +251,8 @@ is run).
251 251
252(defun scheme-start-file (prog) 252(defun scheme-start-file (prog)
253 "Return the name of the start file corresponding to PROG. 253 "Return the name of the start file corresponding to PROG.
254Search in the directories \"~\" and \"~/.emacs.d\", in this 254Search in the directories \"~\" and `user-emacs-directory',
255order. Return nil if no start file found." 255in this order. Return nil if no start file found."
256 (let* ((progname (file-name-nondirectory prog)) 256 (let* ((progname (file-name-nondirectory prog))
257 (start-file (concat "~/.emacs_" progname)) 257 (start-file (concat "~/.emacs_" progname))
258 (alt-start-file (concat user-emacs-directory "init_" progname ".scm"))) 258 (alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
@@ -367,7 +367,7 @@ For Scheme 48 and Scsh use \",expand %s\"."
367 (scheme-form-at-point))))) 367 (scheme-form-at-point)))))
368 368
369(defun switch-to-scheme (eob-p) 369(defun switch-to-scheme (eob-p)
370 "Switch to the scheme process buffer. 370 "Switch to the Scheme process buffer.
371With argument, position cursor at end of buffer." 371With argument, position cursor at end of buffer."
372 (interactive "P") 372 (interactive "P")
373 (if (or (and scheme-buffer (get-buffer scheme-buffer)) 373 (if (or (and scheme-buffer (get-buffer scheme-buffer))
diff --git a/lisp/composite.el b/lisp/composite.el
index 4832848cb90..3c25b8b60af 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -57,8 +57,8 @@ The meaning of glyph reference point codes is as follows:
57 | | 7:bc or bottom-center 57 | | 7:bc or bottom-center
58 6----7----8 <---- descent 8:br or bottom-right 58 6----7----8 <---- descent 8:br or bottom-right
59 59
60Glyph reference point symbols are to be used to specify composition 60Glyph reference point symbols are to be used to specify a composition
61rule of the form \(GLOBAL-REF-POINT . NEW-REF-POINT), where 61rule of the form (GLOBAL-REF-POINT . NEW-REF-POINT), where
62GLOBAL-REF-POINT is a reference point in the overall glyphs already 62GLOBAL-REF-POINT is a reference point in the overall glyphs already
63composed, and NEW-REF-POINT is a reference point in the new glyph to 63composed, and NEW-REF-POINT is a reference point in the new glyph to
64be added. 64be added.
@@ -71,13 +71,13 @@ follows (the point `*' corresponds to both reference points):
71 | | | 71 | | |
72 | global| | 72 | global| |
73 | glyph | | 73 | glyph | |
74 -- | | |-- <--- baseline \(doesn't change) 74 -- | | |-- <--- baseline (doesn't change)
75 +----+--*--+ 75 +----+--*--+
76 | | new | 76 | | new |
77 | |glyph| 77 | |glyph|
78 +----+-----+ <--- new descent 78 +----+-----+ <--- new descent
79 79
80A composition rule may have the form \(GLOBAL-REF-POINT 80A composition rule may have the form (GLOBAL-REF-POINT
81NEW-REF-POINT XOFF YOFF), where XOFF and YOFF specify how much 81NEW-REF-POINT XOFF YOFF), where XOFF and YOFF specify how much
82to shift NEW-REF-POINT from GLOBAL-REF-POINT. In this case, XOFF 82to shift NEW-REF-POINT from GLOBAL-REF-POINT. In this case, XOFF
83and YOFF are integers in the range -100..100 representing the 83and YOFF are integers in the range -100..100 representing the
@@ -279,8 +279,8 @@ text in the composition."
279(defun compose-chars (&rest args) 279(defun compose-chars (&rest args)
280 "Return a string from arguments in which all characters are composed. 280 "Return a string from arguments in which all characters are composed.
281For relative composition, arguments are characters. 281For relative composition, arguments are characters.
282For rule-based composition, Mth \(where M is odd) arguments are 282For rule-based composition, Mth (where M is odd) arguments are
283characters, and Nth \(where N is even) arguments are composition rules. 283characters, and Nth (where N is even) arguments are composition rules.
284A composition rule is a cons of glyph reference points of the form 284A composition rule is a cons of glyph reference points of the form
285\(GLOBAL-REF-POINT . NEW-REF-POINT). See the documentation of 285\(GLOBAL-REF-POINT . NEW-REF-POINT). See the documentation of
286`reference-point-alist' for more detail." 286`reference-point-alist' for more detail."
@@ -387,7 +387,7 @@ This function is the default value of `compose-chars-after-function'."
387(defun compose-last-chars (args) 387(defun compose-last-chars (args)
388 "Compose last characters. 388 "Compose last characters.
389The argument is a parameterized event of the form 389The argument is a parameterized event of the form
390 \(compose-last-chars N COMPONENTS), 390 (compose-last-chars N COMPONENTS),
391where N is the number of characters before point to compose, 391where N is the number of characters before point to compose,
392COMPONENTS, if non-nil, is the same as the argument to `compose-region' 392COMPONENTS, if non-nil, is the same as the argument to `compose-region'
393\(which see). If it is nil, `compose-chars-after' is called, 393\(which see). If it is nil, `compose-chars-after' is called,
@@ -640,7 +640,7 @@ All non-spacing characters have this function in
640 unicode-category-table)) 640 unicode-category-table))
641 641
642(defun compose-gstring-for-terminal (gstring) 642(defun compose-gstring-for-terminal (gstring)
643 "Compose glyph string GSTRING for terminal display. 643 "Compose glyph-string GSTRING for terminal display.
644Non-spacing characters are composed with the preceding base 644Non-spacing characters are composed with the preceding base
645character. If the preceding character is not a base character, 645character. If the preceding character is not a base character,
646each non-spacing character is composed as a spacing character by 646each non-spacing character is composed as a spacing character by
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 3cf6654da2b..2a9bc167a9c 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -95,7 +95,7 @@ use \\[customize]."
95 :group 'dired-keys) 95 :group 'dired-keys)
96 96
97(defcustom dired-bind-man t 97(defcustom dired-bind-man t
98 "Non-nil means bind `dired-man' to \"N\" in dired-mode, otherwise do not. 98 "Non-nil means bind `dired-man' to \"N\" in Dired, otherwise do not.
99Setting this variable directly after dired-x is loaded has no effect - 99Setting this variable directly after dired-x is loaded has no effect -
100use \\[customize]." 100use \\[customize]."
101 :type 'boolean 101 :type 'boolean
@@ -107,7 +107,7 @@ use \\[customize]."
107 :group 'dired-keys) 107 :group 'dired-keys)
108 108
109(defcustom dired-bind-info t 109(defcustom dired-bind-info t
110 "Non-nil means bind `dired-info' to \"I\" in dired-mode, otherwise do not. 110 "Non-nil means bind `dired-info' to \"I\" in Dired, otherwise do not.
111Setting this variable directly after dired-x is loaded has no effect - 111Setting this variable directly after dired-x is loaded has no effect -
112use \\[customize]." 112use \\[customize]."
113 :type 'boolean 113 :type 'boolean
@@ -163,7 +163,7 @@ See Info node `(dired-x) Omitting Variables' for more information."
163(defcustom dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$" 163(defcustom dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$"
164 "Filenames matching this regexp will not be displayed. 164 "Filenames matching this regexp will not be displayed.
165This only has effect when `dired-omit-mode' is t. See interactive function 165This only has effect when `dired-omit-mode' is t. See interactive function
166`dired-omit-mode' \(\\[dired-omit-mode]\) and variable 166`dired-omit-mode' (\\[dired-omit-mode]) and variable
167`dired-omit-extensions'. The default is to omit `.', `..', auto-save 167`dired-omit-extensions'. The default is to omit `.', `..', auto-save
168files and lock files." 168files and lock files."
169 :type 'regexp 169 :type 'regexp
@@ -181,7 +181,7 @@ When nil, don't show messages."
181If nil, Dired finds the directory as a subdirectory in some other buffer 181If nil, Dired finds the directory as a subdirectory in some other buffer
182if it is present as one. 182if it is present as one.
183 183
184If there are several dired buffers for a directory, the most recently 184If there are several Dired buffers for a directory, the most recently
185used is chosen. 185used is chosen.
186 186
187Dired avoids switching to the current buffer, so that if you have 187Dired avoids switching to the current buffer, so that if you have
@@ -345,7 +345,7 @@ A `.' is *not* automatically prepended to the string entered."
345 marker-char)) 345 marker-char))
346 346
347(defun dired-flag-extension (extension) 347(defun dired-flag-extension (extension)
348 "In dired, flag all files with a certain EXTENSION for deletion. 348 "In Dired, flag all files with a certain EXTENSION for deletion.
349A `.' is *not* automatically prepended to the string entered." 349A `.' is *not* automatically prepended to the string entered."
350 (interactive "sFlagging extension: ") 350 (interactive "sFlagging extension: ")
351 (dired-mark-extension extension dired-del-marker)) 351 (dired-mark-extension extension dired-del-marker))
@@ -406,17 +406,17 @@ See variables `dired-texinfo-unclean-extensions',
406 406
407;;;###autoload 407;;;###autoload
408(defun dired-jump (&optional other-window file-name) 408(defun dired-jump (&optional other-window file-name)
409 "Jump to dired buffer corresponding to current buffer. 409 "Jump to Dired buffer corresponding to current buffer.
410If in a file, dired the current directory and move to file's line. 410If in a file, Dired the current directory and move to file's line.
411If in Dired already, pop up a level and goto old directory's line. 411If in Dired already, pop up a level and goto old directory's line.
412In case the proper dired file line cannot be found, refresh the dired 412In case the proper Dired file line cannot be found, refresh the dired
413buffer and try again. 413buffer and try again.
414When OTHER-WINDOW is non-nil, jump to dired buffer in other window. 414When OTHER-WINDOW is non-nil, jump to Dired buffer in other window.
415Interactively with prefix argument, read FILE-NAME and 415Interactively with prefix argument, read FILE-NAME and
416move to its line in dired." 416move to its line in dired."
417 (interactive 417 (interactive
418 (list nil (and current-prefix-arg 418 (list nil (and current-prefix-arg
419 (read-file-name "Jump to dired file: ")))) 419 (read-file-name "Jump to Dired file: "))))
420 (let* ((file (or file-name buffer-file-name)) 420 (let* ((file (or file-name buffer-file-name))
421 (dir (if file (file-name-directory file) default-directory))) 421 (dir (if file (file-name-directory file) default-directory)))
422 (if (and (eq major-mode 'dired-mode) (null file-name)) 422 (if (and (eq major-mode 'dired-mode) (null file-name))
@@ -446,7 +446,7 @@ move to its line in dired."
446 "Like \\[dired-jump] (`dired-jump') but in other window." 446 "Like \\[dired-jump] (`dired-jump') but in other window."
447 (interactive 447 (interactive
448 (list (and current-prefix-arg 448 (list (and current-prefix-arg
449 (read-file-name "Jump to dired file: ")))) 449 (read-file-name "Jump to Dired file: "))))
450 (dired-jump t file-name)) 450 (dired-jump t file-name))
451 451
452;;; OMITTING. 452;;; OMITTING.
@@ -486,12 +486,12 @@ Should never be used as marker by the user or other packages.")
486 dired-latex-unclean-extensions 486 dired-latex-unclean-extensions
487 dired-bibtex-unclean-extensions 487 dired-bibtex-unclean-extensions
488 dired-texinfo-unclean-extensions) 488 dired-texinfo-unclean-extensions)
489 "If non-nil, a list of extensions \(strings\) to omit from Dired listings. 489 "If non-nil, a list of extensions (strings) to omit from Dired listings.
490Defaults to elements of `completion-ignored-extensions', 490Defaults to elements of `completion-ignored-extensions',
491`dired-latex-unclean-extensions', `dired-bibtex-unclean-extensions', and 491`dired-latex-unclean-extensions', `dired-bibtex-unclean-extensions', and
492`dired-texinfo-unclean-extensions'. 492`dired-texinfo-unclean-extensions'.
493 493
494See interactive function `dired-omit-mode' \(\\[dired-omit-mode]\) and 494See interactive function `dired-omit-mode' (\\[dired-omit-mode]) and
495variables `dired-omit-mode' and `dired-omit-files'." 495variables `dired-omit-mode' and `dired-omit-files'."
496 :type '(repeat string) 496 :type '(repeat string)
497 :group 'dired-x) 497 :group 'dired-x)
@@ -583,8 +583,8 @@ filesystem will work.
583 583
584This is useful if you want to peruse and move around in an ls -lR 584This is useful if you want to peruse and move around in an ls -lR
585output file, for example one you got from an ftp server. With 585output file, for example one you got from an ftp server. With
586ange-ftp, you can even dired a directory containing an ls-lR file, 586ange-ftp, you can even Dired a directory containing an ls-lR file,
587visit that file and turn on virtual dired mode. But don't try to save 587visit that file and turn on Virtual Dired mode. But don't try to save
588this file, as dired-virtual indents the listing and thus changes the 588this file, as dired-virtual indents the listing and thus changes the
589buffer. 589buffer.
590 590
@@ -593,7 +593,7 @@ resume it in a later session.
593 593
594Type \\<dired-mode-map>\\[revert-buffer] \ 594Type \\<dired-mode-map>\\[revert-buffer] \
595in the Virtual Dired buffer and answer `y' to convert 595in the Virtual Dired buffer and answer `y' to convert
596the virtual to a real dired buffer again. You don't have to do this, though: 596the virtual to a real Dired buffer again. You don't have to do this, though:
597you can relist single subdirs using \\[dired-do-redisplay]." 597you can relist single subdirs using \\[dired-do-redisplay]."
598 598
599 ;; DIRNAME is the top level directory of the buffer. It will become 599 ;; DIRNAME is the top level directory of the buffer. It will become
@@ -682,7 +682,7 @@ Useful on `magic-mode-alist' with the regexp
682 682
683 \"^ \\\\(/[^ /]+\\\\)+/?:$\" 683 \"^ \\\\(/[^ /]+\\\\)+/?:$\"
684 684
685to put saved dired buffers automatically into Virtual Dired mode. 685to put saved Dired buffers automatically into Virtual Dired mode.
686 686
687Also useful for `auto-mode-alist' like this: 687Also useful for `auto-mode-alist' like this:
688 688
@@ -769,7 +769,7 @@ If none, return `default-directory'."
769;; Dired Buffer. 769;; Dired Buffer.
770 770
771(defcustom dired-local-variables-file (convert-standard-filename ".dired") 771(defcustom dired-local-variables-file (convert-standard-filename ".dired")
772 "Filename, as string, containing local dired buffer variables to be hacked. 772 "Filename, as string, containing local Dired buffer variables to be hacked.
773If this file found in current directory, then it will be inserted into dired 773If this file found in current directory, then it will be inserted into dired
774buffer and `hack-local-variables' will be run. See Info node 774buffer and `hack-local-variables' will be run. See Info node
775`(emacs)File Variables' for more information on local variables. 775`(emacs)File Variables' for more information on local variables.
@@ -780,7 +780,7 @@ See also `dired-enable-local-variables'."
780(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1") 780(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1")
781 781
782(defun dired-hack-local-variables () 782(defun dired-hack-local-variables ()
783 "Evaluate local variables in `dired-local-variables-file' for dired buffer." 783 "Evaluate local variables in `dired-local-variables-file' for Dired buffer."
784 (declare (obsolete hack-dir-local-variables-non-file-buffer "24.1")) 784 (declare (obsolete hack-dir-local-variables-non-file-buffer "24.1"))
785 (and (stringp dired-local-variables-file) 785 (and (stringp dired-local-variables-file)
786 (file-exists-p dired-local-variables-file) 786 (file-exists-p dired-local-variables-file)
@@ -984,7 +984,7 @@ replace it with a dir-locals-file `./%s'"
984 " " dired-guess-shell-znew-switches)) 984 " " dired-guess-shell-znew-switches))
985 '("\\.pod\\'" "perldoc" "pod2man * | nroff -man") 985 '("\\.pod\\'" "perldoc" "pod2man * | nroff -man")
986 986
987 '("\\.dvi\\'" "xdvi" "dvips") ; preview and printing 987 '("\\.dvi\\'" "xdvi" "dvips") ; preview and printing
988 '("\\.au\\'" "play") ; play Sun audiofiles 988 '("\\.au\\'" "play") ; play Sun audiofiles
989 '("\\.mpe?g\\'\\|\\.avi\\'" "xine -p") 989 '("\\.mpe?g\\'\\|\\.avi\\'" "xine -p")
990 '("\\.ogg\\'" "ogg123") 990 '("\\.ogg\\'" "ogg123")
@@ -1000,7 +1000,7 @@ replace it with a dir-locals-file `./%s'"
1000 '("\\.tif\\'" "xloadimage") 1000 '("\\.tif\\'" "xloadimage")
1001 '("\\.png\\'" "display") ; xloadimage 4.1 doesn't grok PNG 1001 '("\\.png\\'" "display") ; xloadimage 4.1 doesn't grok PNG
1002 '("\\.jpe?g\\'" "xloadimage") 1002 '("\\.jpe?g\\'" "xloadimage")
1003 '("\\.fig\\'" "xfig") ; edit fig pictures 1003 '("\\.fig\\'" "xfig") ; edit fig pictures
1004 '("\\.out\\'" "xgraph") ; for plotting purposes. 1004 '("\\.out\\'" "xgraph") ; for plotting purposes.
1005 '("\\.tex\\'" "latex" "tex") 1005 '("\\.tex\\'" "latex" "tex")
1006 '("\\.texi\\(nfo\\)?\\'" "makeinfo" "texi2dvi") 1006 '("\\.texi\\(nfo\\)?\\'" "makeinfo" "texi2dvi")
@@ -1044,7 +1044,7 @@ These rules take precedence over the predefined rules in the variable
1044 1044
1045Each element of this list looks like 1045Each element of this list looks like
1046 1046
1047 \(REGEXP COMMAND...\) 1047 (REGEXP COMMAND...)
1048 1048
1049where each COMMAND can either be a string or a Lisp expression that evaluates 1049where each COMMAND can either be a string or a Lisp expression that evaluates
1050to a string. If several COMMANDs are given, the first one will be the default 1050to a string. If several COMMANDs are given, the first one will be the default
@@ -1057,7 +1057,7 @@ REGEXP is matched case-sensitively.
1057You can set this variable in your ~/.emacs. For example, to add rules for 1057You can set this variable in your ~/.emacs. For example, to add rules for
1058`.foo' and `.bar' files, write 1058`.foo' and `.bar' files, write
1059 1059
1060 \(setq dired-guess-shell-alist-user 1060 (setq dired-guess-shell-alist-user
1061 '((\"\\\\.foo\\\\'\" \"FOO-COMMAND\") 1061 '((\"\\\\.foo\\\\'\" \"FOO-COMMAND\")
1062 (\"\\\\.bar\\\\'\" 1062 (\"\\\\.bar\\\\'\"
1063 (if condition 1063 (if condition
@@ -1258,7 +1258,7 @@ Remaining lines go to bottom-most window. The number of files that can be
1258displayed this way is restricted by the height of the current window and 1258displayed this way is restricted by the height of the current window and
1259`window-min-height'. 1259`window-min-height'.
1260 1260
1261To keep dired buffer displayed, type \\[split-window-below] first. 1261To keep Dired buffer displayed, type \\[split-window-below] first.
1262To display just marked files, type \\[delete-other-windows] first." 1262To display just marked files, type \\[delete-other-windows] first."
1263 (interactive "P") 1263 (interactive "P")
1264 (dired-simultaneous-find-file (dired-get-marked-files) noselect)) 1264 (dired-simultaneous-find-file (dired-get-marked-files) noselect))
diff --git a/lisp/dired.el b/lisp/dired.el
index 0f2b0973986..70fee538670 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -87,8 +87,8 @@ will fail to parse some \"unusual\" file names, e.g. those with leading
87spaces. You might want to install ls from GNU Coreutils, which does 87spaces. You might want to install ls from GNU Coreutils, which does
88support this option. Alternatively, you might want to use Emacs's 88support this option. Alternatively, you might want to use Emacs's
89own emulation of \"ls\", by using: 89own emulation of \"ls\", by using:
90 \(setq ls-lisp-use-insert-directory-program nil) 90 (setq ls-lisp-use-insert-directory-program nil)
91 \(require 'ls-lisp) 91 (require 'ls-lisp)
92This is used by default on MS Windows, which does not have an \"ls\" program. 92This is used by default on MS Windows, which does not have an \"ls\" program.
93Note that `ls-lisp' does not support as many options as GNU ls, though. 93Note that `ls-lisp' does not support as many options as GNU ls, though.
94For more details, see Info node `(emacs)ls in Lisp'." 94For more details, see Info node `(emacs)ls in Lisp'."
@@ -204,7 +204,7 @@ You can customize key bindings or load extensions with this."
204 :type 'hook) 204 :type 'hook)
205 205
206(defcustom dired-before-readin-hook nil 206(defcustom dired-before-readin-hook nil
207 "This hook is run before a dired buffer is read in (created or reverted)." 207 "This hook is run before a Dired buffer is read in (created or reverted)."
208 :group 'dired 208 :group 'dired
209 :type 'hook) 209 :type 'hook)
210 210
@@ -231,7 +231,7 @@ It is run the function `dired-initial-position'."
231 "The functions to call when a drop in `dired-mode' is made. 231 "The functions to call when a drop in `dired-mode' is made.
232See `dnd-protocol-alist' for more information. When nil, behave 232See `dnd-protocol-alist' for more information. When nil, behave
233as in other buffers. Changing this option is effective only for 233as in other buffers. Changing this option is effective only for
234new dired buffers." 234new Dired buffers."
235 :type '(choice (repeat (cons (regexp) (function))) 235 :type '(choice (repeat (cons (regexp) (function)))
236 (const :tag "Behave as in other buffers" nil)) 236 (const :tag "Behave as in other buffers" nil))
237 :version "22.1" 237 :version "22.1"
@@ -279,18 +279,18 @@ action argument symbol is `window-height' and its value is nil." "24.3")
279 279
280;;;###autoload 280;;;###autoload
281(defvar dired-directory nil 281(defvar dired-directory nil
282 "The directory name or wildcard spec that this dired directory lists. 282 "The directory name or wildcard spec that this Dired directory lists.
283Local to each dired buffer. May be a list, in which case the car is the 283Local to each Dired buffer. May be a list, in which case the car is the
284directory name and the cdr is the list of files to mention. 284directory name and the cdr is the list of files to mention.
285The directory name must be absolute, but need not be fully expanded.") 285The directory name must be absolute, but need not be fully expanded.")
286 286
287;; Beware of "-l;reboot" etc. See bug#3230. 287;; Beware of "-l;reboot" etc. See bug#3230.
288(defun dired-safe-switches-p (switches) 288(defun dired-safe-switches-p (switches)
289 "Return non-nil if string SWITCHES does not look risky for dired." 289 "Return non-nil if string SWITCHES does not look risky for Dired."
290 (or (not switches) 290 (or (not switches)
291 (and (stringp switches) 291 (and (stringp switches)
292 (< (length switches) 100) ; arbitrary 292 (< (length switches) 100) ; arbitrary
293 (string-match "\\` *-[- [:alnum:]]+\\'" switches)))) 293 (string-match-p "\\` *-[- [:alnum:]]+\\'" switches))))
294 294
295(defvar dired-actual-switches nil 295(defvar dired-actual-switches nil
296 "The value of `dired-listing-switches' used to make this buffer's text.") 296 "The value of `dired-listing-switches' used to make this buffer's text.")
@@ -330,10 +330,9 @@ Each subdirectory has an element: (DIRNAME . STARTMARKER).
330The order of elements is the reverse of the order in the buffer. 330The order of elements is the reverse of the order in the buffer.
331In simple cases, this list contains one element.") 331In simple cases, this list contains one element.")
332 332
333(defvar dired-switches-alist nil 333(defvar-local dired-switches-alist nil
334 "Keeps track of which switches to use for inserted subdirectories. 334 "Keeps track of which switches to use for inserted subdirectories.
335This is an alist of the form (SUBDIR . SWITCHES).") 335This is an alist of the form (SUBDIR . SWITCHES).")
336(make-variable-buffer-local 'dired-switches-alist)
337 336
338(defvaralias 'dired-move-to-filename-regexp 337(defvaralias 'dired-move-to-filename-regexp
339 'directory-listing-before-filename-regexp) 338 'directory-listing-before-filename-regexp)
@@ -360,11 +359,11 @@ Subexpression 2 must end right before the \\n or \\r.")
360 359
361(defface dired-mark 360(defface dired-mark
362 '((t (:inherit font-lock-constant-face))) 361 '((t (:inherit font-lock-constant-face)))
363 "Face used for dired marks." 362 "Face used for Dired marks."
364 :group 'dired-faces 363 :group 'dired-faces
365 :version "22.1") 364 :version "22.1")
366(defvar dired-mark-face 'dired-mark 365(defvar dired-mark-face 'dired-mark
367 "Face name used for dired marks.") 366 "Face name used for Dired marks.")
368 367
369(defface dired-marked 368(defface dired-marked
370 '((t (:inherit warning))) 369 '((t (:inherit warning)))
@@ -563,8 +562,8 @@ For any other non-nil value of ARG, use the current file.
563If optional third arg SHOW-PROGRESS evaluates to non-nil, 562If optional third arg SHOW-PROGRESS evaluates to non-nil,
564redisplay the dired buffer after each file is processed. 563redisplay the dired buffer after each file is processed.
565 564
566No guarantee is made about the position on the marked line. BODY 565No guarantee is made about the position on the marked line.
567must ensure this itself if it depends on this. 566BODY must ensure this itself if it depends on this.
568 567
569Search starts at the beginning of the buffer, thus the car of the 568Search starts at the beginning of the buffer, thus the car of the
570list corresponds to the line nearest to the buffer's bottom. 569list 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
753delete them by typing \\[dired-do-flagged-delete]. 752delete them by typing \\[dired-do-flagged-delete].
754Type \\[describe-mode] after entering Dired for more info. 753Type \\[describe-mode] after entering Dired for more info.
755 754
756If DIRNAME is already in a dired buffer, that buffer is used without refresh." 755If DIRNAME is already in a Dired buffer, that buffer is used without refresh."
757 ;; Cannot use (interactive "D") because of wildcards. 756 ;; Cannot use (interactive "D") because of wildcards.
758 (interactive (dired-read-dir-and-switches "")) 757 (interactive (dired-read-dir-and-switches ""))
759 (switch-to-buffer (dired-noselect dirname switches))) 758 (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."
774 773
775;;;###autoload 774;;;###autoload
776(defun dired-noselect (dir-or-list &optional switches) 775(defun dired-noselect (dir-or-list &optional switches)
777 "Like `dired' but returns the dired buffer as value, does not select it." 776 "Like `dired' but returns the Dired buffer as value, does not select it."
778 (or dir-or-list (setq dir-or-list default-directory)) 777 (or dir-or-list (setq dir-or-list default-directory))
779 ;; This loses the distinction between "/foo/*/" and "/foo/*" that 778 ;; This loses the distinction between "/foo/*/" and "/foo/*" that
780 ;; some shells make: 779 ;; some shells make:
@@ -812,9 +811,9 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
812 (equal (nth 5 attributes) modtime))))) 811 (equal (nth 5 attributes) modtime)))))
813 812
814(defun dired-buffer-stale-p (&optional noconfirm) 813(defun dired-buffer-stale-p (&optional noconfirm)
815 "Return non-nil if current dired buffer needs updating. 814 "Return non-nil if current Dired buffer needs updating.
816If NOCONFIRM is non-nil, then this function always returns nil 815If NOCONFIRM is non-nil, then this function always returns nil
817for a remote directory. This feature is used by Auto Revert Mode." 816for a remote directory. This feature is used by Auto Revert mode."
818 (let ((dirname 817 (let ((dirname
819 (if (consp dired-directory) (car dired-directory) dired-directory))) 818 (if (consp dired-directory) (car dired-directory) dired-directory)))
820 (and (stringp dirname) 819 (and (stringp dirname)
@@ -826,8 +825,8 @@ for a remote directory. This feature is used by Auto Revert Mode."
826 (dired-directory-changed-p dirname)))) 825 (dired-directory-changed-p dirname))))
827 826
828(defcustom dired-auto-revert-buffer nil 827(defcustom dired-auto-revert-buffer nil
829 "Automatically revert dired buffer on revisiting. 828 "Automatically revert Dired buffer on revisiting.
830If t, revisiting an existing dired buffer automatically reverts it. 829If t, revisiting an existing Dired buffer automatically reverts it.
831If its value is a function, call this function with the directory 830If its value is a function, call this function with the directory
832name as single argument and revert the buffer if it returns non-nil. 831name as single argument and revert the buffer if it returns non-nil.
833Otherwise, a message offering to revert the changed dired buffer 832Otherwise, 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
836periodically reverts at specified time intervals." 835periodically reverts at specified time intervals."
837 :type '(choice 836 :type '(choice
838 (const :tag "Don't revert" nil) 837 (const :tag "Don't revert" nil)
839 (const :tag "Always revert visited dired buffer" t) 838 (const :tag "Always revert visited Dired buffer" t)
840 (const :tag "Revert changed dired buffer" dired-directory-changed-p) 839 (const :tag "Revert changed Dired buffer" dired-directory-changed-p)
841 (function :tag "Predicate function")) 840 (function :tag "Predicate function"))
842 :group 'dired 841 :group 'dired
843 :version "23.2") 842 :version "23.2")
@@ -910,7 +909,7 @@ periodically reverts at specified time intervals."
910 ;; Enlarged by dired-advertise 909 ;; Enlarged by dired-advertise
911 ;; Queried by function dired-buffers-for-dir. When this detects a 910 ;; Queried by function dired-buffers-for-dir. When this detects a
912 ;; killed buffer, it is removed from this list. 911 ;; killed buffer, it is removed from this list.
913 "Alist of expanded directories and their associated dired buffers.") 912 "Alist of expanded directories and their associated Dired buffers.")
914 913
915(defvar dired-find-subdir) 914(defvar dired-find-subdir)
916 915
@@ -958,7 +957,7 @@ periodically reverts at specified time intervals."
958;; Read in a new dired buffer 957;; Read in a new dired buffer
959 958
960(defun dired-readin () 959(defun dired-readin ()
961 "Read in a new dired buffer. 960 "Read in a new Dired buffer.
962Differs from `dired-insert-subdir' in that it accepts 961Differs from `dired-insert-subdir' in that it accepts
963wildcards, erases the buffer, and builds the subdir-alist anew 962wildcards, erases the buffer, and builds the subdir-alist anew
964\(including making it buffer-local and clearing it first)." 963\(including making it buffer-local and clearing it first)."
@@ -981,9 +980,8 @@ wildcards, erases the buffer, and builds the subdir-alist anew
981 (run-hooks 'dired-before-readin-hook) 980 (run-hooks 'dired-before-readin-hook)
982 (if (consp buffer-undo-list) 981 (if (consp buffer-undo-list)
983 (setq buffer-undo-list nil)) 982 (setq buffer-undo-list nil))
984 (make-local-variable 'file-name-coding-system) 983 (setq-local file-name-coding-system
985 (setq file-name-coding-system 984 (or coding-system-for-read file-name-coding-system))
986 (or coding-system-for-read file-name-coding-system))
987 (let ((inhibit-read-only t) 985 (let ((inhibit-read-only t)
988 ;; Don't make undo entries for readin. 986 ;; Don't make undo entries for readin.
989 (buffer-undo-list t)) 987 (buffer-undo-list t))
@@ -993,7 +991,7 @@ wildcards, erases the buffer, and builds the subdir-alist anew
993 (goto-char (point-min)) 991 (goto-char (point-min))
994 ;; Must first make alist buffer local and set it to nil because 992 ;; Must first make alist buffer local and set it to nil because
995 ;; dired-build-subdir-alist will call dired-clear-alist first 993 ;; dired-build-subdir-alist will call dired-clear-alist first
996 (set (make-local-variable 'dired-subdir-alist) nil) 994 (setq-local dired-subdir-alist nil)
997 (dired-build-subdir-alist) 995 (dired-build-subdir-alist)
998 (let ((attributes (file-attributes dirname))) 996 (let ((attributes (file-attributes dirname)))
999 (if (eq (car attributes) t) 997 (if (eq (car attributes) t)
@@ -1092,7 +1090,7 @@ BEG..END is the line where the file info is located."
1092 ;; We're now just in front of a field, with a space behind us. 1090 ;; We're now just in front of a field, with a space behind us.
1093 (let* ((curcol (current-column)) 1091 (let* ((curcol (current-column))
1094 ;; Nums are right-aligned. 1092 ;; Nums are right-aligned.
1095 (num-align (looking-at "[0-9]")) 1093 (num-align (looking-at-p "[0-9]"))
1096 ;; Let's look at the other line, in the same column: we 1094 ;; Let's look at the other line, in the same column: we
1097 ;; should be either near the end of the previous field, or 1095 ;; should be either near the end of the previous field, or
1098 ;; in the space between that field and the next. 1096 ;; in the space between that field and the next.
@@ -1141,7 +1139,7 @@ BEG..END is the line where the file info is located."
1141(defun dired-switches-escape-p (switches) 1139(defun dired-switches-escape-p (switches)
1142 "Return non-nil if the string SWITCHES contains -b or --escape." 1140 "Return non-nil if the string SWITCHES contains -b or --escape."
1143 ;; Do not match things like "--block-size" that happen to contain "b". 1141 ;; Do not match things like "--block-size" that happen to contain "b".
1144 (string-match "\\(\\`\\| \\)-[[:alnum:]]*b\\|--escape\\>" switches)) 1142 (string-match-p "\\(\\`\\| \\)-[[:alnum:]]*b\\|--escape\\>" switches))
1145 1143
1146(defun dired-insert-directory (dir switches &optional file-list wildcard hdr) 1144(defun dired-insert-directory (dir switches &optional file-list wildcard hdr)
1147 "Insert a directory listing of DIR, Dired style. 1145 "Insert a directory listing of DIR, Dired style.
@@ -1219,7 +1217,7 @@ see `dired-use-ls-dired' for more details.")
1219 ;; Otherwise, indent them. 1217 ;; Otherwise, indent them.
1220 (unless (save-excursion 1218 (unless (save-excursion
1221 (goto-char opoint) 1219 (goto-char opoint)
1222 (looking-at " ")) 1220 (looking-at-p " "))
1223 (let ((indent-tabs-mode nil)) 1221 (let ((indent-tabs-mode nil))
1224 (indent-rigidly opoint (point) 2))) 1222 (indent-rigidly opoint (point) 2)))
1225 ;; Insert text at the beginning to standardize things. 1223 ;; Insert text at the beginning to standardize things.
@@ -1227,7 +1225,7 @@ see `dired-use-ls-dired' for more details.")
1227 (save-excursion 1225 (save-excursion
1228 (goto-char opoint) 1226 (goto-char opoint)
1229 (when (and (or hdr wildcard) 1227 (when (and (or hdr wildcard)
1230 (not (and (looking-at "^ \\(.*\\):$") 1228 (not (and (looking-at-p "^ \\(.*\\):$")
1231 (file-name-absolute-p (match-string 1))))) 1229 (file-name-absolute-p (match-string 1)))))
1232 ;; Note that dired-build-subdir-alist will replace the name 1230 ;; Note that dired-build-subdir-alist will replace the name
1233 ;; by its expansion, so it does not matter whether what we insert 1231 ;; by its expansion, so it does not matter whether what we insert
@@ -1269,7 +1267,7 @@ see `dired-use-ls-dired' for more details.")
1269;; Reverting a dired buffer 1267;; Reverting a dired buffer
1270 1268
1271(defun dired-revert (&optional _arg _noconfirm) 1269(defun dired-revert (&optional _arg _noconfirm)
1272 "Reread the dired buffer. 1270 "Reread the Dired buffer.
1273Must also be called after `dired-actual-switches' have changed. 1271Must also be called after `dired-actual-switches' have changed.
1274Should not fail even on completely garbaged buffers. 1272Should not fail even on completely garbaged buffers.
1275Preserves old cursor, marks/flags, hidden-p. 1273Preserves old cursor, marks/flags, hidden-p.
@@ -1320,7 +1318,7 @@ ARG and NOCONFIRM, passed from `revert-buffer', are ignored."
1320 "Return current positions in the buffer and all windows with this directory. 1318 "Return current positions in the buffer and all windows with this directory.
1321The positions have the form (BUFFER-POSITION WINDOW-POSITIONS). 1319The positions have the form (BUFFER-POSITION WINDOW-POSITIONS).
1322 1320
1323BUFFER-POSITION is the point position in the current dired buffer. 1321BUFFER-POSITION is the point position in the current Dired buffer.
1324It has the form (BUFFER DIRED-FILENAME BUFFER-POINT). 1322It has the form (BUFFER DIRED-FILENAME BUFFER-POINT).
1325 1323
1326WINDOW-POSITIONS are current positions in all windows displaying 1324WINDOW-POSITIONS are current positions in all windows displaying
@@ -1397,7 +1395,7 @@ Each element of ALIST looks like (FILE . MARKERCHAR)."
1397(defun dired-insert-old-subdirs (old-subdir-alist) 1395(defun dired-insert-old-subdirs (old-subdir-alist)
1398 "Try to insert all subdirs that were displayed before. 1396 "Try to insert all subdirs that were displayed before.
1399Do so according to the former subdir alist OLD-SUBDIR-ALIST." 1397Do so according to the former subdir alist OLD-SUBDIR-ALIST."
1400 (or (string-match "R" dired-actual-switches) 1398 (or (string-match-p "R" dired-actual-switches)
1401 (let (elt dir) 1399 (let (elt dir)
1402 (while old-subdir-alist 1400 (while old-subdir-alist
1403 (setq elt (car old-subdir-alist) 1401 (setq elt (car old-subdir-alist)
@@ -1636,7 +1634,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
1636 :help "Incrementally search for string in file names only.")) 1634 :help "Incrementally search for string in file names only."))
1637 (define-key map [menu-bar immediate compare-directories] 1635 (define-key map [menu-bar immediate compare-directories]
1638 '(menu-item "Compare Directories..." dired-compare-directories 1636 '(menu-item "Compare Directories..." dired-compare-directories
1639 :help "Mark files with different attributes in two dired buffers")) 1637 :help "Mark files with different attributes in two Dired buffers"))
1640 (define-key map [menu-bar immediate backup-diff] 1638 (define-key map [menu-bar immediate backup-diff]
1641 '(menu-item "Compare with Backup" dired-backup-diff 1639 '(menu-item "Compare with Backup" dired-backup-diff
1642 :help "Diff file at cursor with its latest backup")) 1640 :help "Diff file at cursor with its latest backup"))
@@ -1660,7 +1658,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
1660 :help "Create a directory")) 1658 :help "Create a directory"))
1661 (define-key map [menu-bar immediate wdired-mode] 1659 (define-key map [menu-bar immediate wdired-mode]
1662 '(menu-item "Edit File Names" wdired-change-to-wdired-mode 1660 '(menu-item "Edit File Names" wdired-change-to-wdired-mode
1663 :help "Put a dired buffer in a mode in which filenames are editable" 1661 :help "Put a Dired buffer in a mode in which filenames are editable"
1664 :keys "C-x C-q" 1662 :keys "C-x C-q"
1665 :filter (lambda (x) (if (eq major-mode 'dired-mode) x)))) 1663 :filter (lambda (x) (if (eq major-mode 'dired-mode) x))))
1666 1664
@@ -1867,7 +1865,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
1867 :help "Copy current file or all marked files")) 1865 :help "Copy current file or all marked files"))
1868 1866
1869 map) 1867 map)
1870 "Local keymap for `dired-mode' buffers.") 1868 "Local keymap for Dired mode buffers.")
1871 1869
1872;; Dired mode is suitable only for specially formatted data. 1870;; Dired mode is suitable only for specially formatted data.
1873(put 'dired-mode 'mode-class 'special) 1871(put 'dired-mode 'mode-class 'special)
@@ -1878,7 +1876,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
1878 "\ 1876 "\
1879Mode for \"editing\" directory listings. 1877Mode for \"editing\" directory listings.
1880In Dired, you are \"editing\" a list of the files in a directory and 1878In Dired, you are \"editing\" a list of the files in a directory and
1881 \(optionally) its subdirectories, in the format of `ls -lR'. 1879 (optionally) its subdirectories, in the format of `ls -lR'.
1882 Each directory is a page: use \\[backward-page] and \\[forward-page] to move pagewise. 1880 Each directory is a page: use \\[backward-page] and \\[forward-page] to move pagewise.
1883\"Editing\" means that you can run shell commands on files, visit, 1881\"Editing\" means that you can run shell commands on files, visit,
1884 compress, load or byte-compile them, change their file attributes 1882 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.
1900Type \\[dired-do-flagged-delete] to delete (eXecute) the files flagged `D'. 1898Type \\[dired-do-flagged-delete] to delete (eXecute) the files flagged `D'.
1901Type \\[dired-find-file] to Find the current line's file 1899Type \\[dired-find-file] to Find the current line's file
1902 (or dired it in another buffer, if it is a directory). 1900 (or dired it in another buffer, if it is a directory).
1903Type \\[dired-find-file-other-window] to find file or dired directory in Other window. 1901Type \\[dired-find-file-other-window] to find file or Dired directory in Other window.
1904Type \\[dired-maybe-insert-subdir] to Insert a subdirectory in this buffer. 1902Type \\[dired-maybe-insert-subdir] to Insert a subdirectory in this buffer.
1905Type \\[dired-do-rename] to Rename a file or move the marked files to another directory. 1903Type \\[dired-do-rename] to Rename a file or move the marked files to another directory.
1906Type \\[dired-do-copy] to Copy files. 1904Type \\[dired-do-copy] to Copy files.
@@ -1952,31 +1950,25 @@ Keybindings:
1952 ;; Ignore dired-hide-details-* value of invisible text property by default. 1950 ;; Ignore dired-hide-details-* value of invisible text property by default.
1953 (when (eq buffer-invisibility-spec t) 1951 (when (eq buffer-invisibility-spec t)
1954 (setq buffer-invisibility-spec (list t))) 1952 (setq buffer-invisibility-spec (list t)))
1955 (set (make-local-variable 'revert-buffer-function) 1953 (setq-local revert-buffer-function (function dired-revert))
1956 (function dired-revert)) 1954 (setq-local buffer-stale-function (function dired-buffer-stale-p))
1957 (set (make-local-variable 'buffer-stale-function) 1955 (setq-local page-delimiter "\n\n")
1958 (function dired-buffer-stale-p)) 1956 (setq-local dired-directory (or dirname default-directory))
1959 (set (make-local-variable 'page-delimiter)
1960 "\n\n")
1961 (set (make-local-variable 'dired-directory)
1962 (or dirname default-directory))
1963 ;; list-buffers uses this to display the dir being edited in this buffer. 1957 ;; list-buffers uses this to display the dir being edited in this buffer.
1964 (setq list-buffers-directory 1958 (setq list-buffers-directory
1965 (expand-file-name (if (listp dired-directory) 1959 (expand-file-name (if (listp dired-directory)
1966 (car dired-directory) 1960 (car dired-directory)
1967 dired-directory))) 1961 dired-directory)))
1968 (set (make-local-variable 'dired-actual-switches) 1962 (setq-local dired-actual-switches (or switches dired-listing-switches))
1969 (or switches dired-listing-switches)) 1963 (setq-local font-lock-defaults
1970 (set (make-local-variable 'font-lock-defaults) 1964 '(dired-font-lock-keywords t nil nil beginning-of-line))
1971 '(dired-font-lock-keywords t nil nil beginning-of-line)) 1965 (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
1972 (set (make-local-variable 'desktop-save-buffer)
1973 'dired-desktop-buffer-misc-data)
1974 (setq dired-switches-alist nil) 1966 (setq dired-switches-alist nil)
1975 (hack-dir-local-variables-non-file-buffer) ; before sorting 1967 (hack-dir-local-variables-non-file-buffer) ; before sorting
1976 (dired-sort-other dired-actual-switches t) 1968 (dired-sort-other dired-actual-switches t)
1977 (when (featurep 'dnd) 1969 (when (featurep 'dnd)
1978 (set (make-local-variable 'dnd-protocol-alist) 1970 (setq-local dnd-protocol-alist
1979 (append dired-dnd-protocol-alist dnd-protocol-alist))) 1971 (append dired-dnd-protocol-alist dnd-protocol-alist)))
1980 (add-hook 'file-name-at-point-functions 'dired-file-name-at-point nil t) 1972 (add-hook 'file-name-at-point-functions 'dired-file-name-at-point nil t)
1981 (add-hook 'isearch-mode-hook 'dired-isearch-filenames-setup nil t) 1973 (add-hook 'isearch-mode-hook 'dired-isearch-filenames-setup nil t)
1982 (run-mode-hooks 'dired-mode-hook)) 1974 (run-mode-hooks 'dired-mode-hook))
@@ -1984,7 +1976,7 @@ Keybindings:
1984;; Idiosyncratic dired commands that don't deal with marks. 1976;; Idiosyncratic dired commands that don't deal with marks.
1985 1977
1986(defun dired-summary () 1978(defun dired-summary ()
1987 "Summarize basic Dired commands and show recent dired errors." 1979 "Summarize basic Dired commands and show recent Dired errors."
1988 (interactive) 1980 (interactive)
1989 (dired-why) 1981 (dired-why)
1990 ;>> this should check the key-bindings and use substitute-command-keys if non-standard 1982 ;>> this should check the key-bindings and use substitute-command-keys if non-standard
@@ -1992,14 +1984,14 @@ Keybindings:
1992 "d-elete, u-ndelete, x-punge, f-ind, o-ther window, R-ename, C-opy, h-elp")) 1984 "d-elete, u-ndelete, x-punge, f-ind, o-ther window, R-ename, C-opy, h-elp"))
1993 1985
1994(defun dired-undo () 1986(defun dired-undo ()
1995 "Undo in a dired buffer. 1987 "Undo in a Dired buffer.
1996This doesn't recover lost files, it just undoes changes in the buffer itself. 1988This doesn't recover lost files, it just undoes changes in the buffer itself.
1997You can use it to recover marks, killed lines or subdirs." 1989You can use it to recover marks, killed lines or subdirs."
1998 (interactive) 1990 (interactive)
1999 (let ((inhibit-read-only t)) 1991 (let ((inhibit-read-only t))
2000 (undo)) 1992 (undo))
2001 (dired-build-subdir-alist) 1993 (dired-build-subdir-alist)
2002 (message "Change in dired buffer undone. 1994 (message "Change in Dired buffer undone.
2003Actual changes in files cannot be undone by Emacs.")) 1995Actual changes in files cannot be undone by Emacs."))
2004 1996
2005(defun dired-toggle-read-only () 1997(defun dired-toggle-read-only ()
@@ -2032,7 +2024,7 @@ Optional prefix ARG says how many lines to move; default is one line."
2032 (dired-next-line (- (or arg 1)))) 2024 (dired-next-line (- (or arg 1))))
2033 2025
2034(defun dired-next-dirline (arg &optional opoint) 2026(defun dired-next-dirline (arg &optional opoint)
2035 "Goto ARG'th next directory file line." 2027 "Goto ARGth next directory file line."
2036 (interactive "p") 2028 (interactive "p")
2037 (or opoint (setq opoint (point))) 2029 (or opoint (setq opoint (point)))
2038 (if (if (> arg 0) 2030 (if (if (> arg 0)
@@ -2044,7 +2036,7 @@ Optional prefix ARG says how many lines to move; default is one line."
2044 (error "No more subdirectories"))) 2036 (error "No more subdirectories")))
2045 2037
2046(defun dired-prev-dirline (arg) 2038(defun dired-prev-dirline (arg)
2047 "Goto ARG'th previous directory file line." 2039 "Goto ARGth previous directory file line."
2048 (interactive "p") 2040 (interactive "p")
2049 (dired-next-dirline (- arg))) 2041 (dired-next-dirline (- arg)))
2050 2042
@@ -2078,7 +2070,7 @@ Creates a buffer if necessary."
2078 file-name 2070 file-name
2079 (if (file-symlink-p file-name) 2071 (if (file-symlink-p file-name)
2080 (error "File is a symlink to a nonexistent target") 2072 (error "File is a symlink to a nonexistent target")
2081 (error "File no longer exists; type `g' to update dired buffer"))))) 2073 (error "File no longer exists; type `g' to update Dired buffer")))))
2082 2074
2083;; Force C-m keybinding rather than `f' or `e' in the mode doc: 2075;; Force C-m keybinding rather than `f' or `e' in the mode doc:
2084(define-obsolete-function-alias 'dired-advertised-find-file 'dired-find-file "23.2") 2076(define-obsolete-function-alias 'dired-advertised-find-file 'dired-find-file "23.2")
@@ -2091,7 +2083,7 @@ Creates a buffer if necessary."
2091 (find-file (dired-get-file-for-visit)))) 2083 (find-file (dired-get-file-for-visit))))
2092 2084
2093(defun dired-find-alternate-file () 2085(defun dired-find-alternate-file ()
2094 "In Dired, visit this file or directory instead of the dired buffer." 2086 "In Dired, visit this file or directory instead of the Dired buffer."
2095 (interactive) 2087 (interactive)
2096 (set-buffer-modified-p nil) 2088 (set-buffer-modified-p nil)
2097 (find-alternate-file (dired-get-file-for-visit))) 2089 (find-alternate-file (dired-get-file-for-visit)))
@@ -2276,7 +2268,7 @@ unchanged."
2276;;; Minor mode for hiding details 2268;;; Minor mode for hiding details
2277;;;###autoload 2269;;;###autoload
2278(define-minor-mode dired-hide-details-mode 2270(define-minor-mode dired-hide-details-mode
2279 "Hide details in `dired-mode'." 2271 "Hide details in Dired mode."
2280 :group 'dired 2272 :group 'dired
2281 (unless (derived-mode-p 'dired-mode) 2273 (unless (derived-mode-p 'dired-mode)
2282 (error "Not a Dired buffer")) 2274 (error "Not a Dired buffer"))
@@ -2348,7 +2340,7 @@ Return the position of the beginning of the filename, or nil if none found."
2348 (goto-char (next-single-property-change (point) 'dired-filename)) 2340 (goto-char (next-single-property-change (point) 'dired-filename))
2349 (let (opoint file-type executable symlink hidden case-fold-search used-F eol) 2341 (let (opoint file-type executable symlink hidden case-fold-search used-F eol)
2350 ;; case-fold-search is nil now, so we can test for capital F: 2342 ;; case-fold-search is nil now, so we can test for capital F:
2351 (setq used-F (string-match "F" dired-actual-switches) 2343 (setq used-F (string-match-p "F" dired-actual-switches)
2352 opoint (point) 2344 opoint (point)
2353 eol (line-end-position) 2345 eol (line-end-position)
2354 hidden (and selective-display 2346 hidden (and selective-display
@@ -2408,7 +2400,7 @@ Return the position of the beginning of the filename, or nil if none found."
2408 "Copy names of marked (or next ARG) files into the kill ring. 2400 "Copy names of marked (or next ARG) files into the kill ring.
2409The names are separated by a space. 2401The names are separated by a space.
2410With a zero prefix arg, use the absolute file name of each marked file. 2402With a zero prefix arg, use the absolute file name of each marked file.
2411With \\[universal-argument], use the file name relative to the dired buffer's 2403With \\[universal-argument], use the file name relative to the Dired buffer's
2412`default-directory'. (This still may contain slashes if in a subdirectory.) 2404`default-directory'. (This still may contain slashes if in a subdirectory.)
2413 2405
2414If on a subdir headerline, use absolute subdirname instead; 2406If 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]."
2459 (if (stringp dired-directory) 2451 (if (stringp dired-directory)
2460 (let ((wildcards (file-name-nondirectory 2452 (let ((wildcards (file-name-nondirectory
2461 dired-directory))) 2453 dired-directory)))
2462 (or (= 0 (length wildcards)) 2454 (or (zerop (length wildcards))
2463 (string-match (dired-glob-regexp wildcards) 2455 (string-match-p (dired-glob-regexp wildcards)
2464 file))) 2456 file)))
2465 (member (expand-file-name file dir) 2457 (member (expand-file-name file dir)
2466 (cdr dired-directory)))) 2458 (cdr dired-directory))))
2467 (setq result (cons buf result))))))) 2459 (setq result (cons buf result)))))))
@@ -2488,7 +2480,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
2488 (if (= (aref pattern (1+ set-start)) ?^) 2480 (if (= (aref pattern (1+ set-start)) ?^)
2489 (+ 3 set-start) 2481 (+ 3 set-start)
2490 (+ 2 set-start))) 2482 (+ 2 set-start)))
2491 (set-end (string-match "]" pattern set-cont)) 2483 (set-end (string-match-p "]" pattern set-cont))
2492 (set (substring pattern set-start (1+ set-end)))) 2484 (set (substring pattern set-start (1+ set-end))))
2493 (setq regexp (concat regexp set)) 2485 (setq regexp (concat regexp set))
2494 (setq matched-in-pattern (1+ set-end)))) 2486 (setq matched-in-pattern (1+ set-end))))
@@ -2528,7 +2520,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
2528(defun dired-in-this-tree (file dir) 2520(defun dired-in-this-tree (file dir)
2529 ;;"Is FILE part of the directory tree starting at DIR?" 2521 ;;"Is FILE part of the directory tree starting at DIR?"
2530 (let (case-fold-search) 2522 (let (case-fold-search)
2531 (string-match (concat "^" (regexp-quote dir)) file))) 2523 (string-match-p (concat "^" (regexp-quote dir)) file)))
2532 2524
2533(defun dired-normalize-subdir (dir) 2525(defun dired-normalize-subdir (dir)
2534 ;; Prepend default-directory to DIR if relative file name. 2526 ;; Prepend default-directory to DIR if relative file name.
@@ -2610,7 +2602,7 @@ instead of `dired-actual-switches'."
2610 (R-ftp-base-dir-regex 2602 (R-ftp-base-dir-regex
2611 ;; Used to expand subdirectory names correctly in recursive 2603 ;; Used to expand subdirectory names correctly in recursive
2612 ;; ange-ftp listings. 2604 ;; ange-ftp listings.
2613 (and (string-match "R" switches) 2605 (and (string-match-p "R" switches)
2614 (string-match "\\`/.*:\\(/.*\\)" default-directory) 2606 (string-match "\\`/.*:\\(/.*\\)" default-directory)
2615 (concat "\\`" (match-string 1 default-directory))))) 2607 (concat "\\`" (match-string 1 default-directory)))))
2616 (goto-char (point-min)) 2608 (goto-char (point-min))
@@ -2622,7 +2614,7 @@ instead of `dired-actual-switches'."
2622 (goto-char (match-beginning 0)) 2614 (goto-char (match-beginning 0))
2623 (beginning-of-line) 2615 (beginning-of-line)
2624 (forward-char 2) 2616 (forward-char 2)
2625 (save-match-data (looking-at dired-re-perms))) 2617 (looking-at-p dired-re-perms))
2626 (save-excursion 2618 (save-excursion
2627 (goto-char (match-beginning 1)) 2619 (goto-char (match-beginning 1))
2628 (setq new-dir-name 2620 (setq new-dir-name
@@ -2680,9 +2672,9 @@ instead of `dired-actual-switches'."
2680 (dired-goto-next-file);; so there is a file to compare with 2672 (dired-goto-next-file);; so there is a file to compare with
2681 (if (stringp dired-trivial-filenames) 2673 (if (stringp dired-trivial-filenames)
2682 (while (and (not (eobp)) 2674 (while (and (not (eobp))
2683 (string-match dired-trivial-filenames 2675 (string-match-p dired-trivial-filenames
2684 (file-name-nondirectory 2676 (file-name-nondirectory
2685 (or (dired-get-filename nil t) "")))) 2677 (or (dired-get-filename nil t) ""))))
2686 (forward-line 1) 2678 (forward-line 1)
2687 (dired-move-to-filename)))) 2679 (dired-move-to-filename))))
2688 2680
@@ -2692,7 +2684,7 @@ instead of `dired-actual-switches'."
2692 (forward-line 1)))) 2684 (forward-line 1))))
2693 2685
2694(defun dired-goto-file (file) 2686(defun dired-goto-file (file)
2695 "Go to line describing file FILE in this dired buffer." 2687 "Go to line describing file FILE in this Dired buffer."
2696 ;; Return value of point on success, else nil. 2688 ;; Return value of point on success, else nil.
2697 ;; FILE must be an absolute file name. 2689 ;; FILE must be an absolute file name.
2698 ;; Loses if FILE contains control chars like "\007" for which ls 2690 ;; 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."
2741 (setq str (replace-regexp-in-string "\^m" "\\^m" file nil t)) 2733 (setq str (replace-regexp-in-string "\^m" "\\^m" file nil t))
2742 (setq str (replace-regexp-in-string "\\\\" "\\\\" str nil t)) 2734 (setq str (replace-regexp-in-string "\\\\" "\\\\" str nil t))
2743 (and (dired-switches-escape-p dired-actual-switches) 2735 (and (dired-switches-escape-p dired-actual-switches)
2744 (string-match "[ \t\n]" str) 2736 (string-match-p "[ \t\n]" str)
2745 ;; FIXME: to fix this for embedded control characters etc, we 2737 ;; FIXME: to fix this for embedded control characters etc, we
2746 ;; should escape everything that `ls -b' does. 2738 ;; should escape everything that `ls -b' does.
2747 (setq str (replace-regexp-in-string " " "\\ " str nil t) 2739 (setq str (replace-regexp-in-string " " "\\ " str nil t)
@@ -2989,7 +2981,7 @@ also offers to kill buffers visiting deleted files and directories."
2989 (kill-buffer buf))) 2981 (kill-buffer buf)))
2990 (let ((buf-list (dired-buffers-for-dir (expand-file-name fn)))) 2982 (let ((buf-list (dired-buffers-for-dir (expand-file-name fn))))
2991 (and buf-list 2983 (and buf-list
2992 (y-or-n-p (format "Kill dired buffer%s of %s, too? " 2984 (y-or-n-p (format "Kill Dired buffer%s of %s, too? "
2993 (dired-plural-s (length buf-list)) 2985 (dired-plural-s (length buf-list))
2994 (file-name-nondirectory fn))) 2986 (file-name-nondirectory fn)))
2995 (dolist (buf buf-list) 2987 (dolist (buf buf-list)
@@ -3078,7 +3070,7 @@ FILES is the list of marked files. It can also be (t FILENAME)
3078in the case of one marked file, to distinguish that from using 3070in the case of one marked file, to distinguish that from using
3079just the current file. 3071just the current file.
3080 3072
3081FUNCTION should not manipulate files, just read input \(an 3073FUNCTION should not manipulate files, just read input (an
3082argument or confirmation)." 3074argument or confirmation)."
3083 (if (or (eq dired-no-confirm t) 3075 (if (or (eq dired-no-confirm t)
3084 (memq op-symbol dired-no-confirm) 3076 (memq op-symbol dired-no-confirm)
@@ -3183,7 +3175,7 @@ argument or confirmation)."
3183 ;; Skip subdir line and following garbage like the `total' line: 3175 ;; Skip subdir line and following garbage like the `total' line:
3184 (while (and (< (point) end) (dired-between-files)) 3176 (while (and (< (point) end) (dired-between-files))
3185 (forward-line 1)) 3177 (forward-line 1))
3186 (if (and (not (looking-at dired-re-dot)) 3178 (if (and (not (looking-at-p dired-re-dot))
3187 (dired-get-filename nil t)) 3179 (dired-get-filename nil t))
3188 (progn 3180 (progn
3189 (delete-char 1) 3181 (delete-char 1)
@@ -3264,7 +3256,7 @@ As always, hidden subdirs are not affected."
3264 (let ((inhibit-read-only t)) 3256 (let ((inhibit-read-only t))
3265 (while (not (eobp)) 3257 (while (not (eobp))
3266 (or (dired-between-files) 3258 (or (dired-between-files)
3267 (looking-at dired-re-dot) 3259 (looking-at-p dired-re-dot)
3268 ;; use subst instead of insdel because it does not move 3260 ;; use subst instead of insdel because it does not move
3269 ;; the gap and thus should be faster and because 3261 ;; the gap and thus should be faster and because
3270 ;; other characters are left alone automatically 3262 ;; other characters are left alone automatically
@@ -3296,10 +3288,10 @@ object files--just `.o' will mark more than you might think."
3296 (if current-prefix-arg ?\040))) 3288 (if current-prefix-arg ?\040)))
3297 (let ((dired-marker-char (or marker-char dired-marker-char))) 3289 (let ((dired-marker-char (or marker-char dired-marker-char)))
3298 (dired-mark-if 3290 (dired-mark-if
3299 (and (not (looking-at dired-re-dot)) 3291 (and (not (looking-at-p dired-re-dot))
3300 (not (eolp)) ; empty line 3292 (not (eolp)) ; empty line
3301 (let ((fn (dired-get-filename t t))) 3293 (let ((fn (dired-get-filename t t)))
3302 (and fn (string-match regexp fn)))) 3294 (and fn (string-match-p regexp fn))))
3303 "matching file"))) 3295 "matching file")))
3304 3296
3305(defun dired-mark-files-containing-regexp (regexp &optional marker-char) 3297(defun dired-mark-files-containing-regexp (regexp &optional marker-char)
@@ -3312,7 +3304,7 @@ A prefix argument means to unmark them instead.
3312 (if current-prefix-arg ?\040))) 3304 (if current-prefix-arg ?\040)))
3313 (let ((dired-marker-char (or marker-char dired-marker-char))) 3305 (let ((dired-marker-char (or marker-char dired-marker-char)))
3314 (dired-mark-if 3306 (dired-mark-if
3315 (and (not (looking-at dired-re-dot)) 3307 (and (not (looking-at-p dired-re-dot))
3316 (not (eolp)) ; empty line 3308 (not (eolp)) ; empty line
3317 (let ((fn (dired-get-filename nil t))) 3309 (let ((fn (dired-get-filename nil t)))
3318 (when (and fn (file-readable-p fn) 3310 (when (and fn (file-readable-p fn)
@@ -3346,15 +3338,15 @@ The match is against the non-directory part of the filename. Use `^'
3346With prefix argument, unmark or unflag all those files." 3338With prefix argument, unmark or unflag all those files."
3347 (interactive "P") 3339 (interactive "P")
3348 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char))) 3340 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
3349 (dired-mark-if (looking-at dired-re-sym) "symbolic link"))) 3341 (dired-mark-if (looking-at-p dired-re-sym) "symbolic link")))
3350 3342
3351(defun dired-mark-directories (unflag-p) 3343(defun dired-mark-directories (unflag-p)
3352 "Mark all directory file lines except `.' and `..'. 3344 "Mark all directory file lines except `.' and `..'.
3353With prefix argument, unmark or unflag all those files." 3345With prefix argument, unmark or unflag all those files."
3354 (interactive "P") 3346 (interactive "P")
3355 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char))) 3347 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
3356 (dired-mark-if (and (looking-at dired-re-dir) 3348 (dired-mark-if (and (looking-at-p dired-re-dir)
3357 (not (looking-at dired-re-dot))) 3349 (not (looking-at-p dired-re-dot)))
3358 "directory file"))) 3350 "directory file")))
3359 3351
3360(defun dired-mark-executables (unflag-p) 3352(defun dired-mark-executables (unflag-p)
@@ -3362,7 +3354,7 @@ With prefix argument, unmark or unflag all those files."
3362With prefix argument, unmark or unflag all those files." 3354With prefix argument, unmark or unflag all those files."
3363 (interactive "P") 3355 (interactive "P")
3364 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char))) 3356 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
3365 (dired-mark-if (looking-at dired-re-exe) "executable file"))) 3357 (dired-mark-if (looking-at-p dired-re-exe) "executable file")))
3366 3358
3367;; dired-x.el has a dired-mark-sexp interactive command: mark 3359;; dired-x.el has a dired-mark-sexp interactive command: mark
3368;; files for which PREDICATE returns non-nil. 3360;; files for which PREDICATE returns non-nil.
@@ -3386,7 +3378,7 @@ A prefix argument says to unmark or unflag those files instead."
3386 (progn 3378 (progn
3387 (forward-char -1) 3379 (forward-char -1)
3388 (eq (preceding-char) ?#))))) 3380 (eq (preceding-char) ?#)))))
3389 (not (looking-at dired-re-dir)) 3381 (not (looking-at-p dired-re-dir))
3390 (let ((fn (dired-get-filename t t))) 3382 (let ((fn (dired-get-filename t t)))
3391 (if fn (auto-save-file-name-p 3383 (if fn (auto-save-file-name-p
3392 (file-name-nondirectory fn))))) 3384 (file-name-nondirectory fn)))))
@@ -3424,7 +3416,7 @@ With prefix argument, unmark or unflag these files."
3424 (if (eq (preceding-char) ?*) 3416 (if (eq (preceding-char) ?*)
3425 (forward-char -1)) 3417 (forward-char -1))
3426 (eq (preceding-char) ?~)) 3418 (eq (preceding-char) ?~))
3427 (not (looking-at dired-re-dir)) 3419 (not (looking-at-p dired-re-dir))
3428 (let ((fn (dired-get-filename t t))) 3420 (let ((fn (dired-get-filename t t)))
3429 (if fn (backup-file-name-p fn)))) 3421 (if fn (backup-file-name-p fn))))
3430 "backup file"))) 3422 "backup file")))
@@ -3453,7 +3445,7 @@ OLD and NEW are both characters used to mark files."
3453 (match-end 0) old new))))))) 3445 (match-end 0) old new)))))))
3454 3446
3455(defun dired-unmark-all-marks () 3447(defun dired-unmark-all-marks ()
3456 "Remove all marks from all files in the dired buffer." 3448 "Remove all marks from all files in the Dired buffer."
3457 (interactive) 3449 (interactive)
3458 (dired-unmark-all-files ?\r)) 3450 (dired-unmark-all-files ?\r))
3459 3451
@@ -3560,12 +3552,12 @@ or nil if file names are not applicable."
3560;; So anything that does not contain these is sort "by name". 3552;; So anything that does not contain these is sort "by name".
3561 3553
3562(defvar dired-ls-sorting-switches "SXU" 3554(defvar dired-ls-sorting-switches "SXU"
3563 "String of `ls' switches \(single letters\) except \"t\" that influence sorting. 3555 "String of `ls' switches (single letters) except \"t\" that influence sorting.
3564 3556
3565This indicates to Dired which option switches to watch out for because they 3557This indicates to Dired which option switches to watch out for because they
3566will change the sorting order behavior of `ls'. 3558will change the sorting order behavior of `ls'.
3567 3559
3568To change the default sorting order \(e.g. add a `-v' option\), see the 3560To change the default sorting order (e.g. add a `-v' option), see the
3569variable `dired-listing-switches'. To temporarily override the listing 3561variable `dired-listing-switches'. To temporarily override the listing
3570format, use `\\[universal-argument] \\[dired]'.") 3562format, use `\\[universal-argument] \\[dired]'.")
3571 3563
@@ -3584,7 +3576,7 @@ format, use `\\[universal-argument] \\[dired]'.")
3584 3576
3585(defvar dired-sort-inhibit nil 3577(defvar dired-sort-inhibit nil
3586 "Non-nil means the Dired sort command is disabled. 3578 "Non-nil means the Dired sort command is disabled.
3587The idea is to set this buffer-locally in special dired buffers.") 3579The idea is to set this buffer-locally in special Dired buffers.")
3588 3580
3589(defun dired-sort-set-mode-line () 3581(defun dired-sort-set-mode-line ()
3590 ;; Set mode line display according to dired-actual-switches. 3582 ;; 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.")
3594 (when (eq major-mode 'dired-mode) 3586 (when (eq major-mode 'dired-mode)
3595 (setq mode-name 3587 (setq mode-name
3596 (let (case-fold-search) 3588 (let (case-fold-search)
3597 (cond ((string-match 3589 (cond ((string-match-p
3598 dired-sort-by-name-regexp dired-actual-switches) 3590 dired-sort-by-name-regexp dired-actual-switches)
3599 "Dired by name") 3591 "Dired by name")
3600 ((string-match 3592 ((string-match-p
3601 dired-sort-by-date-regexp dired-actual-switches) 3593 dired-sort-by-date-regexp dired-actual-switches)
3602 "Dired by date") 3594 "Dired by date")
3603 (t 3595 (t
@@ -3612,7 +3604,7 @@ The idea is to set this buffer-locally in special dired buffers.")
3612With a prefix argument, edit the current listing switches instead." 3604With a prefix argument, edit the current listing switches instead."
3613 (interactive "P") 3605 (interactive "P")
3614 (when dired-sort-inhibit 3606 (when dired-sort-inhibit
3615 (error "Cannot sort this dired buffer")) 3607 (error "Cannot sort this Dired buffer"))
3616 (if arg 3608 (if arg
3617 (dired-sort-other 3609 (dired-sort-other
3618 (read-string "ls switches (must contain -l): " dired-actual-switches)) 3610 (read-string "ls switches (must contain -l): " dired-actual-switches))
@@ -3620,8 +3612,8 @@ With a prefix argument, edit the current listing switches instead."
3620 3612
3621(defun dired-sort-toggle () 3613(defun dired-sort-toggle ()
3622 ;; Toggle between sort by date/name. Reverts the buffer. 3614 ;; Toggle between sort by date/name. Reverts the buffer.
3623 (let ((sorting-by-date (string-match dired-sort-by-date-regexp 3615 (let ((sorting-by-date (string-match-p dired-sort-by-date-regexp
3624 dired-actual-switches)) 3616 dired-actual-switches))
3625 ;; Regexp for finding (possibly embedded) -t switches. 3617 ;; Regexp for finding (possibly embedded) -t switches.
3626 (switch-regexp "\\(\\`\\| \\)-\\([a-su-zA-Z]*\\)\\(t\\)\\([^ ]*\\)") 3618 (switch-regexp "\\(\\`\\| \\)-\\([a-su-zA-Z]*\\)\\(t\\)\\([^ ]*\\)")
3627 case-fold-search) 3619 case-fold-search)
@@ -3662,7 +3654,7 @@ With a prefix argument, edit the current listing switches instead."
3662 (concat result (substring string start)))) 3654 (concat result (substring string start))))
3663 3655
3664(defun dired-sort-other (switches &optional no-revert) 3656(defun dired-sort-other (switches &optional no-revert)
3665 "Specify new `ls' SWITCHES for current dired buffer. 3657 "Specify new `ls' SWITCHES for current Dired buffer.
3666Values matching `dired-sort-by-date-regexp' or `dired-sort-by-name-regexp' 3658Values matching `dired-sort-by-date-regexp' or `dired-sort-by-name-regexp'
3667set the minor mode accordingly, others appear literally in the mode line. 3659set the minor mode accordingly, others appear literally in the mode line.
3668With optional second arg NO-REVERT, don't refresh the listing afterwards." 3660With 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."
3671 (dired-sort-set-mode-line) 3663 (dired-sort-set-mode-line)
3672 (or no-revert (revert-buffer))) 3664 (or no-revert (revert-buffer)))
3673 3665
3674(defvar dired-subdir-alist-pre-R nil 3666(defvar-local dired-subdir-alist-pre-R nil
3675 "Value of `dired-subdir-alist' before -R switch added.") 3667 "Value of `dired-subdir-alist' before -R switch added.")
3676(make-variable-buffer-local 'dired-subdir-alist-pre-R)
3677 3668
3678(defun dired-sort-R-check (switches) 3669(defun dired-sort-R-check (switches)
3679 "Additional processing of -R in ls option string SWITCHES. 3670 "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
3681minus any directories explicitly deleted when R is cleared. 3672minus any directories explicitly deleted when R is cleared.
3682To be called first in body of `dired-sort-other', etc." 3673To be called first in body of `dired-sort-other', etc."
3683 (cond 3674 (cond
3684 ((and (string-match "R" switches) 3675 ((and (string-match-p "R" switches)
3685 (not (string-match "R" dired-actual-switches))) 3676 (not (string-match-p "R" dired-actual-switches)))
3686 ;; Adding -R to ls switches -- save `dired-subdir-alist': 3677 ;; Adding -R to ls switches -- save `dired-subdir-alist':
3687 (setq dired-subdir-alist-pre-R dired-subdir-alist)) 3678 (setq dired-subdir-alist-pre-R dired-subdir-alist))
3688 ((and (string-match "R" dired-actual-switches) 3679 ((and (string-match-p "R" dired-actual-switches)
3689 (not (string-match "R" switches))) 3680 (not (string-match-p "R" switches)))
3690 ;; Deleting -R from ls switches -- revert to pre-R subdirs 3681 ;; Deleting -R from ls switches -- revert to pre-R subdirs
3691 ;; that are still present: 3682 ;; that are still present:
3692 (setq dired-subdir-alist 3683 (setq dired-subdir-alist
@@ -3754,7 +3745,7 @@ Any other value means to ask for each directory."
3754(defvar dired-overwrite-confirmed) ;Defined in dired-aux. 3745(defvar dired-overwrite-confirmed) ;Defined in dired-aux.
3755 3746
3756(defun dired-dnd-handle-local-file (uri action) 3747(defun dired-dnd-handle-local-file (uri action)
3757 "Copy, move or link a file to the dired directory. 3748 "Copy, move or link a file to the Dired directory.
3758URI is the file to handle, ACTION is one of copy, move, link or ask. 3749URI is the file to handle, ACTION is one of copy, move, link or ask.
3759Ask means pop up a menu for the user to select one of copy, move or link." 3750Ask means pop up a menu for the user to select one of copy, move or link."
3760 (require 'dired-aux) 3751 (require 'dired-aux)
@@ -3801,7 +3792,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3801 action)))))) 3792 action))))))
3802 3793
3803(defun dired-dnd-handle-file (uri action) 3794(defun dired-dnd-handle-file (uri action)
3804 "Copy, move or link a file to the dired directory if it is a local file. 3795 "Copy, move or link a file to the Dired directory if it is a local file.
3805URI is the file to handle. If the hostname in the URI isn't local, do nothing. 3796URI is the file to handle. If the hostname in the URI isn't local, do nothing.
3806ACTION is one of copy, move, link or ask. 3797ACTION is one of copy, move, link or ask.
3807Ask means pop up a menu for the user to select one of copy, move or link." 3798Ask 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."
3835(defun dired-restore-desktop-buffer (_file-name 3826(defun dired-restore-desktop-buffer (_file-name
3836 _buffer-name 3827 _buffer-name
3837 misc-data) 3828 misc-data)
3838 "Restore a dired buffer specified in a desktop file." 3829 "Restore a Dired buffer specified in a desktop file."
3839 ;; First element of `misc-data' is the value of `dired-directory'. 3830 ;; First element of `misc-data' is the value of `dired-directory'.
3840 ;; This value is a directory name, optionally with shell wildcard or 3831 ;; This value is a directory name, optionally with shell wildcard or
3841 ;; a directory name followed by list of files. 3832 ;; a directory name followed by list of files.
@@ -4376,17 +4367,16 @@ instead.
4376 4367
4377;;;*** 4368;;;***
4378 4369
4379;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump) 4370;;;### (autoloads nil "dired-x" "dired-x.el" "4b863621846609105c0371f8ffb8c1cf")
4380;;;;;; "dired-x" "dired-x.el" "90ba5245f6f5df3bdbda6303c725ef45")
4381;;; Generated autoloads from dired-x.el 4371;;; Generated autoloads from dired-x.el
4382 4372
4383(autoload 'dired-jump "dired-x" "\ 4373(autoload 'dired-jump "dired-x" "\
4384Jump to dired buffer corresponding to current buffer. 4374Jump to Dired buffer corresponding to current buffer.
4385If in a file, dired the current directory and move to file's line. 4375If in a file, Dired the current directory and move to file's line.
4386If in Dired already, pop up a level and goto old directory's line. 4376If in Dired already, pop up a level and goto old directory's line.
4387In case the proper dired file line cannot be found, refresh the dired 4377In case the proper Dired file line cannot be found, refresh the dired
4388buffer and try again. 4378buffer and try again.
4389When OTHER-WINDOW is non-nil, jump to dired buffer in other window. 4379When OTHER-WINDOW is non-nil, jump to Dired buffer in other window.
4390Interactively with prefix argument, read FILE-NAME and 4380Interactively with prefix argument, read FILE-NAME and
4391move to its line in dired. 4381move to its line in dired.
4392 4382
diff --git a/lisp/dos-w32.el b/lisp/dos-w32.el
index d6788ffe028..ff4a3ad66f0 100644
--- a/lisp/dos-w32.el
+++ b/lisp/dos-w32.el
@@ -86,7 +86,7 @@ and whether the file exists:
86 If the file does not exist default value of `buffer-file-coding-system' 86 If the file does not exist default value of `buffer-file-coding-system'
87 87
88Note that the CAR of arguments to `insert-file-contents' operation could 88Note that the CAR of arguments to `insert-file-contents' operation could
89be a cons cell of the form \(FILENAME . BUFFER\), where BUFFER is a buffer 89be a cons cell of the form (FILENAME . BUFFER), where BUFFER is a buffer
90into which the file's contents were already read, but not yet decoded. 90into which the file's contents were already read, but not yet decoded.
91 91
92If operation is `write-region', the coding system is chosen based 92If operation is `write-region', the coding system is chosen based
@@ -203,8 +203,8 @@ dealing with untranslated filesystems."
203 ;; with bare drive letters (which would have the cwd appended). 203 ;; with bare drive letters (which would have the cwd appended).
204 ;; Avoid expanding names that could trigger ange-ftp to prompt 204 ;; Avoid expanding names that could trigger ange-ftp to prompt
205 ;; for passwords, though. 205 ;; for passwords, though.
206 (if (or (string-match "^.:$" name) 206 (if (or (string-match-p "^.:$" name)
207 (string-match "^/[^/:]+:" name)) 207 (string-match-p "^/[^/:]+:" name))
208 name 208 name
209 (expand-file-name name))) 209 (expand-file-name name)))
210 filename)) 210 filename))
@@ -216,7 +216,7 @@ CR/LF translation, and nil otherwise."
216 (ufs-list untranslated-filesystem-list) 216 (ufs-list untranslated-filesystem-list)
217 (found nil)) 217 (found nil))
218 (while (and (not found) ufs-list) 218 (while (and (not found) ufs-list)
219 (if (string-match (concat "^" (car ufs-list)) fs) 219 (if (string-match-p (concat "^" (car ufs-list)) fs)
220 (setq found t) 220 (setq found t)
221 (setq ufs-list (cdr ufs-list)))) 221 (setq ufs-list (cdr ufs-list))))
222 found)) 222 found))
@@ -288,19 +288,19 @@ filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
288 ;; asking command.com to copy the file. 288 ;; asking command.com to copy the file.
289 ;; No action is needed for UNC printer names, which is just as well 289 ;; No action is needed for UNC printer names, which is just as well
290 ;; because `expand-file-name' doesn't support UNC names on MS-DOS. 290 ;; because `expand-file-name' doesn't support UNC names on MS-DOS.
291 (if (and (stringp printer) (not (string-match "^\\\\" printer))) 291 (if (and (stringp printer) (not (string-match-p "^\\\\" printer)))
292 (setq printer 292 (setq printer
293 (subst-char-in-string ?/ ?\\ (expand-file-name printer safe-dir)))) 293 (subst-char-in-string ?/ ?\\ (expand-file-name printer safe-dir))))
294 ;; Handle known programs specially where necessary. 294 ;; Handle known programs specially where necessary.
295 (unwind-protect 295 (unwind-protect
296 (cond 296 (cond
297 ;; nprint.exe is the standard print command on Netware 297 ;; nprint.exe is the standard print command on Netware
298 ((string-match "^nprint\\(\\.exe\\)?$" (file-name-nondirectory lpr-prog)) 298 ((string-match-p "^nprint\\(\\.exe\\)?$" (file-name-nondirectory lpr-prog))
299 (write-region start end tempfile nil 0) 299 (write-region start end tempfile nil 0)
300 (call-process lpr-prog nil errbuf nil 300 (call-process lpr-prog nil errbuf nil
301 tempfile (concat "P=" printer))) 301 tempfile (concat "P=" printer)))
302 ;; print.exe is a standard command on NT 302 ;; print.exe is a standard command on NT
303 ((string-match "^print\\(\\.exe\\)?$" (file-name-nondirectory lpr-prog)) 303 ((string-match-p "^print\\(\\.exe\\)?$" (file-name-nondirectory lpr-prog))
304 ;; Be careful not to invoke print.exe on MS-DOS or Windows 9x 304 ;; Be careful not to invoke print.exe on MS-DOS or Windows 9x
305 ;; though, because it is a TSR program there (hangs Emacs). 305 ;; though, because it is a TSR program there (hangs Emacs).
306 (or (and (eq system-type 'windows-nt) 306 (or (and (eq system-type 'windows-nt)
@@ -355,7 +355,7 @@ filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
355 &rest rest) 355 &rest rest)
356 "DOS/Windows-specific function to print the region on a printer. 356 "DOS/Windows-specific function to print the region on a printer.
357Writes the region to the device or file which is a value of 357Writes the region to the device or file which is a value of
358`printer-name' \(which see\), unless the value of `lpr-command' 358`printer-name' (which see), unless the value of `lpr-command'
359indicates a specific program should be invoked." 359indicates a specific program should be invoked."
360 360
361 ;; DOS printers need the lines to end with CR-LF pairs, so make 361 ;; DOS printers need the lines to end with CR-LF pairs, so make
@@ -405,7 +405,7 @@ indicates a specific program should be invoked."
405 &rest rest) 405 &rest rest)
406 "DOS/Windows-specific function to print the region on a PostScript printer. 406 "DOS/Windows-specific function to print the region on a PostScript printer.
407Writes the region to the device or file which is a value of 407Writes the region to the device or file which is a value of
408`ps-printer-name' \(which see\), unless the value of `ps-lpr-command' 408`ps-printer-name' (which see), unless the value of `ps-lpr-command'
409indicates a specific program should be invoked." 409indicates a specific program should be invoked."
410 410
411 (let ((printer (or (and (boundp 'dos-ps-printer) 411 (let ((printer (or (and (boundp 'dos-ps-printer)