emacs-devel
[Top][All Lists]
Advanced

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

narrow-to-page: when page-delimiter spans lines, exclude if from narrow


From: Alan Mackenzie
Subject: narrow-to-page: when page-delimiter spans lines, exclude if from narrowed bit.
Date: Tue, 6 Sep 2005 08:39:10 +0000 (GMT)

Hi, Emacs!

Normally in narrow-to-page, when page-delimiter is something nice and
simple like "^^L", the delimiter at the end of the page is excluded from
the region narrowed to.

A change made in version 1.8 was intended to handle multi-line
delimiters, but this change wasn't completed.  Currently, when the page
delimiter spans line breaks, only the last line of the delimiter gets
excluded.  The following patch fixes this.



2005-09-06  Alan Mackenzie  <address@hidden>

        * page.el (narrow-to-page): Exclude _entire_ multi-line delimiter
        from the region narrowed to.

*** page.el     Mon Sep  5 12:44:15 2005
--- page-1.19.acm.el    Tue Sep  6 08:10:14 2005
***************
*** 112,118 ****
             (save-excursion
               (goto-char (match-beginning 0)) ; was (beginning-of-line)
               (looking-at page-delimiter)))
!       (beginning-of-line))
      (narrow-to-region (point)
                      (progn
                        ;; Find the top of the page.
--- 112,118 ----
             (save-excursion
               (goto-char (match-beginning 0)) ; was (beginning-of-line)
               (looking-at page-delimiter)))
!       (goto-char (match-beginning 0))) ; was (beginning-of-line)
      (narrow-to-region (point)
                      (progn
                        ;; Find the top of the page.


-- 
Alan Mackenzie (Munich, Germany)






reply via email to

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