[Top][All Lists]

[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" <address@hidden> 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:
> Description:
> 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."
  (describe-function major-mode))

;; display page delimiter “^L” as a horizontal line. Code by Sébastien
Vauban. 2009-02-25
(or standard-display-table
     standard-display-table (make-display-table)))
(aset standard-display-table ?\f (vconcat "\n" (make-vector 60 ?-) "^L

;; Display the “^L” page break mark as a horizontal line
;; from , 2009-02-25
;; code by Andre Riemann
 (lambda ()
   (font-lock-add-keywords nil
    `((,page-delimiter ;; variable with the regexp (usually "^\f" or
        (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
            ;; gray1 here is just a little different from black
            (overlay-put pdl 'face '(:underline "gray30" :background
            (overlay-put pdl 'modification-hooks
                         ;; these arguments are received from
                         '((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.


reply via email to

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