Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In Emacs;

Is there a way for both window-display-table and buffer-display-table to have effect at the same time?

The reason is, I'm using Pretty-Control-L (from Emacs Goodies El script package) and whitespace (of whitespace.el, I think it is in the base Emacs distribution, but I’m not sure).

  • Pretty-Control-L visualizes form-feeds (^L) in a customized manner, by setting the entry for C-l in the window-local window-display-table.
  • Whitespace visualizes spaces, tabs and newlines by setting entries in the buffer-local buffer-display-table. (and also by using font-lock functionality).

These uses clashes (or rather, the use of a window-display-table and buffer-display-table clashes) since, if the window-display-table is non-nil it completely overrides any buffer-display-table for any buffer displayed in that window.

Quote from the Emacs Lisp manual:

38.21.2 Active Display Table

Each window can specify a display table, and so can each buffer. When a buffer B is displayed in window W, display uses the display table for window W if it has one; otherwise, the display table for buffer B if it has one; otherwise, the standard display table if any. The display table chosen is called the "active" display table.


(emphasis by me)

So, Is there any easy way to consolidate this? Or is the only way to re-code one of them to use the same mechanism as the other?

I've been considering writing a small (i.e. even smaller) crude variant of the form-feed visualization compatible with the white-space visualization that just uses some buffer-loading hook (or other) to put a hard-coded entry for ^L in the buffer-display-table. But I’d like to know if there’s any simpler alternative.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.