GNU bug report logs - #21025
tabulated-list.el: It should preserve header line set by derived modes. (Encl. a suggested PATCH)

Previous Next

Package: emacs;

Reported by: Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>

Date: Fri, 10 Jul 2015 01:37:03 UTC

Severity: minor

Tags: fixed

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21025 in the body.
You can then email your comments to 21025 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21025; Package emacs. (Fri, 10 Jul 2015 01:37:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 10 Jul 2015 01:37:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: tabulated-list.el:  It should preserve header line set by derived
 modes. (Encl. a suggested PATCH)
Date: Fri, 10 Jul 2015 00:02:09 +0530
[Message part 1 (text/plain, inline)]
tabulated-list.el: It should preserve header line set by derived
modes.  Also some fontification improvements.

1. Load the attached font-family.el.

2. M-x list-font-families.

3. Note that there is no header line when I explicitly request that I
   need a header line @ lines 25, 26 in font-family.el

      (setq tabulated-list-use-header-line nil)
      (setq header-line-format "Font families")

----------------------------------------------------------------

4. Apply the attached patch.

5. See that the header line is preserved (and stays put even when the
   columns are sorted and the buffer is refreshed).

6. Admire the revamped look of header columns.  (See the attached
   screenshot)

----------------------------------------------------------------

edictc.el -- my all new DICT client for Emacs -- uses header lines
when in tabulated list mode.  (See the attached screenshot.)  Btw, the
red strip is coming from whitespace mode.
[font-family.el (text/x-emacs-lisp, attachment)]
[tabulated-list.el.diff (text/x-patch, attachment)]
[tabulated-list-with-header-line-(after the fix).png (image/png, attachment)]
[a-preview-of-edictc.el-with-header-xref-buttons-and-header-line-in-tabulated-list-mode.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21025; Package emacs. (Sun, 12 Jul 2015 23:17:02 GMT) Full text and rfc822 format available.

Message #8 received at 21025 <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>
Cc: 21025 <at> debbugs.gnu.org
Subject: Re: bug#21025: tabulated-list.el: It should preserve header line set
 by derived modes. (Encl. a suggested PATCH)
Date: Mon, 13 Jul 2015 00:16:10 +0100
[Message part 1 (text/plain, inline)]
> 3. Note that there is no header line when I explicitly request that I
>    need a header line @ lines 25, 26 in font-family.el
>
>       (setq tabulated-list-use-header-line nil)
>       (setq header-line-format "Font families")

When you set that to nil you are explicitly asking tabulated-list to erase
the header line. Just leave it as t instead.
As long as you don't call init-header, the header will be left as you set
it.

> ----------------------------------------------------------------
>
> 4. Apply the attached patch.
>
> 5. See that the header line is preserved (and stays put even when the
>    columns are sorted and the buffer is refreshed).

Although your patch is technically unnecessary (what you want to do is
already possible) it might be good to apply anyway.
The line of code that you remove in your patch might break stuff, but if it
doesn't then it should be removed. But I'm not the right person to say
that.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21025; Package emacs. (Mon, 13 Jul 2015 15:41:01 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#21025: tabulated-list.el: It should preserve header line
 set by derived modes. (Encl. a suggested PATCH)
Date: Mon, 13 Jul 2015 08:25:57 +0530
On Monday 13 July 2015 04:46 AM, Artur Malabarba wrote:

> Although your patch is technically unnecessary (what you want to do is
> already possible)

Could you please share a recipe whereby I can get *both*

    a) the table header of the tabulated list.
    b) header line of the buffer.

The screenshots I attached shows what I hope to accomplish.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21025; Package emacs. (Mon, 13 Jul 2015 18:57:02 GMT) Full text and rfc822 format available.

Message #14 received at 21025 <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>
Cc: 21025 <at> debbugs.gnu.org
Subject: Re: bug#21025: tabulated-list.el: It should preserve header line set
 by derived modes. (Encl. a suggested PATCH)
Date: Mon, 13 Jul 2015 19:56:39 +0100
[Message part 1 (text/plain, inline)]
> Could you please share a recipe whereby I can get *both*
>
>     a) the table header of the tabulated list.
>     b) header line of the buffer.
>
> The screenshots I attached shows what I hope to accomplish.

Sorry, I was under the impression that you only wanted to have a custom
header line. Indeed, to achieve both of those things, your patch is
necessary.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21025; Package emacs. (Tue, 23 Feb 2016 09:45:02 GMT) Full text and rfc822 format available.

Message #17 received at 21025 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>
Cc: 21025 <at> debbugs.gnu.org
Subject: Re: bug#21025: tabulated-list.el: It should preserve header line set
 by derived modes. (Encl. a suggested PATCH)
Date: Tue, 23 Feb 2016 20:43:20 +1100
Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com> writes:

> 3. Note that there is no header line when I explicitly request that I
>    need a header line @ lines 25, 26 in font-family.el
>
>       (setq tabulated-list-use-header-line nil)
>       (setq header-line-format "Font families")

[...]

