27

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.

Drew
  • 29,895
  • 7
  • 74
  • 104
Iceland_jack
  • 6,848
  • 7
  • 37
  • 46

5 Answers5

7

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

klang
  • 524
  • 3
  • 12
  • Why are you using `(menu-bar-showhide-fringe-menu-customize-disable)` instead of `(set-fringe-mode 0)`? – Rörd Feb 22 '11 at 20:54
  • Thanks for the response, the reason I asked was because I had vague ideas of merging the mode line and echo area together. I have already extensively customized the mode line and I doubt I'll set it to `nil` any time soon. `(setq max-mini-window-height 0)` has no effect —— it **is** possible to have a dedicated minibuffer (http://www.emacswiki.org/emacs/Dedicated_Minibuffer_Frame), using that with `make-frame-invisible` and a minibuffer hook might be the solution I'm looking for.. – Iceland_jack Feb 23 '11 at 22:22
5

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)))
geekosaur
  • 59,309
  • 11
  • 123
  • 114
4

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.

Community
  • 1
  • 1
vpit3833
  • 7,817
  • 2
  • 25
  • 25
  • 1
    I awarded you the bounty since the deadline was running out, your solution only describes a dedicated minibuffer frame though so I'll need solve this myself. – Iceland_jack Mar 08 '11 at 20:22
  • Thank you, I will be just as interested in having the minibuffer behave the way you describe it in the question. It will be good to reclaim some space in the netbook I use. – vpit3833 Mar 08 '11 at 23:58
  • @Iceland_jack, did you find a solution? – guilhermemtr Dec 13 '21 at 14:21
3

Technically, it's not possible to hide the echo area. However, I have an idea might might give the same appearance, under the assumption that you work with Emacs in a full-screen environment. In that case, a tool could resize the emacs window (the "frame" in emacs-speak) so that it would either fill the display or extend beyond the bottom of the display, depending on if the echo area should be visible or not.

Unfortunately, I don't have the time myself to implement this, so I leave it to somebody else to do this and to claim the bounty.

The first challenge is to find a good spot to make the resizing, one such place could be the post-command-hook. Other places might be minibuffer-setup-hook and minibuffer-setup-hook The second challenge is to decide if the echo area should be visible or not, I think that you can use current-message to check if a message is being displayed.

Lindydancer
  • 25,428
  • 4
  • 49
  • 68
1

As far as I know it's not possible to hide the echo area, and I would not agree with you that it is unused a lot of time. From buffer switching over M-x commands to minibuffer output, a lot of different stuff goes on in the echo area.

I can understand that on small displays, e.g., on netbooks etc. it is desirable to save screen estate. But I would argue that the echo area is used much more when you edit a file than the address bar of a web browser is used when you look at a web page. It's an integral part of Emacs.

Thomas
  • 17,016
  • 4
  • 46
  • 70
  • I never mentioned a browser's address bar although one could argue that Pentadactyl's command line is used just as much as Emacs' echo area. Nevertheless I have some ideas about integrating non-interactive features of the echo area into the {mode,header}\ line (or vice versa). Hell, I won't argue *why* — to me the motto of Emacs is *why not*. – Iceland_jack Feb 23 '11 at 18:43
  • 1
    Well, on a widescreen setup, after the first 50-80 characters, echo area is pretty much a waste of screen state. I can hold about 320 characters wide at work, so, uh, yeah, it's not used much in my workflow. – Paul Nathan Mar 02 '11 at 03:29