From: Jonas Bernoulli <jonas@bernoul.li>
To: 13563@debbugs.gnu.org
Subject: bug#13563: tabulated-list-print-col nicer help-echo
Date: Sat, 26 Jan 2013 22:14:37 +0100 [thread overview]
Message-ID: <877gmzve82.fsf@bernoul.li> (raw)
[-- Attachment #1: Type: text/plain, Size: 452 bytes --]
`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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tabulated-list-print-col.patch --]
[-- Type: text/x-diff, Size: 1533 bytes --]
From bbe78adda05897c892ea3c3687912a4c056d6fe1 Mon Sep 17 00:00:00 2001
From: Jonas Bernoulli <jonas@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
next reply other threads:[~2013-01-26 21:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-26 21:14 Jonas Bernoulli [this message]
2013-01-27 2:53 ` bug#13563: tabulated-list-print-col nicer help-echo Glenn Morris
2013-01-27 3:58 ` Jonas Bernoulli
2013-02-16 2:52 ` Glenn Morris
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=877gmzve82.fsf@bernoul.li \
--to=jonas@bernoul.li \
--cc=13563@debbugs.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).