aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTino Calancha2017-06-26 14:22:34 +0900
committerTino Calancha2017-06-26 14:22:34 +0900
commit6dd0462f5a67e8306eb8681cd02668810ce93a96 (patch)
tree06d748ea1a11632735c91649486d9d913776116c
parentcb5d6e0260e8937acea511d9e824df1868cd1249 (diff)
downloademacs-6dd0462f5a67e8306eb8681cd02668810ce93a96.tar.gz
emacs-6dd0462f5a67e8306eb8681cd02668810ce93a96.zip
Use #' instead of (function ...)
* lisp/dired-aux.el (dired-do-chxxx, dired-clean-directory) (dired-mark-confirm, dired-query, dired-byte-compile) (dired-load, dired-update-file-line, dired-after-subdir-garbage) (dired-relist-file, dired-rename-subdir, dired-do-create-files) (dired-mark-read-file-name, dired-do-copy, dired-do-symlink) (dired-do-hardlink, dired-do-rename, dired-do-rename-regexp) (dired-do-copy-regexp, dired-do-hardlink-regexp) (dired-do-symlink-regexp, dired-create-files-non-directory) (dired-upcase, dired-downcase) * lisp/dired.el (dired-mode, dired-copy-filename-as-kill) (dired-internal-do-deletions, dired-internal-do-deletions): Prefer #' instead of (function ...).
-rw-r--r--lisp/dired-aux.el54
-rw-r--r--lisp/dired.el12
2 files changed, 33 insertions, 33 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 21c8e78f2bb..aede83e61cc 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -308,7 +308,7 @@ List has a form of (file-name full-file-name (attribute-list))."
308 failures) 308 failures)
309 (setq failures 309 (setq failures
310 (dired-bunch-files 10000 310 (dired-bunch-files 10000
311 (function dired-check-process) 311 #'dired-check-process
312 (append 312 (append
313 (list operation program) 313 (list operation program)
314 (unless (or (string-equal new-attribute "") 314 (unless (or (string-equal new-attribute "")
@@ -512,7 +512,7 @@ with a prefix argument."
512 ;; If the file has numeric backup versions, 512 ;; If the file has numeric backup versions,
513 ;; put on dired-file-version-alist an element of the form 513 ;; put on dired-file-version-alist an element of the form
514 ;; (FILENAME . VERSION-NUMBER-LIST) 514 ;; (FILENAME . VERSION-NUMBER-LIST)
515 (dired-map-dired-file-lines (function dired-collect-file-versions)) 515 (dired-map-dired-file-lines #'dired-collect-file-versions)
516 ;; Sort each VERSION-NUMBER-LIST, 516 ;; Sort each VERSION-NUMBER-LIST,
517 ;; and remove the versions not to be deleted. 517 ;; and remove the versions not to be deleted.
518 (let ((fval dired-file-version-alist)) 518 (let ((fval dired-file-version-alist))
@@ -528,7 +528,7 @@ with a prefix argument."
528 (setq fval (cdr fval)))) 528 (setq fval (cdr fval))))
529 ;; Look at each file. If it is a numeric backup file, 529 ;; Look at each file. If it is a numeric backup file,
530 ;; find it in a VERSION-NUMBER-LIST and maybe flag it for deletion. 530 ;; find it in a VERSION-NUMBER-LIST and maybe flag it for deletion.
531 (dired-map-dired-file-lines (function dired-trample-file-versions)) 531 (dired-map-dired-file-lines #'dired-trample-file-versions)
532 (message "Cleaning numerical backups...done"))) 532 (message "Cleaning numerical backups...done")))
533 533
534;;; Subroutines of dired-clean-directory. 534;;; Subroutines of dired-clean-directory.
@@ -722,9 +722,9 @@ can be produced by `dired-get-marked-files', for example."
722 (if on-each 722 (if on-each
723 (dired-bunch-files 723 (dired-bunch-files
724 (- 10000 (length command)) 724 (- 10000 (length command))
725 (function (lambda (&rest files) 725 (lambda (&rest files)
726 (dired-run-shell-command 726 (dired-run-shell-command
727 (dired-shell-stuff-it command files t arg)))) 727 (dired-shell-stuff-it command files t arg)))
728 nil 728 nil
729 file-list) 729 file-list)
730 ;; execute the shell command 730 ;; execute the shell command
@@ -1122,7 +1122,7 @@ Return nil if no change in files."
1122 (let ((files (dired-get-marked-files t arg nil t)) 1122 (let ((files (dired-get-marked-files t arg nil t))
1123 (string (if (eq op-symbol 'compress) "Compress or uncompress" 1123 (string (if (eq op-symbol 'compress) "Compress or uncompress"
1124 (capitalize (symbol-name op-symbol))))) 1124 (capitalize (symbol-name op-symbol)))))
1125 (dired-mark-pop-up nil op-symbol files (function y-or-n-p) 1125 (dired-mark-pop-up nil op-symbol files #'y-or-n-p
1126 (concat string " " 1126 (concat string " "
1127 (dired-mark-prompt arg files) "? "))))) 1127 (dired-mark-prompt arg files) "? ")))))
1128 1128
@@ -1190,7 +1190,7 @@ return t; if SYM is q or ESC, return nil."
1190(defun dired-do-compress (&optional arg) 1190(defun dired-do-compress (&optional arg)
1191 "Compress or uncompress marked (or next ARG) files." 1191 "Compress or uncompress marked (or next ARG) files."
1192 (interactive "P") 1192 (interactive "P")
1193 (dired-map-over-marks-check (function dired-compress) arg 'compress t)) 1193 (dired-map-over-marks-check #'dired-compress arg 'compress t))
1194 1194
1195;; Commands for Emacs Lisp files - load and byte compile 1195;; Commands for Emacs Lisp files - load and byte compile
1196 1196
@@ -1218,7 +1218,7 @@ return t; if SYM is q or ESC, return nil."
1218(defun dired-do-byte-compile (&optional arg) 1218(defun dired-do-byte-compile (&optional arg)
1219 "Byte compile marked (or next ARG) Emacs Lisp files." 1219 "Byte compile marked (or next ARG) Emacs Lisp files."
1220 (interactive "P") 1220 (interactive "P")
1221 (dired-map-over-marks-check (function dired-byte-compile) arg 'byte-compile t)) 1221 (dired-map-over-marks-check #'dired-byte-compile arg 'byte-compile t))
1222 1222
1223(defun dired-load () 1223(defun dired-load ()
1224 ;; Return nil for success, offending file name else. 1224 ;; Return nil for success, offending file name else.
@@ -1235,7 +1235,7 @@ return t; if SYM is q or ESC, return nil."
1235(defun dired-do-load (&optional arg) 1235(defun dired-do-load (&optional arg)
1236 "Load the marked (or next ARG) Emacs Lisp files." 1236 "Load the marked (or next ARG) Emacs Lisp files."
1237 (interactive "P") 1237 (interactive "P")
1238 (dired-map-over-marks-check (function dired-load) arg 'load t)) 1238 (dired-map-over-marks-check #'dired-load arg 'load t))
1239 1239
1240;;;###autoload 1240;;;###autoload
1241(defun dired-do-redisplay (&optional arg test-for-subdir) 1241(defun dired-do-redisplay (&optional arg test-for-subdir)
@@ -1308,7 +1308,7 @@ See Info node `(emacs)Subdir switches' for more details."
1308(defun dired-add-file (filename &optional marker-char) 1308(defun dired-add-file (filename &optional marker-char)
1309 (dired-fun-in-all-buffers 1309 (dired-fun-in-all-buffers
1310 (file-name-directory filename) (file-name-nondirectory filename) 1310 (file-name-directory filename) (file-name-nondirectory filename)
1311 (function dired-add-entry) filename marker-char)) 1311 #'dired-add-entry filename marker-char))
1312 1312
1313(defvar dired-omit-mode) 1313(defvar dired-omit-mode)
1314(declare-function dired-omit-regexp "dired-x" ()) 1314(declare-function dired-omit-regexp "dired-x" ())
@@ -1445,7 +1445,7 @@ files matching `dired-omit-regexp'."
1445(defun dired-remove-file (file) 1445(defun dired-remove-file (file)
1446 (dired-fun-in-all-buffers 1446 (dired-fun-in-all-buffers
1447 (file-name-directory file) (file-name-nondirectory file) 1447 (file-name-directory file) (file-name-nondirectory file)
1448 (function dired-remove-entry) file)) 1448 #'dired-remove-entry file))
1449 1449
1450(defun dired-remove-entry (file) 1450(defun dired-remove-entry (file)
1451 (save-excursion 1451 (save-excursion
@@ -1459,7 +1459,7 @@ files matching `dired-omit-regexp'."
1459 "Create or update the line for FILE in all Dired buffers it would belong in." 1459 "Create or update the line for FILE in all Dired buffers it would belong in."
1460 (dired-fun-in-all-buffers (file-name-directory file) 1460 (dired-fun-in-all-buffers (file-name-directory file)
1461 (file-name-nondirectory file) 1461 (file-name-nondirectory file)
1462 (function dired-relist-entry) file)) 1462 #'dired-relist-entry file))
1463 1463
1464(defun dired-relist-entry (file) 1464(defun dired-relist-entry (file)
1465 ;; Relist the line for FILE, or just add it if it did not exist. 1465 ;; Relist the line for FILE, or just add it if it did not exist.
@@ -1553,7 +1553,7 @@ Special value `always' suppresses confirmation."
1553 (setq from-dir (file-name-as-directory from-dir) 1553 (setq from-dir (file-name-as-directory from-dir)
1554 to-dir (file-name-as-directory to-dir)) 1554 to-dir (file-name-as-directory to-dir))
1555 (dired-fun-in-all-buffers from-dir nil 1555 (dired-fun-in-all-buffers from-dir nil
1556 (function dired-rename-subdir-1) from-dir to-dir) 1556 #'dired-rename-subdir-1 from-dir to-dir)
1557 ;; Update visited file name of all affected buffers 1557 ;; Update visited file name of all affected buffers
1558 (let ((expanded-from-dir (expand-file-name from-dir)) 1558 (let ((expanded-from-dir (expand-file-name from-dir))
1559 (blist (buffer-list))) 1559 (blist (buffer-list)))
@@ -1788,7 +1788,7 @@ Optional arg HOW-TO determines how to treat the target.
1788 For any other return value, TARGET is treated as a directory." 1788 For any other return value, TARGET is treated as a directory."
1789 (or op1 (setq op1 operation)) 1789 (or op1 (setq op1 operation))
1790 (let* ((fn-list (dired-get-marked-files nil arg)) 1790 (let* ((fn-list (dired-get-marked-files nil arg))
1791 (rfn-list (mapcar (function dired-make-relative) fn-list)) 1791 (rfn-list (mapcar #'dired-make-relative fn-list))
1792 (dired-one-file ; fluid variable inside dired-create-files 1792 (dired-one-file ; fluid variable inside dired-create-files
1793 (and (consp fn-list) (null (cdr fn-list)) (car fn-list))) 1793 (and (consp fn-list) (null (cdr fn-list)) (car fn-list)))
1794 (target-dir (dired-dwim-target-directory)) 1794 (target-dir (dired-dwim-target-directory))
@@ -1856,7 +1856,7 @@ Optional arg HOW-TO determines how to treat the target.
1856 &optional default) 1856 &optional default)
1857 (dired-mark-pop-up 1857 (dired-mark-pop-up
1858 nil op-symbol files 1858 nil op-symbol files
1859 (function read-file-name) 1859 #'read-file-name
1860 (format prompt (dired-mark-prompt arg files)) dir default)) 1860 (format prompt (dired-mark-prompt arg files)) dir default))
1861 1861
1862(defun dired-dwim-target-directory () 1862(defun dired-dwim-target-directory ()
@@ -1984,7 +1984,7 @@ This command copies symbolic links by creating new ones, similar
1984to the \"-d\" option for the \"cp\" shell command." 1984to the \"-d\" option for the \"cp\" shell command."
1985 (interactive "P") 1985 (interactive "P")
1986 (let ((dired-recursive-copies dired-recursive-copies)) 1986 (let ((dired-recursive-copies dired-recursive-copies))
1987 (dired-do-create-files 'copy (function dired-copy-file) 1987 (dired-do-create-files 'copy #'dired-copy-file
1988 "Copy" 1988 "Copy"
1989 arg dired-keep-marker-copy 1989 arg dired-keep-marker-copy
1990 nil dired-copy-how-to-fn))) 1990 nil dired-copy-how-to-fn)))
@@ -2001,7 +2001,7 @@ suggested for the target directory depends on the value of
2001 2001
2002For relative symlinks, use \\[dired-do-relsymlink]." 2002For relative symlinks, use \\[dired-do-relsymlink]."
2003 (interactive "P") 2003 (interactive "P")
2004 (dired-do-create-files 'symlink (function make-symbolic-link) 2004 (dired-do-create-files 'symlink #'make-symbolic-link
2005 "Symlink" arg dired-keep-marker-symlink)) 2005 "Symlink" arg dired-keep-marker-symlink))
2006 2006
2007;;;###autoload 2007;;;###autoload
@@ -2014,7 +2014,7 @@ with the same names that the files currently have. The default
2014suggested for the target directory depends on the value of 2014suggested for the target directory depends on the value of
2015`dired-dwim-target', which see." 2015`dired-dwim-target', which see."
2016 (interactive "P") 2016 (interactive "P")
2017 (dired-do-create-files 'hardlink (function dired-hardlink) 2017 (dired-do-create-files 'hardlink #'dired-hardlink
2018 "Hardlink" arg dired-keep-marker-hardlink)) 2018 "Hardlink" arg dired-keep-marker-hardlink))
2019 2019
2020(defun dired-hardlink (file newname &optional ok-if-already-exists) 2020(defun dired-hardlink (file newname &optional ok-if-already-exists)
@@ -2033,7 +2033,7 @@ This command also renames any buffers that are visiting the files.
2033The default suggested for the target directory depends on the value 2033The default suggested for the target directory depends on the value
2034of `dired-dwim-target', which see." 2034of `dired-dwim-target', which see."
2035 (interactive "P") 2035 (interactive "P")
2036 (dired-do-create-files 'move (function dired-rename-file) 2036 (dired-do-create-files 'move #'dired-rename-file
2037 "Move" arg dired-keep-marker-rename "Rename")) 2037 "Move" arg dired-keep-marker-rename "Rename"))
2038;;;###end dired-cp.el 2038;;;###end dired-cp.el
2039 2039
@@ -2127,7 +2127,7 @@ With a zero prefix arg, renaming by regexp affects the absolute file name.
2127Normally, only the non-directory part of the file name is used and changed." 2127Normally, only the non-directory part of the file name is used and changed."
2128 (interactive (dired-mark-read-regexp "Rename")) 2128 (interactive (dired-mark-read-regexp "Rename"))
2129 (dired-do-create-files-regexp 2129 (dired-do-create-files-regexp
2130 (function dired-rename-file) 2130 #'dired-rename-file
2131 "Rename" arg regexp newname whole-name dired-keep-marker-rename)) 2131 "Rename" arg regexp newname whole-name dired-keep-marker-rename))
2132 2132
2133;;;###autoload 2133;;;###autoload
@@ -2137,7 +2137,7 @@ See function `dired-do-rename-regexp' for more info."
2137 (interactive (dired-mark-read-regexp "Copy")) 2137 (interactive (dired-mark-read-regexp "Copy"))
2138 (let ((dired-recursive-copies nil)) ; No recursive copies. 2138 (let ((dired-recursive-copies nil)) ; No recursive copies.
2139 (dired-do-create-files-regexp 2139 (dired-do-create-files-regexp
2140 (function dired-copy-file) 2140 #'dired-copy-file
2141 (if dired-copy-preserve-time "Copy [-p]" "Copy") 2141 (if dired-copy-preserve-time "Copy [-p]" "Copy")
2142 arg regexp newname whole-name dired-keep-marker-copy))) 2142 arg regexp newname whole-name dired-keep-marker-copy)))
2143 2143
@@ -2147,7 +2147,7 @@ See function `dired-do-rename-regexp' for more info."
2147See function `dired-do-rename-regexp' for more info." 2147See function `dired-do-rename-regexp' for more info."
2148 (interactive (dired-mark-read-regexp "HardLink")) 2148 (interactive (dired-mark-read-regexp "HardLink"))
2149 (dired-do-create-files-regexp 2149 (dired-do-create-files-regexp
2150 (function add-name-to-file) 2150 #'add-name-to-file
2151 "HardLink" arg regexp newname whole-name dired-keep-marker-hardlink)) 2151 "HardLink" arg regexp newname whole-name dired-keep-marker-hardlink))
2152 2152
2153;;;###autoload 2153;;;###autoload
@@ -2156,7 +2156,7 @@ See function `dired-do-rename-regexp' for more info."
2156See function `dired-do-rename-regexp' for more info." 2156See function `dired-do-rename-regexp' for more info."
2157 (interactive (dired-mark-read-regexp "SymLink")) 2157 (interactive (dired-mark-read-regexp "SymLink"))
2158 (dired-do-create-files-regexp 2158 (dired-do-create-files-regexp
2159 (function make-symbolic-link) 2159 #'make-symbolic-link
2160 "SymLink" arg regexp newname whole-name dired-keep-marker-symlink)) 2160 "SymLink" arg regexp newname whole-name dired-keep-marker-symlink))
2161 2161
2162(defvar rename-non-directory-query) 2162(defvar rename-non-directory-query)
@@ -2189,20 +2189,20 @@ Type SPC or `y' to %s one file, DEL or `n' to skip to next,
2189 2189
2190(defun dired-rename-non-directory (basename-constructor operation arg) 2190(defun dired-rename-non-directory (basename-constructor operation arg)
2191 (dired-create-files-non-directory 2191 (dired-create-files-non-directory
2192 (function dired-rename-file) 2192 #'dired-rename-file
2193 basename-constructor operation arg)) 2193 basename-constructor operation arg))
2194 2194
2195;;;###autoload 2195;;;###autoload
2196(defun dired-upcase (&optional arg) 2196(defun dired-upcase (&optional arg)
2197 "Rename all marked (or next ARG) files to upper case." 2197 "Rename all marked (or next ARG) files to upper case."
2198 (interactive "P") 2198 (interactive "P")
2199 (dired-rename-non-directory (function upcase) "Rename upcase" arg)) 2199 (dired-rename-non-directory #'upcase "Rename upcase" arg))
2200 2200
2201;;;###autoload 2201;;;###autoload
2202(defun dired-downcase (&optional arg) 2202(defun dired-downcase (&optional arg)
2203 "Rename all marked (or next ARG) files to lower case." 2203 "Rename all marked (or next ARG) files to lower case."
2204 (interactive "P") 2204 (interactive "P")
2205 (dired-rename-non-directory (function downcase) "Rename downcase" arg)) 2205 (dired-rename-non-directory #'downcase "Rename downcase" arg))
2206 2206
2207;;;###end dired-re.el 2207;;;###end dired-re.el
2208 2208
diff --git a/lisp/dired.el b/lisp/dired.el
index 5a4e95d5f3b..0c1f3e4af64 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1994,8 +1994,8 @@ Keybindings:
1994 ;; Ignore dired-hide-details-* value of invisible text property by default. 1994 ;; Ignore dired-hide-details-* value of invisible text property by default.
1995 (when (eq buffer-invisibility-spec t) 1995 (when (eq buffer-invisibility-spec t)
1996 (setq buffer-invisibility-spec (list t))) 1996 (setq buffer-invisibility-spec (list t)))
1997 (setq-local revert-buffer-function (function dired-revert)) 1997 (setq-local revert-buffer-function #'dired-revert)
1998 (setq-local buffer-stale-function (function dired-buffer-stale-p)) 1998 (setq-local buffer-stale-function #'dired-buffer-stale-p)
1999 (setq-local page-delimiter "\n\n") 1999 (setq-local page-delimiter "\n\n")
2000 (setq-local dired-directory (or dirname default-directory)) 2000 (setq-local dired-directory (or dirname default-directory))
2001 ;; list-buffers uses this to display the dir being edited in this buffer. 2001 ;; list-buffers uses this to display the dir being edited in this buffer.
@@ -2468,7 +2468,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
2468 (interactive "P") 2468 (interactive "P")
2469 (let ((string 2469 (let ((string
2470 (or (dired-get-subdir) 2470 (or (dired-get-subdir)
2471 (mapconcat (function identity) 2471 (mapconcat #'identity
2472 (if arg 2472 (if arg
2473 (cond ((zerop (prefix-numeric-value arg)) 2473 (cond ((zerop (prefix-numeric-value arg))
2474 (dired-get-marked-files)) 2474 (dired-get-marked-files))
@@ -2970,12 +2970,12 @@ non-empty directories is allowed."
2970 ;; lines still to be changed, so the (point) values in L stay valid. 2970 ;; lines still to be changed, so the (point) values in L stay valid.
2971 ;; Also, for subdirs in natural order, a subdir's files are deleted 2971 ;; Also, for subdirs in natural order, a subdir's files are deleted
2972 ;; before the subdir itself - the other way around would not work. 2972 ;; before the subdir itself - the other way around would not work.
2973 (let* ((files (mapcar (function car) l)) 2973 (let* ((files (mapcar #'car l))
2974 (count (length l)) 2974 (count (length l))
2975 (succ 0) 2975 (succ 0)
2976 (trashing (and trash delete-by-moving-to-trash))) 2976 (trashing (and trash delete-by-moving-to-trash)))
2977 ;; canonicalize file list for pop up 2977 ;; canonicalize file list for pop up
2978 (setq files (nreverse (mapcar (function dired-make-relative) files))) 2978 (setq files (nreverse (mapcar #'dired-make-relative files)))
2979 (if (dired-mark-pop-up 2979 (if (dired-mark-pop-up
2980 " *Deletions*" 'delete files dired-deletion-confirmer 2980 " *Deletions*" 'delete files dired-deletion-confirmer
2981 (format "%s %s " 2981 (format "%s %s "
@@ -2998,7 +2998,7 @@ non-empty directories is allowed."
2998 (progress-reporter-update progress-reporter succ) 2998 (progress-reporter-update progress-reporter succ)
2999 (dired-fun-in-all-buffers 2999 (dired-fun-in-all-buffers
3000 (file-name-directory fn) (file-name-nondirectory fn) 3000 (file-name-directory fn) (file-name-nondirectory fn)
3001 (function dired-delete-entry) fn)) 3001 #'dired-delete-entry fn))
3002 (error ;; catch errors from failed deletions 3002 (error ;; catch errors from failed deletions
3003 (dired-log "%s\n" err) 3003 (dired-log "%s\n" err)
3004 (setq failures (cons (car (car l)) failures))))) 3004 (setq failures (cons (car (car l)) failures)))))