]> git.eshelyaron.com Git - emacs.git/commitdiff
(calendar-cursor-to-nearest-date, calendar-cursor-to-visible-date):
authorGlenn Morris <rgm@gnu.org>
Fri, 21 Aug 2009 07:11:24 +0000 (07:11 +0000)
committerGlenn Morris <rgm@gnu.org>
Fri, 21 Aug 2009 07:11:24 +0000 (07:11 +0000)
Use forward-line, not goto-line.

lisp/ChangeLog
lisp/calendar/cal-move.el

index 304a50c6850205beea1ef1213d3154396f42b77b..fbab5bc818ce201757cd6f432c914d55f349f884 100644 (file)
@@ -1,5 +1,8 @@
 2009-08-21  Glenn Morris  <rgm@gnu.org>
 
+       * calendar/cal-move.el (calendar-cursor-to-nearest-date)
+       (calendar-cursor-to-visible-date): Use forward-line, not goto-line.
+
        * mail/rmail.el (rmail-obsolete): Delete custom group.
        (rmail-pop-password, rmail-pop-password-required): Make into aliases.
        (rmail-remote-password, rmail-remote-password-required):
index 534e7c1ecc72a8a318193a905098075ce50147e0..6433b71c3824cc3e1c0124886cad069d01dd2089 100644 (file)
@@ -47,7 +47,8 @@ Returns the list (month day year) giving the cursor position."
              (last (nth 2 edges))
              (right (nth 3 edges)))
         (when (< (count-lines (point-min) (point)) calendar-first-date-row)
-          (goto-line calendar-first-date-row)
+          (goto-char (point-min))
+          (forward-line (1- calendar-first-date-row))
           (move-to-column col))
         ;; The date positions are fixed and computable, but searching
         ;; is probably more flexible.  Need to consider blank days at
@@ -76,13 +77,14 @@ Returns the list (month day year) giving the cursor position."
   (let ((month (calendar-extract-month date))
         (day (calendar-extract-day date))
         (year (calendar-extract-year date)))
-    (goto-line (+ calendar-first-date-row
-                  (/ (+ day  -1
-                        (mod
-                         (- (calendar-day-of-week (list month 1 year))
-                            calendar-week-start-day)
-                         7))
-                     7)))
+    (goto-char (point-min))
+    (forward-line (+ calendar-first-date-row -1
+                     (/ (+ day -1
+                           (mod
+                            (- (calendar-day-of-week (list month 1 year))
+                               calendar-week-start-day)
+                            7))
+                        7)))
     (move-to-column (+ calendar-left-margin (1- calendar-day-digit-width)
                        (* calendar-month-width
                           (1+ (calendar-interval