aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2015-04-20 21:55:00 -0400
committerStefan Monnier2015-04-20 21:55:00 -0400
commitc9a75a4030a556d700fd95222ec0bf4c1a9f67b5 (patch)
tree6983e7d01dabf1995a709f568e59f2499bda1551 /lisp
parente3bfb5191f6144c9ac96772fea9f40c2e988c75b (diff)
downloademacs-c9a75a4030a556d700fd95222ec0bf4c1a9f67b5.tar.gz
emacs-c9a75a4030a556d700fd95222ec0bf4c1a9f67b5.zip
Fix byte-compiler warnings about looking-back.
* lisp/vc/log-view.el (log-view-end-of-defun-1): * lisp/textmodes/tex-mode.el (latex-forward-sexp-1): * lisp/textmodes/reftex-ref.el (reftex-goto-label): * lisp/textmodes/bibtex.el (bibtex-insert-kill): * lisp/progmodes/sh-script.el (sh--maybe-here-document): * lisp/progmodes/ruby-mode.el (ruby-end-of-defun): * lisp/progmodes/ada-mode.el (ada-in-numeric-literal-p): * lisp/org/org.el (org-insert-heading, org-sort-entries): * lisp/org/org-mouse.el (org-mouse-end-headline) (org-mouse-context-menu): * lisp/org/org-clock.el (org-clock-cancel): * lisp/man.el (Man-default-man-entry): * lisp/mail/rmail.el (rmail-get-new-mail, rmail-insert-inbox-text) (rmail-ensure-blank-line): * lisp/mail/footnote.el (Footnote-delete-footnote): * lisp/mail/emacsbug.el (report-emacs-bug): * lisp/info.el (Info-follow-reference, Info-fontify-node): * lisp/info-look.el (info-lookup-guess-custom-symbol): * lisp/help-fns.el (help-fns--key-bindings): * lisp/files.el (hack-local-variables): * lisp/emulation/viper-ex.el (viper-get-ex-token, ex-cmd-complete) (viper-get-ex-pat, ex-expand-filsyms, viper-get-ex-file) (viper-complete-filename-or-exit): * lisp/emulation/viper-cmd.el (viper-backward-indent): * lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/cus-edit.el (custom-face-edit-value-create): * lisp/calendar/todo-mode.el (todo-set-item-priority) (todo-filter-items-1, todo-convert-legacy-files) (todo-prefix-overlays): Add explicit second arg to looking-back.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calendar/todo-mode.el11
-rw-r--r--lisp/cus-edit.el2
-rw-r--r--lisp/emacs-lisp/elint.el2
-rw-r--r--lisp/emacs-lisp/lisp-mnt.el4
-rw-r--r--lisp/emacs-lisp/lisp-mode.el7
-rw-r--r--lisp/emulation/viper-cmd.el4
-rw-r--r--lisp/emulation/viper-ex.el27
-rw-r--r--lisp/files.el2
-rw-r--r--lisp/help-fns.el2
-rw-r--r--lisp/info-look.el3
-rw-r--r--lisp/info.el10
-rw-r--r--lisp/mail/emacsbug.el2
-rw-r--r--lisp/mail/footnote.el2
-rw-r--r--lisp/mail/rmail.el6
-rw-r--r--lisp/man.el3
-rw-r--r--lisp/org/org-clock.el3
-rw-r--r--lisp/org/org-mouse.el4
-rw-r--r--lisp/org/org.el5
-rw-r--r--lisp/progmodes/ada-mode.el2
-rw-r--r--lisp/progmodes/ruby-mode.el3
-rw-r--r--lisp/progmodes/sh-script.el2
-rw-r--r--lisp/textmodes/bibtex.el2
-rw-r--r--lisp/textmodes/reftex-ref.el3
-rw-r--r--lisp/textmodes/tex-mode.el4
-rw-r--r--lisp/vc/log-view.el3
25 files changed, 70 insertions, 48 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index dcc960fb9bf..bb9316c81d7 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -2606,7 +2606,8 @@ meaning to raise or lower the item's priority by one."
2606 ;; separator. 2606 ;; separator.
2607 (when (looking-back (concat "^" 2607 (when (looking-back (concat "^"
2608 (regexp-quote todo-category-done) 2608 (regexp-quote todo-category-done)
2609 "\n")) 2609 "\n")
2610 (line-beginning-position 0))
2610 (todo-backward-item)))) 2611 (todo-backward-item))))
2611 (todo-insert-with-overlays item) 2612 (todo-insert-with-overlays item)
2612 ;; If item was marked, restore the mark. 2613 ;; If item was marked, restore the mark.
@@ -4231,7 +4232,8 @@ the values of FILTER and FILE-LIST."
4231 (if (and (eobp) 4232 (if (and (eobp)
4232 (looking-back 4233 (looking-back
4233 (concat (regexp-quote todo-done-string) 4234 (concat (regexp-quote todo-done-string)
4234 "\n"))) 4235 "\n")
4236 (line-beginning-position 0)))
4235 (delete-region (point) (progn 4237 (delete-region (point) (progn
4236 (forward-line -2) 4238 (forward-line -2)
4237 (point)))))) 4239 (point))))))
@@ -4648,7 +4650,7 @@ name in `todo-directory'. See also the documentation string of
4648 ;; If the item ends with a non-comment parenthesis not 4650 ;; If the item ends with a non-comment parenthesis not
4649 ;; followed by a period, we lose (but we inherit that 4651 ;; followed by a period, we lose (but we inherit that
4650 ;; problem from the legacy code). 4652 ;; problem from the legacy code).
4651 (when (looking-back "(\\(.*\\)) ") 4653 (when (looking-back "(\\(.*\\)) " (line-beginning-position))
4652 (setq comment (match-string 1)) 4654 (setq comment (match-string 1))
4653 (replace-match "") 4655 (replace-match "")
4654 (insert "[" todo-comment-string ": " comment "]")) 4656 (insert "[" todo-comment-string ": " comment "]"))
@@ -5342,7 +5344,8 @@ of each other."
5342 (looking-at todo-done-string-start) 5344 (looking-at todo-done-string-start)
5343 (looking-back (concat "^" 5345 (looking-back (concat "^"
5344 (regexp-quote todo-category-done) 5346 (regexp-quote todo-category-done)
5345 "\n"))) 5347 "\n")
5348 (line-beginning-position 0)))
5346 (setq num 1 5349 (setq num 1
5347 done t)) 5350 done t))
5348 (setq prefix (concat (propertize 5351 (setq prefix (concat (propertize
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 9cc2fa81d07..cd894f47263 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3115,7 +3115,7 @@ face attributes (as specified by a `default' defface entry)."
3115 widget 3115 widget
3116 (widget-get widget :default-face-attributes))) 3116 (widget-get widget :default-face-attributes)))
3117 entry) 3117 entry)
3118 (unless (looking-back "^ *") 3118 (unless (looking-back "^ *" (line-beginning-position))
3119 (insert ?\n)) 3119 (insert ?\n))
3120 (insert-char ?\s (widget-get widget :extra-offset)) 3120 (insert-char ?\s (widget-get widget :extra-offset))
3121 (if (or alist defaults show-all) 3121 (if (or alist defaults show-all)
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index 136467046b4..317e5a6fd3f 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -374,7 +374,7 @@ Returns the forms."
374 (let ((elint-current-pos (point))) 374 (let ((elint-current-pos (point)))
375 ;; non-list check could be here too. errors may be out of seq. 375 ;; non-list check could be here too. errors may be out of seq.
376 ;; quoted check cannot be elsewhere, since quotes skipped. 376 ;; quoted check cannot be elsewhere, since quotes skipped.
377 (if (looking-back "'") 377 (if (looking-back "'" (1- (point)))
378 ;; Eg cust-print.el uses ' as a comment syntax. 378 ;; Eg cust-print.el uses ' as a comment syntax.
379 (elint-warning "Skipping quoted form `'%.20s...'" 379 (elint-warning "Skipping quoted form `'%.20s...'"
380 (read (current-buffer))) 380 (read (current-buffer)))
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index fec172d05ca..104c23c2102 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -437,9 +437,9 @@ This can be found in an RCS or SCCS header."
437 ((re-search-forward 437 ((re-search-forward
438 (concat 438 (concat
439 "@(#)" 439 "@(#)"
440 (if buffer-file-name 440 (if buffer-file-name
441 (regexp-quote (file-name-nondirectory buffer-file-name)) 441 (regexp-quote (file-name-nondirectory buffer-file-name))
442 "[^\t\n]*") 442 "[^\t\n]+")
443 "\t\\([012345679.]*\\)") 443 "\t\\([012345679.]*\\)")
444 header-max t) 444 header-max t)
445 (match-string-no-properties 1))))))) 445 (match-string-no-properties 1)))))))
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 26a21d52370..108d5ccb0e3 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -855,9 +855,10 @@ is the buffer position of the start of the containing expression."
855 ;; Handle prefix characters and whitespace 855 ;; Handle prefix characters and whitespace
856 ;; following an open paren. (Bug#1012) 856 ;; following an open paren. (Bug#1012)
857 (backward-prefix-chars) 857 (backward-prefix-chars)
858 (while (and (not (looking-back "^[ \t]*\\|([ \t]+")) 858 (while (not (or (looking-back "^[ \t]*\\|([ \t]+"
859 (or (not containing-sexp) 859 (line-beginning-position))
860 (< (1+ containing-sexp) (point)))) 860 (and containing-sexp
861 (>= (1+ containing-sexp) (point)))))
861 (forward-sexp -1) 862 (forward-sexp -1)
862 (backward-prefix-chars)) 863 (backward-prefix-chars))
863 (setq calculate-lisp-indent-last-sexp (point))) 864 (setq calculate-lisp-indent-last-sexp (point)))
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index bd03a870fdb..5c91df90166 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -4533,7 +4533,7 @@ One can use `` and '' to temporarily jump 1 step back."
4533 (interactive) 4533 (interactive)
4534 (if viper-cted 4534 (if viper-cted
4535 (let ((p (point)) (c (current-column)) bol (indent t)) 4535 (let ((p (point)) (c (current-column)) bol (indent t))
4536 (if (looking-back "[0^]") 4536 (if (looking-back "[0^]" (1- (point)))
4537 (progn 4537 (progn
4538 (if (eq ?^ (preceding-char)) 4538 (if (eq ?^ (preceding-char))
4539 (setq viper-preserve-indent t)) 4539 (setq viper-preserve-indent t))
@@ -4545,7 +4545,7 @@ One can use `` and '' to temporarily jump 1 step back."
4545 (delete-region (point) p) 4545 (delete-region (point) p)
4546 (if indent 4546 (if indent
4547 (indent-to (- c viper-shift-width))) 4547 (indent-to (- c viper-shift-width)))
4548 (if (or (bolp) (looking-back "[^ \t]")) 4548 (if (or (bolp) (looking-back "[^ \t]" (1- (point))))
4549 (setq viper-cted nil))))) 4549 (setq viper-cted nil)))))
4550 4550
4551;; do smart indent 4551;; do smart indent
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 212f0533b8f..e6bcf8f89a4 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -455,7 +455,8 @@ reversed."
455 (while (and (not (eolp)) cont) 455 (while (and (not (eolp)) cont)
456 ;;(re-search-forward "[^/]*/") 456 ;;(re-search-forward "[^/]*/")
457 (re-search-forward "[^/]*\\(/\\|\n\\)") 457 (re-search-forward "[^/]*\\(/\\|\n\\)")
458 (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/")) 458 (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/"
459 (line-beginning-position 0)))
459 (setq cont nil)))) 460 (setq cont nil))))
460 (backward-char 1) 461 (backward-char 1)
461 (setq ex-token (buffer-substring (point) (mark t))) 462 (setq ex-token (buffer-substring (point) (mark t)))
@@ -468,7 +469,8 @@ reversed."
468 (while (and (not (eolp)) cont) 469 (while (and (not (eolp)) cont)
469 ;;(re-search-forward "[^\\?]*\\?") 470 ;;(re-search-forward "[^\\?]*\\?")
470 (re-search-forward "[^\\?]*\\(\\?\\|\n\\)") 471 (re-search-forward "[^\\?]*\\(\\?\\|\n\\)")
471 (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?")) 472 (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?"
473 (line-beginning-position 0)))
472 (setq cont nil)) 474 (setq cont nil))
473 (backward-char 1) 475 (backward-char 1)
474 (if (not (looking-at "\n")) (forward-char 1)))) 476 (if (not (looking-at "\n")) (forward-char 1))))
@@ -563,14 +565,18 @@ reversed."
563 save-pos (point))) 565 save-pos (point)))
564 566
565 (if (or (= dist 0) 567 (if (or (= dist 0)
566 (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)") 568 (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)"
569 (line-beginning-position))
567 (looking-back 570 (looking-back
568 "^[ \t]*[a-zA-Z!=>&~][ \t]*[/?]*[ \t]+[a-zA-Z!=>&~]+")) 571 "^[ \t]*[a-zA-Z!=>&~][ \t]*[/?]*[ \t]+[a-zA-Z!=>&~]+"
572 (line-beginning-position)))
569 ;; Preceding characters are not the ones allowed in an Ex command 573 ;; Preceding characters are not the ones allowed in an Ex command
570 ;; or we have typed past command name. 574 ;; or we have typed past command name.
571 ;; Note: we didn't do parsing, so there can be surprises. 575 ;; Note: we didn't do parsing, so there can be surprises.
572 (if (or (looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*") 576 (if (or (looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*"
573 (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)") 577 (line-beginning-position))
578 (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)"
579 (line-beginning-position))
574 (looking-at "[^ \t\n\C-m]")) 580 (looking-at "[^ \t\n\C-m]"))
575 nil 581 nil
576 (with-output-to-temp-buffer "*Completions*" 582 (with-output-to-temp-buffer "*Completions*"
@@ -747,7 +753,8 @@ reversed."
747 (error "Missing closing delimiter for global regexp") 753 (error "Missing closing delimiter for global regexp")
748 (goto-char (point-max)))) 754 (goto-char (point-max))))
749 (if (not (looking-back 755 (if (not (looking-back
750 (format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c))) 756 (format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c)
757 (line-beginning-position 0)))
751 (setq cont nil) 758 (setq cont nil)
752 ;; we are at an escaped delimiter: unescape it and continue 759 ;; we are at an escaped delimiter: unescape it and continue
753 (delete-char -2) 760 (delete-char -2)
@@ -963,7 +970,7 @@ reversed."
963 (while (re-search-forward "%\\|#" nil t) 970 (while (re-search-forward "%\\|#" nil t)
964 (let ((data (match-data)) 971 (let ((data (match-data))
965 (char (buffer-substring (match-beginning 0) (match-end 0)))) 972 (char (buffer-substring (match-beginning 0) (match-end 0))))
966 (if (looking-back (concat "\\\\" char)) 973 (if (looking-back "\\\\." (- (point) 2))
967 (replace-match char) 974 (replace-match char)
968 (store-match-data data) 975 (store-match-data data)
969 (if (string= char "%") 976 (if (string= char "%")
@@ -989,7 +996,7 @@ reversed."
989 (get-buffer-create viper-ex-work-buf-name)) 996 (get-buffer-create viper-ex-work-buf-name))
990 (skip-chars-forward " \t") 997 (skip-chars-forward " \t")
991 (if (looking-at "!") 998 (if (looking-at "!")
992 (if (and (not (looking-back "[ \t]")) 999 (if (and (not (looking-back "[ \t]" (1- (point))))
993 ;; read doesn't have a corresponding :r! form, so ! is 1000 ;; read doesn't have a corresponding :r! form, so ! is
994 ;; immediately interpreted as a shell command. 1001 ;; immediately interpreted as a shell command.
995 (not (string= ex-token "read"))) 1002 (not (string= ex-token "read")))
@@ -1066,7 +1073,7 @@ reversed."
1066 (cond ((ex-cmd-accepts-multiple-files-p ex-token) (exit-minibuffer)) 1073 (cond ((ex-cmd-accepts-multiple-files-p ex-token) (exit-minibuffer))
1067 ;; apparently the argument to an Ex command is 1074 ;; apparently the argument to an Ex command is
1068 ;; supposed to be a shell command 1075 ;; supposed to be a shell command
1069 ((looking-back "^[ \t]*!.*") 1076 ((looking-back "^[ \t]*!.*" (line-beginning-position))
1070 (setq ex-cmdfile t) 1077 (setq ex-cmdfile t)
1071 (insert " ")) 1078 (insert " "))
1072 (t 1079 (t
diff --git a/lisp/files.el b/lisp/files.el
index 0b011f4c363..152f1554279 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3375,7 +3375,7 @@ local variables, but directory-local variables may still be applied."
3375 (error "Local variables entry is missing the prefix")) 3375 (error "Local variables entry is missing the prefix"))
3376 (end-of-line) 3376 (end-of-line)
3377 ;; Discard the suffix. 3377 ;; Discard the suffix.
3378 (if (looking-back suffix) 3378 (if (looking-back suffix (line-beginning-position))
3379 (delete-region (match-beginning 0) (point)) 3379 (delete-region (match-beginning 0) (point))
3380 (error "Local variables entry is missing the suffix")) 3380 (error "Local variables entry is missing the suffix"))
3381 (forward-line 1)) 3381 (forward-line 1))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 7ecd271d0c8..53f4b38b9ec 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -329,7 +329,7 @@ suitable file is found, return nil."
329 329
330 (with-current-buffer standard-output 330 (with-current-buffer standard-output
331 (fill-region-as-paragraph pt2 (point)) 331 (fill-region-as-paragraph pt2 (point))
332 (unless (looking-back "\n\n") 332 (unless (looking-back "\n\n" (- (point) 2))
333 (terpri)))))) 333 (terpri))))))
334 334
335(defun help-fns--compiler-macro (function) 335(defun help-fns--compiler-macro (function)
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 9cf185edf57..8a86dc81687 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -634,7 +634,8 @@ Return nil if there is nothing appropriate in the buffer near point."
634 (setq end (point)) 634 (setq end (point))
635 (> end beg)) 635 (> end beg))
636 (and (looking-at "[ \t\n]") 636 (and (looking-at "[ \t\n]")
637 (looking-back (concat "[" significant-chars "]")) 637 (looking-back (concat "[" significant-chars "]")
638 (1- (point)))
638 (setq end (point)) 639 (setq end (point))
639 (skip-chars-backward significant-chars) 640 (skip-chars-backward significant-chars)
640 (setq beg (point)) 641 (setq beg (point))
diff --git a/lisp/info.el b/lisp/info.el
index 01596619476..057bd77ba16 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2577,7 +2577,9 @@ new buffer."
2577 (save-excursion 2577 (save-excursion
2578 ;; Move point to the beginning of reference if point is on reference 2578 ;; Move point to the beginning of reference if point is on reference
2579 (or (looking-at "\\*note[ \n\t]+") 2579 (or (looking-at "\\*note[ \n\t]+")
2580 (and (looking-back "\\*note[ \n\t]+") 2580 (and (looking-back "\\*note[ \n\t]+"
2581 (save-excursion (skip-chars-backward " \n\t")
2582 (line-beginning-position)))
2581 (goto-char (match-beginning 0))) 2583 (goto-char (match-beginning 0)))
2582 (if (and (save-excursion 2584 (if (and (save-excursion
2583 (goto-char (+ (point) 5)) ; skip a possible *note 2585 (goto-char (+ (point) 5)) ; skip a possible *note
@@ -4738,9 +4740,11 @@ first line or header line, and for breadcrumb links.")
4738 ;; an end of sentence 4740 ;; an end of sentence
4739 (skip-syntax-backward " (")) 4741 (skip-syntax-backward " ("))
4740 (setq other-tag 4742 (setq other-tag
4741 (cond ((save-match-data (looking-back "\\<see")) 4743 (cond ((save-match-data (looking-back "\\<see"
4744 (- (point) 3)))
4742 "") 4745 "")
4743 ((save-match-data (looking-back "\\<in")) 4746 ((save-match-data (looking-back "\\<in"
4747 (- (point) 2)))
4744 "") 4748 "")
4745 ((memq (char-before) '(nil ?\. ?! ??)) 4749 ((memq (char-before) '(nil ?\. ?! ??))
4746 "See ") 4750 "See ")
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 8cd59006d8d..f4ba2264dc8 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -295,7 +295,7 @@ usually do not have translators for other languages.\n\n")))
295 (insert-buffer-substring message-buf beg-pos end-pos)))) 295 (insert-buffer-substring message-buf beg-pos end-pos))))
296 ;; After Recent messages, to avoid the messages produced by 296 ;; After Recent messages, to avoid the messages produced by
297 ;; list-load-path-shadows. 297 ;; list-load-path-shadows.
298 (unless (looking-back "\n") 298 (unless (looking-back "\n" (1- (point)))
299 (insert "\n")) 299 (insert "\n"))
300 (insert "\n") 300 (insert "\n")
301 (insert "Load-path shadows:\n") 301 (insert "Load-path shadows:\n")
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el
index ea674434a2f..86bb9e89618 100644
--- a/lisp/mail/footnote.el
+++ b/lisp/mail/footnote.el
@@ -718,7 +718,7 @@ delete the footnote with that number."
718 end 718 end
719 (point-max)))) 719 (point-max))))
720 (Footnote-goto-char-point-max) 720 (Footnote-goto-char-point-max)
721 (when (looking-back "\n\n") 721 (when (looking-back "\n\n" (- (point) 2))
722 (kill-line -1)))))))) 722 (kill-line -1))))))))
723 723
724(defun Footnote-renumber-footnotes (&optional arg) 724(defun Footnote-renumber-footnotes (&optional arg)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index d150324fc79..74533f88fdf 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1787,7 +1787,7 @@ not be a new one). It returns non-nil if it got any new messages."
1787 ;; Make sure we end with a blank line unless there are 1787 ;; Make sure we end with a blank line unless there are
1788 ;; no messages, as required by mbox format (Bug#9974). 1788 ;; no messages, as required by mbox format (Bug#9974).
1789 (unless (bobp) 1789 (unless (bobp)
1790 (while (not (looking-back "\n\n")) 1790 (while (not (looking-back "\n\n" (- (point) 2)))
1791 (insert "\n"))) 1791 (insert "\n")))
1792 (setq found (or 1792 (setq found (or
1793 (rmail-get-new-mail-1 file-name files delete-files) 1793 (rmail-get-new-mail-1 file-name files delete-files)
@@ -2092,7 +2092,7 @@ Value is the size of the newly read mail after conversion."
2092 ;; Make sure the read-in mbox data properly ends with a 2092 ;; Make sure the read-in mbox data properly ends with a
2093 ;; blank line unless it is of size 0. 2093 ;; blank line unless it is of size 0.
2094 (unless (zerop size) 2094 (unless (zerop size)
2095 (while (not (looking-back "\n\n")) 2095 (while (not (looking-back "\n\n" (- (point) 2)))
2096 (insert "\n"))) 2096 (insert "\n")))
2097 (if (not (and rmail-preserve-inbox (string= file tofile))) 2097 (if (not (and rmail-preserve-inbox (string= file tofile)))
2098 (setq delete-files (cons tofile delete-files))))) 2098 (setq delete-files (cons tofile delete-files)))))
@@ -2127,7 +2127,7 @@ Value is the size of the newly read mail after conversion."
2127Call with point at the end of the message." 2127Call with point at the end of the message."
2128 (unless (bolp) 2128 (unless (bolp)
2129 (insert "\n")) 2129 (insert "\n"))
2130 (unless (looking-back "\n\n") 2130 (unless (looking-back "\n\n" (- (point 2)))
2131 (insert "\n"))) 2131 (insert "\n")))
2132 2132
2133(defun rmail-add-mbox-headers () 2133(defun rmail-add-mbox-headers ()
diff --git a/lisp/man.el b/lisp/man.el
index d9124c24e00..c5dbcba83a1 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -747,7 +747,8 @@ POS defaults to `point'."
747 ;; Record the distance traveled. 747 ;; Record the distance traveled.
748 (setq distance (- column (current-column))) 748 (setq distance (- column (current-column)))
749 (when (looking-back 749 (when (looking-back
750 (concat "([ \t]*\\(?:" Man-section-regexp "\\)[ \t]*)")) 750 (concat "([ \t]*\\(?:" Man-section-regexp "\\)[ \t]*)")
751 (line-beginning-position))
751 ;; Skip section number backwards. 752 ;; Skip section number backwards.
752 (goto-char (match-beginning 0)) 753 (goto-char (match-beginning 0))
753 (skip-chars-backward " \t")) 754 (skip-chars-backward " \t"))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 41e799f9898..c0a45b3ad13 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1656,7 +1656,8 @@ Optional argument N tells to change by that many units."
1656 (save-excursion ; Do not replace this with `with-current-buffer'. 1656 (save-excursion ; Do not replace this with `with-current-buffer'.
1657 (org-no-warnings (set-buffer (org-clocking-buffer))) 1657 (org-no-warnings (set-buffer (org-clocking-buffer)))
1658 (goto-char org-clock-marker) 1658 (goto-char org-clock-marker)
1659 (if (org-looking-back (concat "^[ \t]*" org-clock-string ".*")) 1659 (if (org-looking-back (concat "^[ \t]*" org-clock-string ".*")
1660 (line-beginning-position))
1660 (progn (delete-region (1- (point-at-bol)) (point-at-eol)) 1661 (progn (delete-region (1- (point-at-bol)) (point-at-eol))
1661 (org-remove-empty-drawer-at "LOGBOOK" (point))) 1662 (org-remove-empty-drawer-at "LOGBOOK" (point)))
1662 (message "Clock gone, cancel the timer anyway") 1663 (message "Clock gone, cancel the timer anyway")
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index 160099ff055..9b218147b65 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -191,7 +191,7 @@ Changing this variable requires a restart of Emacs to get activated."
191 (interactive) 191 (interactive)
192 (end-of-line) 192 (end-of-line)
193 (skip-chars-backward "\t ") 193 (skip-chars-backward "\t ")
194 (when (org-looking-back ":[A-Za-z]+:") 194 (when (org-looking-back ":[A-Za-z]+:" (line-beginning-position))
195 (skip-chars-backward ":A-Za-z") 195 (skip-chars-backward ":A-Za-z")
196 (skip-chars-backward "\t "))) 196 (skip-chars-backward "\t ")))
197 197
@@ -645,7 +645,7 @@ This means, between the beginning of line and the point."
645 'org-mode-restart)))) 645 'org-mode-restart))))
646 ((or (eolp) 646 ((or (eolp)
647 (and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$") 647 (and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$")
648 (org-looking-back " \\|\t"))) 648 (org-looking-back " \\|\t" (- (point) 2))))
649 (org-mouse-popup-global-menu)) 649 (org-mouse-popup-global-menu))
650 ((funcall get-context :checkbox) 650 ((funcall get-context :checkbox)
651 (popup-menu 651 (popup-menu
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 3e032d46646..54924a9964a 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -7679,7 +7679,7 @@ command."
7679 (re-search-forward org-outline-regexp-bol) 7679 (re-search-forward org-outline-regexp-bol)
7680 (beginning-of-line 0)) 7680 (beginning-of-line 0))
7681 (skip-chars-backward " \r\n") 7681 (skip-chars-backward " \r\n")
7682 (and (not (looking-back "^\*+")) 7682 (and (not (looking-back "^\*+" (line-beginning-position)))
7683 (looking-at "[ \t]+") (replace-match "")) 7683 (looking-at "[ \t]+") (replace-match ""))
7684 (unless (eobp) (forward-char 1)) 7684 (unless (eobp) (forward-char 1))
7685 (when (looking-at "^\\*") 7685 (when (looking-at "^\\*")
@@ -8658,7 +8658,8 @@ links."
8658 (when (equal (marker-buffer org-clock-marker) (current-buffer)) 8658 (when (equal (marker-buffer org-clock-marker) (current-buffer))
8659 (save-excursion 8659 (save-excursion
8660 (goto-char org-clock-marker) 8660 (goto-char org-clock-marker)
8661 (looking-back "^.*") (match-string-no-properties 0)))) 8661 (buffer-substring-no-properties (line-beginning-position)
8662 (point)))))
8662 start beg end stars re re2 8663 start beg end stars re re2
8663 txt what tmp) 8664 txt what tmp)
8664 ;; Find beginning and end of region to sort 8665 ;; Find beginning and end of region to sort
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el
index 8afb92f2c90..c1bc79c599c 100644
--- a/lisp/progmodes/ada-mode.el
+++ b/lisp/progmodes/ada-mode.el
@@ -1013,7 +1013,7 @@ If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'."
1013 1013
1014(defsubst ada-in-numeric-literal-p () 1014(defsubst ada-in-numeric-literal-p ()
1015 "Return t if point is after a prefix of a numeric literal." 1015 "Return t if point is after a prefix of a numeric literal."
1016 (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)")) 1016 (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)" (line-beginning-position)))
1017 1017
1018;;------------------------------------------------------------------ 1018;;------------------------------------------------------------------
1019;; Contextual menus 1019;; Contextual menus
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index f2fb95ce59a..0e2f66e5bc5 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1392,7 +1392,8 @@ by `end-of-defun'."
1392 (interactive "p") 1392 (interactive "p")
1393 (ruby-forward-sexp) 1393 (ruby-forward-sexp)
1394 (let (case-fold-search) 1394 (let (case-fold-search)
1395 (when (looking-back (concat "^\\s *" ruby-block-end-re)) 1395 (when (looking-back (concat "^\\s *" ruby-block-end-re)
1396 (line-beginning-position))
1396 (forward-line 1)))) 1397 (forward-line 1))))
1397 1398
1398(defun ruby-beginning-of-indent () 1399(defun ruby-beginning-of-indent ()
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 135f945dbb9..e4d16eb0ab6 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -4344,7 +4344,7 @@ The document is bounded by `sh-here-document-word'."
4344 (or arg (sh--maybe-here-document))) 4344 (or arg (sh--maybe-here-document)))
4345 4345
4346(defun sh--maybe-here-document () 4346(defun sh--maybe-here-document ()
4347 (or (not (looking-back "[^<]<<")) 4347 (or (not (looking-back "[^<]<<" (line-beginning-position)))
4348 (save-excursion 4348 (save-excursion
4349 (backward-char 2) 4349 (backward-char 2)
4350 (or (sh-quoted-p) 4350 (or (sh-quoted-p)
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 5933559b37c..8a018520f5f 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -2229,7 +2229,7 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
2229 bibtex-entry-kill-ring)) 2229 bibtex-entry-kill-ring))
2230 ;; If we copied an entry from a buffer containing only this one entry, 2230 ;; If we copied an entry from a buffer containing only this one entry,
2231 ;; it can be missing the second "\n". 2231 ;; it can be missing the second "\n".
2232 (unless (looking-back "\n\n") (insert "\n")) 2232 (unless (looking-back "\n\n" (- (point 2))) (insert "\n"))
2233 (unless (functionp bibtex-reference-keys) 2233 (unless (functionp bibtex-reference-keys)
2234 ;; update `bibtex-reference-keys' 2234 ;; update `bibtex-reference-keys'
2235 (save-excursion 2235 (save-excursion
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index be119d9db58..d0e09bff880 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -857,7 +857,8 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window."
857 (docstruct (symbol-value reftex-docstruct-symbol)) 857 (docstruct (symbol-value reftex-docstruct-symbol))
858 ;; If point is inside a \ref{} or \pageref{}, use that as 858 ;; If point is inside a \ref{} or \pageref{}, use that as
859 ;; default value. 859 ;; default value.
860 (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*") 860 (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*"
861 (line-beginning-position))
861 (reftex-this-word "-a-zA-Z0-9_*.:"))) 862 (reftex-this-word "-a-zA-Z0-9_*.:")))
862 (label (completing-read (if default 863 (label (completing-read (if default
863 (format "Label (default %s): " default) 864 (format "Label (default %s): " default)
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index e9c7e2f114e..c26c6098364 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1761,13 +1761,13 @@ Mark is left at original location."
1761 ;; A better way to handle this, \( .. \) etc, is probably to 1761 ;; A better way to handle this, \( .. \) etc, is probably to
1762 ;; temporarily change the syntax of the \ in \( to punctuation. 1762 ;; temporarily change the syntax of the \ in \( to punctuation.
1763 ((and latex-handle-escaped-parens 1763 ((and latex-handle-escaped-parens
1764 (looking-back "\\\\[])}]")) 1764 (looking-back "\\\\[])}]" (- (point) 2)))
1765 (signal 'scan-error 1765 (signal 'scan-error
1766 (list "Containing expression ends prematurely" 1766 (list "Containing expression ends prematurely"
1767 (- (point) 2) (prog1 (point) 1767 (- (point) 2) (prog1 (point)
1768 (goto-char pos))))) 1768 (goto-char pos)))))
1769 ((and latex-handle-escaped-parens 1769 ((and latex-handle-escaped-parens
1770 (looking-back "\\\\\\([({[]\\)")) 1770 (looking-back "\\\\\\([({[]\\)" (- (point) 2)))
1771 (tex-next-unmatched-eparen (match-string 1))) 1771 (tex-next-unmatched-eparen (match-string 1)))
1772 (t (goto-char newpos)))))) 1772 (t (goto-char newpos))))))
1773 1773
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index 98e93572206..042ea131a97 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -466,7 +466,8 @@ It assumes that a log entry starts with a line matching
466 (goto-char (match-beginning 0)))) 466 (goto-char (match-beginning 0))))
467 ;; Don't advance past the end buttons inserted by 467 ;; Don't advance past the end buttons inserted by
468 ;; `vc-print-log-setup-buttons'. 468 ;; `vc-print-log-setup-buttons'.
469 ((looking-back "Show 2X entries Show unlimited entries") 469 ((looking-back "Show 2X entries Show unlimited entries"
470 (line-beginning-position))
470 (setq looping nil) 471 (setq looping nil)
471 (forward-line -1)))))) 472 (forward-line -1))))))
472 473