"If non-nil, show cursor position of each item decoration.
This is for debugging purposes, and generally set at need in a
-buffer rather than as a prevailing configuration \(but it's handy
-to publicize it by making it a customization variable\)."
+buffer rather than as a prevailing configuration (but it's handy
+to publicize it by making it a customization variable)."
:version "24.1"
:type 'boolean
:group 'allout-widgets-developer)
"Cache allout icon images, as an association list.
`allout-fetch-icon-image' uses this cache transparently, keying
-images with lists containing the name of the icon directory \(as
+images with lists containing the name of the icon directory (as
found on the `load-path') and the icon name.
Set this variable to `nil' to empty the cache, and have it replenish from the
- encryption '~'
- numbering '#'
- indirect reference '@'
- - distinctive bullets - see `allout-distinctive-bullets-string'.\)")
+ - distinctive bullets - see `allout-distinctive-bullets-string'.)")
;;;_ = allout-span-to-category
(defvar allout-span-to-category
'((:guides-span . allout-guides-span-category)
The bullet-icon and guide line graphics provide keybindings and mouse
bindings for easy outline navigation and exposure control, extending
-outline hot-spot navigation \(see `allout-mode')."
+outline hot-spot navigation (see `allout-mode')."
:lighter nil
:keymap nil
(set-buffer-modified-p was-modified))))
;;;_ > allout-widgets-mode-off
(defun allout-widgets-mode-off ()
- "Explicitly disable allout-widgets-mode."
+ "Explicitly disable `allout-widgets-mode'."
(allout-widgets-mode -1))
;;;_ > allout-widgets-mode-off
(defun allout-widgets-mode-on ()
- "Explicitly disable allout-widgets-mode."
+ "Explicitly enable `allout-widgets-mode'."
(allout-widgets-mode 1))
;;;_ > allout-setup-text-properties ()
(defun allout-setup-text-properties ()
(defvar allout-container-item-widget nil
"A widget for the current outline's overarching container as an item.
-The item has settings \(of the file/connection\) and maybe a body, but no
+The item has settings (of the file/connection) and maybe a body, but no
icon/bullet.")
(make-variable-buffer-local 'allout-container-item-widget)
;;;_ . Hooks and hook helpers
;;;_ , major command-loop business:
;;;_ > allout-widgets-pre-command-business (&optional recursing)
(defun allout-widgets-pre-command-business (&optional recursing)
- "Handle actions pending before allout-mode activity."
+ "Handle actions pending before `allout-mode' activity."
)
;;;_ > allout-widgets-post-command-business (&optional recursing)
(defun allout-widgets-post-command-business (&optional recursing)
- "Handle actions pending after any allout-mode commands.
+ "Handle actions pending after any `allout-mode' commands.
Optional RECURSING is for internal use, to limit recursion."
;; - check changed text for nesting discontinuities and escape anything
(defun allout-widgets-after-copy-or-kill-function ()
"Do allout-widgets processing of text just placed in the kill ring.
-Intended for use on allout-after-copy-or-kill-hook."
+Intended for use on `allout-after-copy-or-kill-hook'."
(if (car kill-ring)
(setcar kill-ring (allout-widgets-undecorate-text (car kill-ring)))))
;;;_ > allout-widgets-after-undo-function ()
(defun allout-widgets-after-undo-function ()
"Do allout-widgets processing of text after an undo.
-Intended for use on allout-post-undo-hook."
+Intended for use on `allout-post-undo-hook'."
(save-excursion
(if (allout-goto-prefix)
(allout-redecorate-item (allout-get-or-create-item-widget)))))
(list (if included-from t) new-ranges)))
;;;_ > allout-test-range-overlaps ()
(defun allout-test-range-overlaps ()
- "allout-range-overlaps unit tests."
+ "`allout-range-overlaps' unit tests."
(let* (ranges
got
(try (lambda (from to)
The neighbors include its siblings and parent.
-ITEM-WIDGET can be a created or converted allout-item-widget.
+ITEM-WIDGET can be a created or converted `allout-item-widget'.
If you're only trying to get or create a widget for an item, use
`allout-get-or-create-item-widget'. If you have the item-widget, applying
Optional BLANK-CONTAINER is for internal use. It is used to fabricate a
container widget for an empty-bodied container, in the course of decorating
-a proper \(non-container\) item which starts at the beginning of the file.
+a proper (non-container) item which starts at the beginning of the file.
Optional REDECORATE causes redecoration of the item-widget and
its siblings, even if already decorated in this cycle of the command loop.
the item prefix.
If optional BLANK-CONTAINER is true, then the parameters of a container
-which has an empty body are set. \(Though the body is blank, the object
-may have subitems.\)"
+which has an empty body are set. (Though the body is blank, the object
+may have subitems.)"
;; Uncomment this sit-for to notice where decoration is happening:
;; (sit-for .1)
&optional parent-widget has-successor)
"Add ITEM-WIDGET guide icon-prefix descender and connector text properties.
-Optional arguments provide context for deriving the guides. In
-their absence, the current guide column flags are used.
+Optional arguments provide context for deriving the guides.
+In their absence, the current guide column flags are used.
Optional PARENT-WIDGET is the widget for the item's parent item.
Optional BLANK-CONTAINER is for internal use, to fabricate a
meta-container item with an empty body when the first proper
-\(non-container\) item starts at the beginning of the file.
+\(non-container) item starts at the beginning of the file.
Optional REDECORATE, if non-nil, means to redecorate the widget
if it already exists."
of the buffer."
;; use existing widget, if there, else establish it
(if (or (bobp) (and (not (allout-ascend))
- (looking-at allout-regexp)))
+ (looking-at-p allout-regexp)))
(allout-get-or-create-item-widget redecorate 'blank-container)
(allout-get-or-create-item-widget redecorate)))
;;;_ : X- Item ancillaries
;; - removal and replacement of the settings
;; - maintenance of beginning-of-line guide lines
;;
-;; ?? Escapes removal \(before changes\) is not done when edits span multiple
+;; ?? Escapes removal (before changes) is not done when edits span multiple
;; items, recognizing that item structure is being preserved, including
;; escaping of item-prefix-like text within bodies. See
;; `allout-before-modification-handler' and
(defun allout-graphics-modification-handler (beg end)
"Protect against incoherent deletion of decoration graphics.
-Deletes allowed only when inhibit-read-only is t."
+Deletes allowed only when `inhibit-read-only' is t."
(cond
(undo-in-progress (when (eq (get-text-property beg 'category)
'allout-icon-span-category)
:group 'dired-keys)
(defcustom dired-bind-man t
- "Non-nil means bind `dired-man' to \"N\" in dired-mode, otherwise do not.
+ "Non-nil means bind `dired-man' to \"N\" in Dired, otherwise do not.
Setting this variable directly after dired-x is loaded has no effect -
use \\[customize]."
:type 'boolean
:group 'dired-keys)
(defcustom dired-bind-info t
- "Non-nil means bind `dired-info' to \"I\" in dired-mode, otherwise do not.
+ "Non-nil means bind `dired-info' to \"I\" in Dired, otherwise do not.
Setting this variable directly after dired-x is loaded has no effect -
use \\[customize]."
:type 'boolean
(defcustom dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$"
"Filenames matching this regexp will not be displayed.
This only has effect when `dired-omit-mode' is t. See interactive function
-`dired-omit-mode' \(\\[dired-omit-mode]\) and variable
+`dired-omit-mode' (\\[dired-omit-mode]) and variable
`dired-omit-extensions'. The default is to omit `.', `..', auto-save
files and lock files."
:type 'regexp
If nil, Dired finds the directory as a subdirectory in some other buffer
if it is present as one.
-If there are several dired buffers for a directory, the most recently
+If there are several Dired buffers for a directory, the most recently
used is chosen.
Dired avoids switching to the current buffer, so that if you have
marker-char))
(defun dired-flag-extension (extension)
- "In dired, flag all files with a certain EXTENSION for deletion.
+ "In Dired, flag all files with a certain EXTENSION for deletion.
A `.' is *not* automatically prepended to the string entered."
(interactive "sFlagging extension: ")
(dired-mark-extension extension dired-del-marker))
;;;###autoload
(defun dired-jump (&optional other-window file-name)
- "Jump to dired buffer corresponding to current buffer.
-If in a file, dired the current directory and move to file's line.
+ "Jump to Dired buffer corresponding to current buffer.
+If in a file, Dired the current directory and move to file's line.
If in Dired already, pop up a level and goto old directory's line.
-In case the proper dired file line cannot be found, refresh the dired
+In case the proper Dired file line cannot be found, refresh the dired
buffer and try again.
-When OTHER-WINDOW is non-nil, jump to dired buffer in other window.
+When OTHER-WINDOW is non-nil, jump to Dired buffer in other window.
Interactively with prefix argument, read FILE-NAME and
move to its line in dired."
(interactive
(list nil (and current-prefix-arg
- (read-file-name "Jump to dired file: "))))
+ (read-file-name "Jump to Dired file: "))))
(let* ((file (or file-name buffer-file-name))
(dir (if file (file-name-directory file) default-directory)))
(if (and (eq major-mode 'dired-mode) (null file-name))
"Like \\[dired-jump] (`dired-jump') but in other window."
(interactive
(list (and current-prefix-arg
- (read-file-name "Jump to dired file: "))))
+ (read-file-name "Jump to Dired file: "))))
(dired-jump t file-name))
\f
;;; OMITTING.
dired-latex-unclean-extensions
dired-bibtex-unclean-extensions
dired-texinfo-unclean-extensions)
- "If non-nil, a list of extensions \(strings\) to omit from Dired listings.
+ "If non-nil, a list of extensions (strings) to omit from Dired listings.
Defaults to elements of `completion-ignored-extensions',
`dired-latex-unclean-extensions', `dired-bibtex-unclean-extensions', and
`dired-texinfo-unclean-extensions'.
-See interactive function `dired-omit-mode' \(\\[dired-omit-mode]\) and
+See interactive function `dired-omit-mode' (\\[dired-omit-mode]) and
variables `dired-omit-mode' and `dired-omit-files'."
:type '(repeat string)
:group 'dired-x)
This is useful if you want to peruse and move around in an ls -lR
output file, for example one you got from an ftp server. With
-ange-ftp, you can even dired a directory containing an ls-lR file,
-visit that file and turn on virtual dired mode. But don't try to save
+ange-ftp, you can even Dired a directory containing an ls-lR file,
+visit that file and turn on Virtual Dired mode. But don't try to save
this file, as dired-virtual indents the listing and thus changes the
buffer.
Type \\<dired-mode-map>\\[revert-buffer] \
in the Virtual Dired buffer and answer `y' to convert
-the virtual to a real dired buffer again. You don't have to do this, though:
+the virtual to a real Dired buffer again. You don't have to do this, though:
you can relist single subdirs using \\[dired-do-redisplay]."
;; DIRNAME is the top level directory of the buffer. It will become
\"^ \\\\(/[^ /]+\\\\)+/?:$\"
-to put saved dired buffers automatically into Virtual Dired mode.
+to put saved Dired buffers automatically into Virtual Dired mode.
Also useful for `auto-mode-alist' like this:
;; Dired Buffer.
(defcustom dired-local-variables-file (convert-standard-filename ".dired")
- "Filename, as string, containing local dired buffer variables to be hacked.
+ "Filename, as string, containing local Dired buffer variables to be hacked.
If this file found in current directory, then it will be inserted into dired
buffer and `hack-local-variables' will be run. See Info node
`(emacs)File Variables' for more information on local variables.
(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1")
(defun dired-hack-local-variables ()
- "Evaluate local variables in `dired-local-variables-file' for dired buffer."
+ "Evaluate local variables in `dired-local-variables-file' for Dired buffer."
(declare (obsolete hack-dir-local-variables-non-file-buffer "24.1"))
(and (stringp dired-local-variables-file)
(file-exists-p dired-local-variables-file)
" " dired-guess-shell-znew-switches))
'("\\.pod\\'" "perldoc" "pod2man * | nroff -man")
- '("\\.dvi\\'" "xdvi" "dvips") ; preview and printing
+ '("\\.dvi\\'" "xdvi" "dvips") ; preview and printing
'("\\.au\\'" "play") ; play Sun audiofiles
'("\\.mpe?g\\'\\|\\.avi\\'" "xine -p")
'("\\.ogg\\'" "ogg123")
'("\\.tif\\'" "xloadimage")
'("\\.png\\'" "display") ; xloadimage 4.1 doesn't grok PNG
'("\\.jpe?g\\'" "xloadimage")
- '("\\.fig\\'" "xfig") ; edit fig pictures
+ '("\\.fig\\'" "xfig") ; edit fig pictures
'("\\.out\\'" "xgraph") ; for plotting purposes.
'("\\.tex\\'" "latex" "tex")
'("\\.texi\\(nfo\\)?\\'" "makeinfo" "texi2dvi")
Each element of this list looks like
- \(REGEXP COMMAND...\)
+ (REGEXP COMMAND...)
where each COMMAND can either be a string or a Lisp expression that evaluates
to a string. If several COMMANDs are given, the first one will be the default
You can set this variable in your ~/.emacs. For example, to add rules for
`.foo' and `.bar' files, write
- \(setq dired-guess-shell-alist-user
+ (setq dired-guess-shell-alist-user
'((\"\\\\.foo\\\\'\" \"FOO-COMMAND\")
(\"\\\\.bar\\\\'\"
(if condition
displayed this way is restricted by the height of the current window and
`window-min-height'.
-To keep dired buffer displayed, type \\[split-window-below] first.
+To keep Dired buffer displayed, type \\[split-window-below] first.
To display just marked files, type \\[delete-other-windows] first."
(interactive "P")
(dired-simultaneous-find-file (dired-get-marked-files) noselect))
spaces. You might want to install ls from GNU Coreutils, which does
support this option. Alternatively, you might want to use Emacs's
own emulation of \"ls\", by using:
- \(setq ls-lisp-use-insert-directory-program nil)
- \(require 'ls-lisp)
+ (setq ls-lisp-use-insert-directory-program nil)
+ (require 'ls-lisp)
This is used by default on MS Windows, which does not have an \"ls\" program.
Note that `ls-lisp' does not support as many options as GNU ls, though.
For more details, see Info node `(emacs)ls in Lisp'."
:type 'hook)
(defcustom dired-before-readin-hook nil
- "This hook is run before a dired buffer is read in (created or reverted)."
+ "This hook is run before a Dired buffer is read in (created or reverted)."
:group 'dired
:type 'hook)
"The functions to call when a drop in `dired-mode' is made.
See `dnd-protocol-alist' for more information. When nil, behave
as in other buffers. Changing this option is effective only for
-new dired buffers."
+new Dired buffers."
:type '(choice (repeat (cons (regexp) (function)))
(const :tag "Behave as in other buffers" nil))
:version "22.1"
;;;###autoload
(defvar dired-directory nil
- "The directory name or wildcard spec that this dired directory lists.
-Local to each dired buffer. May be a list, in which case the car is the
+ "The directory name or wildcard spec that this Dired directory lists.
+Local to each Dired buffer. May be a list, in which case the car is the
directory name and the cdr is the list of files to mention.
The directory name must be absolute, but need not be fully expanded.")
;; Beware of "-l;reboot" etc. See bug#3230.
(defun dired-safe-switches-p (switches)
- "Return non-nil if string SWITCHES does not look risky for dired."
+ "Return non-nil if string SWITCHES does not look risky for Dired."
(or (not switches)
(and (stringp switches)
(< (length switches) 100) ; arbitrary
- (string-match "\\` *-[- [:alnum:]]+\\'" switches))))
+ (string-match-p "\\` *-[- [:alnum:]]+\\'" switches))))
(defvar dired-actual-switches nil
"The value of `dired-listing-switches' used to make this buffer's text.")
The order of elements is the reverse of the order in the buffer.
In simple cases, this list contains one element.")
-(defvar dired-switches-alist nil
+(defvar-local dired-switches-alist nil
"Keeps track of which switches to use for inserted subdirectories.
This is an alist of the form (SUBDIR . SWITCHES).")
-(make-variable-buffer-local 'dired-switches-alist)
(defvaralias 'dired-move-to-filename-regexp
'directory-listing-before-filename-regexp)
(defface dired-mark
'((t (:inherit font-lock-constant-face)))
- "Face used for dired marks."
+ "Face used for Dired marks."
:group 'dired-faces
:version "22.1")
(defvar dired-mark-face 'dired-mark
- "Face name used for dired marks.")
+ "Face name used for Dired marks.")
(defface dired-marked
'((t (:inherit warning)))
If optional third arg SHOW-PROGRESS evaluates to non-nil,
redisplay the dired buffer after each file is processed.
-No guarantee is made about the position on the marked line. BODY
-must ensure this itself if it depends on this.
+No guarantee is made about the position on the marked line.
+BODY must ensure this itself if it depends on this.
Search starts at the beginning of the buffer, thus the car of the
list corresponds to the line nearest to the buffer's bottom.
delete them by typing \\[dired-do-flagged-delete].
Type \\[describe-mode] after entering Dired for more info.
-If DIRNAME is already in a dired buffer, that buffer is used without refresh."
+If DIRNAME is already in a Dired buffer, that buffer is used without refresh."
;; Cannot use (interactive "D") because of wildcards.
(interactive (dired-read-dir-and-switches ""))
(switch-to-buffer (dired-noselect dirname switches)))
;;;###autoload
(defun dired-noselect (dir-or-list &optional switches)
- "Like `dired' but returns the dired buffer as value, does not select it."
+ "Like `dired' but returns the Dired buffer as value, does not select it."
(or dir-or-list (setq dir-or-list default-directory))
;; This loses the distinction between "/foo/*/" and "/foo/*" that
;; some shells make:
(equal (nth 5 attributes) modtime)))))
(defun dired-buffer-stale-p (&optional noconfirm)
- "Return non-nil if current dired buffer needs updating.
+ "Return non-nil if current Dired buffer needs updating.
If NOCONFIRM is non-nil, then this function always returns nil
-for a remote directory. This feature is used by Auto Revert Mode."
+for a remote directory. This feature is used by Auto Revert mode."
(let ((dirname
(if (consp dired-directory) (car dired-directory) dired-directory)))
(and (stringp dirname)
(dired-directory-changed-p dirname))))
(defcustom dired-auto-revert-buffer nil
- "Automatically revert dired buffer on revisiting.
-If t, revisiting an existing dired buffer automatically reverts it.
+ "Automatically revert Dired buffer on revisiting.
+If t, revisiting an existing Dired buffer automatically reverts it.
If its value is a function, call this function with the directory
name as single argument and revert the buffer if it returns non-nil.
Otherwise, a message offering to revert the changed dired buffer
periodically reverts at specified time intervals."
:type '(choice
(const :tag "Don't revert" nil)
- (const :tag "Always revert visited dired buffer" t)
- (const :tag "Revert changed dired buffer" dired-directory-changed-p)
+ (const :tag "Always revert visited Dired buffer" t)
+ (const :tag "Revert changed Dired buffer" dired-directory-changed-p)
(function :tag "Predicate function"))
:group 'dired
:version "23.2")
;; Enlarged by dired-advertise
;; Queried by function dired-buffers-for-dir. When this detects a
;; killed buffer, it is removed from this list.
- "Alist of expanded directories and their associated dired buffers.")
+ "Alist of expanded directories and their associated Dired buffers.")
(defvar dired-find-subdir)
;; Read in a new dired buffer
(defun dired-readin ()
- "Read in a new dired buffer.
+ "Read in a new Dired buffer.
Differs from `dired-insert-subdir' in that it accepts
wildcards, erases the buffer, and builds the subdir-alist anew
\(including making it buffer-local and clearing it first)."
(run-hooks 'dired-before-readin-hook)
(if (consp buffer-undo-list)
(setq buffer-undo-list nil))
- (make-local-variable 'file-name-coding-system)
- (setq file-name-coding-system
- (or coding-system-for-read file-name-coding-system))
+ (setq-local file-name-coding-system
+ (or coding-system-for-read file-name-coding-system))
(let ((inhibit-read-only t)
;; Don't make undo entries for readin.
(buffer-undo-list t))
(goto-char (point-min))
;; Must first make alist buffer local and set it to nil because
;; dired-build-subdir-alist will call dired-clear-alist first
- (set (make-local-variable 'dired-subdir-alist) nil)
+ (setq-local dired-subdir-alist nil)
(dired-build-subdir-alist)
(let ((attributes (file-attributes dirname)))
(if (eq (car attributes) t)
;; We're now just in front of a field, with a space behind us.
(let* ((curcol (current-column))
;; Nums are right-aligned.
- (num-align (looking-at "[0-9]"))
+ (num-align (looking-at-p "[0-9]"))
;; Let's look at the other line, in the same column: we
;; should be either near the end of the previous field, or
;; in the space between that field and the next.
(defun dired-switches-escape-p (switches)
"Return non-nil if the string SWITCHES contains -b or --escape."
;; Do not match things like "--block-size" that happen to contain "b".
- (string-match "\\(\\`\\| \\)-[[:alnum:]]*b\\|--escape\\>" switches))
+ (string-match-p "\\(\\`\\| \\)-[[:alnum:]]*b\\|--escape\\>" switches))
(defun dired-insert-directory (dir switches &optional file-list wildcard hdr)
"Insert a directory listing of DIR, Dired style.
;; Otherwise, indent them.
(unless (save-excursion
(goto-char opoint)
- (looking-at " "))
+ (looking-at-p " "))
(let ((indent-tabs-mode nil))
(indent-rigidly opoint (point) 2)))
;; Insert text at the beginning to standardize things.
(save-excursion
(goto-char opoint)
(when (and (or hdr wildcard)
- (not (and (looking-at "^ \\(.*\\):$")
+ (not (and (looking-at-p "^ \\(.*\\):$")
(file-name-absolute-p (match-string 1)))))
;; Note that dired-build-subdir-alist will replace the name
;; by its expansion, so it does not matter whether what we insert
;; Reverting a dired buffer
(defun dired-revert (&optional _arg _noconfirm)
- "Reread the dired buffer.
+ "Reread the Dired buffer.
Must also be called after `dired-actual-switches' have changed.
Should not fail even on completely garbaged buffers.
Preserves old cursor, marks/flags, hidden-p.
"Return current positions in the buffer and all windows with this directory.
The positions have the form (BUFFER-POSITION WINDOW-POSITIONS).
-BUFFER-POSITION is the point position in the current dired buffer.
+BUFFER-POSITION is the point position in the current Dired buffer.
It has the form (BUFFER DIRED-FILENAME BUFFER-POINT).
WINDOW-POSITIONS are current positions in all windows displaying
(defun dired-insert-old-subdirs (old-subdir-alist)
"Try to insert all subdirs that were displayed before.
Do so according to the former subdir alist OLD-SUBDIR-ALIST."
- (or (string-match "R" dired-actual-switches)
+ (or (string-match-p "R" dired-actual-switches)
(let (elt dir)
(while old-subdir-alist
(setq elt (car old-subdir-alist)
:help "Incrementally search for string in file names only."))
(define-key map [menu-bar immediate compare-directories]
'(menu-item "Compare Directories..." dired-compare-directories
- :help "Mark files with different attributes in two dired buffers"))
+ :help "Mark files with different attributes in two Dired buffers"))
(define-key map [menu-bar immediate backup-diff]
'(menu-item "Compare with Backup" dired-backup-diff
:help "Diff file at cursor with its latest backup"))
:help "Create a directory"))
(define-key map [menu-bar immediate wdired-mode]
'(menu-item "Edit File Names" wdired-change-to-wdired-mode
- :help "Put a dired buffer in a mode in which filenames are editable"
+ :help "Put a Dired buffer in a mode in which filenames are editable"
:keys "C-x C-q"
:filter (lambda (x) (if (eq major-mode 'dired-mode) x))))
:help "Copy current file or all marked files"))
map)
- "Local keymap for `dired-mode' buffers.")
+ "Local keymap for Dired mode buffers.")
\f
;; Dired mode is suitable only for specially formatted data.
(put 'dired-mode 'mode-class 'special)
"\
Mode for \"editing\" directory listings.
In Dired, you are \"editing\" a list of the files in a directory and
- \(optionally) its subdirectories, in the format of `ls -lR'.
+ (optionally) its subdirectories, in the format of `ls -lR'.
Each directory is a page: use \\[backward-page] and \\[forward-page] to move pagewise.
\"Editing\" means that you can run shell commands on files, visit,
compress, load or byte-compile them, change their file attributes
Type \\[dired-do-flagged-delete] to delete (eXecute) the files flagged `D'.
Type \\[dired-find-file] to Find the current line's file
(or dired it in another buffer, if it is a directory).
-Type \\[dired-find-file-other-window] to find file or dired directory in Other window.
+Type \\[dired-find-file-other-window] to find file or Dired directory in Other window.
Type \\[dired-maybe-insert-subdir] to Insert a subdirectory in this buffer.
Type \\[dired-do-rename] to Rename a file or move the marked files to another directory.
Type \\[dired-do-copy] to Copy files.
;; Ignore dired-hide-details-* value of invisible text property by default.
(when (eq buffer-invisibility-spec t)
(setq buffer-invisibility-spec (list t)))
- (set (make-local-variable 'revert-buffer-function)
- (function dired-revert))
- (set (make-local-variable 'buffer-stale-function)
- (function dired-buffer-stale-p))
- (set (make-local-variable 'page-delimiter)
- "\n\n")
- (set (make-local-variable 'dired-directory)
- (or dirname default-directory))
+ (setq-local revert-buffer-function (function dired-revert))
+ (setq-local buffer-stale-function (function dired-buffer-stale-p))
+ (setq-local page-delimiter "\n\n")
+ (setq-local dired-directory (or dirname default-directory))
;; list-buffers uses this to display the dir being edited in this buffer.
(setq list-buffers-directory
(expand-file-name (if (listp dired-directory)
(car dired-directory)
dired-directory)))
- (set (make-local-variable 'dired-actual-switches)
- (or switches dired-listing-switches))
- (set (make-local-variable 'font-lock-defaults)
- '(dired-font-lock-keywords t nil nil beginning-of-line))
- (set (make-local-variable 'desktop-save-buffer)
- 'dired-desktop-buffer-misc-data)
+ (setq-local dired-actual-switches (or switches dired-listing-switches))
+ (setq-local font-lock-defaults
+ '(dired-font-lock-keywords t nil nil beginning-of-line))
+ (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data)
(setq dired-switches-alist nil)
(hack-dir-local-variables-non-file-buffer) ; before sorting
(dired-sort-other dired-actual-switches t)
(when (featurep 'dnd)
- (set (make-local-variable 'dnd-protocol-alist)
- (append dired-dnd-protocol-alist dnd-protocol-alist)))
+ (setq-local dnd-protocol-alist
+ (append dired-dnd-protocol-alist dnd-protocol-alist)))
(add-hook 'file-name-at-point-functions 'dired-file-name-at-point nil t)
(add-hook 'isearch-mode-hook 'dired-isearch-filenames-setup nil t)
(run-mode-hooks 'dired-mode-hook))
;; Idiosyncratic dired commands that don't deal with marks.
(defun dired-summary ()
- "Summarize basic Dired commands and show recent dired errors."
+ "Summarize basic Dired commands and show recent Dired errors."
(interactive)
(dired-why)
;>> this should check the key-bindings and use substitute-command-keys if non-standard
"d-elete, u-ndelete, x-punge, f-ind, o-ther window, R-ename, C-opy, h-elp"))
(defun dired-undo ()
- "Undo in a dired buffer.
+ "Undo in a Dired buffer.
This doesn't recover lost files, it just undoes changes in the buffer itself.
You can use it to recover marks, killed lines or subdirs."
(interactive)
(let ((inhibit-read-only t))
(undo))
(dired-build-subdir-alist)
- (message "Change in dired buffer undone.
+ (message "Change in Dired buffer undone.
Actual changes in files cannot be undone by Emacs."))
(defun dired-toggle-read-only ()
(dired-next-line (- (or arg 1))))
(defun dired-next-dirline (arg &optional opoint)
- "Goto ARG'th next directory file line."
+ "Goto ARGth next directory file line."
(interactive "p")
(or opoint (setq opoint (point)))
(if (if (> arg 0)
(error "No more subdirectories")))
(defun dired-prev-dirline (arg)
- "Goto ARG'th previous directory file line."
+ "Goto ARGth previous directory file line."
(interactive "p")
(dired-next-dirline (- arg)))
file-name
(if (file-symlink-p file-name)
(error "File is a symlink to a nonexistent target")
- (error "File no longer exists; type `g' to update dired buffer")))))
+ (error "File no longer exists; type `g' to update Dired buffer")))))
;; Force C-m keybinding rather than `f' or `e' in the mode doc:
(define-obsolete-function-alias 'dired-advertised-find-file 'dired-find-file "23.2")
(find-file (dired-get-file-for-visit))))
(defun dired-find-alternate-file ()
- "In Dired, visit this file or directory instead of the dired buffer."
+ "In Dired, visit this file or directory instead of the Dired buffer."
(interactive)
(set-buffer-modified-p nil)
(find-alternate-file (dired-get-file-for-visit)))
;;; Minor mode for hiding details
;;;###autoload
(define-minor-mode dired-hide-details-mode
- "Hide details in `dired-mode'."
+ "Hide details in Dired mode."
:group 'dired
(unless (derived-mode-p 'dired-mode)
(error "Not a Dired buffer"))
(goto-char (next-single-property-change (point) 'dired-filename))
(let (opoint file-type executable symlink hidden case-fold-search used-F eol)
;; case-fold-search is nil now, so we can test for capital F:
- (setq used-F (string-match "F" dired-actual-switches)
+ (setq used-F (string-match-p "F" dired-actual-switches)
opoint (point)
eol (line-end-position)
hidden (and selective-display
"Copy names of marked (or next ARG) files into the kill ring.
The names are separated by a space.
With a zero prefix arg, use the absolute file name of each marked file.
-With \\[universal-argument], use the file name relative to the dired buffer's
+With \\[universal-argument], use the file name relative to the Dired buffer's
`default-directory'. (This still may contain slashes if in a subdirectory.)
If on a subdir headerline, use absolute subdirname instead;
(if (stringp dired-directory)
(let ((wildcards (file-name-nondirectory
dired-directory)))
- (or (= 0 (length wildcards))
- (string-match (dired-glob-regexp wildcards)
- file)))
+ (or (zerop (length wildcards))
+ (string-match-p (dired-glob-regexp wildcards)
+ file)))
(member (expand-file-name file dir)
(cdr dired-directory))))
(setq result (cons buf result)))))))
(if (= (aref pattern (1+ set-start)) ?^)
(+ 3 set-start)
(+ 2 set-start)))
- (set-end (string-match "]" pattern set-cont))
+ (set-end (string-match-p "]" pattern set-cont))
(set (substring pattern set-start (1+ set-end))))
(setq regexp (concat regexp set))
(setq matched-in-pattern (1+ set-end))))
(defun dired-in-this-tree (file dir)
;;"Is FILE part of the directory tree starting at DIR?"
(let (case-fold-search)
- (string-match (concat "^" (regexp-quote dir)) file)))
+ (string-match-p (concat "^" (regexp-quote dir)) file)))
(defun dired-normalize-subdir (dir)
;; Prepend default-directory to DIR if relative file name.
(R-ftp-base-dir-regex
;; Used to expand subdirectory names correctly in recursive
;; ange-ftp listings.
- (and (string-match "R" switches)
+ (and (string-match-p "R" switches)
(string-match "\\`/.*:\\(/.*\\)" default-directory)
(concat "\\`" (match-string 1 default-directory)))))
(goto-char (point-min))
(goto-char (match-beginning 0))
(beginning-of-line)
(forward-char 2)
- (save-match-data (looking-at dired-re-perms)))
+ (looking-at-p dired-re-perms))
(save-excursion
(goto-char (match-beginning 1))
(setq new-dir-name
(dired-goto-next-file);; so there is a file to compare with
(if (stringp dired-trivial-filenames)
(while (and (not (eobp))
- (string-match dired-trivial-filenames
- (file-name-nondirectory
- (or (dired-get-filename nil t) ""))))
+ (string-match-p dired-trivial-filenames
+ (file-name-nondirectory
+ (or (dired-get-filename nil t) ""))))
(forward-line 1)
(dired-move-to-filename))))
(forward-line 1))))
(defun dired-goto-file (file)
- "Go to line describing file FILE in this dired buffer."
+ "Go to line describing file FILE in this Dired buffer."
;; Return value of point on success, else nil.
;; FILE must be an absolute file name.
;; Loses if FILE contains control chars like "\007" for which ls
(setq str (replace-regexp-in-string "\^m" "\\^m" file nil t))
(setq str (replace-regexp-in-string "\\\\" "\\\\" str nil t))
(and (dired-switches-escape-p dired-actual-switches)
- (string-match "[ \t\n]" str)
+ (string-match-p "[ \t\n]" str)
;; FIXME: to fix this for embedded control characters etc, we
;; should escape everything that `ls -b' does.
(setq str (replace-regexp-in-string " " "\\ " str nil t)
(kill-buffer buf)))
(let ((buf-list (dired-buffers-for-dir (expand-file-name fn))))
(and buf-list
- (y-or-n-p (format "Kill dired buffer%s of %s, too? "
+ (y-or-n-p (format "Kill Dired buffer%s of %s, too? "
(dired-plural-s (length buf-list))
(file-name-nondirectory fn)))
(dolist (buf buf-list)
in the case of one marked file, to distinguish that from using
just the current file.
-FUNCTION should not manipulate files, just read input \(an
+FUNCTION should not manipulate files, just read input (an
argument or confirmation)."
(if (or (eq dired-no-confirm t)
(memq op-symbol dired-no-confirm)
;; Skip subdir line and following garbage like the `total' line:
(while (and (< (point) end) (dired-between-files))
(forward-line 1))
- (if (and (not (looking-at dired-re-dot))
+ (if (and (not (looking-at-p dired-re-dot))
(dired-get-filename nil t))
(progn
(delete-char 1)
(let ((inhibit-read-only t))
(while (not (eobp))
(or (dired-between-files)
- (looking-at dired-re-dot)
+ (looking-at-p dired-re-dot)
;; use subst instead of insdel because it does not move
;; the gap and thus should be faster and because
;; other characters are left alone automatically
(if current-prefix-arg ?\040)))
(let ((dired-marker-char (or marker-char dired-marker-char)))
(dired-mark-if
- (and (not (looking-at dired-re-dot))
+ (and (not (looking-at-p dired-re-dot))
(not (eolp)) ; empty line
(let ((fn (dired-get-filename t t)))
- (and fn (string-match regexp fn))))
+ (and fn (string-match-p regexp fn))))
"matching file")))
(defun dired-mark-files-containing-regexp (regexp &optional marker-char)
(if current-prefix-arg ?\040)))
(let ((dired-marker-char (or marker-char dired-marker-char)))
(dired-mark-if
- (and (not (looking-at dired-re-dot))
+ (and (not (looking-at-p dired-re-dot))
(not (eolp)) ; empty line
(let ((fn (dired-get-filename nil t)))
(when (and fn (file-readable-p fn)
With prefix argument, unmark or unflag all those files."
(interactive "P")
(let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
- (dired-mark-if (looking-at dired-re-sym) "symbolic link")))
+ (dired-mark-if (looking-at-p dired-re-sym) "symbolic link")))
(defun dired-mark-directories (unflag-p)
"Mark all directory file lines except `.' and `..'.
With prefix argument, unmark or unflag all those files."
(interactive "P")
(let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
- (dired-mark-if (and (looking-at dired-re-dir)
- (not (looking-at dired-re-dot)))
+ (dired-mark-if (and (looking-at-p dired-re-dir)
+ (not (looking-at-p dired-re-dot)))
"directory file")))
(defun dired-mark-executables (unflag-p)
With prefix argument, unmark or unflag all those files."
(interactive "P")
(let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
- (dired-mark-if (looking-at dired-re-exe) "executable file")))
+ (dired-mark-if (looking-at-p dired-re-exe) "executable file")))
;; dired-x.el has a dired-mark-sexp interactive command: mark
;; files for which PREDICATE returns non-nil.
(progn
(forward-char -1)
(eq (preceding-char) ?#)))))
- (not (looking-at dired-re-dir))
+ (not (looking-at-p dired-re-dir))
(let ((fn (dired-get-filename t t)))
(if fn (auto-save-file-name-p
(file-name-nondirectory fn)))))
(if (eq (preceding-char) ?*)
(forward-char -1))
(eq (preceding-char) ?~))
- (not (looking-at dired-re-dir))
+ (not (looking-at-p dired-re-dir))
(let ((fn (dired-get-filename t t)))
(if fn (backup-file-name-p fn))))
"backup file")))
(match-end 0) old new)))))))
(defun dired-unmark-all-marks ()
- "Remove all marks from all files in the dired buffer."
+ "Remove all marks from all files in the Dired buffer."
(interactive)
(dired-unmark-all-files ?\r))
;; So anything that does not contain these is sort "by name".
(defvar dired-ls-sorting-switches "SXU"
- "String of `ls' switches \(single letters\) except \"t\" that influence sorting.
+ "String of `ls' switches (single letters) except \"t\" that influence sorting.
This indicates to Dired which option switches to watch out for because they
will change the sorting order behavior of `ls'.
-To change the default sorting order \(e.g. add a `-v' option\), see the
+To change the default sorting order (e.g. add a `-v' option), see the
variable `dired-listing-switches'. To temporarily override the listing
format, use `\\[universal-argument] \\[dired]'.")
(defvar dired-sort-inhibit nil
"Non-nil means the Dired sort command is disabled.
-The idea is to set this buffer-locally in special dired buffers.")
+The idea is to set this buffer-locally in special Dired buffers.")
(defun dired-sort-set-mode-line ()
;; Set mode line display according to dired-actual-switches.
(when (eq major-mode 'dired-mode)
(setq mode-name
(let (case-fold-search)
- (cond ((string-match
+ (cond ((string-match-p
dired-sort-by-name-regexp dired-actual-switches)
"Dired by name")
- ((string-match
+ ((string-match-p
dired-sort-by-date-regexp dired-actual-switches)
"Dired by date")
(t
With a prefix argument, edit the current listing switches instead."
(interactive "P")
(when dired-sort-inhibit
- (error "Cannot sort this dired buffer"))
+ (error "Cannot sort this Dired buffer"))
(if arg
(dired-sort-other
(read-string "ls switches (must contain -l): " dired-actual-switches))
(defun dired-sort-toggle ()
;; Toggle between sort by date/name. Reverts the buffer.
- (let ((sorting-by-date (string-match dired-sort-by-date-regexp
- dired-actual-switches))
+ (let ((sorting-by-date (string-match-p dired-sort-by-date-regexp
+ dired-actual-switches))
;; Regexp for finding (possibly embedded) -t switches.
(switch-regexp "\\(\\`\\| \\)-\\([a-su-zA-Z]*\\)\\(t\\)\\([^ ]*\\)")
case-fold-search)
(concat result (substring string start))))
(defun dired-sort-other (switches &optional no-revert)
- "Specify new `ls' SWITCHES for current dired buffer.
+ "Specify new `ls' SWITCHES for current Dired buffer.
Values matching `dired-sort-by-date-regexp' or `dired-sort-by-name-regexp'
set the minor mode accordingly, others appear literally in the mode line.
With optional second arg NO-REVERT, don't refresh the listing afterwards."
(dired-sort-set-mode-line)
(or no-revert (revert-buffer)))
-(defvar dired-subdir-alist-pre-R nil
+(defvar-local dired-subdir-alist-pre-R nil
"Value of `dired-subdir-alist' before -R switch added.")
-(make-variable-buffer-local 'dired-subdir-alist-pre-R)
(defun dired-sort-R-check (switches)
"Additional processing of -R in ls option string SWITCHES.
minus any directories explicitly deleted when R is cleared.
To be called first in body of `dired-sort-other', etc."
(cond
- ((and (string-match "R" switches)
- (not (string-match "R" dired-actual-switches)))
+ ((and (string-match-p "R" switches)
+ (not (string-match-p "R" dired-actual-switches)))
;; Adding -R to ls switches -- save `dired-subdir-alist':
(setq dired-subdir-alist-pre-R dired-subdir-alist))
- ((and (string-match "R" dired-actual-switches)
- (not (string-match "R" switches)))
+ ((and (string-match-p "R" dired-actual-switches)
+ (not (string-match-p "R" switches)))
;; Deleting -R from ls switches -- revert to pre-R subdirs
;; that are still present:
(setq dired-subdir-alist
(defvar dired-overwrite-confirmed) ;Defined in dired-aux.
(defun dired-dnd-handle-local-file (uri action)
- "Copy, move or link a file to the dired directory.
+ "Copy, move or link a file to the Dired directory.
URI is the file to handle, ACTION is one of copy, move, link or ask.
Ask means pop up a menu for the user to select one of copy, move or link."
(require 'dired-aux)
action))))))
(defun dired-dnd-handle-file (uri action)
- "Copy, move or link a file to the dired directory if it is a local file.
+ "Copy, move or link a file to the Dired directory if it is a local file.
URI is the file to handle. If the hostname in the URI isn't local, do nothing.
ACTION is one of copy, move, link or ask.
Ask means pop up a menu for the user to select one of copy, move or link."
(defun dired-restore-desktop-buffer (_file-name
_buffer-name
misc-data)
- "Restore a dired buffer specified in a desktop file."
+ "Restore a Dired buffer specified in a desktop file."
;; First element of `misc-data' is the value of `dired-directory'.
;; This value is a directory name, optionally with shell wildcard or
;; a directory name followed by list of files.
;;;***
\f
-;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump)
-;;;;;; "dired-x" "dired-x.el" "90ba5245f6f5df3bdbda6303c725ef45")
+;;;### (autoloads nil "dired-x" "dired-x.el" "4b863621846609105c0371f8ffb8c1cf")
;;; Generated autoloads from dired-x.el
(autoload 'dired-jump "dired-x" "\
-Jump to dired buffer corresponding to current buffer.
-If in a file, dired the current directory and move to file's line.
+Jump to Dired buffer corresponding to current buffer.
+If in a file, Dired the current directory and move to file's line.
If in Dired already, pop up a level and goto old directory's line.
-In case the proper dired file line cannot be found, refresh the dired
+In case the proper Dired file line cannot be found, refresh the dired
buffer and try again.
-When OTHER-WINDOW is non-nil, jump to dired buffer in other window.
+When OTHER-WINDOW is non-nil, jump to Dired buffer in other window.
Interactively with prefix argument, read FILE-NAME and
move to its line in dired.