From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Thomas Morgan Newsgroups: gmane.emacs.bugs Subject: Buffer narrowing in Forms mode Date: 15 May 2002 01:18:34 -0400 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1021439883 21924 127.0.0.1 (15 May 2002 05:18:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 15 May 2002 05:18:03 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 177rAp-0005hV-00 for ; Wed, 15 May 2002 07:18:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 177rB7-0005le-00; Wed, 15 May 2002 01:18:21 -0400 Original-Received: from goose.mail.pas.earthlink.net ([207.217.120.18] helo=goose.prod.itd.earthlink.net) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 177r9y-0005ke-00 for ; Wed, 15 May 2002 01:17:11 -0400 Original-Received: from user-2ivecep.dialup.mindspring.com ([165.247.49.217] helo=zamenhof) by goose.prod.itd.earthlink.net with esmtp (Exim 3.33 #2) id 177r9w-0001TC-00 for bug-gnu-emacs@gnu.org; Tue, 14 May 2002 22:17:08 -0700 Original-To: bug-gnu-emacs@gnu.org Original-Lines: 64 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:1372 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:1372 This patch fixes the behavior of Forms mode with narrowed buffers. Whenever Forms mode needs to move to a specified line number, it should calculate from the beginning of the accessible portion rather than from the beginning of the buffer. I reported this patch a year ago, but I don't think it was noticed. *** forms.el.~2.42.~ Mon Jul 16 08:22:58 2001 --- forms.el Wed May 15 01:07:24 2002 *************** *** 1700,1706 **** (if (zerop disp) nil (setq cur (+ cur disp (- (forward-line disp))))) ! (setq cur (+ cur disp (- (goto-line arg))))) (forms--get-record))) --- 1700,1707 ---- (if (zerop disp) nil (setq cur (+ cur disp (- (forward-line disp))))) ! (goto-char (point-min)) ! (setq cur (+ cur disp (- (forward-line (1- arg)))))) (forms--get-record))) *************** *** 1810,1816 **** (save-excursion (set-buffer forms--file-buffer) ! (goto-line ln) (open-line 1) (insert the-record) (beginning-of-line)) --- 1811,1818 ---- (save-excursion (set-buffer forms--file-buffer) ! (goto-char (point-min)) ! (forward-line (1- ln)) (open-line 1) (insert the-record) (beginning-of-line)) *************** *** 1833,1839 **** (let ((ln forms--current-record)) (save-excursion (set-buffer forms--file-buffer) ! (goto-line ln) ;; Use delete-region instead of kill-region, to avoid ;; adding junk to the kill-ring. (delete-region (progn (beginning-of-line) (point)) --- 1835,1842 ---- (let ((ln forms--current-record)) (save-excursion (set-buffer forms--file-buffer) ! (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))