[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Respect buffer narrowing in Forms mode
From: |
Thomas Morgan |
Subject: |
Respect buffer narrowing in Forms mode |
Date: |
Thu, 26 Apr 2001 01:33:47 -0400 |
GNU Emacs 20.7.2 (i686-pc-linux-gnu, X toolkit) of Fri Mar 16 2001 on zamenhof
I have a data file for Forms mode which contains other information
before and after the data, so I wrote the forms-read-file-filter
function to narrow the buffer and the forms-write-file-filter function
to widen it.
It turned out that Forms mode is not prepared for narrowed buffers.
In the mode line the correct total number of records is shown, but
Emacs will never reach those records at the end. This is because it
moves to a given line number relative to the beginning of the file,
not relative to beginning of the narrowed portion.
I made a small change which fixes the problem, at least in my case.
This is part of forms-jump-record in forms.el.
*** /usr/share/emacs/20.7/lisp/forms.el~ Mon May 31 04:34:29 1999
--- /usr/share/emacs/20.7/lisp/forms.el Thu Apr 26 00:33:57 2001
***************
*** 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)))
Diff finished at Thu Apr 26 01:03:05
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Respect buffer narrowing in Forms mode,
Thomas Morgan <=