From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Geralt Newsgroups: gmane.emacs.devel 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 Message-ID: References: <4A755D64.6070400@gmx.at> <4A77F213.6070808@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1249414958 2167 80.91.229.12 (4 Aug 2009 19:42:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Aug 2009 19:42:38 +0000 (UTC) Cc: Tassilo Horn , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 04 21:42:30 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MYPu2-0005xG-Cd for ged-emacs-devel@m.gmane.org; Tue, 04 Aug 2009 21:42:30 +0200 Original-Received: from localhost ([127.0.0.1]:45971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYPu1-0001Yj-SY for ged-emacs-devel@m.gmane.org; Tue, 04 Aug 2009 15:42:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYP5Y-0006cv-Uj for emacs-devel@gnu.org; Tue, 04 Aug 2009 14:50:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYP5U-0006YG-CF for emacs-devel@gnu.org; Tue, 04 Aug 2009 14:50:20 -0400 Original-Received: from [199.232.76.173] (port=50040 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYP5U-0006Y6-9N for emacs-devel@gnu.org; Tue, 04 Aug 2009 14:50:16 -0400 Original-Received: from mail-ew0-f211.google.com ([209.85.219.211]:36103) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MYP5T-0007IO-PV for emacs-devel@gnu.org; Tue, 04 Aug 2009 14:50:16 -0400 Original-Received: by ewy7 with SMTP id 7so915498ewy.42 for ; Tue, 04 Aug 2009 11:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=SoOHEfy/yJE+TUsYCn6Jp0dPgcp+6O3XKY/AjHAOUAo=; b=swAkFYJVb1JF5HYbhVIlywbjNlw/YyPvFZBbpST6sbbzDw0IfC7QFwn1NJSFPrVPbb cQbc78hRS9aDKA/kJDTzoRo3P+STkNCic+eEJN7iphPwLVuJHtngNnWQq0nSpblx8R6k GFkI83lHrYRgRv0a/e+M75rqcev95OsRw+xlk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lpMopVCb3xVcD5mypm44EXMDrJBmLo88hQMRRAGH4H/cd/0G1C97qTSmWSQHjSGwUs /vdlu/C0+XIgZtz1LSbIanbrbR6LbDmHKMtEZFD3mOcJyBv8gsjwMGD6avzwPP190v7f Q12bfqCrreS+uTn381V243EaMrd39VUiPJdaw= Original-Received: by 10.216.29.66 with SMTP id h44mr1517473wea.136.1249411814134; Tue, 04 Aug 2009 11:50:14 -0700 (PDT) In-Reply-To: <4A77F213.6070808@gmx.at> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Tue, 04 Aug 2009 15:42:23 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113676 Archived-At: On Tue, Aug 4, 2009 at 10:32 AM, martin rudalics 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 > =A0 =A0defined. > > This happens because in the > > =A0 =A0 =A0(cond (eldoc-last-message (if eldoc-display-in-header-line > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(s= etq header-line-format > eldoc-last-message) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(messa= ge "%s" eldoc-last-message) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(omess= age (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.