emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/textmodes/org.el


From: Carsten Dominik
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/org.el
Date: Thu, 08 Dec 2005 08:08:55 -0500

Index: emacs/lisp/textmodes/org.el
diff -c emacs/lisp/textmodes/org.el:1.49 emacs/lisp/textmodes/org.el:1.50
*** emacs/lisp/textmodes/org.el:1.49    Tue Dec  6 10:51:28 2005
--- emacs/lisp/textmodes/org.el Thu Dec  8 13:08:54 2005
***************
*** 5,11 ****
  ;; 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.22
  ;;
  ;; This file is part of GNU Emacs.
  ;;
--- 5,11 ----
  ;; 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.23
  ;;
  ;; This file is part of GNU Emacs.
  ;;
***************
*** 82,87 ****
--- 82,91 ----
  ;;
  ;; Changes:
  ;; -------
+ ;; Version 3.23
+ ;;    - M-RET makes new items as well as new headings.
+ ;;    - Various small bug fixes
+ ;;
  ;; Version 3.22
  ;;    - CamelCase words link to other locations in the same file.
  ;;    - File links accept search options, to link to specific locations.
***************
*** 253,259 ****
  
  ;;; Customization variables
  
! (defvar org-version "3.22"
    "The version number of the file org.el.")
  (defun org-version ()
    (interactive)
--- 257,263 ----
  
  ;;; Customization variables
  
! (defvar org-version "3.23"
    "The version number of the file org.el.")
  (defun org-version ()
    (interactive)
***************
*** 2530,2551 ****
  (defvar org-ignore-region nil
    "To temporarily disable the active region.")
  
! (defun org-insert-heading ()
!   "Insert a new heading with same depth at point."
!   (interactive)
!   (let* ((head (save-excursion
!                (condition-case nil
!                    (org-back-to-heading)
!                  (error (outline-next-heading)))
!                (prog1 (match-string 0)
!                  (funcall outline-level)))))
      (unless (bolp) (newline))
!     (insert head)
!     (unless (eolp)
!       (save-excursion (newline-and-indent)))
!     (unless (equal (char-before) ?\ )
!       (insert " "))
!     (run-hooks 'org-insert-heading-hook)))
  
  (defun org-insert-todo-heading (arg)
    "Insert a new heading with the same level and TODO state as current heading.
--- 2534,2572 ----
  (defvar org-ignore-region nil
    "To temporarily disable the active region.")
  
! (defun org-insert-heading (&optional force-heading)
!   "Insert a new heading or item with same depth at point.
! If ARG is non-nil"
!   (interactive "P")
!   (when (or force-heading (not (org-insert-item)))
!     (let* ((head (save-excursion
!                  (condition-case nil
!                      (org-back-to-heading)
!                    (error (outline-next-heading)))
!                  (prog1 (match-string 0)
!                    (funcall outline-level)))))
!       (unless (bolp) (newline))
!       (insert head)
!       (unless (eolp)
!       (save-excursion (newline-and-indent)))
!       (unless (equal (char-before) ?\ )
!       (insert " "))
!       (run-hooks 'org-insert-heading-hook))))
! 
! (defun org-insert-item ()
!   "Insert a new item at the current level.
! Return t when tings worked, nil when we are not in an item."
!   (when (save-excursion
!         (condition-case nil
!             (progn
!               (org-beginning-of-item)
!               (org-at-item-p)
!               t)
!           (error nil)))
      (unless (bolp) (newline))
!     (insert (match-string 0))
!     (org-maybe-renumber-ordered-list)
!     t))
  
  (defun org-insert-todo-heading (arg)
    "Insert a new heading with the same level and TODO state as current heading.
***************
*** 3034,3041 ****
          (beginning-of-line 0)
          (if (looking-at "[ \t]*$") (throw 'next t))
          (skip-chars-forward " \t") (setq ind1 (current-column))
!         (if (and (<= ind1 ind)
!                  (not (org-at-item-p)))
              (throw 'exit t)))))
      ;; Walk forward and replace these numbers
      (catch 'exit
--- 3055,3063 ----
          (beginning-of-line 0)
          (if (looking-at "[ \t]*$") (throw 'next t))
          (skip-chars-forward " \t") (setq ind1 (current-column))
!         (if (or (< ind1 ind)
!                 (and (= ind1 ind)
!                      (not (org-at-item-p))))
              (throw 'exit t)))))
      ;; Walk forward and replace these numbers
      (catch 'exit
***************
*** 3055,3061 ****
          (insert (format "%d" (setq n (1+ n)))))))
      (goto-line line)
      (move-to-column col)))
!     
  (defvar org-last-indent-begin-marker (make-marker))
  (defvar org-last-indent-end-marker (make-marker))
  
--- 3077,3083 ----
          (insert (format "%d" (setq n (1+ n)))))))
      (goto-line line)
      (move-to-column col)))
! 
  (defvar org-last-indent-begin-marker (make-marker))
  (defvar org-last-indent-end-marker (make-marker))
  
***************
*** 3422,3430 ****
                  (save-match-data (funcall callback)))
          (setq cnt (1+ cnt))
          (org-highlight-new-match (match-beginning 0) (match-end 0))
-         (add-hook 'before-change-functions 'org-remove-occur-highlights
-                   nil 'local)
          (org-show-hierarchy-above))))
      (run-hooks 'org-occur-hook)
      (if (interactive-p)
        (message "%d match(es) for regexp %s" cnt regexp))
--- 3444,3453 ----
                  (save-match-data (funcall callback)))
          (setq cnt (1+ cnt))
          (org-highlight-new-match (match-beginning 0) (match-end 0))
          (org-show-hierarchy-above))))
+     (make-local-hook 'before-change-functions) ; needed for XEmacs
+     (add-hook 'before-change-functions 'org-remove-occur-highlights
+             nil 'local)
      (run-hooks 'org-occur-hook)
      (if (interactive-p)
        (message "%d match(es) for regexp %s" cnt regexp))
***************
*** 4036,4042 ****
--- 4059,4067 ----
    (use-local-map org-agenda-mode-map)
    (easy-menu-add org-agenda-menu)
    (if org-startup-truncated (setq truncate-lines t))
+   (make-local-hook 'post-command-hook)  ; Needed for XEmacs
    (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local)
+   (make-local-hook 'pre-command-hook)  ; Needed for XEmacs
    (add-hook 'pre-command-hook 'org-unhighlight nil 'local)
    (setq org-agenda-follow-mode nil)
    (easy-menu-change
***************
*** 4049,4055 ****
    (org-agenda-set-mode-name)
    (apply
     (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks)
!    org-agenda-mode-hook))
  
  (define-key org-agenda-mode-map "\C-i"     'org-agenda-goto)
  (define-key org-agenda-mode-map "\C-m"     'org-agenda-switch-to)
--- 4074,4080 ----
    (org-agenda-set-mode-name)
    (apply
     (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks)
!    (list 'org-agenda-mode-hook)))
  
  (define-key org-agenda-mode-map "\C-i"     'org-agenda-goto)
  (define-key org-agenda-mode-map "\C-m"     'org-agenda-switch-to)
***************
*** 4903,4910 ****
    (let (tbl)
      (save-excursion
        (goto-char (point-min))
!       (while (re-search-forward "^#\\+CATEGORY:[ \t]*\\(.*\\)" nil t)
!       (push (cons (point) (org-trim (match-string 1))) tbl)))
      tbl))
    (defun org-get-category (&optional pos)
      "Get the category applying to position POS."
--- 4928,4935 ----
    (let (tbl)
      (save-excursion
        (goto-char (point-min))
!       (while (re-search-forward "\\(^\\|\r\\)#\\+CATEGORY:[ \t]*\\(.*\\)" nil 
t)
!       (push (cons (point) (org-trim (match-string 2))) tbl)))
      tbl))
    (defun org-get-category (&optional pos)
      "Get the category applying to position POS."
***************
*** 10899,10905 ****
    (cond
     ((org-at-table-p)
      (org-table-wrap-region arg))
!    (t (org-insert-heading))))
  
  ;;; Menu entries
  
--- 10924,10930 ----
    (cond
     ((org-at-table-p)
      (org-table-wrap-region arg))
!    (t (org-insert-heading arg))))
  
  ;;; Menu entries
  




reply via email to

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