From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Thum Subject: More helm awesomeness Date: Sun, 18 Jan 2015 23:15:21 +0100 Message-ID: <54BC3079.1030706@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCy84-00061B-M0 for emacs-orgmode@gnu.org; Sun, 18 Jan 2015 17:15:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCy81-00017e-CT for emacs-orgmode@gnu.org; Sun, 18 Jan 2015 17:15:32 -0500 Received: from mout.gmx.net ([212.227.17.20]:60219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCy80-000178-Vz for emacs-orgmode@gnu.org; Sun, 18 Jan 2015 17:15:29 -0500 Received: from [192.168.0.12] ([37.24.151.54]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MdaiW-1YMvrO3an6-00PKPo for ; Sun, 18 Jan 2015 23:15:26 +0100 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: emacs-orgmode Hi all, I recently updated my helm install so it includes helm-org-agenda-headings which is just AWESOME (to me at least). A bit like org-goto but across all agenda files at once, with goto, refile, linking built in. If you haven't tried it, I definitely recommend to do so. Yet I'm missing a few things so far, I would like to have different datasources differentiated by tags, in particular the ARCHIVE tag, and the infamous FILETAGS so I cannot just regex my way through as the current approach does. This requires making more use of org-ode when filling helm's buffers. My elisp isn't great but I might be able to get there if the approach is sane. Any pointers are welcome! If you might help me please read on. I would like to ask what would be the best approach for better utilising org infrastructure so I may have separate helm sources for live/archived, private/work, the clocking history, stuff like that. The helm-org definition looks deceptively simple: https://github.com/emacs-helm/helm/blob/master/helm-org.el (defun helm-org-agenda-files-headings () (interactive) (helm :sources (helm-source-org-headings-for-files (org-agenda-files)) :candidate-number-limit 99999 :buffer "*helm org headings*")) FWICT, in effect helm-org is chewing itself through the buffers: (defun helm-get-org-candidates-in-file (filename min-depth max-depth &optional fontify) (with-current-buffer (find-file-noselect filename) (and fontify (jit-lock-fontify-now)) (let ((match-fn (if fontify 'match-string 'match-string-no-properties))) (save-excursion (goto-char (point-min)) (cl-loop while (re-search-forward org-complex-heading-regexp nil t) if (let ((num-stars (length (match-string-no-properties 1)))) (and (>= num-stars min-depth) (<= num-stars max-depth))) collect `(,(funcall match-fn 0) . ,(point-marker))))))) I don't really get what it does but I have a hunch that org-element or other org-mode functions could be used to achieve the same with more precision. That's what I would need to do. FWIW I'd be happy to take a performance hit. Thanks in advance, Simon