Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Emacs echo area during inactivity

The echo area is the line at the bottom of Emacs below the mode line:

                     ~                       ~
                     |                       |
                     +-----------------------+
                     |-U:--- mode-line       |
                     +-----------------------+
                     | M-x echo-area         |
                     +-----------------------+

Now the mode line is highly customizable while the echo area is more rigid (and unused a lot of the time). The question is pretty simple: is it possible to hide the echo area during inactivity and redisplay it once it needs your attention:

  ~                       ~             ~                       ~
  |                       |             |                       |
  |                       |             +-----------------------+
  |                       |             |-U:--- mode-line       |
  +-----------------------+             +-----------------------+
  |-U:--- mode-line       |             | M-x echo-area         |
  +-----------------------+             +-----------------------+

          Inactive                                Active

This is similar to the way Google Chrome displays URLs when you hover your mose over a link and the Firefox addon Pentadactyl where the command-line is hidden by default.

like image 683
Iceland_jack Avatar asked Feb 22 '11 14:02

Iceland_jack


3 Answers

This is NOT the answer to what you are asking, it will not give you the mini-buffer, but it will reclaim a bit of screen real estate

(defun toggle-mode-line () "toggles the modeline on and off"
  (interactive) 
  (setq mode-line-format
    (if (equal mode-line-format nil)
        (default-value 'mode-line-format)) )
  (redraw-display))

(global-set-key [M-f12] 'toggle-mode-line)

And for completeness sake, the hallmark of luddite-mode

(global-set-key [f12] '(lambda () (interactive) (menu-bar-mode nil) (scroll-bar-mode nil)))

Of course, it is desirable to start out with this:

(cond ((> emacs-major-version 20)
       (tool-bar-mode -1) ; introduced in emacs 21
       (menu-bar-mode -1)
       (scroll-bar-mode -1)
       (menu-bar-showhide-fringe-menu-customize-disable)
       (blink-cursor-mode -1)
       (windmove-default-keybindings 'meta)))

I will eagerly be awaiting the answer to this question and incorporate it in luddite-mode

like image 172
klang Avatar answered Nov 19 '22 11:11

klang


One thing you could do is split the minibuffer into its own frame, then hide and show it as needed.

(setq minibuffer-frame-alist (append '((auto-raise . t) (auto-lower . t)) minibuffer-frame-alist))
(setq initial-frame-alist (append '((minibuffer . nil)) initial-frame-alist))

You will lose echo area messages, but I gather you already don't care about that.


EDIT: the above was untested, and incomplete. This appears to work here:

(setq initial-frame-alist (append '((minibuffer . nil)) initial-frame-alist))
(setq default-frame-alist (append '((minibuffer . nil)) default-frame-alist))
(setq minibuffer-auto-raise t)
(setq minibuffer-exit-hook '(lambda () (lower-frame)))
like image 5
geekosaur Avatar answered Nov 19 '22 11:11

geekosaur


You could get a minibuffer-less frame by using this code

(setq default-minibuffer-frame
      (make-frame
       '((name . "minibuffer")
         (width . 0)
         (height . 0)
         (minibuffer . only)
         (top . 0)
         (left . 0)
         )))
(setq new-frame
      (make-frame
       '((name . "editor")
         (width . 80)
         (height . 30)
         (minibuffer . nil)
         (top . 50)
         (left . 0)
         )))

that I took and modified from here on SO.

Though it can create minibuffer-less frames, it appears impossible to get rid of minibuffer and make it appear only when needed as you describe with the Google Chrome's status bar example.

like image 4
vpit3833 Avatar answered Nov 19 '22 12:11

vpit3833