bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Buffer narrowing in Forms mode


From: Thomas Morgan
Subject: Buffer narrowing in Forms mode
Date: 15 May 2002 01:18:34 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

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))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]