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

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

Re: mode-line now has WAY fewer items on it! eg follow-mode


From: Emanuel Berg
Subject: Re: mode-line now has WAY fewer items on it! eg follow-mode
Date: Wed, 09 Oct 2013 21:55:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

dkcombs@panix.com (David Combs) writes:

> Even an abbreviation would be better than nothing:
> follow rather than follow-mode, say.  Of foll.

I don't know exactly what you are after but I managed to
fix the mode-line issue in my early Emacs days with the
below material [1]. I you (or anyone else) know how to
improve it do tell.

Here is a dump [2] that shows that, at the surface at
least, it works. But I wonder if those functions get
called an unnecessary amount of times?

Yes, how *do* you setup the mode line, on a mode-basis,
the standard way?

[1]

;; mode line / mode bar color and face
(defun set-mode-bar-colors (f b)
  (interactive "s Background (bar) color: \ns Foreground (face) color: ")
  (set-face-attribute 'modeline nil
                      :reverse-video nil
                      :background f :foreground b) )
(set-mode-bar-colors "blue" "white")
;; minibuffer
(set-face-foreground 'minibuffer-prompt "green")

;; mode line: what to show
(defvar *show-mode-line-caption*)
(setq *show-mode-line-caption* nil)
(defvar *mode-line-caption*)
(defvar *show-mode-line-modified*)
(setq *show-mode-line-modified* t)
(defvar *show-default-directory*)
(setq *show-default-directory* t)
(defvar *show-mode-line-buffer-identification*)
(setq *show-mode-line-buffer-identification* t)
(defvar *show-mode-line-modes*)
(setq *show-mode-line-modes* nil)
(setq column-number-mode nil)
(setq line-number-mode nil)

(defun set-mode-line ()
  (interactive)
  (setq-default mode-line-format
   `(" "
     (*silly-projector* "          ")
     (*show-mode-line-modified* mode-line-modified)
     (*show-mode-line-modified* " ")
     (*show-mode-line-caption* *mode-line-caption*)
     (*show-mode-line-caption* " ")
     (*show-default-directory* default-directory)
     (*show-mode-line-buffer-identification* mode-line-buffer-identification)
     (*show-mode-line-buffer-identification* " ")
     (line-number-mode   "[%l] ")
     (column-number-mode "{%c} ")
     (*show-mode-line-modes* mode-line-modes) )))
(set-mode-line)

;; example for local mode
(defun set-buffer-menu-mode-line ()
  "Mode line: Set the mode line for Buffer Menu mode."
  (set-variable '*mode-line-caption*                     ""  t)
  (set-variable '*show-mode-line-caption*                nil t)
  (set-variable '*show-mode-line-modified*               nil t)
  (set-variable '*show-default-directory*                nil t)
  (set-variable '*show-mode-line-buffer-identification*  t   t)
  (set-variable '*show-mode-line-modes*                  nil t)
  (set-variable 'column-number-mode                      nil t)
  (set-variable 'line-number-mode                        nil t) )
(add-hook 'buffer-menu-mode-hook 'set-buffer-menu-mode-line)

[2] http://user.it.uu.se/~embe8573/pics/usenet.png

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


reply via email to

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