]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/reftex-ref.el
Fix byte-compiler warnings about looking-back.
[gnu-emacs] / lisp / textmodes / reftex-ref.el
index be119d9db58682ba15714cd4ad27be431f6babc5..d0e09bff88051179c7ff52f71b3af2834c34e346 100644 (file)
@@ -857,7 +857,8 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window."
          (docstruct (symbol-value reftex-docstruct-symbol))
         ;; If point is inside a \ref{} or \pageref{}, use that as
         ;; default value.
-        (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*")
+        (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*"
+                                      (line-beginning-position))
                    (reftex-this-word "-a-zA-Z0-9_*.:")))
          (label (completing-read (if default
                                     (format "Label (default %s): " default)