Commits

scop  committed 55059b0

Don't use line-{beginning,end}-position <1148121480.2765.70.camel@localhost.localdomain>

  • Participants
  • Parent commits b0d0adb

Comments (0)

Files changed (3)

+2006-05-20  Ville Skyttä  <scop@xemacs.org>
+
+	* haskell-indent.el: Use `point-at-bol' and `point-at-eol' instead
+	of `line-beginning-position' and `line-end-position' for < 21.5
+	compatibility.
+	* haskell-simple-indent.el: Ditto.
+
 2006-05-17  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.09 released.

File haskell-indent.el

   (or (bolp)
       (and (eq haskell-literate 'bird)
            (<= (current-column) (1+ haskell-indent-literate-Bird-default-offset))
-           (eq (char-after (line-beginning-position)) ?\>))))
+           ;; XEmacs: no `line-beginning-position' in < 21.5
+           (eq (char-after (point-at-bol)) ?\>))))
 
 (defun haskell-indent-empty-line-p ()
   "Checks if the current line is empty; deals with Bird style scripts."
             (progn
               (forward-char 1)
               (if (not (eolp))
-                (skip-chars-forward " \t" (line-end-position))))
+                ;; XEmacs: no `line-end-position' in < 21.5
+                (skip-chars-forward " \t" (point-at-eol))))
           (back-to-indentation)))
     (back-to-indentation)))
 
         (save-excursion
           (goto-char end)               ; Remove end.
           (if (re-search-backward "^\\\\end{code}[ \t\n]*\\="
-                                  (line-beginning-position -2) t)
-              (delete-region (point) (line-beginning-position 2)))
+                              ;; XEmacs: no `line-beginning-position' in < 21.5
+                                  (point-at-bol -2) t)
+              (delete-region (point) (point-at-bol 2)))
           (goto-char beg)               ; Remove end.
           (beginning-of-line)
           (if (looking-at "\\\\begin{code}")
 	  (let				; guess the type of line
 	      ((sep
 		(haskell-indent-separate-valdef
-		 (point) (line-end-position))))
+		 ;; XEmacs: no `line-end-position' in < 21.5
+		 (point) (point-at-eol))))
 	    ;; if the first ident is where or the start of a def
 	    ;; keep it in a global variable
 	    (setq haskell-indent-current-line-first-ident
       (while contour-line		; explore the contour points
 	(setq line-start (pop contour-line))
 	(goto-char line-start)
-	(setq line-end (line-end-position))
+	;; XEmacs: no `line-end-position' in < 21.5
+	(setq line-end (point-at-eol))
 	(setq end-visible		; visible until the column of the
 	      (if contour-line		; next contour point
 		  (save-excursion
                (cond
                 ((eq (char-after) ?\{) nil) ;Align as if it were code.
                 ((and (forward-comment -1)
-                      (> (line-beginning-position 3) open))
+                      ;; XEmacs: no `line-beginning-position' in < 21.5
+                      (> (point-at-bol 3) open))
                  ;; We're after another comment and there's no empty line
                  ;; between us.
                  (list (list (haskell-indent-point-to-col (point)))))
               (setq start-block
                     (save-excursion
                       (goto-char (mark))
-                      (line-beginning-position)))
+                      ;; XEmacs: no `line-beginning-position' in < 21.5
+                      (point-at-bol)))
               (setq end-block
                   (progn (if (haskell-indent-bolp)
                              (haskell-indent-forward-line -1))
-                         (line-end-position))))
+                         ;; XEmacs: no `line-end-position' in < 21.5
+                         (point-at-eol))))
             (error "The mark is not set for aligning definitions"))
         ;; aligning the current definition
         (setq start-block (haskell-indent-start-of-def))
-        (setq end-block (line-end-position)))
+        ;; XEmacs: no `line-end-position' in < 21.5
+        (setq end-block (point-at-eol)))
       ;; find the start of the current valdef using the contour line
       ;; in reverse order because we need the nearest one from the end
       (setq contour
                 (setq defname "\\<\\|("))
             (setq defcol (haskell-indent-point-to-col defnamepos))
             (goto-char pos)
-            (setq end-block (line-end-position))
+            ;; XEmacs: no `line-end-position' in < 21.5
+            (setq end-block (point-at-eol))
             (catch 'top-of-buffer
               (while (and (not start-found)
                           (>= (point) start-block))
 				  (save-excursion
 				    (goto-char (caadr eqns-start))
 				    (haskell-indent-forward-line -1)
-				    (line-end-position))
+				    ;; XEmacs: no `line-end-position' in < 21.5
+				    (point-at-eol))
 				end-block))
 		(setq sep (haskell-indent-separate-valdef eqn lastpos)))
               (if (eq type 'guard)
                                  (goto-char pos)
                                  (skip-chars-backward
                                   " \t"
-                                  (line-beginning-position))
+                              ;; XEmacs: no `line-beginning-position' in < 21.5
+                                  (point-at-bol))
                                  (if (haskell-indent-bolp)
                                      ;;if on an empty prefix
                                      (haskell-indent-point-to-col pos) ;keep original indent

File haskell-simple-indent.el

                               (< this-indentation invisible-from))
                           (if (> this-indentation start-column)
                               (setq invisible-from this-indentation)
-                            (let ((end (line-beginning-position 2)))
+                            ;; XEmacs: no `line-beginning-position' in < 21.5
+                            (let ((end (point-at-bol 2)))
                               (move-to-column start-column)
                               ;; Is start-column inside a tab on this line?
                               (if (> (current-column) start-column)