[Top][All Lists]

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

Re: [Orgmode] POLL: the 40 variables project

From: James TD Smith
Subject: Re: [Orgmode] POLL: the 40 variables project
Date: Sun, 1 Feb 2009 15:18:04 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Carsten,

On 2009-01-29 09:49:21(+0100), Carsten Dominik wrote:
> So here is my question to all of you.  Could you, in reply to this
> message, list all the Org-related variables that you have customized,
> along with the values you used?

Here are my org settings, with commentary. I've included definitions for
org-related functions as well.

; I use frequently use org in a terminal, so I need the replacement keys.
(setq org-replace-disputed-keys t)
(setq org-disputed-keys
'(([(shift up)] . [(control c) (up)])
  ([(shift down)] . [(control c) (down)])
  ([(shift left)] . [(control c) (left)])
  ([(shift right)] . [(control c) (right)])
  ([(control shift right)] . [(control c) (control x) (right)])
  ([(control shift left)] . [(control c) (control x) (left)])))

; Clock persistence
(setq org-clock-persist t) ; Persist clock data
(setq org-clock-in-resume t) ; Resume persisted clock when loading emacs
(setq org-clock-persist-query-resume nil) ; Resume clock without asking

(aput 'auto-mode-alist "\\.org$" (function org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(define-key global-map "\C-cf" 'org-footnote-action)
(define-key org-mode-map "\C-\M-g" 'org-plot/gnuplot)

(setq org-log-done t)

; I use the emacs diary mostly for things like
(setq org-agenda-include-diary t)

; TODO sequences.

(setq org-todo-keywords
      '((sequence "TODO" "|" "DONE")
                  "COMPLETED" "CANCELLED")
        (sequence "INVESTIGATE(i)" "TOGET(g)" "ORDERED(address@hidden)" "|"
                  "GOT(r)" "UNNEEDED(address@hidden)")
        (sequence "INVESTIGATE(i)" "TOGET(g)" "TOREAD(t)" "READING(r)" "|"
                  "READ(d)" "UNNEEDED(address@hidden)")
        (sequence "PROPOSED(p)" "TRIAL(t)" "|" "ACCEPTED(address@hidden)" 
        (sequence "INVESTIGATE(i)" "TOGET(g)" "TOLISTEN(l)" "LISTENING(L)" "|"
                  "HEARD(h)" "NOTINTERESTED(@n)")
        (sequence "INVESTIGATE(i)" "TOGET(g)" "TOWATCH(w)" "WATCHING(W)" "|"
                  "WATCHED(d)" "NOTINTERESTED(@n)")))

I also have some per-file settings:


; Some of my entries contain extensive notes in plain list format, so being able
; to fold them is useful.
(setq org-cycle-include-plain-lists t)

; Turn on tag inheritance
(setq org-use-tag-inheritance t)

; Make headlines with inherited tags show up in tag searches
(setq org-tags-match-list-sublevels t)

(setq org-directory "~/Personal")

