# Better out-of-the-box display for FORM FEED By default, FORM FEED is displayed as a dumb `^L` glyph. This is surprising considering it shows up in so many places: - Emacs source files (C and Elisp), - help buffers: - `describe-mode`, - `describe-bindings`, - outline buffers: - several files under `etc/` - notably `NEWS`, as seen in `view-emacs-news`, - several files under `admin/`, - log buffers: - `*Compile-Log*`, - `*Dired log*`, - etc. You can even see it in source files of other GNU projects, like GCC. "Pages" are important enough to have their own navigation and narrowing commands, yet their default delimiter is displayed as an unassuming control character. I like the way form feeds are displayed with [`page-break-lines`]; magit's `show-lines` blaming style achieves a similar look. Having this kind of display by default would make it more obvious that this character has actual navigation semantics; as it stands, it looks no different from some stray CARRIAGE RETURN (to the point where people unfamiliar with them [sometimes assume][junk] they are junk). This hypothetical thin-line display could be re-used by e.g.: - `apropos-documentation`, where symbol matches are delimited by strings of hyphens, - `describe-symbol`, where symbol definitions are delimited by text properties: ``` lisp (insert "\n\n" (eval-when-compile (propertize "\n" 'face '(:height 0.1 :inverse-video t))) "\n") ``` - Custom buffers, where sections are delimited with a 999-character-wide underlined space, - `eldoc-doc-buffer-separator`, - `shr-hr-line` See [emacs-devel][emacs-devel-thin-line] for a list of use-cases for thin lines, form-feed-related or not. [`page-break-lines`]: https://github.com/purcell/page-break-lines [junk]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41250#89 [emacs-devel-thin-line]: https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00268.html ## State of the art Emacs has grown some facilities that we could build on: - `page-delimiter` locates spots in the buffer that mark page limits; - `(make-separator-line)` produces a "thin-line" representation. ## Incidental motivation This reflection started because moving over this underlined space with `truncate-lines` on caused the screen to jump horizontally. This specific problem was fixed without dragging FORM FEED display into the discussion, but I feel like the latter is the more interesting issue ([who on Earth] enables `truncate-lines` by default anyway). Also `page-break-lines` breaks down in a couple of scenarios (e.g. form feeds embedded in diffs shown in Gnus or Magit; somehow vc-diff seems to fare better). Those could probably be fixed, but it feels like effort would be better spent improving core, for the reasons given above. Also² `page-break-lines` causes Emacs ≥30 to hang with this recipe: ``` elisp ;;; -*- lexical-binding: t -*- (custom-set-variables '(global-page-break-lines-mode t nil (page-break-lines)) '(inhibit-startup-screen t) '(window-restore-killed-buffer-windows nil)) ;; Start Emacs; current buffer = *scratch* ;; C-x t 2 ; new tab ;; C-x k RET ; kill *scratch* ;; C-TAB ``` [who on Earth]: https://git.kevinlegouguec.net/dotfiles/tree/.emacs-custom.el ## Scratch pad In a temporary buffer: ``` foobar ^L foobaz (put-text-property 8 10 'display (propertize "\n" 'face '(:height 0.1 :inverse-video t))) ``` Possibly needs `:extend t` now? Grabbing the newline as well as the form-feed could be a way to ensure we do not fontify `^L`s embedded in strings?