From: Manuel Hermenegildo <herme@fi.upm.es>
To: Carsten Dominik <C.Dominik@uva.nl>
Cc: emacs-orgmode@gnu.org
Subject: Re: global tags for a file
Date: Tue, 20 May 2008 10:42:28 +0200 [thread overview]
Message-ID: <18482.36596.774796.551366@clip.dia.fi.upm.es> (raw)
In-Reply-To: <9EDB83BC-2C90-49C9-B1B8-702A0F126280@uva.nl>
> I would not have thought that this would be useful, but the use-case
> you describe actually does make sense. So I am putting these in,
> but I will use a keyword
>
> #+FILETAGS:
Thanks!! FILETAGS sounds good --you are right that just TAG would lead
to confusion.
As I mentioned, I am giving your EXCELLENT org mode a bit of a stress
test in collaborative work so we will hopefully come up with some more
suggestions, or usage tips that may be useful for other people. For
now, I am including the setup we are currently using in case it is
useful for someone else. It is not in finished state (e.g., some
cleanup would be needed, and I am still adding functionality) but this
setup seems to be working reasonably well for us right now.
Some things that may be interesting:
- my-org-agenda-toggle-list-category: With this typing "L" in agenda
and todo buffers allows toggling whether category/file names appear
or not at the left or entries in agenda/todo listings. Helps
unclutter.
- the use of org-agenda-skip-archived-trees toggling to control
visibility of archived tasks. The key redefinitions that we use
(everything goes to sibling archive) may be too much for other
applications. Here we are just trying to make sure that we always
use the archive to sibling method, since it preserves TAG
inheritance, which is vital to keep archived tasks assigned to the
person that had them assigned in the first place.
- The agenda commands may be interesting to someone, e.g., how a view
can be built to show which tasks are assigned to each person.
Carsten, related to this, I could not find a built-in way to skip
entries by tag so I programmed a filter function "my-skip-by-tags"
(maybe not in the ideal way: I am not familiar with org inside
workings). I think it would be nice to have this built-in and usable
in all the views. When using tags to assign work to people (or
projects, etc.) it seems very natural to me to want to build an agenda
view (or todo view, or ...) that only contain entries that contain a
set of tags. Regexps are useful but do not really work for the
application of using tags to assign tasks to people, because of lack
of inheritance. A specific concept of task assignment could also be
add to org of course (as TODOs are a very specific sort of tags), but
for now using tags to establish who has to do what seems very natural.
Cheers,
Manuel
==============================================================================
File org-personal-setup.el
==============================================================================
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Personal org setup for collaborative work.
;; To be included in your .emacs file. --Manuel Hermenegildo herme@fi.upm.es
;;
;; In order to keep this (relatively) simple, a lot of decisions are
;; made for you in "org-general-setup.el". Look there if you would
;; like to change things further.
;;
;; Most typical commands to build lists of tasks:
;;
;; C-c a a Build agenda with your tasks (entries with your tag and a date).
;; C-c a t Build your TODO list (TODO items without a date).
;; C-c a i All items assigned to you, TODO or not, date or not.
;;
;; Other:
;;
;; C-c a p Agenda for a given person (or for any other tag).
;; C-c a A Agenda with all tasks in all org files (not just yours).
;; C-c a P List of people and their assigned TODO tasks.
;; C-c a I List of people and all their assigned items (TODO or not).
;; C-c a U Generate a view of any org file with only my tasks.
;; (Type it while in an org file; C-cC-c to exit.)
;;
;; Useful tips:
;; - Use "A" in agenda to archive (move out of view) completed tasks.
;; - l in agenda toggles whether such archived tasks are visible or not.
;; - L in most listings toggles the category labels or file names at left.
;; - Use C-cr anywhere in emacs to enter quickly a note or date in
;; your main org file (the first one on the list).
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; List your org files: typically these are your personal files and
;; files of projects & groups you participate in. "remember" notes go
;; into the first of these. You can also set this through M-x
;; org-customize or typing C-c[ in each org file.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq org-agenda-files
'(
;; Personal:
"~/org-mode/MyTasks.org.gpg"
;; Wrok:
"~/Work/org/General.org"
"~/Work/hiring/Hiring.org.gpg"
;; TESTS:
;; "~/ORG/org-mode/Test1.org"
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The tag used to identify your tasks in those files. Add :MyTag: to
;; each line. Lower-level lines inherit the tag. E.g., in:
;; * Level 1 :MH:
;; ** Level 1.1
;; level 1.1 also has tag "MH"
;; For the "official" tags used to identify each one of us see the
;; org-general-setup.el file.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq org-my-tag "MH")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Finally, this loads into your emacs our common org setup.
;; You may want to replace with path to your svn checkout
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq org-general-path "/usr/local/share/org/lisp/")
(load (concat org-general-path "org-general-setup"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
==============================================================================
File org-general-setup.el
==============================================================================
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; General org setup for org mode, todo lists,
;; agendas, etc. for collaborative work --Manuel Hermenegildo herme@fi.upm.es
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The set of tags for people (to build global list of tasks by people)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq org-people-tags
'("MH" ; Manuel Hermenegildo
"JS" ; John Smith
; ...
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Predefined set of tags -- to undefine this list in a given file put
;; #+TAGS:
;; at the beginning of the file.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq org-tag-alist
'(
("MH" . ?h)
("JS" . ?j)
; ...
))
;; Or, if you do not need to specify the single letter command you can
;; generate this automatically.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Needs to be set before loading org!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq org-return-follows-link t) ;; Links followed when typing return
;; No time to lose with the mouse
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Make sure we load the latest version of the org mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq load-path (cons (concat org-general-path "org/lisp") load-path))
(setq load-path (cons (concat org-general-path "remember") load-path))
(setq load-path (cons org-general-path load-path))
(load "org")
;; This is so org-agenda-redo etc. is defined (needed below for initialization)
(require 'org-agenda)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Some org files may be encrypted: this handles it automatically.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'crypt++)
;; Configure gpg backend
(setq crypt-encryption-type 'gpg
crypt-encryption-file-extension "\\(\\.gpg\\)$")
(modify-coding-system-alist 'file "\\.gpg\\'" 'no-conversion)
(modify-coding-system-alist 'file "\\.bz\\'" 'no-conversion)
(modify-coding-system-alist 'file "\\.bz2\\'" 'no-conversion)
(modify-coding-system-alist 'file "\\.gz\\'" 'no-conversion)
(modify-coding-system-alist 'file "\\.Z\\'" 'no-conversion)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; A way to point to latest version of the manual but does not work
;; on some versions of emacs if INFOPATH is set (which is normal) and
;; it does not end in : (which may also happen often)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq Info-default-directory-list
(cons (expand-file-name
(concat org-general-path "org/doc"))
Info-default-directory-list))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; These just in case the user did not find out yet that this is useful
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq inhibit-splash-screen t)
(global-font-lock-mode 1)
;; (add-hook 'org-mode-hook 'turn-on-font-lock) ; just in case
(setq transient-mark-mode t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; General org settings to make things work nicer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The following lines are always needed. You can choose your own keys.
(define-key global-map "\C-ca" 'org-agenda)
(define-key global-map "\C-ct"
(lambda () (interactive) (find-file org-default-notes-file)))
(define-key global-map "\C-cl" 'org-store-link)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(add-to-list 'auto-mode-alist '("\\.org_archive$" . org-mode))
(add-to-list 'auto-mode-alist '("\\.org.gpg$" . org-mode))
(add-to-list 'auto-mode-alist '("\\.org.gpg_archive$" . org-mode))
(setq org-hide-leading-stars t) ;; Nicer decoration
(setq org-log-done 'time) ;; Insert time stamp on done
(setq org-agenda-todo-list-sublevels t) ;; Whether to check sublevels
(setq org-tags-match-list-sublevels t) ;; Match tags in sublevels
;; (setq org-agenda-include-diary t) ;; Connect with diary
;; (setq org-popup-calendar-for-date-prompt nil) ;; was distracting
(setq org-popup-calendar-for-date-prompt t) ;; works better in recent versions
(setq org-startup-folded t) ;; reduces clutter
(setq org-highest-priority ?A)
(setq org-default-priority ?C)
(setq org-lowest-priority ?E)
(setq org-special-ctrl-k t)
(setq org-fontify-done-headline t)
(setq org-fontify-emphasized-text t)
;; (setq org-extend-today-until 6) ;; Does not work yet...
(setq org-ellipsis (quote org-ellipsis))
(setq org-agenda-window-setup
'current-window) ;; normal value: reorganize-frame
;; Best done on a per-file basis --default is fine for simple files
;; (setq org-todo-keywords
;; '((sequence "TODO(t)" "ASSIGNED(!)" "VERIFY"
;; "|" "DONE(!)" "CANCELED(!)")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Customize in what order entries are sorted (important for todo
;; lists). Default is first by category -> changed to first by priority.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq org-agenda-sorting-strategy
'((agenda time-up priority-down category-keep)
(todo time-up priority-down category-keep)
(tags time-up priority-down category-keep)
(search category-keep)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; With this typing "L" in agenda and todo buffers allows toggling
;; whether category/file names appear or not at the left or entries in
;; agenda/todo listings.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; FIXME: Ideally the two formats should be in two variables,
;; org-agenda-prefix--verbose-format and org-agenda-prefix-terse-format
(add-hook
'org-mode-hook
(lambda ()
(define-key org-agenda-keymap "L" 'my-org-agenda-toggle-list-category)
(define-key org-agenda-mode-map "L" 'my-org-agenda-toggle-list-category)
))
(defvar my-org-agenda-list-category t)
(defun my-org-agenda-toggle-list-category ()
"Toggles whether category/file name appears or not at the left
of entries in agenda listings. Useful to unclutter listings."
(interactive)
(if my-org-agenda-list-category
(progn
(setq my-org-agenda-list-category nil)
(setq org-agenda-prefix-format
'((agenda . " %-12:c%?-12t% s")
(timeline . " % s")
(todo . " %-12:c")
(tags . " %-12:c")
(search . " %-12:c")))
)
(setq my-org-agenda-list-category t)
(setq org-agenda-prefix-format
'((agenda . " %?-12t% s")
(timeline . " % s")
(todo . " ")
(tags . " ")
(search . " ")))
)
(org-agenda-redo))
(my-org-agenda-toggle-list-category)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; With these settings typing "l" in agenda buffers toggles whether
;; archived and closed tasks appear or not in agenda/todo
;; listings. Useful to keep track of what has been done.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; It is definitely best to archive to sibling
;; "A" in agenda or "C-cC-xA" in org mode
;; We also redefine a and $ to be to sibling (much better: no info lost and
;; keeps tag inheritance --very important)
(setq org-archive-location "::* Archive")
;; (setq org-agenda-include-all-todo t) ;; useful but clutter
(setq org-agenda-todo-ignore-scheduled t) ;; reduces clutter
(setq org-agenda-todo-ignore-with-date t) ;; reduces clutter
(setq org-agenda-show-log nil) ; By default do not show closed tasks
;; Actually, the other way around, since it will be toggled at startup
;; (setq org-agenda-skip-archived-trees t)
(setq org-agenda-skip-archived-trees nil)
;; This was a simple solution piggybacking on org-agenda-log-mode but
;; then completed tasks tasks appear twice.
;;
;; (defadvice org-agenda-log-mode
;; (before my-toggle-archive-visibility ())
;; (if org-agenda-show-log
;; (setq org-agenda-skip-archived-trees t)
;; (setq org-agenda-skip-archived-trees nil)))
;; (ad-activate 'org-agenda-log-mode)
;; The key redefinitions below may be too much for other
;; applications. Here we are just trying to make sure that we always
;; use the archive to sibling method, since it preserves TAG
;; inheritance, which is vital to keep archived tasks assigned to
;; the person that had them assigned in the first place.
(add-hook
'org-mode-hook
(lambda ()
(define-key org-agenda-keymap "l" 'my-org-agenda-toggle-seeing-archived)
(define-key org-agenda-mode-map "l" 'my-org-agenda-toggle-seeing-archived)
))
(defun my-org-agenda-toggle-seeing-archived ()
"Toggles whether archived tasks appear or not in agenda/todo
listings. We use archiving to get completed work out of the
way. Useful to unclutter / keep track of what has been done."
(interactive)
(if org-agenda-skip-archived-trees
(progn
(setq org-agenda-skip-archived-trees nil)
(org-defkey org-agenda-keymap "$" 'org-my-key-not-available)
(org-defkey org-agenda-mode-map "$" 'org-my-key-not-available)
(org-defkey org-agenda-keymap "a" 'org-my-key-not-available)
(org-defkey org-agenda-mode-map "a" 'org-my-key-not-available)
(org-defkey org-agenda-keymap "A" 'org-my-key-not-available)
(org-defkey org-agenda-mode-map "A" 'org-my-key-not-available)
(org-agenda-redo)
(message "Viewing archived tasks on")
)
(setq org-agenda-skip-archived-trees t)
; No archiving!
;; To mark tasks as done and archive them (they will appear in log "l")
(define-key org-agenda-keymap "$" 'org-agenda-my-done)
(define-key org-agenda-mode-map "$" 'org-agenda-my-done)
;; Use to just archive tasks (they will not appear in log "l")
(define-key org-agenda-keymap "a" 'org-agenda-my-done)
(define-key org-agenda-mode-map "a" 'org-agenda-my-done)
;; Use to just archive tasks (they will not appear in log "l")
(define-key org-agenda-keymap "A" 'org-agenda-my-done)
(define-key org-agenda-mode-map "A" 'org-agenda-my-done)
(org-agenda-redo)
(message "Viewing archived tasks off")
))
(my-org-agenda-toggle-seeing-archived)
(defun org-my-key-not-available ()
(interactive)
(error "Archiving unavailable when viewing archived tasks"))
;; This is for testing different global archiving methods
(defun org-agenda-my-done ()
(interactive)
;; (org-agenda-archive)
(org-agenda-archive-to-archive-sibling)
;; (org-my-agenda-archive)
)
;; This below probably unneeded in recent versions (everything maked as
;; done on archiving automatically?).
(add-hook
'org-mode-hook
(lambda ()
;; Use to mark tasks as done and archive them
(org-defkey org-mode-map "\C-c$" 'org-my-done)
;; Use to just archive tasks
(org-defkey org-mode-map "\C-c\C-xa" 'org-archive-to-archive-sibling)
))
(defun org-my-done ()
(interactive)
(org-todo 'done)
(org-archive-to-archive-sibling))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Some custom agenda views
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq org-agenda-custom-commands
(list
;;;;;;;;;;;;;;;;;;;;;
(list
"a" "Agenda with (only) my tasks (those that have my tag and a date)"
'((agenda
""
((org-agenda-skip-function '(my-skip-by-tags org-my-tag))
(org-agenda-overriding-header
"Agenda with (only) my tasks (those that have my tag and a date)"
)))))
;;;;;;;;;;;;;;;;;;;;;
;; Ideally this should be easy to do by extending the standard ones
;; views, but: tags-todo does not ignore timestamps
;; and todo (which does) does not support tags... :-(
;; Btw TODOs should be scheduled (not just a time stamp).
;; This does avoid double entries when archiving.
(list
"t" "List of my TODO items with no assigned date (not in agenda)"
(list
(list
'tags-todo
org-my-tag
(list
(list
'org-agenda-skip-function
''(org-agenda-skip-entry-if
'regexp
org-ts-regexp
;; "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)>"
)
)))))
;;;;;;;;;;;;;;;;;;;;;
;; (list
;; "i" "List of all my active items (TODO or not, date or not)"
;; (list
;; (list
;; 'tags
;; org-my-tag
;; '((org-agenda-overriding-header
;; "List of all my active items (TODO or not, date or not)"
;; )))))
(list
"i" "List of all my active items (TODO or not, date or not)"
(list
(list
'tags
org-my-tag
'((org-agenda-overriding-header
"List of all my active items (TODO or not, date or not)"
)))))
;; (list "i" 'tags org-my-tag)
;;;;;;;;;;;;;;;;;;;;;
(list
"p" "Agenda for a particular person or tag"
'((agenda ""
((this-tag
(progn
(read-string
"Build agenda for user/tag: " org-my-tag "" org-my-tag)))
(org-agenda-skip-function '(my-skip-by-tags this-tag))))))
;;;;;;;;;;;;;;;;;;;;;
;; To be programmed
;; (list
;; "t" "List of TODO items for a particular person or tag"
;; '((todo
;; org-my-tag
;; ((org-agenda-overriding-header
;; "Prioritized todo list (my unscheduled tasks --not in agenda)"
;; )))))
;;;;;;;;;;;;;;;;;;;;;
(list
"A" "Agenda view of all tasks in org files (for all people/tags)"
'((agenda "")))
;;;;;;;;;;;;;;;;;;
(list
"P" "List of people and their assigned TODO tasks"
(mapcar (lambda (x) (list 'tags-todo x)) org-people-tags))
;;;;;;;;;;;;;;;;;;
(list
"I" "List of people and all their assigned items (TODO or not)"
(mapcar (lambda (x) (list 'tags x)) org-people-tags))
;;;;;;;;;;;;;;;;;;;;;
;; (list
;; "U" "(Only while on an org file) Generate view with only my tasks"
;; (list
;; (list
;; 'tags-tree
;; org-my-tag)))
(list "U" 'tags-tree org-my-tag)
;;;;;;;;;;;;;;;;;;
))
;; This one works well, but is a bit slow
(defun my-skip-by-tags (tag)
"Skip tasks except those that contain tag (with
inheritance!). Useful for, e.g., listing an agenda with my (or
someone's) tasks out of a shared folder. This is one of the main
filtering routines for use when generating agenda views."
(let ((line-end (save-excursion (progn (end-of-line) (point))))) ;; return pos
(if (member tag (org-get-tags-at (point)))
nil ; do not skip
line-end))) ; skip, continue after that
;; ;; Attempt to make it faster by skipping archived subtrees.
;; ;; Not sure it is really working: gives same perceived speed.
;; (defun my-skip-by-tags (tag)
;; "Skip tasks except those that contain tag (with
;; inheritance!). Useful for, e.g., listing an agenda with my (or
;; someone's) tasks out of a shared folder. This is one of the main
;; filtering routines for use when generating agenda views."
;; (let (;; (line-end
;; (save-excursion (progn (end-of-line) (point)))) ;; return pos
;; (line-end (save-excursion
;; (re-search-forward org-complex-heading-regexp)))
;; (subtree-end (save-excursion (org-end-of-subtree t)))) ;; whole subtree
;; (if
;; (save-excursion
;; (re-search-forward
;; ":ARCHIVE:"
;; subtree-end t))
;; subtree-end ; skip, continue after subtree
;; (if (member tag (org-get-tags-at (point)))
;; nil ; do not skip
;; line-end)))) ; skip, continue after that
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Connection w/remember: allows adding quickly entries in agenda.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'remember)
;; Default target for storing notes
(setq org-default-notes-file (car org-agenda-files))
(define-key global-map "\C-cr" 'org-remember)
(setq org-remember-templates
'(("Todo" ?t "** TODO [#C] %?\n %a" "" "Raw Data")
("Journal Entry" ?j "* %U %?\n\n %a" "" "Raw Data")
("Idea" ?i "* %^{Title}\n %a" "" "Raw New Ideas")
("Appointments" ?a "** %^t %?\n %a" "" "Raw Data")
))
(org-remember-insinuate)
(setq org-reverse-note-order t) ;; Add new things at the beginning
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Diary stuff (Note: we were using diary only for recurring dates)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; All now being done within org-mode...
;; (setq view-diary-entries-initially t)
;; (setq diary-file "/home/herme/ORG/org-mode/Recurring.org")
;; Gives problems... (e.g., surprise messages in the middle of demos :-))
;; (load "appt")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Quick testing harness
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun test-org ()
(interactive)
(start-process-shell-command
"org-test" "org-test"
;; "emacs-snapshot-gtk"
"emacs22"
"-q" "-l" (concat org-general-path "org-personal-setup")
"-f" "test-org-startup" "&"))
(defun test-org-startup ()
(interactive)
(if (< emacs-major-version 23)
()
(set-default-font "Bitstream Vera Sans Mono-12"))
(call-interactively 'org-agenda))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Older code that may be useful sometime
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; With this typing "D" in agenda and todo buffers allows toggling
;; ;; whether archived tasks appear or not in agenda/todo listings.
;; (add-hook
;; 'org-mode-hook
;; (lambda ()
;; (define-key org-agenda-keymap "K"
;; 'my-org-agenda-toggle-list-archived)
;; (define-key org-agenda-mode-map "K"
;; 'my-org-agenda-toggle-list-archived)
;; ))
;; (defun my-org-agenda-toggle-list-archived ()
;; "Toggles whether archived tasks appear or not in agenda/todo listings.
;; Useful to see what was done on a given day."
;; (interactive)
;; (setq org-agenda-skip-archived-trees (not org-agenda-skip-archived-trees))
;; (org-agenda-redo)
;; )
;; ;;;;;
;; ;; We control visibility of archived tasks ("l" key in agenda views).
;; ;;;;;
;; ;;;; Default is "%s_archive::" DO NOT CHANGE (see below)
;; ;; (setq org-archive-location "::* Archived Tasks")
;; (defadvice org-agenda-log-mode
;; (before my-toggle-archive-visibility ())
;; ;; overkill, but to ensure agenda is loaded
;; (if org-agenda-show-log
;; (setq org-agenda-skip-archived-trees t)
;; (setq org-agenda-skip-archived-trees nil)))
;; (ad-activate 'org-agenda-log-mode)
;; ;;;;;
;; ;; Archiving (this is actually to control visibility of done tasks,
;; ;; i.e., we mark them as done by archiving them)
;; ;;;;;
;; ;; NEEDS A BETTER SOLUTION
;; ;;;; Default is "%s_archive::" DO NOT CHANGE (see below)
;; ;; (setq org-archive-location "::* Archived Tasks")
;; (setq org-agenda-files org-my-agenda-files)
;; (defadvice org-agenda-log-mode
;; (before my-toggle-archive-visibility ())
;; ;; overkill, but to ensure agenda is loaded
;; (if org-agenda-show-log
;; (setq org-agenda-files org-my-agenda-files)
;; (setq org-agenda-files
;; (append org-my-agenda-files
;; (mapcar (lambda (x) (concat x "_archive"))
;; org-my-agenda-files)))))
;; (ad-activate 'org-agenda-log-mode)
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; These are the (old) custom agenda views
;; ;;;;;;;;;;;;;;;;;;;;;
;; (setq org-agenda-custom-commands
;; '(
;;;;;;;;;;;;;;;;;;;;;
;; (list
;; "a" "Agenda with only my tasks"
;; '((agenda ""
;; ((org-agenda-skip-function '(my-skip-if-not-for org-my-tag))))))
;;;;;;;;;;;;;;;;;;;;;
;; (list
;; "p" "Agenda for a particular person"
;; '((agenda ""
;; ((someone
;; (progn
;; (read-string
;; "Build agenda for user: " org-my-tag "" org-my-tag)))
;; (org-agenda-skip-function '(my-skip-if-not-for someone))))))
;; ;;;;;;;;;;;;;;;;;;;;;
;; The following, even older
;; ;;;;;;;;;;;;;;;;;;;;;
;; ("A" "Agenda including other people's tasks"
;; ((agenda "")))
;; ;;;;;;;;;;;;;;;;;;;;;
;; ("a" "Agenda with only my tasks"
;; ((agenda ""
;; ((org-agenda-skip-function '(my-skip-if-not-for org-my-tag))))))
;; ;;;;;;;;;;;;;;;;;;;;;
;; ("P" "Agenda for a particular person"
;; ((agenda ""
;; ((someone
;; (progn
;; (read-string
;; "Build agenda for user: " org-my-tag "" org-my-tag)))
;; (org-agenda-skip-function '(my-skip-if-not-for someone))))))
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; ("t" "Todo list with only my tasks"
;; ;; ((todo
;; ;; "")))
;; ;; ("t" "Todo list with only my tasks"
;; ;; ((todo
;; ;; ""
;; ;; ((org-agenda-skip-function '(my-skip-if-not-for org-me))
;; ;; (org-agenda-overriding-header
;; ;; "Prioritized todo list (contains my unscheduled tasks)")))))
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; ("p" "Tasks by people:"
;; ;; (
;; ;; (tags "MH")
;; ;; (tags "JM")
;; ;; (tags "AM")
;; ;; )
;; )
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; ("d" todo "DELEGATED" nil)
;; ;; ("c" todo "DONE|DEFERRED|CANCELLED" nil)
;; ;; ("w" todo "WAITING" nil)
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; ("W" agenda "" ((org-agenda-ndays 21)))
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; ("A" agenda ""
;; ;; ((org-agenda-skip-function
;; ;; (lambda nil
;; ;; (org-agenda-skip-entry-if
;; ;; (quote notregexp) "\\=.*\\[#A\\]")))
;; ;; (org-agenda-ndays 7)
;; ;; (org-agenda-overriding-header
;; ;; "Today's Priority #A tasks: ")))
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; ("u" alltodo ""
;; ;; ((org-agenda-skip-function
;; ;; (lambda nil
;; ;; (org-agenda-skip-entry-if (quote scheduled)
;; ;; (quote deadline)
;; ;; (quote regexp) "<[^>\n]+>")))
;; ;; (org-agenda-overriding-header "Unscheduled TODO entries: ")))
;; ;;;;;;;;;;;;;;;;;;;;;
;; )
;; )
;; (defun my-skip-if-not-for (who)
;; "Skip tasks which are assigned to others and not also assigned
;; to interested party (normally, me). This was the old way of
;; filtering when generating agenda views. It is similar to
;; my-skip-by-tags but uses regexp and (main issue with it) does not
;; use inheritance, which makes it less useful."
;; (let ((subtree-end (save-excursion (org-end-of-subtree t))))
;; (if
;; (and
;; (save-excursion
;; (re-search-forward
;; (concat
;; "\\(:"
;; (mapconcat 'identity
;; (delete org-my-tag org-people-tags)
;; ":\\|:")
;; ":\\)") ;; I.e., "\\(:AM:\\|:RP:\\)"
;; subtree-end t))
;; (not
;; (re-search-forward
;; (concat ":" who ":")
;; subtree-end t))
;; )
;; subtree-end ; skip,continue after end of subtree
;; nil))) ; do not skip
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--
-------------------------------------------------------------------------------
Manuel Hermenegildo | Prof., C.S. Department
Director, IMDEA-Software and CLIP Group | T.U. of Madrid (UPM)
http://www.cliplab.org/herme | +34-91-336-7435 (W) -352-4819 (Fax)
-------------------------------------------------------------------------------
next prev parent reply other threads:[~2008-05-20 8:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-16 16:14 global tags for a file Manuel Hermenegildo
2008-05-16 16:44 ` Manuel Hermenegildo
2008-05-19 17:47 ` Carsten Dominik
2008-05-20 8:42 ` Manuel Hermenegildo [this message]
2008-06-03 11:19 ` Manuel Hermenegildo
2008-06-10 11:42 ` Dominik, C.
2008-06-10 11:43 ` Dominik, C.
2008-06-10 11:50 ` Manuel Hermenegildo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18482.36596.774796.551366@clip.dia.fi.upm.es \
--to=herme@fi.upm.es \
--cc=C.Dominik@uva.nl \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).