(setq org-special-ctrl-a/e 'reversed)

; Hide scheduled items which I've done.
(setq org-agenda-skip-scheduled-if-done t)

; I can fit ~155 characters across the screen; 3 more are needed for the
; ellipsis for folded items, so -150 is about right for the tag position.
(setq org-tags-column -150)
; Use the same settings in the agenda
(setq org-agenda-tags-column org-tags-column)

; Always put clock items into drawers.
(setq org-clock-into-drawer t)

; I set this when the default was changed to f, but I just use C-u TAB now.
(setq org-cycle-global-at-bob t)

(setq org-refile-use-outline-path t)
(setq org-outline-path-complete-in-steps nil)
(setq org-context-in-file-links nil)
(setq org-confirm-elisp-link-function 'y-or-n-p)

; I like to see how much time I've spent on things in the agenda
(setq org-agenda-start-with-clockreport-mode t)

(setq org-agenda-sorting-strategy
  '((agenda time-up priority-down effort-up category-up )
    (todo priority-down effort-up category-up)
    (tags priority-down effort-up category-keep)
    (search category-keep)))

; Four priority levels. Items with no set priority are equivalent to the lowest.
(setq org-default-priority ?D)
(setq org-lowest-priority ?D)

(setq org-empty-line-terminates-plain-lists nil)

; I prefer to keep my drawers at the top of items.
(setq org-log-state-notes-insert-after-drawers t)

(setq org-completion-use-ido t)

; Makes the display look nicer
(setq org-hide-leading-stars t)

;;Stop org from opening DXFs in emacs
(add-to-list 'org-file-apps '("dxf" . "qcad %s"))

; Use my style sheet for HTML export
(setq org-export-html-style
      "<link rel=\"stylesheet\" type=\"text/css\" href=\"ahktdefault.css\"")

;;Default notes file, publishing and agenda files settings. These are different
;;for home and at work.
(cond ((string= (getenv "USER") "james")
       (setq org-default-notes-file
       (setq org-publish-project-alist
                :base-directory "~/work/currentproj/planning"
                :base-extension "org"
                :exclude "\\(testCardData.org\\|misc.org\\)"
                :publishing-directory "~/public_html"
                :auto-index t
                :index-title "Box Office Work Status")
                :base-directory "~/stuff/homedir/config"
                :base-extension "css"
                :publishing-directory "~/public_html"
                :publishing-function org-publish-attachment)
               ("main" :components ("orgfiles" "css"))))
       (setq org-agenda-files (quote ("~/work/currentproj/planning/main.org"
       (setq org-refile-targets '((org-agenda-files . (:maxlevel . 2))
                                  (nil . (:maxlevel . 3)))))
      ((string= (getenv "USER") "ahktenzero")
       (setq org-default-notes-file "~/Personal/notes.org")
       (setq org-agenda-files
             (list "~/Personal/Personal.org"
       (setq single-org-files (list "~/Personal/ReadingList.org"
       (setq double-org-files (list "~/Personal/Personal.org"
       (setq org-refile-targets '((single-org-files . (:maxlevel . 1))
                                  (double-org-files . (:maxlevel . 2))
                                  (nil . (:maxlevel . 3)))))
      (t "Not setting org notes/publish settings"))

;; Remember
(add-to-list 'load-path "~/share/emacs/site-lisp/remember")

; My remember templates.

(setq org-remember-templates
       '("Task" ?t "* TODO %i%?\n%U" "~/Personal/stuff.org" bottom)
       '("Task (l)"?T "* TODO %^C%?\n%U\n%a" "~/Personal/stuff.org" bottom)
       '("Scheduled" ?S "* TODO %^C%?\n%^{When}T" "~/Personal/Personal.org"
       '("Project" ?p "* PLANNING %^C%?\n%U\n%K" "~/Personal/projects.org"
       '("Project (l)" ?P "* PLANNING %^L%?\n%U\n%K\n%a"
         "~/Personal/projects.org" bottom)
       '("Note" ?n "* %^C%?\n   %U\n" "~/Personal/notes.org" "Notes")
       '("Note (ann)" ?N "* %^C%?\n   %U\n   %a" "~/Personal/notes.org" "Notes")
       ;Web-related stuff
       '("Web reading" ?w "* TOREAD %^L\n%U %k\n%? "
         "~/Personal/Web.org" "Web sites to read")
       '("Web reading <" ?W "* TOREAD %^L (%K)\n%U\n%?"
         "~/Personal/Web.org" "Web sites to read")
       '("Bookmark" ?b "* %^L\n%U\n%?" "~/Personal/bookmarks.org" "Bookmarks")
       ;Reading list
       '("Book" ?r
         "* INVESTIGATE %^{Title} %?%^g\n   %U %k\n%^{AUTHOR}p %^{ISBN}p"
         "~/Personal/ReadingList.org" "Books")
       '("Book (clipboard)" ?R
         "* INVESTIGATE %^C %?%^g\n   %U %k\n%^{AUTHOR}p %^{ISBN}p"
         "~/Personal/ReadingList.org" "Books")
       '("Video" ?v
         "* INVESTIGATE %^{Title} %? %^g \n%U %k%^{Type}p%^{Length}p%^{Year}p"
         "~/Personal/Video.org" top)
       '("Video (c)" ?V
         "* INVESTIGATE %^C%? %^g\n%U %k%^{Type}p%^{Length}p%^{Year}p"
         "~/Personal/Video.org" top)
       '("Game" ?g "* INVESTIGATE %^{Title} %? %^g \n%U %k"
         "~/Personal/Interactive.org" top)
       '("Game (l)" ?G "* INVESTIGATE %^L %? %^g \n%U %k"
         "~/Personal/Interactive.org" top)))

