From 17b1725804cc726fa23158e4bcddf1a27ae94ca1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pavel=20Jan=C3=ADk?= Date: Sat, 18 May 2002 08:05:54 +0000 Subject: [PATCH] (forms-jump-record, forms-insert-record, forms-delete-record): Calculate lines from the beginning of the accessible portion rather than from the beginning of the buffer. --- lisp/ChangeLog | 6 ++++++ lisp/forms.el | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 021b651d540..9c4c70376cf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2002-05-17 Thomas Morgan + + * forms.el (forms-jump-record, forms-insert-record) + (forms-delete-record): Calculate lines from the beginning of the + accessible portion rather than from the beginning of the buffer. + 2002-05-16 Eli Zaretskii * ps-mule.el (eval-and-compile): Add a trivial replacement for a diff --git a/lisp/forms.el b/lisp/forms.el index 0a25e77bd73..8b75766590c 100644 --- a/lisp/forms.el +++ b/lisp/forms.el @@ -301,10 +301,10 @@ (provide 'forms) ;;; official (provide 'forms-mode) ;;; for compatibility -(defconst forms-version (substring "$Revision: 2.41 $" 11 -2) +(defconst forms-version (substring "$Revision: 2.42 $" 11 -2) "The version number of forms-mode (as string). The complete RCS id is: - $Id: forms.el,v 2.41 2001/02/07 23:40:52 fx Exp $") + $Id: forms.el,v 2.42 2001/07/16 12:22:58 pj Exp $") (defcustom forms-mode-hooks nil "Hook run upon entering Forms mode." @@ -1700,7 +1700,8 @@ As a side effect: sets `forms--the-record-list'." (if (zerop disp) nil (setq cur (+ cur disp (- (forward-line disp))))) - (setq cur (+ cur disp (- (goto-line arg))))) + (goto-char (point-min)) + (setq cur (+ cur disp (- (forward-line (1- arg)))))) (forms--get-record))) @@ -1810,7 +1811,8 @@ after the current record." (save-excursion (set-buffer forms--file-buffer) - (goto-line ln) + (goto-char (point-min)) + (forward-line (1- ln)) (open-line 1) (insert the-record) (beginning-of-line)) @@ -1833,7 +1835,8 @@ after the current record." (let ((ln forms--current-record)) (save-excursion (set-buffer forms--file-buffer) - (goto-line ln) + (goto-char (point-min)) + (forward-line (1- ln)) ;; Use delete-region instead of kill-region, to avoid ;; adding junk to the kill-ring. (delete-region (progn (beginning-of-line) (point)) -- 2.39.5