emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 06/18: Fix error in approximation to (line-number-at-pos (point-m


From: Leo Liu
Subject: [elpa] 06/18: Fix error in approximation to (line-number-at-pos (point-max))
Date: Sat, 05 Apr 2014 01:25:15 +0000

leoliu pushed a commit to branch master
in repository elpa.

commit 9527576d414771001f90c7a37219d8cb4d7c7a43
Author: Leo Liu <address@hidden>
Date:   Wed Apr 2 08:41:12 2014 +0800

    Fix error in approximation to (line-number-at-pos (point-max))
    
    ggtags-global-output-lines >= (line-number-at-pos (point-max)) is not
    always true.
---
 ggtags.el |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/ggtags.el b/ggtags.el
index 4ded7ba..4acf610 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1317,10 +1317,7 @@ commands `next-error' and `previous-error'.
          compilation-filter-start t)
     (replace-match ""))
   (cl-incf ggtags-global-output-lines
-           (count-lines (if (zerop ggtags-global-output-lines)
-                            (point-min)
-                          compilation-filter-start)
-                        (point)))
+           (count-lines compilation-filter-start (point)))
   ;; If the number of output lines is small
   ;; `ggtags-global-handle-exit' takes care of displaying the buffer.
   (when (and (> ggtags-global-output-lines 30) ggtags-navigation-mode)
@@ -1328,10 +1325,9 @@ commands `next-error' and `previous-error'.
   (when (and (eq ggtags-auto-jump-to-match 'history)
              (numberp ggtags-auto-jump-to-match-target)
              (not compilation-current-error)
-             ;; `ggtags-global-output-lines' is imprecise but is
-             ;; greater than (line-number-at-pos (point-max)) so use
-             ;; it as first approximation.
-             (> ggtags-global-output-lines ggtags-auto-jump-to-match-target)
+             ;; `ggtags-global-output-lines' is imprecise but use it
+             ;; as first approximation.
+             (> (+ 10 ggtags-global-output-lines) 
ggtags-auto-jump-to-match-target)
              (> (line-number-at-pos (point-max))
                 ggtags-auto-jump-to-match-target))
     (ggtags-forward-to-line ggtags-auto-jump-to-match-target)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]