From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: Mode to display information in the topmost line of a window Date: Thu, 30 Jul 2009 17:58:21 +0200 Message-ID: References: <87r5vyw653.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1248969563 9959 80.91.229.12 (30 Jul 2009 15:59:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jul 2009 15:59:23 +0000 (UTC) Cc: Tassilo Horn , help-gnu-emacs@gnu.org To: Geralt Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 30 17:59:15 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MWY2F-0001n2-BP for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jul 2009 17:59:15 +0200 Original-Received: from localhost ([127.0.0.1]:50658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWY2E-0007vg-Q5 for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jul 2009 11:59:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWY1U-0007fs-CS for help-gnu-emacs@gnu.org; Thu, 30 Jul 2009 11:58:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWY1P-0007cY-NO for help-gnu-emacs@gnu.org; Thu, 30 Jul 2009 11:58:28 -0400 Original-Received: from [199.232.76.173] (port=47744 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWY1P-0007cH-Hz for help-gnu-emacs@gnu.org; Thu, 30 Jul 2009 11:58:23 -0400 Original-Received: from mail-yw0-f184.google.com ([209.85.211.184]:49445) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MWY1P-00075E-6g for help-gnu-emacs@gnu.org; Thu, 30 Jul 2009 11:58:23 -0400 Original-Received: by ywh14 with SMTP id 14so812395ywh.1 for ; Thu, 30 Jul 2009 08:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=LPRnMwcNbWbDfgg3VD2xnryq//LmQT9MO2HTOzNMqiI=; b=hxcUJRQL3mvXJgWWZULysPn9W7JC9RroO0HBGqqwRuxpBQAWZyl88fI02jrkbfWyxK KIu8VybMG5JULQIfDAXArHzCaywMEu77YoM8DDC90FWmOeDhEYyRH5lCL5LYykP5ouKQ rBYpRi8gMTTJZf9foMx4akR65HOHQNLOIN0UY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=hRwAfRFFyXWnB37E7FBTf+K8QtmxhZZotK6gtx2GzM6jUkyeZUP6V/IavHfJuf+w1S Bl6wAfcUxoYTxR6TuO2ffRnnQ1ozV2LWS8b1kEXVN2Y7NJISxk022zT+CDuuaJ0ZIfiY LShOFSoLkZp6YzUPt26dKlHh+AH/rcsuRCsQg= Original-Received: by 10.100.138.7 with SMTP id l7mr1780329and.141.1248969501828; Thu, 30 Jul 2009 08:58:21 -0700 (PDT) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:66523 Archived-At: On Thu, Jul 30, 2009 at 5:47 PM, Geralt wrote: > On Thu, Jul 30, 2009 at 5:19 PM, Tassilo Horn wro= te: >> Geralt 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. =C2=A0Do= 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 >> | >> | =C2=A0 Automatically becomes buffer-local when set in any fashion. >> | =C2=A0 This variable is potentially risky when used as a file local va= riable. >> | >> | 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) > =C2=A0(let ((omessage eldoc-last-message)) > =C2=A0 =C2=A0(setq eldoc-last-message > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cond ((eq (car args) eldoc-last-messag= e) eldoc-last-message) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((null (car args))= nil) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; If only one arg= , no formatting to do, so put it in > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; eldoc-last-mess= age so eq test above might succeed on > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; subsequent call= s. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((null (cdr args))= (car args)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(t (apply 'format = args)))) > =C2=A0 =C2=A0;; In emacs 19.29 and later, and XEmacs 19.13 and later, all= messages > =C2=A0 =C2=A0;; are recorded in a log. =C2=A0Do not put eldoc messages in= that log since > =C2=A0 =C2=A0;; they are Legion. > =C2=A0 =C2=A0;; Emacs way of preventing log messages. > =C2=A0 =C2=A0(let ((message-log-max nil)) > =C2=A0 =C2=A0 =C2=A0(cond (eldoc-last-message (setq header-line-format el= doc-last-message)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(omessage (message nil))))) > =C2=A0eldoc-last-message) > > > > What's the prefered way to overwrite a function? Just putting this one > into .emacs? Looking through it more carefully and submitting a patch to Emacs.