; Remember templates in plist format, from the improved org-remember I'm working
; on.

(setq org-remember-templates-2
       '(:name "Task" :key ?t :template "* TODO %i%?\n%U"
               :target "~/Personal/stuff.org")
       '(:name "Task (l)" :key ?T :template "* TODO %^C%?\n%U\n%a"
               :target "~/Personal/stuff.org")
       '(:name "Scheduled" :key ?S :template "* TODO %^C%?\n%^{When}T"
               :target "~/Personal/Personal.org::Appointments")
       '(:name "Project" :key ?p :template "* PLANNING %^C%?\n%U\n%K"
               :target "~/Personal/projects.org")
       '(:name "Project (l)" :key ?P :template "* PLANNING %^L%?\n%U\n%K\n%a"
               :target "~/Personal/projects.org")
       '(:name "Note" :key ?n :template  "* %^C%?\n   %U\n"
               :target "~/Personal/notes.org::Notes")
       '(:name "Note (ann)" :key ?N :template "* %^C%?\n   %U\n   %a"
               :target "~/Personal/notes.org::Notes")
       ;Web-related stuff
       '(:name "Web reading" :key ?w :template "* TOREAD %^L\n%U %k\n%? "
               :target "~/Personal/Web.org::Web sites to read")
       '(:name "Web reading <" :key ?W :template "* TOREAD %^L (%K)\n%U\n%?"
               :target "~/Personal/Web.org::Web sites to read")
       '(:name "Bookmark" :key ?b :template "* %^L\n%U\n%?"
               :target "~/Personal/bookmarks.org::Bookmarks")
       ;Reading list
       '(:name "Book" :key ?r
               :template "* INVESTIGATE %^{Title} %?%^g\n   %U %k\n%^{AUTHOR}p 
               :target "~/Personal/ReadingList.org::Books")
       '(:name "Book (clipboard)" :key ?R
               :template "* INVESTIGATE %^C %?%^g\n   %U %k\n%^{AUTHOR}p 
               :target "~/Personal/ReadingList.org::Books")
       '(:name "Video" :key ?v
               :template "* INVESTIGATE %^{Title} %? %^g \n%U 
               :target "~/Personal/Video.org" :prepend t)
       '(:name "Video (c)" :key ?V
               :template "* INVESTIGATE %^C%? %^g\n%U 
               :target "~/Personal/Video.org" :prepend t)
       '(:name "Game" :key ?g :template "* INVESTIGATE %^{Title} %? %^g \n%U %k"
               :target "~/Personal/Interactive.org" :prepend t)
       '(:name "Game (l)" :key ?G :template "* INVESTIGATE %^L %? %^g \n%U %k"
               :target "~/Personal/Interactive.org" :prepend t)))

