[Top][All Lists]

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

Viewing the *Messages* buffer is too inconvenient

From: Algol Petrofsky
Subject: Viewing the *Messages* buffer is too inconvenient
Date: Sun, 6 Jan 2002 16:54:13 -0800

Viewing recent echo area messages is at least as frequently useful as
viewing recent input (C-h l), and similarly deserves a convenient key
binding.  I suggest C-h M.  This would also make it possible to
discover the message log feature through C-h a.  Here's an

(defun view-messages ()
  "View the log of recent echo-area messages.

The number of messages retained is specified by the variable `message-log-max'."
  (switch-to-buffer (get-buffer-create "*Messages*")))

(global-set-key "\C-hM" view-messages)

If you adopt this, the help-for-help text would also need to be
updated.  (And that will make the message log feature discoverable by
C-h C-h as well as by C-h a.)

It might also make sense for a mouse click in the echo area to invoke
view-messages.  To implement that cleanly might require a new
echo-area pseudo-event command prefix analogous to vertical-line and
friends.  Then we could write:

  (global-set-key [echo-area mouse-1] 'view-messages)

I started to implement this, but I got confused about what the Right
Thing was when I realized that the echo area can have a scrollbar,
which already has its own pseudo-event type.  Here's a simpler,
kludgier implementation for your consideration:

(defun mouse-drag-region-or-view-messages (event)
  "Call `mouse-drag-region', or, if in the echo area, `view-messages'.
\"The echo area\" means any inactive miniwindow.
Like mouse-drag-region, this must be bound to a button-down mouse event."
  (interactive "e")
  (let ((w (posn-window (event-start event))))
    (if (or (not (window-minibuffer-p w))
            (minibuffer-window-active-p w))
        (mouse-drag-region event)
      ;; Discard the up event.

(global-set-key [down-mouse-1] 'mouse-drag-region-or-view-messages)


reply via email to

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