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

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

Re: Mode to display information in the topmost line of a window


From: Geralt
Subject: Re: Mode to display information in the topmost line of a window
Date: Thu, 30 Jul 2009 17:47:42 +0200

On Thu, Jul 30, 2009 at 5:19 PM, Tassilo Horn<tassilo@member.fsf.org> wrote:
> Geralt <usr.gentoo@googlemail.com> writes:
>
> Hi Geralt,
>
>> iirc there's a mode in Emacs to display some information in the
>> topmost line of a window, but I don't recall its name anymore.  Do you
>> know what I'm talking about?
>
> Yes, but it's no mode, it's a simple variable you can set.
>
> ,----[ C-h v header-line-format RET ]
> | header-line-format is a variable defined in `C source code'.
> | Its value is nil
> |
> |   Automatically becomes buffer-local when set in any fashion.
> |   This variable is potentially risky when used as a file local variable.
> |
> | Documentation:
> | Analogous to `mode-line-format', but controls the header line.
> | The header line appears, optionally, at the top of a window;
> | the mode line appears at the bottom.
> `----
>
>> And if yes do you know if it's possible to display ElDoc's output in
>> this line instead of the echo area?
>
> I guess you could redefine the function `eldoc-message' and set
> `header-line-format' there.
>
> Bye,
> Tassilo
>
>
>
>
Hi Tassilo,

thanks, that helped me a lot! From what I've found it's as simple as
changing eldoc-message to:

(defun eldoc-message (&rest args)
  (let ((omessage eldoc-last-message))
    (setq eldoc-last-message
          (cond ((eq (car args) eldoc-last-message) eldoc-last-message)
                ((null (car args)) nil)
                ;; If only one arg, no formatting to do, so put it in
                ;; eldoc-last-message so eq test above might succeed on
                ;; subsequent calls.
                ((null (cdr args)) (car args))
                (t (apply 'format args))))
    ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages
    ;; are recorded in a log.  Do not put eldoc messages in that log since
    ;; they are Legion.
    ;; Emacs way of preventing log messages.
    (let ((message-log-max nil))
      (cond (eldoc-last-message (setq header-line-format eldoc-last-message))
            (omessage (message nil)))))
  eldoc-last-message)



What's the prefered way to overwrite a function? Just putting this one
into .emacs?




Geralt.




reply via email to

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