;; Remember
(define-key global-map [(control c) ?m] 'org-remember)
(define-key global-map [(control c) (shift m)] 'remember-clipboard)

;; Access clock from anywhere.
(global-set-key [(control c) (control x) (control o)] 'org-clock-out)
(global-set-key [(control c) (control x) (control j)] 'org-clock-goto)
(global-set-key [(control c) (control x) (control x)] 'org-clock-cancel)

: There isn't a key binding to toggle between descriptive and literal link 
(defun ahkt-org-toggle-link-type ()
  "Toggle visibility of org-mode links"
  (interactive "*")
  (if (member '(org-link) buffer-invisibility-spec)
      (org-remove-from-invisibility-spec '(org-link))
      (org-add-to-invisibility-spec '(org-link)))

(define-key org-mode-map [(control c) ?v] 'ahkt-org-toggle-link-type)

;; This is my link description generator. It either uses the URL, if it contains
;; a useful value, or fetches the page and gets the title from the HTML.

(defun undashify (str)
   "[-_]" " "
   (mm-url-decode-entities-string (url-unhex-string str nil))))

(setq ahkt-link-sites
      '(("http://ask.metafilter.com/[0-9]*/\\(.*\\)" . "Ask Mefi")
        ("http://www.metafilter.com/[0-9]*/\\(.*\\)" . "Mefi" )
        ("http://www.rudyrucker.com/blog/[0-9/]*\\([^/]*\\)" . "Rudy Rucker")
        ("http://www.ectomo.com/index.php/[0-9/]*\\([^/]*\\)" . "ectomo")
        ("http://.*wikipedia.org/wiki/\\(.*\\)" . "WP")
        ("http://io9.com/[0-9]*/\\(.*\\)". "io9")
        ("http://weirdtales.net/wordpress/[0-9/]*\\([^/]*\\)/". "Wierd Tales")
        ("http://lifehacker.com/[0-9]*/\\(.*\\)" . "lifehacker")
        ("http://www.instructables.com/id/\\([^/]*\\)" . "Instructables")
        ("http://toolmonger.com/[0-9/]*\\([^/]*\\)" . "Toolmonger" )))

(defun ahkt-link-description (link desc)
  "Better link description generator for orgmode"
  (or (car (remove nil
                   (mapcar (lambda (x)
                             (if (string-match (car x) link)
                                 (concat (cdr x) ": "
                                         (undashify (match-string 1 link)))))
       ((string-match "https?:" link)
          (w3m-retrieve link)
          (w3m-region (point-min) (point-max))
          (if (string= "text/html" (w3m-content-type link))
              (replace-regexp-in-string "[ \t]+" " "
\\)" ""
       ((string-match "file:\\([^:]+\\)::\\(.+\\)" link)
        (let ((search (match-string-no-properties 2 link))
               (car (last
                     (split-string (match-string-no-properties 1 link) "/")))))
          (format "%s: %s" filename search)))
       ((string-match "file:\\([^:]+\\)" link)
        (car (last (split-string (match-string-no-properties 1 link) "/"))))
       (t (or desc link)))))

(setq org-make-link-description-function 'ahkt-link-description)

(defun ahkt-org-end-of-day ()
      (org-clock-out t)
      (org-dblock-update 1)

; Helper function for
(defun ahkt-org-open-read ()
  (interactive "")
  (if (string= (org-get-todo-state) "TOREAD") (org-todo "READING"))

(define-key org-mode-map [(control c) ?o] 'ahkt-org-open-read)

; Select clock in state based on initial state
(defun ahkt-clock-state (state)
  (cond ((string= state "TOREAD") "READING")
        ((string= state "TOWATCH") "WATCHING")
        ((string= state "TOPLAY") "PLAYING")
        (t state)))
(setq org-clock-in-switch-to-state 'ahkt-clock-state)

; This is a custom sort function I wrote. It sorts by priority, todo state and
; then headline text.
(defun ahkt-org-sort-function ()
    (if (looking-at org-complex-heading-regexp)
        (let* ((todo (match-string-no-properties 2))
               (todo-pos (or (position todo org-todo-keywords-1 :test 'string=)
               (headline-str (match-string-no-properties 4))
               (priority-str (match-string-no-properties 3))
               (headline (if (string-match org-bracket-link-analytic-regexp
                             (match-string-no-properties 5 headline-str)
               (priority (- (if (and priority-str
                                     (string-match org-priority-regexp
                                (+ (string-to-char (match-string 2 
                                   (if (member todo org-done-keywords)
                                       (- org-lowest-priority
                              (+ org-lowest-priority 1000))
          (format "%04d%04d%s" priority todo-pos headline)))))

; Load org-checklist
(require 'org-checklist "org-checklist" t)

(require 'org-registry)
; Put the org-registry data file in .emacs.d.
(setq org-registry-file "~/.emacs.d/org-registry.el")

(require 'org-annotation-helper)

;;some custom agenda commands.
(setq org-agenda-custom-commands
      '(("S" "shopping"
         ((agenda "") (todo "TOGET"))
         ((org-agenda-files '("~/Personal/info.org"
          (org-agenda-text-search-extra-files nil)
          (org-agenda-start-with-clockreport-mode nil)))
        ("w" "TV to watch" ((todo "WATCHING|TOWATCH")))))

I'll probably be adding various things from the other configs people have
posted; there are lots of great ideas in this thread.


|-<James TD Smith>-<email/address@hidden>-|

reply via email to

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