diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-04-20 21:55:00 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-04-20 21:55:00 -0400 |
commit | c9a75a4030a556d700fd95222ec0bf4c1a9f67b5 (patch) | |
tree | 6983e7d01dabf1995a709f568e59f2499bda1551 /lisp/emulation/viper-ex.el | |
parent | e3bfb5191f6144c9ac96772fea9f40c2e988c75b (diff) | |
download | emacs-c9a75a4030a556d700fd95222ec0bf4c1a9f67b5.tar.gz |
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/emulation/viper-ex.el')
-rw-r--r-- | lisp/emulation/viper-ex.el | 27 |
1 files changed, 17 insertions, 10 deletions
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." (while (and (not (eolp)) cont) ;;(re-search-forward "[^/]*/") (re-search-forward "[^/]*\\(/\\|\n\\)") - (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/")) + (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/" + (line-beginning-position 0))) (setq cont nil)))) (backward-char 1) (setq ex-token (buffer-substring (point) (mark t))) @@ -468,7 +469,8 @@ reversed." (while (and (not (eolp)) cont) ;;(re-search-forward "[^\\?]*\\?") (re-search-forward "[^\\?]*\\(\\?\\|\n\\)") - (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?")) + (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?" + (line-beginning-position 0))) (setq cont nil)) (backward-char 1) (if (not (looking-at "\n")) (forward-char 1)))) @@ -563,14 +565,18 @@ reversed." save-pos (point))) (if (or (= dist 0) - (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)") + (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)" + (line-beginning-position)) (looking-back - "^[ \t]*[a-zA-Z!=>&~][ \t]*[/?]*[ \t]+[a-zA-Z!=>&~]+")) + "^[ \t]*[a-zA-Z!=>&~][ \t]*[/?]*[ \t]+[a-zA-Z!=>&~]+" + (line-beginning-position))) ;; Preceding characters are not the ones allowed in an Ex command ;; or we have typed past command name. ;; Note: we didn't do parsing, so there can be surprises. - (if (or (looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*") - (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)") + (if (or (looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*" + (line-beginning-position)) + (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)" + (line-beginning-position)) (looking-at "[^ \t\n\C-m]")) nil (with-output-to-temp-buffer "*Completions*" @@ -747,7 +753,8 @@ reversed." (error "Missing closing delimiter for global regexp") (goto-char (point-max)))) (if (not (looking-back - (format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c))) + (format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c) + (line-beginning-position 0))) (setq cont nil) ;; we are at an escaped delimiter: unescape it and continue (delete-char -2) @@ -963,7 +970,7 @@ reversed." (while (re-search-forward "%\\|#" nil t) (let ((data (match-data)) (char (buffer-substring (match-beginning 0) (match-end 0)))) - (if (looking-back (concat "\\\\" char)) + (if (looking-back "\\\\." (- (point) 2)) (replace-match char) (store-match-data data) (if (string= char "%") @@ -989,7 +996,7 @@ reversed." (get-buffer-create viper-ex-work-buf-name)) (skip-chars-forward " \t") (if (looking-at "!") - (if (and (not (looking-back "[ \t]")) + (if (and (not (looking-back "[ \t]" (1- (point)))) ;; read doesn't have a corresponding :r! form, so ! is ;; immediately interpreted as a shell command. (not (string= ex-token "read"))) @@ -1066,7 +1073,7 @@ reversed." (cond ((ex-cmd-accepts-multiple-files-p ex-token) (exit-minibuffer)) ;; apparently the argument to an Ex command is ;; supposed to be a shell command - ((looking-back "^[ \t]*!.*") + ((looking-back "^[ \t]*!.*" (line-beginning-position)) (setq ex-cmdfile t) (insert " ")) (t |