GNU bug report logs - #13563
tabulated-list-print-col nicer help-echo

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Sat, 26 Jan 2013 21:16:02 UTC

Severity: minor

Tags: patch

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.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 13563 in the body.
You can then email your comments to 13563 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#13563; Package emacs. (Sat, 26 Jan 2013 21:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonas Bernoulli <jonas <at> bernoul.li>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 26 Jan 2013 21:16:02 GMT) Full text and rfc822 format available.

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

From: Jonas Bernoulli <jonas <at> bernoul.li>
To: bug-gnu-emacs <at> gnu.org
Subject: tabulated-list-print-col nicer help-echo
Date: Sat, 26 Jan 2013 22:14:37 +0100
[Message part 1 (text/plain, inline)]
`tabulated-list-set-col' adds a help-echo property to the "labels" that
it inserts.  With this patch this is done a bit differently:

* If the label already has a help-echo property then use that help-echo
  instead of overriding it with a generic one.  This allows displaying
  additional information when it makes sense.
* Otherwise propertize as before but don't prefix the help-echo with the
  column name.  That information is not really useful.

[tabulated-list-print-col.patch (text/x-diff, inline)]
From bbe78adda05897c892ea3c3687912a4c056d6fe1 Mon Sep 17 00:00:00 2001
From: Jonas Bernoulli <jonas <at> bernoul.li>
Date: Sat, 26 Jan 2013 22:03:09 +0100
Subject: [PATCH] lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-col):
 don't prepend help-echo with column name, if help-echo is already predefined
 don't replace it

---
 lisp/emacs-lisp/tabulated-list.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 94b3c15..13fc730 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -363,7 +363,6 @@ Return the column number after insertion."
          (right-align (plist-get props :right-align))
 	 (label     (if (stringp col-desc) col-desc (car col-desc)))
          (label-width (string-width label))
-	 (help-echo (concat (car format) ": " label))
 	 (opoint (point))
 	 (not-last-col (< (1+ n) (length tabulated-list-format))))
     ;; Truncate labels if necessary (except last column).
@@ -379,7 +378,9 @@ Return the column number after insertion."
         (setq width (- width shift))
         (setq x (+ x shift))))
     (if (stringp col-desc)
-	(insert (propertize label 'help-echo help-echo))
+	(insert (if (get-text-property 0 'help-echo label)
+		    label
+		  (propertize label 'help-echo label)))
       (apply 'insert-text-button label (cdr col-desc)))
     (let ((next-x (+ x pad-right width)))
       ;; No need to append any spaces if this is the last column.
-- 
1.8.0.1


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13563; Package emacs. (Sun, 27 Jan 2013 02:54:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Jonas Bernoulli <jonas <at> bernoul.li>
Cc: 13563 <at> debbugs.gnu.org
Subject: Re: bug#13563: tabulated-list-print-col nicer help-echo
Date: Sat, 26 Jan 2013 21:53:04 -0500
Jonas Bernoulli wrote:

> `tabulated-list-set-col' adds a help-echo property to the "labels" that
> it inserts.  With this patch this is done a bit differently:
>
> * If the label already has a help-echo property then use that help-echo
>   instead of overriding it with a generic one.  This allows displaying
>   additional information when it makes sense.

Seems good.

> * Otherwise propertize as before but don't prefix the help-echo with the
>   column name.  That information is not really useful.

Not sure I agree. Eg in Buffer-menu mode, the prefix is useful IMO.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13563; Package emacs. (Sun, 27 Jan 2013 03:59:02 GMT) Full text and rfc822 format available.

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

From: Jonas Bernoulli <jonas <at> bernoul.li>
To: "Glenn Morris" <rgm <at> gnu.org>
Cc: 13563 <at> debbugs.gnu.org
Subject: Re: bug#13563: tabulated-list-print-col nicer help-echo
Date: Sun, 27 Jan 2013 04:58:30 +0100
Glenn Morris <rgm <at> gnu.org> writes:

> Jonas Bernoulli wrote:
>
>> `tabulated-list-set-col' adds a help-echo property to the "labels" that
>> it inserts.  With this patch this is done a bit differently:
>>
>> * If the label already has a help-echo property then use that help-echo
>>   instead of overriding it with a generic one.  This allows displaying
>>   additional information when it makes sense.
>
> Seems good.
>
>> * Otherwise propertize as before but don't prefix the help-echo with the
>>   column name.  That information is not really useful.
>
> Not sure I agree. Eg in Buffer-menu mode, the prefix is useful IMO.

I don't find it very useful since the same information is also displayed
in the header-line.  But if the other change is merged then I can easily
work around this by explicitly setting the help-echo in my
Tabulated-List mode derived modes.

One other thing I forgot to include in this pull request: I think it
would make sense to set `x-stretch-cursor' to nil in
`tabulated-list-mode'.  One shouldn't set that to t globally (I did for
a while, silly me) but it also does not hurt to actively override such a
setting in cases where it is known not to make any sense.

I don't care much about this (after all I have not enabled this globally
anymore:).  Let me know what you think and I will create a new patch
with the second change above removed and this one included if desired.




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sat, 16 Feb 2013 02:53:01 GMT) Full text and rfc822 format available.

Notification sent to Jonas Bernoulli <jonas <at> bernoul.li>:
bug acknowledged by developer. (Sat, 16 Feb 2013 02:53:01 GMT) Full text and rfc822 format available.

Message #16 received at 13563-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 13563-done <at> debbugs.gnu.org
Subject: Re: bug#13563: tabulated-list-print-col nicer help-echo
Date: Fri, 15 Feb 2013 21:52:01 -0500
Version: 24.4

Jonas Bernoulli wrote:

>>> * If the label already has a help-echo property then use that help-echo
>>>   instead of overriding it with a generic one.  This allows displaying
>>>   additional information when it makes sense.

I applied this part, thanks.

> One other thing I forgot to include in this pull request: I think it
> would make sense to set `x-stretch-cursor' to nil in
> `tabulated-list-mode'. 

I don't see the point.

> One shouldn't set that to t globally (I did for a while, silly me) but
> it also does not hurt to actively override such a setting in cases
> where it is known not to make any sense.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 16 Mar 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 78 days ago.

Previous Next


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