emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Add number of items in the lists
@ 2012-10-01 21:46 Sebastien Vauban
  2012-10-02 14:14 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastien Vauban @ 2012-10-01 21:46 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

Here a first patch to do the above announced thing. Surely, this should be
extended to more types of lists, but I first wait for comments...

From 49e516a175e658469088181bb0c364136198360e Mon Sep 17 00:00:00 2001
From: Sebastien Vauban <svauban-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
Date: Mon, 1 Oct 2012 23:43:43 +0200
Subject: [PATCH 3/3] Add number of items in the TODO lists

* org-agenda.el (org-todo-list): Add the number of items in the lists.

TINYCHANGE
---
 lisp/org-agenda.el |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 99bbe6a..992d7f1 100755
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4423,6 +4423,8 @@ for a keyword.  A numeric prefix directly selects the Nth keyword in
       (when rtnall
 	(insert (org-agenda-finalize-entries rtnall) "\n"))
       (goto-char (point-min))
+      (end-of-line)
+      (insert (format " (%s)" (length rtnall)))
       (or org-agenda-multi (org-agenda-fit-window-to-buffer))
       (add-text-properties (point-min) (point-max)
 			   `(org-agenda-type todo
--
1.7.9

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Add number of items in the lists
  2012-10-01 21:46 Add number of items in the lists Sebastien Vauban
@ 2012-10-02 14:14 ` Bastien
  2012-10-02 20:43   ` Sebastien Vauban
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2012-10-02 14:14 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hi Sébastien,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> * org-agenda.el (org-todo-list): Add the number of items in the lists.

I don't think this is useful in general, but might be 
useful for some users with a lot of items in their agendas :)

Maybe some `org-agenda-header-format' custom variable could do.

Also have a look at `org-agenda-title-append' which is currently
only used by org-mobile to add stuff here.  But could be combined
with a format string, or an option to add an overlay...

5 cts,

-- 
 Bastien

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

* Re: Add number of items in the lists
  2012-10-02 14:14 ` Bastien
@ 2012-10-02 20:43   ` Sebastien Vauban
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastien Vauban @ 2012-10-02 20:43 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bastien,

Bastien wrote:
> "Sebastien Vauban" writes:
>
>> * org-agenda.el (org-todo-list): Add the number of items in the lists.
>
> I don't think this is useful in general, but might be useful for some users
> with a lot of items in their agendas :)

I personally think that, even for small numbers, it is a nice nice-to-have...

> Maybe some `org-agenda-header-format' custom variable could do.

But I have no problem to make that optional.

What do you have in mind: something like `org-clock-file-time-cell-format'
where one can write %s or not (for disabling the display of the number), and
to add decorations around, such as parentheses or spaces or ...?

> Also have a look at `org-agenda-title-append' which is currently
> only used by org-mobile to add stuff here.  But could be combined
> with a format string, or an option to add an overlay...

I must admit I did not really understand how `org-agenda-title-append' is
used, not using OrgMobile myself. IIUC, it's a property (i.e., not displayed
as such in the buffer, right?).

You also evoke an overlay (instead of a real string inserted in the buffer):
any reason for preferring that approach?

FYI, my patch works well, except that the number is not updated when we apply
tag filtering (while the list of items is well reduced). Does this (in your
point of view) exclude any of the mentioned alternatives to go?

Best regards,
  Seb

-- 
Sebastien Vauban

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

end of thread, other threads:[~2012-10-02 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-01 21:46 Add number of items in the lists Sebastien Vauban
2012-10-02 14:14 ` Bastien
2012-10-02 20:43   ` Sebastien Vauban

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).