unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1503: feature request: multiline header (and mode) lines
@ 2008-12-06  6:43 Peter Mao
  2008-12-06 10:49 ` martin rudalics
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Mao @ 2008-12-06  6:43 UTC (permalink / raw)
  To: bug-gnu-emacs

I realize this requires tweaking of the C-code, but I'm not awesome
enough to do it myself:

Can emacs be given the gift of a header-line that word wraps, so that
the header can be more than one line tall?  I imagine the same could
go for the mode line, but I don't have a clear need for that right
now.  I know that the fringes can occupy > 1 column, so it seems like
an oversight if the header and mode lines are restricted to 1 line.

I've written a minor mode for reading/sorting physics abstracts from
the physics arXiv.  The mode either lists subdirectories directly
under the current directory, or recursively lists all subdirectories
of the pwd.  Either way, the list could potentially be longer than the
width of the screen, making some directory names unviewable.  A
multiline header would make it perfect.

I thought of putting that text in the buffer, but that makes it much
harder to update the text.

Peter Mao







^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1503: feature request: multiline header (and mode) lines
  2008-12-06  6:43 bug#1503: feature request: multiline header (and mode) lines Peter Mao
@ 2008-12-06 10:49 ` martin rudalics
  2021-10-20 15:53   ` Stefan Kangas
  0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2008-12-06 10:49 UTC (permalink / raw)
  To: 1503

 > Can emacs be given the gift of a header-line that word wraps, so that
 > the header can be more than one line tall?  I imagine the same could
 > go for the mode line, but I don't have a clear need for that right
 > now.  I know that the fringes can occupy > 1 column, so it seems like
 > an oversight if the header and mode lines are restricted to 1 line.
 >
 > I've written a minor mode for reading/sorting physics abstracts from
 > the physics arXiv.  The mode either lists subdirectories directly
 > under the current directory, or recursively lists all subdirectories
 > of the pwd.  Either way, the list could potentially be longer than the
 > width of the screen, making some directory names unviewable.  A
 > multiline header would make it perfect.
 >
 > I thought of putting that text in the buffer, but that makes it much
 > harder to update the text.

At the moment, we can't do that because the fact that a header-line
occupies exactly one line of text is hardwired into many lower-level
primitives.  In principle, what you want could be accomplished by the
routines below, but this will certainly have wrinkles (Emacs is not
really good at handling zero-length overlays).

martin


(defvar my-overlay (make-overlay (point-min) (point-min)))

(defun my-move (window start)
   (move-overlay my-overlay start start))

(add-hook 'window-scroll-functions 'my-move nil t)

(defun my-text (text)
   (overlay-put
    my-overlay 'before-string (propertize text 'face 'header-line)))

(my-text "a first line\nand another one\nand a third one\n")






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1503: feature request: multiline header (and mode) lines
  2008-12-06 10:49 ` martin rudalics
@ 2021-10-20 15:53   ` Stefan Kangas
  2021-10-20 16:46     ` Eli Zaretskii
  2021-10-21  9:06     ` martin rudalics
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Kangas @ 2021-10-20 15:53 UTC (permalink / raw)
  To: martin rudalics; +Cc: 1503

martin rudalics <rudalics@gmx.at> writes:

>> Can emacs be given the gift of a header-line that word wraps, so that
>> the header can be more than one line tall?  I imagine the same could
>> go for the mode line, but I don't have a clear need for that right
>> now.  I know that the fringes can occupy > 1 column, so it seems like
>> an oversight if the header and mode lines are restricted to 1 line.
>>
>> I've written a minor mode for reading/sorting physics abstracts from
>> the physics arXiv.  The mode either lists subdirectories directly
>> under the current directory, or recursively lists all subdirectories
>> of the pwd.  Either way, the list could potentially be longer than the
>> width of the screen, making some directory names unviewable.  A
>> multiline header would make it perfect.
>>
>> I thought of putting that text in the buffer, but that makes it much
>> harder to update the text.
>
> At the moment, we can't do that because the fact that a header-line
> occupies exactly one line of text is hardwired into many lower-level
> primitives.

Could those primitives be changed to support this use-case?

I'm not very interested in a multi-line mode-line myself, but I can see
many uses for a multi-line header line.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1503: feature request: multiline header (and mode) lines
  2021-10-20 15:53   ` Stefan Kangas
@ 2021-10-20 16:46     ` Eli Zaretskii
  2021-10-21  9:06     ` martin rudalics
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-10-20 16:46 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 1503

> From: Stefan Kangas <stefan@marxist.se>
> Date: Wed, 20 Oct 2021 08:53:45 -0700
> Cc: 1503@debbugs.gnu.org
> 
> >> I thought of putting that text in the buffer, but that makes it much
> >> harder to update the text.
> >
> > At the moment, we can't do that because the fact that a header-line
> > occupies exactly one line of text is hardwired into many lower-level
> > primitives.
> 
> Could those primitives be changed to support this use-case?

