From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: Weight of headers Date: Sun, 26 Feb 2012 21:52:30 -0700 Message-ID: References: <8762euxqli.fsf@iro.umontreal.ca> <874nudhj4j.fsf@gmail.com> <871uphlzfs.fsf@iro.umontreal.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1tpy-00015e-OJ for emacs-orgmode@gnu.org; Mon, 27 Feb 2012 01:13:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1sZb-0003kF-IN for emacs-orgmode@gnu.org; Sun, 26 Feb 2012 23:52:32 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:33732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1sZb-0003kA-Cc for emacs-orgmode@gnu.org; Sun, 26 Feb 2012 23:52:31 -0500 Received: by iajr24 with SMTP id r24so1213403iaj.0 for ; Sun, 26 Feb 2012 20:52:30 -0800 (PST) In-Reply-To: <871uphlzfs.fsf@iro.umontreal.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?UTF-8?Q?Fran=C3=A7ois_Pinard?= Cc: emacs-orgmode@gnu.org Great way of doing it. Another option is to create a new buffer and sort the headers by the weight. Ideally each header in the new buffer would be a link. Yet another is to use the agenda. I think it might have a new format string option for the weight. Then use the agenda to sort. And another possibility is to gather weights recursively vs. for each header. This works for bytes. Samuel P.S. Code from years ago. Might or might not work. ;;(alpha-org-dus-tree) (defun* alpha-org-dus-tree (&optional same (n 10)) "Show the biggest subtrees in agenda files. SAME says whether to measure each node vs. each subtree." (interactive) ;;(show-all) ;;(with-current-buffer ... (switch-to-buffer "*alpha-org-dus-tree*") (erase-buffer) (insert ;;; (cl-prettyprint (subseq (sort* (alpha-org-dus-tree-1 same) #'> :key #'car) 0 n))) (defun alpha-org-dus-tree-1 (same) (org-map-entries #'(lambda () ;;(message "doing %s" (cons (alpha-org-get-size same) (org-get-heading))) t 'agenda)) (defun alpha-org-get-size (&optional same) ;;(current-buffer) (- (save-excursion (ignore-errors (funcall (if same ;;org-end-of-subtree t t 'org-forward-same-level 'outline-next-heading) 1)) (point)) (point))) -- The Kafka Pandemic: http://thekafkapandemic.blogspot.com