emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Weight of headers


From: Samuel Wales
Subject: Re: [O] Weight of headers
Date: Sun, 26 Feb 2012 21:52:30 -0700

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]