>      (if tabulated-list-use-header-line
>  	(setq header-line-format cols)
> -      (setq header-line-format nil)

I'm not very familiar with tabulated lists, but this seems like it's
fixing the problem you're seeing...

> -      (overlay-put tabulated-list--header-overlay 'face 'underline))))
> +      (overlay-put tabulated-list--header-overlay
> +                   'face '(:overline t :underline t :weight bold)))))

This might be more controversial, though.  I think it looks nice, but
some people don't like so many lines.  Perhaps it should be a defface,
so that people can change this themselves?  The default could be what
you're describing, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21025; Package emacs. (Tue, 25 Jun 2019 16:11:01 GMT) Full text and rfc822 format available.

Message #20 received at 21025 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>
Cc: 21025 <at> debbugs.gnu.org
Subject: Re: bug#21025: tabulated-list.el: It should preserve header line set
 by derived modes. (Encl. a suggested PATCH)
Date: Tue, 25 Jun 2019 18:10:21 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> -      (overlay-put tabulated-list--header-overlay 'face 'underline))))
>> +      (overlay-put tabulated-list--header-overlay
>> +                   'face '(:overline t :underline t :weight bold)))))
>
> This might be more controversial, though.  I think it looks nice, but
> some people don't like so many lines.  Perhaps it should be a defface,
> so that people can change this themselves?  The default could be what
> you're describing, though.

I've now done this change and otherwise applied your patch.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Jun 2019 16:12:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 21025 <at> debbugs.gnu.org and Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Jun 2019 16:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21025; Package emacs. (Tue, 25 Jun 2019 16:37:02 GMT) Full text and rfc822 format available.

Message #27 received at 21025 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Vaidheeswaran C
 <vaidheeswaran.chinnaraju <at> gmail.com>
Cc: 21025 <at> debbugs.gnu.org
Subject: RE: bug#21025: tabulated-list.el: It should preserve header line set
 by derived modes. (Encl. a suggested PATCH)
Date: Tue, 25 Jun 2019 09:35:57 -0700 (PDT)
> >> -      (overlay-put tabulated-list--header-overlay 'face 'underline))))
> >> +      (overlay-put tabulated-list--header-overlay
> >> +                   'face '(:overline t :underline t :weight bold)))))
> >
> > This might be more controversial, though.  I think it looks nice, but
> > some people don't like so many lines.  Perhaps it should be a defface,
> > so that people can change this themselves?  The default could be what
> > you're describing, though.
> 
> I've now done this change and otherwise applied your patch.

This is a bad way to do things - makes it difficult
for users do customize the appearance.  Emacs is "the
extensible, customizable, self-documenting, real-time
display editor".

The right way to take care of what is essentially a
user's preference for column-header appearance is not
to change the hard-coded appearance but to define a
face for this in `tabulated-list.el'.  Then ALL users
can get the appearance they want just by customizing
that face.

The face can have whatever default appearance you
want: underline, underline and overline - whatever.
But let users customize a face; do not hard-code one.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21025; Package emacs. (Tue, 25 Jun 2019 16:40:02 GMT) Full text and rfc822 format available.

Message #30 received at 21025 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>, 21025 <at> debbugs.gnu.org
Subject: Re: bug#21025: tabulated-list.el: It should preserve header line set
 by derived modes. (Encl. a suggested PATCH)
Date: Tue, 25 Jun 2019 18:39:24 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

>> >> -      (overlay-put tabulated-list--header-overlay 'face 'underline))))
>> >> +      (overlay-put tabulated-list--header-overlay
>> >> +                   'face '(:overline t :underline t :weight bold)))))
>> >
>> > This might be more controversial, though.  I think it looks nice, but
>> > some people don't like so many lines.  Perhaps it should be a defface,
>> > so that people can change this themselves?  The default could be what
>> > you're describing, though.
>> 
>> I've now done this change and otherwise applied your patch.
>
> This is a bad way to do things - makes it difficult
> for users do customize the appearance.  Emacs is "the
> extensible, customizable, self-documenting, real-time
> display editor".
>
> The right way to take care of what is essentially a
> user's preference for column-header appearance is not
> to change the hard-coded appearance but to define a
> face for this in `tabulated-list.el'.  Then ALL users
> can get the appearance they want just by customizing
> that face.

That's what I did, and that's what I said I did.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21025; Package emacs. (Tue, 25 Jun 2019 17:14:01 GMT) Full text and rfc822 format available.

Message #33 received at 21025 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Vaidheeswaran C <vaidheeswaran.chinnaraju <at> gmail.com>, 21025 <at> debbugs.gnu.org
Subject: RE: bug#21025: tabulated-list.el: It should preserve header line set
 by derived modes. (Encl. a suggested PATCH)
Date: Tue, 25 Jun 2019 10:12:49 -0700 (PDT)
> That's what I did, and that's what I said I did.

Sorry; my bad - didn't read well.  I thought the
bit of patch quoted was applied as is.  Thx for
DTRT.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 24 Jul 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 250 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.