From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleh Subject: Re: Organizing org-mode files: Tree view Date: Mon, 28 Apr 2014 18:16:26 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeoEI-000473-8w for emacs-orgmode@gnu.org; Mon, 28 Apr 2014 12:16:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WeoEH-0001QY-1U for emacs-orgmode@gnu.org; Mon, 28 Apr 2014 12:16:30 -0400 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:43766) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeoEG-0001Pn-Qu for emacs-orgmode@gnu.org; Mon, 28 Apr 2014 12:16:28 -0400 Received: by mail-wi0-f176.google.com with SMTP id r20so5984609wiv.15 for ; Mon, 28 Apr 2014 09:16:27 -0700 (PDT) In-Reply-To: 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: Dotan Cohen Cc: emacs-orgmode@gnu.org Hi Dotan, > If there is a better way to organize the files, then I would love to > know how the more experienced users do it. I'm using an extremely simplistic approach: just dump all the org files into one directory. The name of each org file should be concise but descriptive, e.g. Makefile.org describes Makefiles, and git.org describes git. This simplicity completely alleviates organization effort: there's nothing to organize, since there's only one directory to put the files in. At the same time, it's very accessible by means of two `helm` wrappers: - globally, "C-0" runs the command helm-org-wiki (the code is below) - in org-mode, "g" runs the command wspecial-worf-goto (the code is at https://github.com/abo-abo/worf) It's like a two-stage personal Google: the first stage is to find an org-file, the second stage is to search within an org-file. For example, here's the sequence of key bindings when I want to look up how git bisect works, assuming that I'm in some random buffer, like `ansi-term`: C-0 gi RET g bis RET Done. Note that "gi" was enough to match "git.org", since all my other pages don't contain "gi". Same thing for "bis" being able to match uniquely the heading "git bisect". I think that it's quite optimal that I'm able to find the topic "git bisect" by using only 10 key presses, which is the same as the amount of characters in "git bisect". Compare this to `helm-google-suggest` (bound to "C-p g"): C-p g git bi RET TAB RET That's 12 key presses (10 in Emacs, 2 in Firefox). New wiki pages can be created with "C-0" as well, just type in the name of the new file and hit RET. That's it, the code is below. It's very similar to `org-switchb`, except that the files need not be opened to appear in the completion list, and new files are created if there's no match. (defgroup helm-org-wiki nil "Simple jump-to-org-file package." :group 'org :prefix "helm-org-wiki-") (defcustom helm-org-wiki-directory "~/org/wiki/" "Directory where files for `helm-org-wiki' are stored." :group 'helm-org-wiki :type 'directory) (defun helm-org-wiki-files () "Return .org files in `helm-org-wiki-directory'." (let ((default-directory helm-org-wiki-directory)) (mapcar #'file-name-sans-extension (file-expand-wildcards "*.org")))) (defvar helm-source-org-wiki `((name . "Projects") (candidates . helm-org-wiki-files) (action . ,(lambda (x) (find-file (expand-file-name (format "%s.org" x) helm-org-wiki-directory)))))) (defvar helm-source-org-wiki-not-found `((name . "Create org-wiki") (dummy) (action . (lambda (x) (helm-switch-to-buffer (find-file (format "%s/%s.org" helm-org-wiki-directory x))))))) ;;;###autoload (defun helm-org-wiki () "Select an org-file to jump to." (interactive) (helm :sources '(helm-source-org-wiki helm-source-org-wiki-not-found))) (provide 'helm-org-wiki) regards, Oleh