(if (and (/= (current-column) 0) (not (eobp)))
(forward-char 1))
(if (not (eobp))
- (if (and (save-match-data (looking-at "\n"))
+ (if (and (= (following-char) ?\n)
(or (save-excursion
(or (not (allout-next-heading))
(= depth allout-recent-depth)))
(setq got nil
done t)
(goto-char (setq got (match-beginning 0)))
- (if (save-match-data (looking-at "\n"))
- (forward-char 1))
+ (when (= (following-char) ?\n) (forward-char 1))
(setq got (point)))
(cond ((not got)
Does not affect the kill ring."
(let ((eol (line-end-position)))
(delete-region (point) eol)
- (if (and newline-too (looking-at "\n"))
- (delete-char 1))))
+ (when (and newline-too (= (following-char) ?\n))
+ (delete-char 1))))
;; Defvars to avoid compilation warnings:
(if (bolp)
(princ " "))
(princ ")")
- (unless (looking-at-p "\n")
+ (when (/= (following-char) ?\n)
(princ "\n")))))
(defun custom-save-faces ()
(if (bolp)
(princ " "))
(princ ")")
- (unless (looking-at-p "\n")
+ (when (/= (following-char) ?\n)
(princ "\n")))))
\f
;;; The Customize Menu.
(if (bolp)
(princ " "))
(princ ")")
- (unless (looking-at "\n")
+ (when (/= (following-char) ?\n)
(princ "\n")))))
(defun custom-theme-write-faces (theme faces)
(princ ")")))))
(if (bolp) (princ " "))
(princ ")")
- (unless (looking-at "\n")
+ (when (/= (following-char) ?\n)
(princ "\n")))))
\f
(setq output-start (autoload--setup-output
otherbuf outbuf absfile load-name)))
(autoload--print-cookie-text output-start load-name file))
- ((looking-at ";")
+ ((= (following-char) ?\;)
;; Don't read the comment.
(forward-line 1))
(t
;; Compile the forms from the input buffer.
(while (progn
(while (progn (skip-chars-forward " \t\n\^l")
- (looking-at ";"))
+ (= (following-char) ?\;))
(forward-line 1))
(not (eobp)))
(setq byte-compile-read-position (point)
(checkdoc-overlay-put cdo 'face 'highlight)
;; Make sure the whole doc string is visible if possible.
(sit-for 0)
- (if (and (looking-at "\"")
+ (if (and (= (following-char) ?\")
(not (pos-visible-in-window-p
(save-excursion (forward-sexp 1) (point))
(selected-window))))
(while (checkdoc-next-docstring)
(message "Searching for doc string spell error...%d%%"
(floor (* 100.0 (point)) (point-max)))
- (if (looking-at "\"")
- (checkdoc-ispell-docstring-engine
- (save-excursion (forward-sexp 1) (point-marker)))))
+ (when (= (following-char) ?\")
+ (checkdoc-ispell-docstring-engine
+ (save-excursion (forward-sexp 1) (point-marker)))))
(message "Checkdoc: Done."))))
(defun checkdoc-message-interactive-ispell-loop (start-here)
(while (checkdoc-message-text-next-string (point-max))
(message "Searching for message string spell error...%d%%"
(floor (* 100.0 (point)) (point-max)))
- (if (looking-at "\"")
+ (if (= (following-char) ?\")
(checkdoc-ispell-docstring-engine
(save-excursion (forward-sexp 1) (point-marker)))))
(message "Checkdoc: Done."))))
"All variables and subroutines might as well have a \
documentation string")
(point) (+ (point) 1) t)))))
- (if (and (not err) (looking-at "\""))
+ (if (and (not err) (= (following-char) ?\"))
(with-syntax-table checkdoc-syntax-table
(checkdoc-this-string-valid-engine fp))
err)))
;; we won't accidentally lose our place. This could cause
;; end-of doc string whitespace to also delete the " char.
(s (point))
- (e (if (looking-at "\"")
+ (e (if (= (following-char) ?\")
(save-excursion (forward-sexp 1) (point-marker))
(point))))
(or
((looking-at "[\\!?;:.)]")
;; These are ok
nil)
- ((and checkdoc-permit-comma-termination-flag (looking-at ","))
+ ((and checkdoc-permit-comma-termination-flag (= (following-char) ?,))
nil)
(t
;; If it is not a complete sentence, let's see if we can
(let ((elint-current-pos (point)))
;; non-list check could be here too. errors may be out of seq.
;; quoted check cannot be elsewhere, since quotes skipped.
- (if (looking-back "'" (1- (point)))
+ (if (= (preceding-char) ?\')
;; Eg cust-print.el uses ' as a comment syntax.
(elint-warning "Skipping quoted form `%c%.20s...'" ?\'
(read (current-buffer)))
(interactive)
(if viper-cted
(let ((p (point)) (c (current-column)) bol (indent t))
- (if (looking-back "[0^]" (1- (point)))
+ (if (memq (preceding-char) '(?0 ?^))
(progn
(if (eq ?^ (preceding-char))
(setq viper-preserve-indent t))
(interactive)
(let ((inhibit-read-only t))
(delete-char 1)
- (if (looking-at " ")
- (delete-char 1))))
+ (when (= (following-char) ?\s)
+ (delete-char 1))))
;;;###autoload
(defun image-dired-display-thumbs-append ()
;; whether the trailing whitespace is highlighted. But, it's
;; OK to just do this unconditionally.
(skip-chars-forward " \t")))
- (kill-region opoint (if (and kill-whole-line (looking-at "\n"))
+ (kill-region opoint (if (and kill-whole-line (= (following-char) ?\n))
(1+ (point))
(point)))))