[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: usability problem of emacs describe-mode
From: |
Xah Lee |
Subject: |
Re: usability problem of emacs describe-mode |
Date: |
Wed, 25 Feb 2009 11:30:35 -0800 (PST) |
User-agent: |
G2/1.0 |
On Feb 25, 7:04 am, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > > * 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 and others.
I have currently these code:
;; code by Kevin Rodgers. 2009-02-25
(defun describe-major-mode ()
"Show inline doc for current major-mode."
(interactive)
(describe-function major-mode))
;; display page delimiter “^L” as a horizontal line. Code by Sébastien
Vauban. 2009-02-25
(or standard-display-table
(setq
standard-display-table (make-display-table)))
(aset standard-display-table ?\f (vconcat "\n" (make-vector 60 ?-) "^L
\n"))
;; Display the “^L” page break mark as a horizontal line
;; from http://www.emacswiki.org/emacs/OverlayControlL , 2009-02-25
;; code by Andre Riemann
(add-hook
'after-change-major-mode-hook
(lambda ()
(font-lock-add-keywords nil
`((,page-delimiter ;; variable with the regexp (usually "^\f" or
"^^L")
0
(prog1 nil
;; don't display ^L
(compose-region (match-beginning 0) (match-end 0) "")
;; make an overlay (like in hl-line)
(let ((pdl (make-overlay (line-beginning-position)
(line-beginning-position 2))))
;; :background has to be different from the background
color
;; gray1 here is just a little different from black
(overlay-put pdl 'face '(:underline "gray30" :background
"gray1"))
(overlay-put pdl 'modification-hooks
;; these arguments are received from
modification-hooks
'((lambda (overlay after-p begin end
&optional length)
(delete-overlay overlay))))
(overlay-put pdl 'insert-in-front-hooks
'((lambda (overlay after-p begin end
&optional length)
(delete-overlay overlay)))))) t)))))
(haven't tried Drew's PrettyControlL, the Andre code i just happened
to tried first)
If people think this is a problem, please perhaps file a bug report to
FSF. (Alt+x report-emacs-bug)
There are many diverse solutions on the web, but they need to become
part of emacs out of the box.
Xah
∑ http://xahlee.org/
☄
- Re: usability problem of emacs describe-mode, (continued)
Re: usability problem of emacs describe-mode, Kevin Rodgers, 2009/02/25
Re: usability problem of emacs describe-mode, address@hidden, 2009/02/25
Re: usability problem of emacs describe-mode, Tassilo Horn, 2009/02/25
RE: usability problem of emacs describe-mode, Drew Adams, 2009/02/25
Message not availableRe: usability problem of emacs describe-mode,
Xah Lee <=
Re: usability problem of emacs describe-mode, Teemu Likonen, 2009/02/25
Message not availableImproving Emacs (was: usability problem of emacs describe-mode), Teemu Likonen, 2009/02/26
RE: usability problem of emacs describe-mode, Drew Adams, 2009/02/26
Message not availableRe: usability problem of emacs describe-mode, Giorgos Keramidas, 2009/02/26
Message not availableMessage not availableRe: usability problem of emacs describe-mode, address@hidden, 2009/02/27
Re: usability problem of emacs describe-mode, Lennart Borgman, 2009/02/27
Message not availableMessage not availableRe: usability problem of emacs describe-mode, David Kastrup, 2009/02/27
Message not availableMessage not availableRe: usability problem of emacs describe-mode, Alan Mackenzie, 2009/02/27
Re: usability problem of emacs describe-mode, Xah Lee, 2009/02/27
Re: usability problem of emacs describe-mode, David Kastrup, 2009/02/27