1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

Convert more uses of looking-at to following-char

More followup to Karl Fogel's commit a84da83c1.
* lisp/dired-aux.el (dired-add-entry, dired-subdir-hidden-p):
* lisp/dired-x.el (dired-mark-unmarked-files, dired-mark-sexp):
* lisp/help-fns.el (doc-file-to-man, doc-file-to-info):
* lisp/proced.el (proced-toggle-marks):
* lisp/progmodes/f90.el (f90-indent-line):
* lisp/ses.el (ses-load):
* lisp/tar-mode.el (tar-expunge): Replace instances of looking-at with
char comparisons using following-char.
This commit is contained in:
Mark Oteiza 2017-07-06 23:53:19 -04:00
parent 1eefada3f2
commit 51275358e9
7 changed files with 13 additions and 13 deletions

View file

@ -1399,7 +1399,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-p "\r")
(if (= (following-char) ?\r)
;; Point is at end of subdir line.
(dired-unhide-subdir))
;; found - skip subdir and `total' line
@ -2639,7 +2639,7 @@ Lower levels are unaffected."
(and selective-display
(save-excursion
(dired-goto-subdir dir)
(looking-at-p "\r"))))
(= (following-char) ?\r))))
;;;###autoload
(defun dired-hide-subdir (arg)

View file

@ -634,7 +634,7 @@ Optional fifth argument CASE-FOLD-P specifies the value of
(dired-mark-if
(and
;; not already marked
(looking-at-p " ")
(= (following-char) ?\s)
;; uninteresting
(let ((fn (dired-get-filename localp t))
;; Match patterns case-insensitively on case-insensitive
@ -1530,7 +1530,7 @@ refer at all to the underlying file system. Contrast this with
(setq mode (buffer-substring (point) (+ mode-len (point))))
(forward-char mode-len)
;; Skip any extended attributes marker ("." or "+").
(or (looking-at " ")
(or (= (following-char) ?\s)
(forward-char 1))
(setq nlink (read (current-buffer)))
;; Karsten Wenger <kw@cis.uni-muenchen.de> fixed uid.

View file

@ -1271,14 +1271,14 @@ BUFFER should be a buffer or a buffer name."
(insert-file-contents file)
(let (notfirst)
(while (search-forward "" nil 'move)
(if (looking-at "S")
(if (= (following-char) ?S)
(delete-region (1- (point)) (line-end-position))
(delete-char -1)
(if notfirst
(insert "\n.DE\n")
(setq notfirst t))
(insert "\n.SH ")
(insert (if (looking-at "F") "Function " "Variable "))
(insert (if (= (following-char) ?F) "Function " "Variable "))
(delete-char 1)
(forward-line 1)
(insert ".DS L\n"))))
@ -1304,7 +1304,7 @@ BUFFER should be a buffer or a buffer name."
(forward-char 1))
(goto-char (point-min))
(while (search-forward "" nil t)
(unless (looking-at "S")
(when (/= (following-char) ?S)
(setq type (char-after)
name (buffer-substring (1+ (point)) (line-end-position))
doc (buffer-substring (line-beginning-position 2)

View file

@ -767,7 +767,7 @@ The time interval for updates is specified via `proced-auto-update-interval'."
(while (not (eobp))
(cond ((looking-at mark-re)
(proced-insert-mark nil))
((looking-at " ")
((= (following-char) ?\s)
(proced-insert-mark t))
(t
(forward-line 1)))))))

View file

@ -1880,8 +1880,8 @@ after indenting."
;; FIXME This means f90-calculate-indent gives different answers
;; for comments and preprocessor lines to this function.
;; Better to make f90-calculate-indent return the correct answer?
(cond ((looking-at "!") (setq indent (f90-comment-indent)))
((looking-at "#") (setq indent 0))
(cond ((= (following-char) ?!) (setq indent (f90-comment-indent)))
((= (following-char) ?#) (setq indent 0))
(t
(and f90-smart-end (looking-at "end")
(f90-match-end))

View file

@ -1880,7 +1880,7 @@ Does not execute cell formulas or print functions."
(setq ses--numlocprn 0)
(dotimes (_ numlocprn)
(let ((x (read (current-buffer))))
(or (and (looking-at-p "\n")
(or (and (= (following-char) ?\n)
(eq (car-safe x) 'ses-local-printer)
(apply #'ses--local-printer (cdr x)))
(error "local printer-def error"))
@ -1890,7 +1890,7 @@ Does not execute cell formulas or print functions."
(dotimes (col ses--numcols)
(let* ((x (read (current-buffer)))
(sym (car-safe (cdr-safe x))))
(or (and (looking-at-p "\n")
(or (and (= (following-char) ?\n)
(eq (car-safe x) 'ses-cell)
(ses-create-cell-variable sym row col))
(error "Cell-def error"))

View file

@ -1118,7 +1118,7 @@ for this to be permanent."
(save-excursion
(goto-char (point-min))
(while (not (eobp))
(if (looking-at "D")
(if (= (following-char) ?D)
(progn (tar-expunge-internal)
(setq n (1+ n)))
(forward-line 1)))