emacs-devel
[Top][All Lists]
Advanced

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

Re: Customizing faces with `defcustom'


From: Juri Linkov
Subject: Re: Customizing faces with `defcustom'
Date: Sat, 31 Dec 2005 02:48:45 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> I appreciate your proposal but for one issue: `mode-line-buffer' would
> usually highlight that part of the modeline where "previous / next
> buffer" mouse clicks operate on.  Doing this differently for Info
> buffers appears counterintuitive.  On the other hand, it would be
> convenient to make the modeline part occupied by the Info node name
> sensitive for `Info-next' / `Info-prev' (or `Info-history-forward' /
> `Info-history-back').

Good idea.  I tried the following code and it works well.

(defvar Info-mode-line-node-keymap
  (let ((map (make-sparse-keymap)))
    (define-key map [mode-line mouse-1] 'Info-prev)
    (define-key map [mode-line mouse-3] 'Info-next)
    map)
  "Keymap to put on the Info node name in the mode line.")

(defun Info-set-mode-line ()
  (setq mode-line-buffer-identification
        (nconc (propertized-buffer-identification "%b")
               (list
                (concat
                 " ("
                 (if Info-current-file
                     (file-name-nondirectory Info-current-file)
                   "")
                 ") "
                 (if Info-current-node
                     (propertize Info-current-node
                                 'face 'info-mode-line-node
                                 'help-echo
                                 "mouse-1: previous node, mouse-3: next node"
                                 'mouse-face 'mode-line-highlight
                                 'local-map Info-mode-line-node-keymap)
                   ""))))))

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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