chiark / gitweb /
el/dot-emacs.el: Sharpen up the page delimiter patterns.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 25 Apr 2020 22:08:29 +0000 (23:08 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 25 Apr 2020 22:08:29 +0000 (23:08 +0100)
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

index 0ff628b95a40b2949dec7ad1772f6100b35375c1..0c402be42a882d8392cb29e4a2eede1f36dc5ff5 100644 (file)
@@ -1291,7 +1291,14 @@ (defun mdw-misc-mode-config ()
   (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)