Of course.  It's just a lot of work, and will probably have a long
tail (because many places assume that without stating the assumption
clearly enough for you to catch it).





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1503: feature request: multiline header (and mode) lines
  2021-10-20 15:53   ` Stefan Kangas
  2021-10-20 16:46     ` Eli Zaretskii
@ 2021-10-21  9:06     ` martin rudalics
  2021-10-21 16:34       ` Stefan Kangas
  1 sibling, 1 reply; 7+ messages in thread
From: martin rudalics @ 2021-10-21  9:06 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 1503

 >>> Can emacs be given the gift of a header-line that word wraps, so that
 >>> the header can be more than one line tall?  I imagine the same could
 >>> go for the mode line, but I don't have a clear need for that right
 >>> now.  I know that the fringes can occupy > 1 column, so it seems like
 >>> an oversight if the header and mode lines are restricted to 1 line.
 >>>
 >>> I've written a minor mode for reading/sorting physics abstracts from
 >>> the physics arXiv.  The mode either lists subdirectories directly
 >>> under the current directory, or recursively lists all subdirectories
 >>> of the pwd.  Either way, the list could potentially be longer than the
 >>> width of the screen, making some directory names unviewable.  A
 >>> multiline header would make it perfect.
 >>>
 >>> I thought of putting that text in the buffer, but that makes it much
 >>> harder to update the text.
 >>
 >> At the moment, we can't do that because the fact that a header-line
 >> occupies exactly one line of text is hardwired into many lower-level
 >> primitives.
 >
 > Could those primitives be changed to support this use-case?
 >
 > I'm not very interested in a multi-line mode-line myself, but I can see
 > many uses for a multi-line header line.

IIUC the OP would be better served with a separate buffer for listing
these subdirectories shown above the window of his buffer.  To glue them
together, the two windows could be put into an atomic window.  Omitting
all decorations for that separate buffer, it would not be discernible
from a header line.

So if you see any use for a multi-line header line, please give me
details where a specification via 'header-line-format' would be
preferable to one that puts that stuff into a separate buffer.

martin





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1503: feature request: multiline header (and mode) lines
  2021-10-21  9:06     ` martin rudalics
@ 2021-10-21 16:34       ` Stefan Kangas
  2021-10-21 17:18         ` martin rudalics
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Kangas @ 2021-10-21 16:34 UTC (permalink / raw)
  To: martin rudalics; +Cc: 1503

martin rudalics <rudalics@gmx.at> writes:

> IIUC the OP would be better served with a separate buffer for listing
> these subdirectories shown above the window of his buffer.  To glue them
> together, the two windows could be put into an atomic window.  Omitting
> all decorations for that separate buffer, it would not be discernible
> from a header line.
>
> So if you see any use for a multi-line header line, please give me
> details where a specification via 'header-line-format' would be
> preferable to one that puts that stuff into a separate buffer.

One benefit of the header line is that it always stays in place, whereas
with a buffer you never know where it might end up.  Or is there a way
to force a buffer in place with the same strong guarantee?

We also might not want users to switch to that buffer, as it would be
more annoying than useful (e.g. headers in tabulated-list-mode).  AFAIU,
with a regular buffer you will always be able to switch to them with
`other-window'.

I was also going to say that with header-line-format you get horizontal
scrolling automatically, but it turns out that you don't.  In any case,
it seems like this feature shouldn't be too hard to add.  (I remember
now that I added code to fix that in one of my packages.)





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#1503: feature request: multiline header (and mode) lines
  2021-10-21 16:34       ` Stefan Kangas
@ 2021-10-21 17:18         ` martin rudalics
  0 siblings, 0 replies; 7+ messages in thread
From: martin rudalics @ 2021-10-21 17:18 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 1503

 > One benefit of the header line is that it always stays in place, whereas
 > with a buffer you never know where it might end up.  Or is there a way
 > to force a buffer in place with the same strong guarantee?

Why not?  Have you ever seen windows deliberately change places on a
frame?  Atomic windows are glued together like a window and its mode
lines.

 > We also might not want users to switch to that buffer, as it would be
 > more annoying than useful (e.g. headers in tabulated-list-mode).  AFAIU,
 > with a regular buffer you will always be able to switch to them with
 > `other-window'.

That's what the 'no-other-window' parameter is for.  With the slight
difference that with a window you can turn it off temporarily.

 > I was also going to say that with header-line-format you get horizontal
 > scrolling automatically, but it turns out that you don't.  In any case,
 > it seems like this feature shouldn't be too hard to add.  (I remember
 > now that I added code to fix that in one of my packages.)

XEmacs has it, IIRC.

martin





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-21 17:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-06  6:43 bug#1503: feature request: multiline header (and mode) lines Peter Mao
2008-12-06 10:49 ` martin rudalics
2021-10-20 15:53   ` Stefan Kangas
2021-10-20 16:46     ` Eli Zaretskii
2021-10-21  9:06     ` martin rudalics
2021-10-21 16:34       ` Stefan Kangas
2021-10-21 17:18         ` martin rudalics

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).