* Mode to display information in the topmost line of a window @ 2009-07-30 12:38 Geralt 2009-07-30 15:19 ` Tassilo Horn 0 siblings, 1 reply; 13+ messages in thread From: Geralt @ 2009-07-30 12:38 UTC (permalink / raw) To: Emacs Help List Hi, 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? And if yes do you know if it's possible to display ElDoc's output in this line instead of the echo area? Thanks, Geralt. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-30 12:38 Mode to display information in the topmost line of a window Geralt @ 2009-07-30 15:19 ` Tassilo Horn 2009-07-30 15:47 ` Geralt 0 siblings, 1 reply; 13+ messages in thread From: Tassilo Horn @ 2009-07-30 15:19 UTC (permalink / raw) To: help-gnu-emacs 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 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-30 15:19 ` Tassilo Horn @ 2009-07-30 15:47 ` Geralt 2009-07-30 15:58 ` Lennart Borgman ` (2 more replies) 0 siblings, 3 replies; 13+ messages in thread From: Geralt @ 2009-07-30 15:47 UTC (permalink / raw) To: Tassilo Horn; +Cc: help-gnu-emacs 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. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-30 15:47 ` Geralt @ 2009-07-30 15:58 ` Lennart Borgman 2009-07-30 16:00 ` Tassilo Horn 2009-07-31 4:08 ` Kevin Rodgers 2 siblings, 0 replies; 13+ messages in thread From: Lennart Borgman @ 2009-07-30 15:58 UTC (permalink / raw) To: Geralt; +Cc: Tassilo Horn, help-gnu-emacs On Thu, Jul 30, 2009 at 5:47 PM, Geralt<usr.gentoo@googlemail.com> wrote: > 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? Looking through it more carefully and submitting a patch to Emacs. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-30 15:47 ` Geralt 2009-07-30 15:58 ` Lennart Borgman @ 2009-07-30 16:00 ` Tassilo Horn 2009-07-31 4:08 ` Kevin Rodgers 2 siblings, 0 replies; 13+ messages in thread From: Tassilo Horn @ 2009-07-30 16:00 UTC (permalink / raw) To: Geralt; +Cc: help-gnu-emacs Geralt <usr.gentoo@googlemail.com> writes: Hi Geralt, > thanks, that helped me a lot! From what I've found it's as simple as > changing eldoc-message to: > [...] Great! > What's the prefered way to overwrite a function? Just putting this one > into .emacs? Yes. Bye, Tassilo ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-30 15:47 ` Geralt 2009-07-30 15:58 ` Lennart Borgman 2009-07-30 16:00 ` Tassilo Horn @ 2009-07-31 4:08 ` Kevin Rodgers 2009-07-31 7:12 ` Tassilo Horn 2 siblings, 1 reply; 13+ messages in thread From: Kevin Rodgers @ 2009-07-31 4:08 UTC (permalink / raw) To: help-gnu-emacs Geralt wrote: > What's the prefered way to overwrite a function? Just putting this one > into .emacs? Don't overwrite it, so that you don't have to track changes to its implementation: (defadvice eldoc-message (after header-line-format activate) "If `eldoc-last-message' is non-nil, set `header-line-format'." (when eldoc-last-message (setq header-line-format 'eldoc-last-message) (force-mode-line-update))) -- Kevin Rodgers Denver, Colorado, USA ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-31 4:08 ` Kevin Rodgers @ 2009-07-31 7:12 ` Tassilo Horn 2009-07-31 16:03 ` Geralt 0 siblings, 1 reply; 13+ messages in thread From: Tassilo Horn @ 2009-07-31 7:12 UTC (permalink / raw) To: help-gnu-emacs Kevin Rodgers <kevin.d.rodgers@gmail.com> writes: Hi Kevin, >> What's the prefered way to overwrite a function? Just putting this >> one into .emacs? > > Don't overwrite it, so that you don't have to track changes to its > implementation: > > (defadvice eldoc-message (after header-line-format activate) > "If `eldoc-last-message' is non-nil, set `header-line-format'." > (when eldoc-last-message > (setq header-line-format 'eldoc-last-message) > (force-mode-line-update))) I'd generally agree, but I guess Gerald doesn't want to duplicate the eldoc output in the header line, but instead he wants it to be there only. BTW: In contrast to the echo area, the header-line allows only one single line of content. So you might want to let-bind `eldoc-echo-area-use-multiline-p' to nil. BTW2: I think this eldoc-in-header-line is really nice. Gerald, you might want to built that into eldoc.el directly as an option, and submit a patch to emacs-devel, so that others can share the experience. Bye, Tassilo ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-31 7:12 ` Tassilo Horn @ 2009-07-31 16:03 ` Geralt 2009-07-31 16:19 ` Drew Adams 0 siblings, 1 reply; 13+ messages in thread From: Geralt @ 2009-07-31 16:03 UTC (permalink / raw) To: Tassilo Horn, kevin.d.rodgers; +Cc: help-gnu-emacs On Fri, Jul 31, 2009 at 9:12 AM, Tassilo Horn<tassilo@member.fsf.org> wrote: > Kevin Rodgers <kevin.d.rodgers@gmail.com> writes: > > Hi Kevin, > >>> What's the prefered way to overwrite a function? Just putting this >>> one into .emacs? >> >> Don't overwrite it, so that you don't have to track changes to its >> implementation: >> >> (defadvice eldoc-message (after header-line-format activate) >> "If `eldoc-last-message' is non-nil, set `header-line-format'." >> (when eldoc-last-message >> (setq header-line-format 'eldoc-last-message) >> (force-mode-line-update))) > > I'd generally agree, but I guess Gerald doesn't want to duplicate the > eldoc output in the header line, but instead he wants it to be there > only. > Hi, yes, that's right, I want the information in the header line only. > BTW: In contrast to the echo area, the header-line allows only one > single line of content. So you might want to let-bind > `eldoc-echo-area-use-multiline-p' to nil. > That's right, but I'm using ElDoc not for Emacs Lisp, but with c-eldoc[1] to display C function signatures, or anything C-related that's at point. I don't like it if ElDoc is overwriting all the time the messages in the echo area, the header line is a better place for that (I think), but only since it's rarely used (and thus it's never overwriting anything). > BTW2: I think this eldoc-in-header-line is really nice. Gerald, you > might want to built that into eldoc.el directly as an option, and submit > a patch to emacs-devel, so that others can share the experience. > I can try, but my Emacs Lisp knowledge is quite limited, I'll try to come up with something customizable and I'll post it here for review :) Geralt. P.S. It's Geralt with a t at the end (and don't worry, no offensive taken!). ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: Mode to display information in the topmost line of a window 2009-07-31 16:03 ` Geralt @ 2009-07-31 16:19 ` Drew Adams 2009-07-31 23:46 ` Geralt 0 siblings, 1 reply; 13+ messages in thread From: Drew Adams @ 2009-07-31 16:19 UTC (permalink / raw) To: 'Geralt', 'Tassilo Horn', kevin.d.rodgers; +Cc: help-gnu-emacs As an alternative, you might want to put the info in the mode line. This is what I use: (defun show-in-mode-line (text &optional buffer) "Display TEXT in BUFFER's mode line for 10 sec (or until user event). Note: This sits for 10 sec or until a user event, so call this last in a sequence of user-visible actions." (with-current-buffer (or buffer (current-buffer)) (make-local-variable 'mode-line-format) (let ((mode-line-format text)) (force-mode-line-update) (sit-for 10)) (force-mode-line-update))) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-31 16:19 ` Drew Adams @ 2009-07-31 23:46 ` Geralt 2009-07-31 23:51 ` Lennart Borgman 2009-07-31 23:56 ` Drew Adams 0 siblings, 2 replies; 13+ messages in thread From: Geralt @ 2009-07-31 23:46 UTC (permalink / raw) To: Drew Adams; +Cc: Tassilo Horn, kevin.d.rodgers, help-gnu-emacs [-- Attachment #1: Type: text/plain, Size: 1998 bytes --] On Fri, Jul 31, 2009 at 6:19 PM, Drew Adams<drew.adams@oracle.com> wrote: > As an alternative, you might want to put the info in the mode line. > This is what I use: > > (defun show-in-mode-line (text &optional buffer) > "Display TEXT in BUFFER's mode line for 10 sec (or until user event). > Note: This sits for 10 sec or until a user event, so call this last in > a sequence of user-visible actions." > (with-current-buffer (or buffer (current-buffer)) > (make-local-variable 'mode-line-format) > (let ((mode-line-format text)) > (force-mode-line-update) (sit-for 10)) > (force-mode-line-update))) > > Hi, I've already got a lot of information there, especially when I'm clocking a task with org-mode. I've finished the changes to eldoc and here's a patch containing them (but you better try the patch in the attachement since GoogleMail is doing some changes to whitespace): --- eldoc.el 2009-07-31 18:03:58.000000000 +0200 +++ eldoc.el 2009-08-01 01:30:34.732647994 +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,9 @@ ;; 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 + (setq header-line-format eldoc-last-message) + (message "%s" eldoc-last-message))) (omessage (message nil))))) eldoc-last-message) Do you think that's good enough for a submission? Geralt. [-- Attachment #2: eldoc-display-in-header-line.patch --] [-- Type: application/octet-stream, Size: 977 bytes --] --- eldoc.el 2009-07-31 18:03:58.000000000 +0200 +++ eldoc.el 2009-08-01 01:30:34.732647994 +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,9 @@ ;; 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 + (setq header-line-format eldoc-last-message) + (message "%s" eldoc-last-message))) (omessage (message nil))))) eldoc-last-message) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-31 23:46 ` Geralt @ 2009-07-31 23:51 ` Lennart Borgman 2009-08-01 9:30 ` Geralt 2009-07-31 23:56 ` Drew Adams 1 sibling, 1 reply; 13+ messages in thread From: Lennart Borgman @ 2009-07-31 23:51 UTC (permalink / raw) To: Geralt; +Cc: Tassilo Horn, kevin.d.rodgers, help-gnu-emacs On Sat, Aug 1, 2009 at 1:46 AM, Geralt<usr.gentoo@googlemail.com> wrote: > (let ((message-log-max nil)) > - (cond (eldoc-last-message (message "%s" eldoc-last-message)) > + (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) Isn't the line (omessage (message nil)) clearing old messages in the message area? If the head-line is used that should not be needed. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Mode to display information in the topmost line of a window 2009-07-31 23:51 ` Lennart Borgman @ 2009-08-01 9:30 ` Geralt 0 siblings, 0 replies; 13+ messages in thread From: Geralt @ 2009-08-01 9:30 UTC (permalink / raw) To: Lennart Borgman; +Cc: Tassilo Horn, kevin.d.rodgers, help-gnu-emacs On Sat, Aug 1, 2009 at 1:51 AM, Lennart Borgman<lennart.borgman@gmail.com> wrote: > On Sat, Aug 1, 2009 at 1:46 AM, Geralt<usr.gentoo@googlemail.com> wrote: >> (let ((message-log-max nil)) >> - (cond (eldoc-last-message (message "%s" eldoc-last-message)) >> + (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) > > Isn't the line (omessage (message nil)) clearing old messages in the > message area? If the head-line is used that should not be needed. > Yes, you're right, I'll put that one into the ELSE clause and then I'll submit it to emacs-devel@gnu.org Geralt. ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: Mode to display information in the topmost line of a window 2009-07-31 23:46 ` Geralt 2009-07-31 23:51 ` Lennart Borgman @ 2009-07-31 23:56 ` Drew Adams 1 sibling, 0 replies; 13+ messages in thread From: Drew Adams @ 2009-07-31 23:56 UTC (permalink / raw) To: 'Geralt'; +Cc: 'Tassilo Horn', kevin.d.rodgers, help-gnu-emacs > I've finished the changes to eldoc and here's a patch containing them ... > Do you think that's good enough for a submission? Send it to emacs-devel@gnu.org, and ask there. They will let you know what, if anything, might need to be changed. help-gnu-emacs is not the best list to find out whether a patch is good enough for a submission. emacs-devel is perfect for that question. ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2009-08-01 9:30 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-07-30 12:38 Mode to display information in the topmost line of a window Geralt 2009-07-30 15:19 ` Tassilo Horn 2009-07-30 15:47 ` Geralt 2009-07-30 15:58 ` Lennart Borgman 2009-07-30 16:00 ` Tassilo Horn 2009-07-31 4:08 ` Kevin Rodgers 2009-07-31 7:12 ` Tassilo Horn 2009-07-31 16:03 ` Geralt 2009-07-31 16:19 ` Drew Adams 2009-07-31 23:46 ` Geralt 2009-07-31 23:51 ` Lennart Borgman 2009-08-01 9:30 ` Geralt 2009-07-31 23:56 ` Drew Adams
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).