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/cus-edit.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/cus-edit.el') diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 2b86051a726..fac9c77e12a 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4581,7 +4581,7 @@ This function does not save the buffer." (if (bolp) (princ " ")) (princ ")") - (unless (looking-at-p "\n") + (when (/= (following-char) ?\n) (princ "\n"))))) (defun custom-save-faces () @@ -4636,7 +4636,7 @@ This function does not save the buffer." (if (bolp) (princ " ")) (princ ")") - (unless (looking-at-p "\n") + (when (/= (following-char) ?\n) (princ "\n"))))) ;;; The Customize Menu. -- cgit v1.2.1