[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: changing the display of formfeed characters
From: |
Javier |
Subject: |
Re: changing the display of formfeed characters |
Date: |
Mon, 3 Sep 2018 13:57:22 +0000 (UTC) |
User-agent: |
tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (Linux/3.18.6-1-ARCH (x86_64)) |
> You could use whitespace-mode itself to display form-feeds. Assuming you
> have whitespace-mode's newline style enabled, try evaling something like
> this before you start whitespace-mode:
>
> (add-to-list 'whitespace-display-mappings
> '(newline-mark ?\^L [?= ?= ?=]))
Thanks for the clue. This works.
But one needs to be aware that whitespace-display-mappings remains
undefined until you invoke whitespace-mode.
(setq whitespace-display-mappings
;;fancy chars from http://ergoemacs.org/emacs/modernization_formfeed.html
;; all numbers are unicode codepoint in decimal. e.g. (insert-char
182 1)
'((space-mark 32 [183] [46]) ; SPACE 32 「 」, 183 MIDDLE DOT 「·」, 46 FULL
STOP 「.」
(space-mark 160 [164] [95])
(newline-mark 10 [182 10]) ; LINE FEED,
(tab-mark 9 [9655 9] [92 9])) ; tab
(newline-mark ?\^L [?= ?= ?= ?= ?= ?= ?=]) ; FORM FEED
)
whitespace-mode now displays everything including ^L formfeed.
whitespace-newline-mode displays only newlines and formfeed.
> If you want the line to extend across the width of your current window,
> you could eval something like this instead:
>
> (add-to-list 'whitespace-display-mappings
> `(newline-mark ?\^L ,(make-vector (1- (window-width)) ?=)))
>
> You might also be able to use window-configuration-change-hook or
> similar to adapt the length of the line as you resize the width of your
> window.
>
This looks like adding more and more entries to the list
whitespace-display-mappings, but only the older one will be taken into
account.