Commit 45fdb482 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

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.
parent c880af52
2013-08-10 Juanma Barranquero <lekktu@gmail.com>
* 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.el (dired-buffer-more-recently-used-p): Declare.
(dired-insert-set-properties, dired-insert-old-subdirs):
Use ignore-errors.
* 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.
* 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.
* emacs-lisp/timer.el (timer--time): Define setter with
gv-define-setter to avoid deprecation warning.
......
......@@ -708,7 +708,7 @@ See the documentation for `calculator-mode' for more information."
;; can't use 'noprompt, bug in electric.el
(lambda () 'noprompt)
nil
(lambda (x y) (calculator-update-display))))
(lambda (_x _y) (calculator-update-display))))
(and calculator-buffer
(catch 'calculator-done (calculator-quit)))
(use-local-map old-l-map)
......@@ -905,9 +905,9 @@ The string is set not to exceed the screen width."
value)
(car (read-from-string
(cond ((equal "." str) "0.0")
((string-match "[eE][+-]?$" str) (concat str "0"))
((string-match "\\.[0-9]\\|[eE]" str) str)
((string-match "\\." str)
((string-match-p "[eE][+-]?$" str) (concat str "0"))
((string-match-p "\\.[0-9]\\|[eE]" str) str)
((string-match-p "\\." str)
;; do this because Emacs reads "23." as an integer
(concat str "0"))
((stringp str) (concat str ".0"))
......@@ -1366,7 +1366,7 @@ OP is the operator (if any) that caused this call."
(or calculator-display-fragile
(not (numberp (car calculator-stack))))
(not (and calculator-curnum
(string-match "[.eE]" calculator-curnum))))
(string-match-p "[.eE]" calculator-curnum))))
;; enter the period on the same condition as a digit, only if no
;; period or exponent entered yet
(progn
......@@ -1382,7 +1382,7 @@ OP is the operator (if any) that caused this call."
(if (and (or calculator-display-fragile
(not (numberp (car calculator-stack))))
(not (and calculator-curnum
(string-match "[eE]" calculator-curnum))))
(string-match-p "[eE]" calculator-curnum))))
;; same condition as above, also no E so far
(progn
(calculator-clear-fragile)
......@@ -1452,7 +1452,7 @@ no need for negative numbers since these are handled by unary operators)."
(interactive)
(if (and (not calculator-display-fragile)
calculator-curnum
(string-match "[eE]$" calculator-curnum))
(string-match-p "[eE]$" calculator-curnum))
(calculator-digit)
(calculator-op)))
......@@ -1661,8 +1661,7 @@ Used by `calculator-paste' and `get-register'."
(setq str (concat (or (match-string 1 str) "0")
(or (match-string 2 str) ".0")
(or (match-string 3 str) ""))))
(condition-case nil (calculator-string-to-number str)
(error nil)))))
(ignore-errors (calculator-string-to-number str)))))
(defun calculator-get-register (reg)
"Get a value from a register REG."
......@@ -1728,13 +1727,11 @@ Used by `calculator-paste' and `get-register'."
(interactive)
(set-buffer calculator-buffer)
(let ((inhibit-read-only t)) (erase-buffer))
(if (not calculator-electric-mode)
(progn
(condition-case nil
(while (get-buffer-window calculator-buffer)
(delete-window (get-buffer-window calculator-buffer)))
(error nil))
(kill-buffer calculator-buffer)))
(unless calculator-electric-mode
(ignore-errors
(while (get-buffer-window calculator-buffer)
(delete-window (get-buffer-window calculator-buffer))))
(kill-buffer calculator-buffer))
(setq calculator-buffer nil)
(message "Calculator done.")
(if calculator-electric-mode (throw 'calculator-done nil)))
......@@ -1768,14 +1765,11 @@ To use this, apply a binary operator (evaluate it), then call this."
(defun calculator-integer-p (x)
"Non-nil if X is equal to an integer."
(condition-case nil
(= x (ftruncate x))
(error nil)))
(ignore-errors (= x (ftruncate x))))
(defun calculator-expt (x y)
"Compute X^Y, dealing with errors appropriately."
(condition-case
nil
(condition-case nil
(expt x y)
(domain-error 0.0e+NaN)
(range-error
......
......@@ -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)
......
......@@ -34,6 +34,9 @@
;;; Code:
(declare-function dired-buffer-more-recently-used-p
"dired-x" (buffer1 buffer2))
;;; Customizable variables
(defgroup dired nil
......@@ -1242,26 +1245,25 @@ see `dired-use-ls-dired' for more details.")
(save-excursion
(goto-char beg)
(while (< (point) end)
(condition-case nil
(if (not (dired-move-to-filename))
(put-text-property (line-beginning-position)
(1+ (line-end-position))
'invisible 'dired-hide-details-information)
(put-text-property (+ (line-beginning-position) 1) (1- (point))
'invisible 'dired-hide-details-detail)
(add-text-properties
(point)
(progn
(dired-move-to-end-of-filename)
(point))
'(mouse-face
highlight
dired-filename t
help-echo "mouse-2: visit this file in other window"))
(when (< (+ (point) 4) (line-end-position))
(put-text-property (+ (point) 4) (line-end-position)
'invisible 'dired-hide-details-link)))
(error nil))
(ignore-errors
(if (not (dired-move-to-filename))
(put-text-property (line-beginning-position)
(1+ (line-end-position))
'invisible 'dired-hide-details-information)
(put-text-property (+ (line-beginning-position) 1) (1- (point))
'invisible 'dired-hide-details-detail)
(add-text-properties
(point)
(progn
(dired-move-to-end-of-filename)
(point))
'(mouse-face
highlight
dired-filename t
help-echo "mouse-2: visit this file in other window"))
(when (< (+ (point) 4) (line-end-position))
(put-text-property (+ (point) 4) (line-end-position)
'invisible 'dired-hide-details-link))))
(forward-line 1))))
;; Reverting a dired buffer
......@@ -1401,11 +1403,9 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
(setq elt (car old-subdir-alist)
old-subdir-alist (cdr old-subdir-alist)
dir (car elt))
(condition-case ()
(progn
(dired-uncache dir)
(dired-insert-subdir dir))
(error nil))))))
(ignore-errors
(dired-uncache dir)
(dired-insert-subdir dir))))))
(defun dired-uncache (dir)
"Remove directory DIR from any directory cache."
......@@ -3849,7 +3849,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
;;; Start of automatically extracted autoloads.
;;;### (autoloads nil "dired-aux" "dired-aux.el" "555c067fcab27f5a377536db407803ab")
;;;### (autoloads nil "dired-aux" "dired-aux.el" "04b4cb6bde3220f55574eb1d99ac0d29")
;;; Generated autoloads from dired-aux.el
(autoload 'dired-diff "dired-aux" "\
......
......@@ -92,7 +92,7 @@ car of that event, which is the symbol `file-notify'."
(pending-event (assoc desc file-notify--pending-events))
(actions (nth 1 event))
(file (file-notify--event-file-name event))
file1 cookie callback)
file1 callback)
;; Make actions a list.
(unless (consp actions) (setq actions (cons actions nil)))
......
......@@ -214,8 +214,8 @@ key is supported."
(defun filesets-which-command-p (cmd)
"Call \"which CMD\" and return non-nil if the command was found."
(when (string-match (format "\\(/[^/]+\\)?/%s" cmd)
(filesets-which-command cmd))
(when (string-match-p (format "\\(/[^/]+\\)?/%s" cmd)
(filesets-which-command cmd))
cmd))
(defun filesets-message (level &rest args)
......@@ -1082,7 +1082,7 @@ defined in `filesets-ingroup-patterns'."
(require 'easymenu)
(defun filesets-error (class &rest args)
(defun filesets-error (_class &rest args)
"`error' wrapper."
(error "%s" (mapconcat 'identity args " ")))
......@@ -1093,10 +1093,10 @@ defined in `filesets-ingroup-patterns'."
If NEGATIVE is non-nil, remove all directory names."
(filesets-filter-list lst
(lambda (x)
(and (not (string-match "^\\.+/$" x))
(and (not (string-match-p "^\\.+/$" x))
(if negative
(not (string-match "[:/\\]$" x))
(string-match "[:/\\]$" x))))))
(not (string-match-p "[:/\\]$" x))
(string-match-p "[:/\\]$" x))))))
(defun filesets-conditional-sort (lst &optional access-fn)
"Return a sorted copy of LST, LST being a list of strings.
......@@ -1130,18 +1130,18 @@ Return full path if FULL-FLAG is non-nil."
(dirs nil))
(dolist (this (file-name-all-completions "" dir))
(cond
((string-match "^\\.+/$" this)
((string-match-p "^\\.+/$" this)
nil)
((string-match "[:/\\]$" this)
((string-match-p "[:/\\]$" this)
(when (or (not match-dirs-flag)
(not pattern)
(string-match pattern this))
(string-match-p pattern this))
(filesets-message 5 "Filesets: matched dir %S with pattern %S"
this pattern)
(setq dirs (cons this dirs))))
(t
(when (or (not pattern)
(string-match pattern this))
(string-match-p pattern this))
(filesets-message 5 "Filesets: matched file %S with pattern %S"
this pattern)
(setq files (cons (if full-flag
......@@ -1249,7 +1249,7 @@ Return full path if FULL-FLAG is non-nil."
(let ((filename (file-name-nondirectory file)))
(filesets-some
(lambda (entry)
(when (and (string-match (nth 0 entry) filename)
(when (and (string-match-p (nth 0 entry) filename)
(filesets-eviewer-constraint-p entry))
entry))
filesets-external-viewers)))
......@@ -2004,7 +2004,7 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings."
(fn (or fun (lambda (a b)
(and (stringp a)
(stringp b)
(string-match a b))))))
(string-match-p a b))))))
(filesets-some (lambda (x)
(if (funcall fn (car x) masterfile)
(nth pos x)
......
......@@ -528,11 +528,9 @@ the `ff-ignore-include' variable."
stub ;; name of the file without extension
alist ;; working copy of the list of file extensions
pathname ;; the pathname of the file or the #include line
default-name ;; file we should create if none found
format ;; what we have to match
found ;; name of the file or buffer found - nil if none
dirs ;; local value of ff-search-directories
no-match) ;; whether we know about this kind of file
dirs) ;; local value of ff-search-directories
(message "Working...")
......@@ -545,7 +543,6 @@ the `ff-ignore-include' variable."
(cond
((and (not ff-ignore-include) fname)
(setq default-name fname)
(setq found (ff-get-file-name dirs fname nil)))
;; let's just get the corresponding file
......@@ -558,7 +555,6 @@ the `ff-ignore-include' variable."
"/none.none"))
(setq fname (file-name-nondirectory pathname)
no-match nil
match (car alist))
;; find the table entry corresponding to this file
......@@ -569,8 +565,7 @@ the `ff-ignore-include' variable."
(setq pos (ff-string-match (car match) fname)))
;; no point going on if we haven't found anything
(if (not match)
(setq no-match t)
(when match
;; otherwise, suffixes contains what we need
(setq suffixes (car (cdr match))
......@@ -583,8 +578,7 @@ the `ff-ignore-include' variable."
(progn
(setq suffixes (funcall action (buffer-file-name))
match (cons (car match) (list suffixes))
stub nil
default-name (car suffixes)))
stub nil))
;; otherwise build our filename stub
(cond
......@@ -599,11 +593,7 @@ the `ff-ignore-include' variable."
(setq format (concat "\\(.+\\)" (car match)))
(string-match format fname)
(setq stub (substring fname (match-beginning 1) (match-end 1)))
))
;; if we find nothing, we should try to get a file like this one
(setq default-name
(concat stub (car (car (cdr match))))))
)))
;; do the real work - find the file
(setq found
......@@ -671,7 +661,7 @@ name of the first file found."
(setq buf (buffer-name (car blist)))
(while (and blist (not found))
(if (string-match (concat filename "<[0-9]+>") buf)
(if (string-match-p (concat filename "<[0-9]+>") buf)
(setq found (buffer-file-name (car blist))))
(setq blist (cdr blist))
......@@ -797,20 +787,18 @@ See variable `ff-special-constructs'."
"Get all the directory files under directory HERE.
Exclude all files in the optional EXCLUDE list."
(if (file-directory-p here)
(condition-case nil
(progn
(let ((files (directory-files here t))
(dirlist (list))
file)
(while files
(setq file (car files))
(if (and
(file-directory-p file)
(not (member (ff-basename file) exclude)))
(setq dirlist (cons file dirlist)))
(setq files (cdr files)))
(setq dirlist (reverse dirlist))))
(error nil))
(ignore-errors
(let ((files (directory-files here t))
(dirlist (list))
file)
(while files
(setq file (car files))
(if (and
(file-directory-p file)
(not (member (ff-basename file) exclude)))
(setq dirlist (cons file dirlist)))
(setq files (cdr files)))
(setq dirlist (reverse dirlist))))
nil))
(defun ff-switch-file (f1 f2 file &optional in-other-window new-file)
......@@ -892,9 +880,7 @@ Given START and/or END, checks between these characters."
Build up a new file list based possibly on part of the directory name
and the name of the file passed in."
(ff-string-match "\\(.*\\)/\\([^/]+\\)/\\([^.]+\\).\\([^/]+\\)$" arg)
(let ((path (if (match-beginning 1)
(substring arg (match-beginning 1) (match-end 1)) nil))
(dire (if (match-beginning 2)
(let ((dire (if (match-beginning 2)
(substring arg (match-beginning 2) (match-end 2)) nil))
(file (if (match-beginning 3)
(substring arg (match-beginning 3) (match-end 3)) nil))
......
......@@ -515,7 +515,7 @@ Works like `scroll-up' when not in Follow mode."
(declare-function comint-adjust-point "comint" (window))
(defvar comint-scroll-show-maximum-output)
(defun follow-comint-scroll-to-bottom (&optional window)
(defun follow-comint-scroll-to-bottom (&optional _window)
"Scroll the bottom-most window in the current Follow chain.
This is to be called by `comint-postoutput-scroll-to-bottom'."
(let* ((buffer (current-buffer))
......@@ -883,15 +883,14 @@ returned by `follow-windows-start-end'."
(defun follow-select-if-visible (dest win-start-end)
"Select and return a window, if DEST is visible in it.
Return the selected window."
(let (win win-end wse)
(let (win wse)
(while (and (not win) win-start-end)
;; Don't select a window that was just moved. This makes it
;; possible to later select the last window after a
;; `end-of-buffer' command.
(setq wse (car win-start-end))
(when (follow-pos-visible dest (car wse) win-start-end)
(setq win (car wse)
win-end (nth 2 wse))
(setq win (car wse))
(select-window win))
(setq win-start-end (cdr win-start-end)))
win))
......
......@@ -439,6 +439,8 @@ Also, initial position is at last record."
(defvar forms--rw-face nil
"Face used to represent read-write data on the screen.")