From 91478f46238ab5a0f5fb7e6e6b4b1da0163c596e Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Sun, 12 Feb 2017 09:46:03 -0500 Subject: Nix some useless uses of looking-at, looking-back * lisp/allout.el (allout-kill-topic): (allout-next-topic-pending-encryption): * lisp/bookmark.el (bookmark-kill-line): * lisp/cus-edit.el (custom-save-variables, custom-save-faces): * lisp/cus-theme.el (custom-theme-write-variables): (custom-theme-write-faces): * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads): * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): * lisp/emacs-lisp/checkdoc.el (checkdoc-interactive-loop): (checkdoc-interactive-ispell-loop): (checkdoc-message-interactive-ispell-loop, checkdoc-this-string-valid): (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emulation/viper-cmd.el (viper-backward-indent): * lisp/image-dired.el (image-dired-delete-char): * lisp/simple.el (kill-visual-line): Replace instances of looking-at, looking-back with char comparisons using following-char, preceding-char. --- lisp/allout.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lisp/allout.el') diff --git a/lisp/allout.el b/lisp/allout.el index 4a0aeeedf6a..e837f83ed38 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -4462,7 +4462,7 @@ Topic exposure is marked with text-properties, to be used by (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))) @@ -6278,8 +6278,7 @@ It must also have content." (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) -- cgit v1.2.1