;; Author: Carsten Dominik <dominik at science dot uva dot nl>
;; Keywords: outlines, hypermedia, calendar
;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 3.09
+;; Version: 3.10
;;
;; This file is part of GNU Emacs.
;;
;;
;; Changes:
;; -------
+;; Version 3.10
+;; - Using `define-derived-mode' to derive `org-mode' from `outline-mode'.
+;;
;; Version 3.09
;; - Time-of-day specifications in agenda are extracted and placed
;; into the prefix. Timed entries can be placed into a time grid for
(require 'outline)
(require 'time-date)
(require 'easymenu)
+(or (fboundp 'run-mode-hooks)
+ (defalias 'run-mode-hooks 'run-hooks))
;;; Customization variables
-(defvar org-version "3.09"
+(defvar org-version "3.10"
"The version number of the file org.el.")
(defun org-version ()
(interactive)
-*- mode: org; org-category: \"ELisp\"
-If the file does not specify a category, the file's base name
+or contain a special line
+
+#+CATEGORY: ELisp
+
+If the file does not specify a category, then file's base name
is used instead.")
(defun org-set-regexps-and-options ()
;;;###autoload
-(defun org-mode (&optional arg)
+(define-derived-mode org-mode outline-mode "Org"
"Outline-based notes management and organizer, alias
\"Carstens outline-mode for keeping track of everything.\"
Plain text URL-like links connect to websites, emails (VM), Usenet
messages (Gnus), BBDB entries, and any files related to the project.
For printing and sharing of notes, an Org-mode file (or a part of it)
-can be exported as a well-structured ASCII or HTML file.
+can be exported as a structured ASCII or HTML file.
The following commands are available:
\\{org-mode-map}"
- (interactive "P")
- (outline-mode)
- (setq major-mode 'org-mode)
- (setq mode-name "Org")
- (use-local-map org-mode-map)
(easy-menu-add org-org-menu)
(org-install-agenda-files-menu)
(setq outline-regexp "\\*+")
(if org-enable-table-editor "|" "")
(if org-enable-fixed-width-editor ":" "")
"]"))))
- ;; Hook, and startup actions
- (if (or arg
- (and org-insert-mode-line-in-empty-file
- (interactive-p)
- (= (point-min) (point-max))))
- (save-excursion
- (goto-char (point-min))
- (insert " -*- mode: org -*-\n\n")))
- (run-hooks 'org-mode-hook)
+ (if (and org-insert-mode-line-in-empty-file
+ (interactive-p)
+ (= (point-min) (point-max)))
+ (insert " -*- mode: org -*-\n\n"))
(unless org-inhibit-startup
(if org-startup-with-deadline-check
(call-interactively 'org-check-deadlines)
'keymap org-mouse-map))
t)))
-
(defun org-font-lock-level ()
(save-excursion
(org-back-to-heading t)
"--")
(mapcar 'org-file-menu-entry org-agenda-files)))
(org-agenda-set-mode-name)
- (run-hooks 'org-agenda-mode-hook))
+ (run-mode-hooks 'org-agenda-mode-hook))
(define-key org-agenda-mode-map [(tab)] 'org-agenda-goto)
(define-key org-agenda-mode-map [(return)] 'org-agenda-switch-to)
(concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp)
"[ \t]*|"))
(easy-menu-add orgtbl-mode-menu)
- (run-hooks (quote orgtbl-mode-hook)))
+ (run-hooks 'orgtbl-mode-hook))
(setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp)
(remove-hook 'before-change-functions 'org-before-change-function t)
(easy-menu-remove orgtbl-mode-menu)
;;; Menu entries
-;; First, remove the outline menus.
+;; First, remove the outline menus. Org-mode does not neede these commands.
(if org-xemacs-p
(add-hook 'org-mode-hook
(lambda ()
(delete-menu-item '("Hide"))
(set-menubar-dirty-flag)))
(setq org-mode-map (delq (assoc 'menu-bar (cdr org-mode-map))
- org-mode-map)))
+ org-mode-map)))
;; Define the Org-mode menus
(easy-menu-define org-org-menu org-mode-map "Org menu"