diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2013-08-10 17:17:29 +0200 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2013-08-10 17:17:29 +0200 |
commit | 45fdb48240996f7ad9c8c03f438ecf7f5b925d8e (patch) | |
tree | 63d1b157c6391428d8641dd4bf25cceab50e7e84 /lisp/dired-aux.el | |
parent | c880af52a62dda0900b8737b9e592700466e45ec (diff) | |
download | emacs-45fdb48240996f7ad9c8c03f438ecf7f5b925d8e.tar.gz |
lisp/*.el: Remove lexical-binding warnings; additional small cleanups.
* calculator.el (calculator): Mark unused argument.
(calculator-paste, calculator-quit, calculator-integer-p):
Use ignore-errors.
(calculator-string-to-number, calculator-decimal, calculator-exp)
(calculator-op-or-exp): Use string-match-p.
* dired-aux.el (dired-compress): Use ignore-errors.
(dired-do-chxxx, dired-do-chmod, dired-trample-file-versions)
(dired-do-async-shell-command, dired-do-shell-command)
(dired-shell-stuff-it, dired-compress-file, dired-insert-subdir)
(dired-insert-subdir-validate): Use string-match-p.
(dired-map-dired-file-lines, dired-subdir-hidden-p): Use looking-at-p.
(dired-add-entry): Use string-match-p, looking-at-p.
(dired-insert-subdir-newpos): Remove unused local variable.
* dired.el (dired-buffer-more-recently-used-p): Declare.
(dired-insert-set-properties, dired-insert-old-subdirs):
Use ignore-errors.
* filenotify.el (file-notify-callback): Remove unused local variable.
* filesets.el (filesets-error): Mark unused argument.
(filesets-which-command-p, filesets-filter-dir-names)
(filesets-directory-files, filesets-get-external-viewer)
(filesets-ingroup-get-data): Use string-match-p.
* find-file.el (ff-other-file-name, ff-other-file-name)
(ff-find-the-other-file, ff-cc-hh-converter):
Remove unused local variables.
(ff-get-file-name): Use string-match-p.
(ff-all-dirs-under): Use ignore-errors.
* follow.el (follow-comint-scroll-to-bottom): Mark unused argument.
(follow-select-if-visible): Remove unused local variable.
* forms.el (read-file-filter): Move declaration.
(forms--make-format, forms--make-parser, forms-insert-record):
Quote function with #'.
(forms--update): Use string-match-p. Quote function with #'.
* help-mode.el (help-dir-local-var-def): Mark unused argument.
(help-make-xrefs): Use looking-at-p.
(help-xref-on-pp): Use looking-at-p, ignore-errors.
* ibuffer.el (ibuffer-ext-visible-p): Declare.
(ibuffer-confirm-operation-on): Use string-match-p.
* msb.el (msb-item-handler, msb-dired-item-handler):
Mark unused arguments.
* ses.el (ses-decode-cell-symbol)
(ses-kill-override): Remove unused local variable.
(ses-create-cell-variable, ses-relocate-formula): Use string-match-p.
(ses-load): Use ignore-errors, looking-at-p.
(ses-jump-safe): Use ignore-errors.
(ses-export-tsv, ses-export-tsf, ses-unsafe): Mark unused arguments.
* tabify.el (untabify, tabify): Mark unused arguments.
* thingatpt.el (thing-at-point--bounds-of-well-formed-url):
Mark unused argument.
(bounds-of-thing-at-point, thing-at-point-bounds-of-list-at-point)
(thing-at-point-newsgroup-p, form-at-point): Use ignore-errors.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r-- | lisp/dired-aux.el | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index c12ac068689..31d0495175a 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -286,7 +286,7 @@ List has a form of (file-name full-file-name (attribute-list))." (if (eq op-symbol 'touch) (list "-t" new-attribute) (list new-attribute))) - (if (string-match "gnu" system-configuration) + (if (string-match-p "gnu" system-configuration) '("--") nil)) files)) (dired-do-redisplay arg);; moves point if ARG is an integer @@ -327,7 +327,7 @@ into the minibuffer." ;; We used to treat empty input as DEFAULT, but that is not ;; such a good idea (Bug#9361). (error "No file mode specified")) - ((string-match "^[0-7]+" modes) + ((string-match-p "^[0-7]+" modes) (setq num-modes (string-to-number modes 8)))) (dolist (file files) @@ -500,7 +500,7 @@ with a prefix argument." (goto-char (point-min)) (while (not (eobp)) (save-excursion - (and (not (looking-at dired-re-dir)) + (and (not (looking-at-p dired-re-dir)) (not (eolp)) (setq file (dired-get-filename nil t)) ; nil on non-file (progn (end-of-line) @@ -530,7 +530,7 @@ with a prefix argument." dired-file-version-alist))))))) (defun dired-trample-file-versions (fn) - (let* ((start-vn (string-match "\\.~[0-9]+~$" fn)) + (let* ((start-vn (string-match-p "\\.~[0-9]+~$" fn)) base-version-list) (and start-vn (setq base-version-list ; there was a base version to which @@ -602,7 +602,7 @@ The output appears in the buffer `*Async Shell Command*'." (dired-read-shell-command "& on %s: " current-prefix-arg files) current-prefix-arg files))) - (unless (string-match "&[ \t]*\\'" command) + (unless (string-match-p "&[ \t]*\\'" command) (setq command (concat command " &"))) (dired-do-shell-command command arg file-list)) @@ -663,10 +663,10 @@ can be produced by `dired-get-marked-files', for example." (dired-read-shell-command "! on %s: " current-prefix-arg files) current-prefix-arg files))) - (let* ((on-each (not (string-match dired-star-subst-regexp command))) - (no-subst (not (string-match dired-quark-subst-regexp command))) - (star (string-match "\\*" command)) - (qmark (string-match "\\?" command))) + (let* ((on-each (not (string-match-p dired-star-subst-regexp command))) + (no-subst (not (string-match-p dired-quark-subst-regexp command))) + (star (string-match-p "\\*" command)) + (qmark (string-match-p "\\?" command))) ;; Get confirmation for wildcards that may have been meant ;; to control substitution of a file name or the file name list. (if (cond ((not (or on-each no-subst)) @@ -713,8 +713,8 @@ can be produced by `dired-get-marked-files', for example." (substring command 0 (match-beginning 0)) command)) (stuff-it - (if (or (string-match dired-star-subst-regexp command) - (string-match dired-quark-subst-regexp command)) + (if (or (string-match-p dired-star-subst-regexp command) + (string-match-p dired-quark-subst-regexp command)) (lambda (x) (let ((retval command)) (while (string-match @@ -840,9 +840,7 @@ command with a prefix argument (the value does not matter)." (if new-file (let ((start (point))) ;; Remove any preexisting entry for the name NEW-FILE. - (condition-case nil - (dired-remove-entry new-file) - (error nil)) + (ignore-errors (dired-remove-entry new-file)) (goto-char start) ;; Now replace the current line with an entry for NEW-FILE. (dired-update-file-line new-file) nil) @@ -883,7 +881,7 @@ Otherwise, the rule is a compression rule, and compression is done with gzip.") ;; See if any suffix rule matches this file name. (while suffixes (let (case-fold-search) - (if (string-match (car (car suffixes)) file) + (if (string-match-p (car (car suffixes)) file) (setq suffix (car suffixes) suffixes nil)) (setq suffixes (cdr suffixes)))) ;; If so, compute desired new name. @@ -1143,16 +1141,16 @@ files matching `dired-omit-regexp'." ;; Avoid calling ls for files that are going to be omitted anyway. (let ((omit-re (dired-omit-regexp))) (or (string= omit-re "") - (not (string-match omit-re - (cond - ((eq 'no-dir dired-omit-localp) - filename) - ((eq t dired-omit-localp) - (dired-make-relative filename)) - (t - (dired-make-absolute - filename - (file-name-directory filename))))))))) + (not (string-match-p omit-re + (cond + ((eq 'no-dir dired-omit-localp) + filename) + ((eq t dired-omit-localp) + (dired-make-relative filename)) + (t + (dired-make-absolute + filename + (file-name-directory filename))))))))) ;; Do it! (progn (setq filename (directory-file-name filename)) @@ -1180,7 +1178,7 @@ files matching `dired-omit-regexp'." ;; else try to find correct place to insert (if (dired-goto-subdir directory) (progn ;; unhide if necessary - (if (looking-at "\r") + (if (looking-at-p "\r") ;; Point is at end of subdir line. (dired-unhide-subdir)) ;; found - skip subdir and `total' line @@ -2090,7 +2088,7 @@ This function takes some pains to conform to `ls -lR' output." (and (not switches) cons (setq switches (cdr cons))) (dired-insert-subdir-validate dirname switches) ;; case-fold-search is nil now, so we can test for capital `R': - (if (setq switches-have-R (and switches (string-match "R" switches))) + (if (setq switches-have-R (and switches (string-match-p "R" switches))) ;; avoid duplicated subdirs (setq mark-alist (dired-kill-tree dirname t))) (if elt @@ -2128,8 +2126,8 @@ This function takes some pains to conform to `ls -lR' output." (mapcar (function (lambda (x) - (or (eq (null (string-match x real-switches)) - (null (string-match x dired-actual-switches))) + (or (eq (null (string-match-p x real-switches)) + (null (string-match-p x dired-actual-switches))) (error "Can't have dirs with and without -%s switches together" x)))) ;; all switches that make a difference to dired-get-filename: @@ -2170,7 +2168,7 @@ of marked files. If KILL-ROOT is non-nil, kill DIRNAME as well." (defun dired-insert-subdir-newpos (new-dir) ;; Find pos for new subdir, according to tree order. ;;(goto-char (point-max)) - (let ((alist dired-subdir-alist) elt dir pos new-pos) + (let ((alist dired-subdir-alist) elt dir new-pos) (while alist (setq elt (car alist) alist (cdr alist) @@ -2421,7 +2419,7 @@ Lower levels are unaffected." (and selective-display (save-excursion (dired-goto-subdir dir) - (looking-at "\r")))) + (looking-at-p "\r")))) ;;;###autoload (defun dired-hide-subdir (arg) |