[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ElDoc: adding optional support to display messages in header-line in
From: |
Geralt |
Subject: |
Re: ElDoc: adding optional support to display messages in header-line instead of the echo area |
Date: |
Tue, 4 Aug 2009 20:50:14 +0200 |
On Tue, Aug 4, 2009 at 10:32 AM, martin rudalics<address@hidden> wrote:
>> can you explain why? I put the omessage into the ELSE block because
>> somebody on emacs-help suggested it and it made sense to me at that
>> time.
>
> Compiling eldoc.el after applying your patch gets me
>
> eldoc-new.el~:550:1:Warning: the function `omessage' is not known to be
> defined.
>
> This happens because in the
>
> (cond (eldoc-last-message (if eldoc-display-in-header-line
> (setq header-line-format
> eldoc-last-message)
> (message "%s" eldoc-last-message)
> (omessage (message nil)))))))
>
> form you misplaced the parentheses and thus `omessage' is not considered
> a condition of some clause of the `cond' special form but as a function
> call.
>
> BTW, I suppose you also need to call `force-mode-line-update' because
> Emacs does not necessarily update the contents of the header line when
> just moving point.
>
> martin
>
Ok, I did all the changes, here's the patch with all the changes:
--- eldoc.el 2009-08-04 20:48:20.789335848 +0200
+++ eldoc.el 2009-08-04 20:47:34.350337476 +0200
@@ -105,6 +105,11 @@
enable argument list to fit on one line" truncate-sym-name-if-fit))
:group 'eldoc)
+(defcustom eldoc-display-in-header-line nil
+ "If set eldoc will display its messages in the topmost line of the
window, called the header-line, instead of the echo area."
+ :type 'boolean
+ :group 'eldoc)
+
(defface eldoc-highlight-function-argument
'((t (:inherit bold)))
"Face used for the argument at point in a function's argument list.
@@ -201,7 +206,11 @@
;; they are Legion.
;; Emacs way of preventing log messages.
(let ((message-log-max nil))
- (cond (eldoc-last-message (message "%s" eldoc-last-message))
+ (cond (eldoc-last-message (if eldoc-display-in-header-line
+ (progn
+ (setq header-line-format
eldoc-last-message)
+ (force-mode-line-update))
+ (message "%s" eldoc-last-message)))
(omessage (message nil)))))
eldoc-last-message)
Geralt.
Re: ElDoc: adding optional support to display messages in header-line, Stefan Monnier, 2009/08/04