Re: [O] Seeking advice on structuring my org-mode file

2013-05-26 Thread Karl Voit
* Marcin Borkowski mb...@wmi.amu.edu.pl wrote:
 Hi all,

Hi!

 I have an Org-mode file with notes concerning a large project connected
 with teaching at my university.  One of the headlines is dedicated to
 one particular course, where I am part of a group developing a concept
 of this course.  So, one subheadline is devoted to that.  Yet another
 (subsub)headline is a list if my proposals of things that should be
 covered during that course, and now it needs 3 more levels down.
 Summing it up: I have 5 levels of headlines and now I need a sixth
 one.  So, my question is: what are good practices of other Org-moders?
 Do you push such a monster to an external file and just include a link
 to it?  Or do you just live with 6-level structure (which is a bit
 cumbersome, since I sometimes want to copy a part of this document to
 an email)?  Or maybe there's yet another way of handling this?

So I assume you've got this:

- project.org
  - courseX
- covered topics (unsure about this one; not necessary)
  - topic 1
- task related to topic 1

Either you are OK with this level of headings (I would not care) or
you have many different possibilities.

1. Additional Org-mode file(s): see other answers

2. Usage of flat hierarchy

- project.org
  - non-educational
  - courseX
  - courseX notes

3. Usage of tags

- project.org
  - X:non-educational:
  - course material:courseX:
  - course topics  :courseX:
  - course notes   :courseX:

Or you can use a combination of these methods or additional methods
which do not come to my mind for now.

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
get Memacs from https://github.com/novoid/Memacs 

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] Seeking advice on structuring my org-mode file

2013-05-23 Thread Julian M. Burgos
Matt, this is very useful!  I agree with you, I also tend to create
several org-mode files for a project that is becoming too large.  For
example, I keep a separate org-file for each paper or report, another
with notes, another with analysis (with R code blocks), etc.

One issue is that I use lots of TODO statemens in my files, and when
org-mode files multiply it starts to become difficult to keep the agenda
files list updated.  To do this I use this snippet that I found
somewhere (I do not remember exactly where).  This includes all
org-files in a specific directory (in my case my Documents directory)
in the agenda files list.

