branch: elpa/adoc-mode
commit 95e6c7fa4620c3e8ae9fd702ada724a405af66ee
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Fix (goto-char 0) to use (point-min)
    
    Buffer positions start at 1, not 0.  While 0 works by accident,
    (point-min) is the correct idiom and respects narrowing.
---
 adoc-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/adoc-mode.el b/adoc-mode.el
index b3cd7d8e19..ac9090c1e7 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -2673,7 +2673,7 @@ for multiline constructs to be matched."
                    (concat "Goto anchor of reference/label " default-str ": ")
                    nil nil default))))
   (let ((pos (save-excursion
-               (goto-char 0)
+               (goto-char (point-min))
                (re-search-forward (adoc-re-anchor nil id) nil t))))
     (if (null pos) (error (concat "Can't find an anchor defining '" id "'")))
     (push-mark)
@@ -3555,7 +3555,7 @@ LOCAL-ATTRIBUTE-FACE-ALIST before it is looked up in
           (concat "\\(?:" re-all-titles-core "\\)")))
     (save-restriction
       (widen)
-      (goto-char 0)
+      (goto-char (point-min))
       (while (re-search-forward re-all-titles nil t)
         (backward-char) ; skip backwards the trailing \n of a title
         (let* ((descriptor (adoc-title-descriptor t))

Reply via email to