unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Geralt <usr.gentoo@googlemail.com>
To: emacs-devel@gnu.org
Subject: ElDoc: adding optional support to display messages in header-line  instead of the echo area
Date: Sat, 1 Aug 2009 11:46:55 +0200	[thread overview]
Message-ID: <fbdd0e50908010246i2b7e8b80m9cfcf70e9df1616d@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]

Hi,

I've added to ElDoc a customizable flag to redirect the output into
the header-line instead of the echo area. It's my first contribution
and I'm not sure if the patch is implementing the functionality good
enough to make it into Emacs. I'd like to hear your feedback :)

Here's the patch (and as attachement too, because GoogleMail is doing
changes to whitespace):
--- eldoc.el	2009-07-31 18:03:58.000000000 +0200
+++ eldoc.el	2009-08-01 11:43:29.587798820 +0200
@@ -105,6 +105,12 @@
  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.
+Use only when eldoc-echo-area-use-multiline-p is set to nil."
+  :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,8 +207,10 @@
     ;; they are Legion.
     ;; Emacs way of preventing log messages.
     (let ((message-log-max nil))
-      (cond (eldoc-last-message (message "%s" eldoc-last-message))
-	    (omessage (message nil)))))
+      (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)))))))
   eldoc-last-message)

 ;; This function goes on pre-command-hook for XEmacs or when using idle




Geralt.

[-- Attachment #2: eldoc-display-in-header-line.patch --]
[-- Type: application/octet-stream, Size: 1148 bytes --]

--- eldoc.el	2009-07-31 18:03:58.000000000 +0200
+++ eldoc.el	2009-08-01 11:43:29.587798820 +0200
@@ -105,6 +105,12 @@
  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.
+Use only when eldoc-echo-area-use-multiline-p is set to nil."
+  :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,8 +207,10 @@
     ;; they are Legion.
     ;; Emacs way of preventing log messages.
     (let ((message-log-max nil))
-      (cond (eldoc-last-message (message "%s" eldoc-last-message))
-	    (omessage (message nil)))))
+      (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)))))))
   eldoc-last-message)
 
 ;; This function goes on pre-command-hook for XEmacs or when using idle

             reply	other threads:[~2009-08-01  9:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-01  9:46 Geralt [this message]
2009-08-02  9:33 ` ElDoc: adding optional support to display messages in header-line instead of the echo area martin rudalics
2009-08-03 21:47   ` Geralt
2009-08-04  7:10     ` Tassilo Horn
2009-08-04  8:32     ` martin rudalics
2009-08-04 18:50       ` Geralt
2009-08-04 17:05 ` ElDoc: adding optional support to display messages in header-line Stefan Monnier
2009-08-04 19:05   ` Geralt
2009-08-05  2:00     ` Stefan Monnier
2009-08-06 18:50       ` Geralt
2009-08-04 17:07 ` Stefan Monnier
2009-08-04 19:06   ` Geralt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fbdd0e50908010246i2b7e8b80m9cfcf70e9df1616d@mail.gmail.com \
    --to=usr.gentoo@googlemail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).