#+begin_src lisp
;;--
;; Load org agenda files
;;--
; Do not add agenda files by hand
(add-hook 'org-mode-hook
  (lambda ()
(org-defkey org-mode-map \C-c['undefined)
(org-defkey org-mode-map \C-c]'undefined))
  'append)

(load-library find-lisp)

(add-hook 'org-agenda-mode-hook (lambda () 
(setq org-agenda-files 
  (find-lisp-find-files /home/julian/Documents \.org$))
))
#+end_src

With this I can create org-files to my heart's content and I know that
all TODOs statements will show up in the agenda.

All the best,

Julian

-- 
Julian Mariano Burgos, PhD
Hafrannsóknastofnunin/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: jul...@hafro.is

Matt Lundin writes:

 Marcin Borkowski mb...@wmi.amu.edu.pl writes:

 I have an Org-mode file with notes concerning a large project connected
 with teaching at my university.  One of the headlines is dedicated to
 one particular course, where I am part of a group developing a concept
 of this course.  So, one subheadline is devoted to that.  Yet another
 (subsub)headline is a list if my proposals of things that should be
 covered during that course, and now it needs 3 more levels down.
 Summing it up: I have 5 levels of headlines and now I need a sixth
 one.  So, my question is: what are good practices of other Org-moders?
 Do you push such a monster to an external file and just include a link
 to it?  

 If a file grows to large, I simply create a new one. In this instance, I
 would recommend creating a separate file for each course.

 Below you'll find a very hackish helper function that I use to generate
 a new file from a headline. It leaves a link to the new file in the
 original location.

 Best,
 Matt

 --8---cut here---start-8---
 (defun my-org-file-from-headline (file)
   (interactive
(list
 (completing-read File: 
  (mapcar 'file-name-nondirectory
(file-expand-wildcards ~/org/*.org))
  nil nil)))
   (unless (string-match \\.org$ file)
 (error Not an org file))
   (save-excursion
 (beginning-of-line)
 (unless (org-at-heading-p)
   (error Not on a headline)))
   (let* ((exists (file-exists-p file))
  (ftags (append
  (list (file-name-sans-extension file))
  (mapcar 'substring-no-properties org-file-tags)))
  (headline (nth 4 (org-heading-components)))
  (org-archive-reversed-order t)
  (org-archive-location (concat file ::))
  (org-archive-save-context-info nil))
 (org-archive-subtree)
 (save-excursion (insert * [[file: file ][ file ]] -  headline \n))
 (find-file file)
 (goto-char (point-min))
 (save-excursion
   (if (re-search-forward #\\+FILETAGS:\\(.*\\)$ nil t)
   (progn
 (save-match-data
   (setq ftags
 (mapconcat 'identity
(org-uniquify
 (append ftags
 (split-string
  (substring-no-properties
   (match-string 1)  )))
 (replace-match (concat #+FILETAGS:  ftags)))
 (insert #+FILETAGS:  (mapconcat 'identity ftags  ) \n))
   (goto-char (point-min))
   (unless (re-search-forward #\\+CATEGORY:\\(.*\\)$ nil t)
 (insert #+CATEGORY:  (file-name-sans-extension file) \n))
   (goto-char (point-min))
   (when (re-search-forward ^Archived entries from file.+\n nil t)
 (replace-match 
   (write-file file))
 --8---cut here---end---8---





[O] Seeking advice on structuring my org-mode file

2013-05-22 Thread Marcin Borkowski
Hi all,

I have an Org-mode file with notes concerning a large project connected
with teaching at my university.  One of the headlines is dedicated to
one particular course, where I am part of a group developing a concept
of this course.  So, one subheadline is devoted to that.  Yet another
(subsub)headline is a list if my proposals of things that should be
covered during that course, and now it needs 3 more levels down.
Summing it up: I have 5 levels of headlines and now I need a sixth
one.  So, my question is: what are good practices of other Org-moders?
Do you push such a monster to an external file and just include a link
to it?  Or do you just live with 6-level structure (which is a bit
cumbersome, since I sometimes want to copy a part of this document to
an email)?  Or maybe there's yet another way of handling this?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



Re: [O] Seeking advice on structuring my org-mode file

2013-05-22 Thread Matt Lundin
Marcin Borkowski mb...@wmi.amu.edu.pl writes:

 I have an Org-mode file with notes concerning a large project connected
 with teaching at my university.  One of the headlines is dedicated to
 one particular course, where I am part of a group developing a concept
 of this course.  So, one subheadline is devoted to that.  Yet another
 (subsub)headline is a list if my proposals of things that should be
 covered during that course, and now it needs 3 more levels down.
 Summing it up: I have 5 levels of headlines and now I need a sixth
 one.  So, my question is: what are good practices of other Org-moders?
 Do you push such a monster to an external file and just include a link
 to it?  

If a file grows to large, I simply create a new one. In this instance, I
would recommend creating a separate file for each course.

Below you'll find a very hackish helper function that I use to generate
a new file from a headline. It leaves a link to the new file in the
original location.

Best,
Matt

--8---cut here---start-8---
(defun my-org-file-from-headline (file)
  (interactive
   (list
(completing-read File: 
 (mapcar 'file-name-nondirectory
 (file-expand-wildcards ~/org/*.org))
 nil nil)))
  (unless (string-match \\.org$ file)
(error Not an org file))
  (save-excursion
(beginning-of-line)
(unless (org-at-heading-p)
  (error Not on a headline)))
  (let* ((exists (file-exists-p file))
 (ftags (append
 (list (file-name-sans-extension file))
 (mapcar 'substring-no-properties org-file-tags)))
 (headline (nth 4 (org-heading-components)))
 (org-archive-reversed-order t)
 (org-archive-location (concat file ::))
 (org-archive-save-context-info nil))
(org-archive-subtree)
(save-excursion (insert * [[file: file ][ file ]] -  headline \n))
(find-file file)
(goto-char (point-min))
(save-excursion
  (if (re-search-forward #\\+FILETAGS:\\(.*\\)$ nil t)
  (progn
(save-match-data
  (setq ftags
(mapconcat 'identity
   (org-uniquify
(append ftags
(split-string
 (substring-no-properties
  (match-string 1)  )))
(replace-match (concat #+FILETAGS:  ftags)))
(insert #+FILETAGS:  (mapconcat 'identity ftags  ) \n))
  (goto-char (point-min))
  (unless (re-search-forward #\\+CATEGORY:\\(.*\\)$ nil t)
(insert #+CATEGORY:  (file-name-sans-extension file) \n))
  (goto-char (point-min))
  (when (re-search-forward ^Archived entries from file.+\n nil t)
(replace-match 
  (write-file file))
--8---cut here---end---8---