help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: usability problem of emacs describe-mode


From: Drew Adams
Subject: RE: usability problem of emacs describe-mode
Date: Sat, 28 Feb 2009 07:47:56 -0800

> > > >     * Get rid of convention of using ^L (ascii 12) for 
> > > >       page break marker.
> >
> > > Is there a way to draw a sort of horizontal line for the ASCII 12
> > > symbol instead of printing "^L"? I'm talking about X version.
> >
> > Yes.
> > Code:http://www.emacswiki.org/emacs/pp-c-l.el
> > Description:http://www.emacswiki.org/emacs/PrettyControlL
> > You can customize the appearance.
> > The screenshot shows the default appearance.
> 
> Thanks Drew.
> I have now tried your code and it's great. I also updated it here:
> 
> . Usability Problems Of Emacs's Mode Documentation
>   http://xahlee.org/emacs/modernization_mode_doc.html
> 
> Btw, when i insert a ^L, it automatically become displayed as
> horizontal line but with the overlay display "Section (Printable
> Page)". Is there a way to turn that off? i.e. i just want a line.


Yes, and it's described in the file and the doc strings of the user options. To
quote:

------8<-------------------
* Option `pp^L-^L-string':

Highlighted string displayed in place of each Control-l (^L) character.
If `pp^L-^L-string-function' is non-nil, then the string that function
returns is used instead of `pp^L-^L-string'.

* Option `pp^L-^L-string-function':

Function to produce string displayed in place of each Control-l (^L) char.
If this is non-nil, then option `pp^L-^L-string' is not used.
You can use this option to have a dynamically defined display string.
For example, with `foo' as the value, and this definition, a
window-width horizontal line is displayed.

  (defun foo () (make-string (window-width) ?_))

In the library's Commentary:

Note: If you use option `pp^L-^L-string-function' to define the ^L
appearance based on the current window (e.g. its width), then you
might want to add command `refresh-pretty-control-l' to variable
`window-configuration-change-hook', to automatically update the ^L
display whenever you resize the window:

 (add-hook 'window-configuration-change-hook
           'refresh-pretty-control-l)
------8<-------------------

So:

* If you want a different static string from the default,
  "          Section (Printable Page)          ", then just
  customize `pp^L-^L-string'.

* If you want a dynamic string, such as a horizontal line for the
  full window width, even as the window is resized, then use
  `pp^L-^L-string-function'. That option can have a function value.
  If it does, then whatever string that function returns is used.

You can also customize the face used, and prefix and suffix strings to bookend
the basic string.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]