unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Buffer narrowing in Forms mode
@ 2002-05-15  5:18 Thomas Morgan
  0 siblings, 0 replies; only message in thread
From: Thomas Morgan @ 2002-05-15  5:18 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-15  5:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-15  5:18 Buffer narrowing in Forms mode Thomas Morgan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).