User: scop
Date: 06/05/24 19:52:08
Modified: packages/xemacs-packages/haskell-mode ChangeLog
haskell-indent.el haskell-simple-indent.el
Log:
Don't use line-{beginning,end}-position
<1148121480.2765.70.camel(a)localhost.localdomain>
Revision Changes Path
1.26 +7 -0 XEmacs/packages/xemacs-packages/haskell-mode/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/haskell-mode/ChangeLog,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- ChangeLog 2006/05/17 08:32:03 1.25
+++ ChangeLog 2006/05/24 17:52:07 1.26
@@ -1,3 +1,10 @@
+2006-05-20 Ville Skyttä <scop(a)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(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.09 released.
1.5 +25 -13 XEmacs/packages/xemacs-packages/haskell-mode/haskell-indent.el
Index: haskell-indent.el
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/haskell-mode/haskell-indent.el,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- haskell-indent.el 2006/03/15 05:18:23 1.4
+++ haskell-indent.el 2006/05/24 17:52:07 1.5
@@ -172,7 +172,8 @@ followed by an OFFSET (if present use it
(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."
@@ -192,7 +193,8 @@ followed by an OFFSET (if present use it
(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)))
@@ -302,8 +304,9 @@ It deals with both Bird style and non Bi
(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}")
@@ -864,7 +867,8 @@ and find indentation info for each part.
(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
@@ -877,7 +881,8 @@ and find indentation info for each part.
(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
@@ -950,7 +955,8 @@ OPEN is the start position of the commen
(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)))))
@@ -1246,15 +1252,18 @@ TYPE is either 'guard or 'rhs."
(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
@@ -1278,7 +1287,8 @@ TYPE is either 'guard or 'rhs."
(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))
@@ -1308,7 +1318,8 @@ TYPE is either 'guard or 'rhs."
(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)
@@ -1330,7 +1341,8 @@ TYPE is either 'guard or 'rhs."
(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
1.3 +2 -1
XEmacs/packages/xemacs-packages/haskell-mode/haskell-simple-indent.el
Index: haskell-simple-indent.el
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/haskell-mode/haskell-simple-indent.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- haskell-simple-indent.el 2006/03/15 05:18:23 1.2
+++ haskell-simple-indent.el 2006/05/24 17:52:08 1.3
@@ -100,7 +100,8 @@ column, `tab-to-tab-stop' is done instea
(< 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)
Show replies by date