From 5a29709b2dc76bc1753b4be5656414c39d5b057a Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 25 Apr 2020 23:08:29 +0100 Subject: [PATCH] el/dot-emacs.el: Sharpen up the page delimiter patterns. The page-banner pattern is now much more precise: we need a brief comment-opening sequence, up against the left margin, exactly five `-'s, an optional heading surrounded by spaces, and then more `-'s to the end of the line, with an optional short comment-closing sequence or knob. I've not been especially picky about the comment opening and closing sequences except that they should be short, but I don't think that will be a problem. We now need the `^L' to be at the start of the line. The documentation implies that Emacs already ensured this, but that's not true. --- el/dot-emacs.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 0ff628b..0c402be 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -1291,7 +1291,14 @@ case." (set (make-local-variable 'mdw-do-misc-mode-hacking) t) (local-set-key [C-return] 'newline) (make-local-variable 'page-delimiter) - (setq page-delimiter "\f\\|^.*-\\{6\\}.*$") + (setq page-delimiter (concat "^" "\f" + "\\|" "^" + ".\\{0,4\\}" + "-\\{5\\}" + "\\(" " " ".*" " " "\\)?" + "-+" + ".\\{0,2\\}" + "$")) (setq comment-column 40) (auto-fill-mode 1) (setq fill-column mdw-text-width) -- 2.11.0