From c2e5b13a2d214210971044c267b96d6119f9ce85 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 18 Apr 2010 19:26:30 +0200 Subject: [PATCH 1/8] Use `add-to-invisibility-spec' directly --- contrib/ChangeLog | 4 ++++ contrib/babel/lisp/org-babel.el | 4 ++-- lisp/ChangeLog | 10 ++++++++++ lisp/org-compat.el | 13 ------------- lisp/org-table.el | 2 +- lisp/org.el | 8 ++++---- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 181ab0db7..4f42b55a3 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,5 +1,9 @@ 2010-04-18 Carsten Dominik + * babel/lisp/org-babel.el (org-babel-hide-hash): Use + `add-to-invisibility-spec'. + (org-babel-result-hide-spec): + * lisp/org-learn.el (require): `calendar' is now required already by org.el on top level. diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index b348503ba..12a5be47a 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -394,7 +394,7 @@ added to the header-arguments-alist." "Hide the hash in the current results line. Only the initial `org-babel-hash-show' characters of the hash will remain visible." - (org-add-to-invisibility-spec '(org-babel-hide-hash . t)) + (add-to-invisibility-spec '(org-babel-hide-hash . t)) (save-excursion (when (and (re-search-forward org-babel-result-regexp nil t) (match-string 3)) @@ -432,7 +432,7 @@ with C-c C-c." (add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-hash-at-point) (defun org-babel-result-hide-spec () - (org-add-to-invisibility-spec '(org-babel-hide-result . t))) + (add-to-invisibility-spec '(org-babel-hide-result . t))) (add-hook 'org-mode-hook 'org-babel-result-hide-spec) (defvar org-babel-hide-result-overlays nil diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 25839f53f..eeee21fe6 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,15 @@ 2010-04-18 Carsten Dominik + * org.el (org-mode, org-org-menu): Use `add-to-invisibility-spec'. + + * org-table.el (orgtbl-mode): Use `add-to-invisibility-spec'. + + * org-compat.el (org-make-overlay, org-delete-overlay) + (org-overlay-start, org-overlay-end, org-overlay-put) + (org-overlay-get, org-overlay-move, org-overlay-buffer): Functions + removed. + (org-add-to-invisibility-spec): Function removed. + * org-html.el (org-export-as-html-and-open): Add argument to kill-buffer. diff --git a/lisp/org-compat.el b/lisp/org-compat.el index e226923d3..3daff847e 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -182,19 +182,6 @@ Works on both Emacs and XEmacs." ;; Invisibility compatibility -(defun org-add-to-invisibility-spec (arg) - "Add elements to `buffer-invisibility-spec'. -See documentation for `buffer-invisibility-spec' for the kind of elements -that can be added." - (cond - ((fboundp 'add-to-invisibility-spec) - (add-to-invisibility-spec arg)) - ((or (null buffer-invisibility-spec) (eq buffer-invisibility-spec t)) - (setq buffer-invisibility-spec (list arg))) - (t - (setq buffer-invisibility-spec - (cons arg buffer-invisibility-spec))))) - (defun org-remove-from-invisibility-spec (arg) "Remove elements from `buffer-invisibility-spec'." (if (fboundp 'remove-from-invisibility-spec) diff --git a/lisp/org-table.el b/lisp/org-table.el index b189818de..c2df70626 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -3454,7 +3454,7 @@ table editor in arbitrary modes.") (concat orgtbl-line-start-regexp "\\|" auto-fill-inhibit-regexp) orgtbl-line-start-regexp)) - (org-add-to-invisibility-spec '(org-cwidth)) + (add-to-invisibility-spec '(org-cwidth)) (when (fboundp 'font-lock-add-keywords) (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords) (org-restart-font-lock)) diff --git a/lisp/org.el b/lisp/org.el index 7cad96290..16c1f91c1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4365,9 +4365,9 @@ The following commands are available: (easy-menu-add org-org-menu) (easy-menu-add org-tbl-menu) (org-install-agenda-files-menu) - (if org-descriptive-links (org-add-to-invisibility-spec '(org-link))) - (org-add-to-invisibility-spec '(org-cwidth)) - (org-add-to-invisibility-spec '(org-hide-block . t)) + (if org-descriptive-links (add-to-invisibility-spec '(org-link))) + (add-to-invisibility-spec '(org-cwidth)) + (add-to-invisibility-spec '(org-hide-block . t)) (when (featurep 'xemacs) (org-set-local 'line-move-ignore-invisible t)) (org-set-local 'outline-regexp org-outline-regexp) @@ -16687,7 +16687,7 @@ See the individual commands for more information." ["Previous link" org-previous-link t] "--" ["Descriptive Links" - (progn (org-add-to-invisibility-spec '(org-link)) (org-restart-font-lock)) + (progn (add-to-invisibility-spec '(org-link)) (org-restart-font-lock)) :style radio :selected (member '(org-link) buffer-invisibility-spec)] ["Literal Links" From b35b9914e6334e340948f52b02cbc772c06f91c3 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 18 Apr 2010 19:38:10 +0200 Subject: [PATCH 2/8] Revert "Use `add-to-invisibility-spec' directly" This reverts commit c2e5b13a2d214210971044c267b96d6119f9ce85. --- contrib/ChangeLog | 4 ---- contrib/babel/lisp/org-babel.el | 4 ++-- lisp/ChangeLog | 10 ---------- lisp/org-compat.el | 13 +++++++++++++ lisp/org-table.el | 2 +- lisp/org.el | 8 ++++---- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 4f42b55a3..181ab0db7 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,9 +1,5 @@ 2010-04-18 Carsten Dominik - * babel/lisp/org-babel.el (org-babel-hide-hash): Use - `add-to-invisibility-spec'. - (org-babel-result-hide-spec): - * lisp/org-learn.el (require): `calendar' is now required already by org.el on top level. diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index 12a5be47a..b348503ba 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -394,7 +394,7 @@ added to the header-arguments-alist." "Hide the hash in the current results line. Only the initial `org-babel-hash-show' characters of the hash will remain visible." - (add-to-invisibility-spec '(org-babel-hide-hash . t)) + (org-add-to-invisibility-spec '(org-babel-hide-hash . t)) (save-excursion (when (and (re-search-forward org-babel-result-regexp nil t) (match-string 3)) @@ -432,7 +432,7 @@ with C-c C-c." (add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-hash-at-point) (defun org-babel-result-hide-spec () - (add-to-invisibility-spec '(org-babel-hide-result . t))) + (org-add-to-invisibility-spec '(org-babel-hide-result . t))) (add-hook 'org-mode-hook 'org-babel-result-hide-spec) (defvar org-babel-hide-result-overlays nil diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eeee21fe6..25839f53f 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,15 +1,5 @@ 2010-04-18 Carsten Dominik - * org.el (org-mode, org-org-menu): Use `add-to-invisibility-spec'. - - * org-table.el (orgtbl-mode): Use `add-to-invisibility-spec'. - - * org-compat.el (org-make-overlay, org-delete-overlay) - (org-overlay-start, org-overlay-end, org-overlay-put) - (org-overlay-get, org-overlay-move, org-overlay-buffer): Functions - removed. - (org-add-to-invisibility-spec): Function removed. - * org-html.el (org-export-as-html-and-open): Add argument to kill-buffer. diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 3daff847e..e226923d3 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -182,6 +182,19 @@ Works on both Emacs and XEmacs." ;; Invisibility compatibility +(defun org-add-to-invisibility-spec (arg) + "Add elements to `buffer-invisibility-spec'. +See documentation for `buffer-invisibility-spec' for the kind of elements +that can be added." + (cond + ((fboundp 'add-to-invisibility-spec) + (add-to-invisibility-spec arg)) + ((or (null buffer-invisibility-spec) (eq buffer-invisibility-spec t)) + (setq buffer-invisibility-spec (list arg))) + (t + (setq buffer-invisibility-spec + (cons arg buffer-invisibility-spec))))) + (defun org-remove-from-invisibility-spec (arg) "Remove elements from `buffer-invisibility-spec'." (if (fboundp 'remove-from-invisibility-spec) diff --git a/lisp/org-table.el b/lisp/org-table.el index c2df70626..b189818de 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -3454,7 +3454,7 @@ table editor in arbitrary modes.") (concat orgtbl-line-start-regexp "\\|" auto-fill-inhibit-regexp) orgtbl-line-start-regexp)) - (add-to-invisibility-spec '(org-cwidth)) + (org-add-to-invisibility-spec '(org-cwidth)) (when (fboundp 'font-lock-add-keywords) (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords) (org-restart-font-lock)) diff --git a/lisp/org.el b/lisp/org.el index 16c1f91c1..7cad96290 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4365,9 +4365,9 @@ The following commands are available: (easy-menu-add org-org-menu) (easy-menu-add org-tbl-menu) (org-install-agenda-files-menu) - (if org-descriptive-links (add-to-invisibility-spec '(org-link))) - (add-to-invisibility-spec '(org-cwidth)) - (add-to-invisibility-spec '(org-hide-block . t)) + (if org-descriptive-links (org-add-to-invisibility-spec '(org-link))) + (org-add-to-invisibility-spec '(org-cwidth)) + (org-add-to-invisibility-spec '(org-hide-block . t)) (when (featurep 'xemacs) (org-set-local 'line-move-ignore-invisible t)) (org-set-local 'outline-regexp org-outline-regexp) @@ -16687,7 +16687,7 @@ See the individual commands for more information." ["Previous link" org-previous-link t] "--" ["Descriptive Links" - (progn (add-to-invisibility-spec '(org-link)) (org-restart-font-lock)) + (progn (org-add-to-invisibility-spec '(org-link)) (org-restart-font-lock)) :style radio :selected (member '(org-link) buffer-invisibility-spec)] ["Literal Links" From 97e20048b2ef6e793a6387bfc3eb5bdedd6226e4 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 18 Apr 2010 19:26:30 +0200 Subject: [PATCH 3/8] Use `add-to-invisibility-spec' directly --- contrib/ChangeLog | 4 ++++ contrib/babel/lisp/org-babel.el | 4 ++-- lisp/ChangeLog | 10 ++++++++++ lisp/org-compat.el | 13 ------------- lisp/org-table.el | 2 +- lisp/org.el | 8 ++++---- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 181ab0db7..4f42b55a3 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,5 +1,9 @@ 2010-04-18 Carsten Dominik + * babel/lisp/org-babel.el (org-babel-hide-hash): Use + `add-to-invisibility-spec'. + (org-babel-result-hide-spec): + * lisp/org-learn.el (require): `calendar' is now required already by org.el on top level. diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index b348503ba..12a5be47a 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -394,7 +394,7 @@ added to the header-arguments-alist." "Hide the hash in the current results line. Only the initial `org-babel-hash-show' characters of the hash will remain visible." - (org-add-to-invisibility-spec '(org-babel-hide-hash . t)) + (add-to-invisibility-spec '(org-babel-hide-hash . t)) (save-excursion (when (and (re-search-forward org-babel-result-regexp nil t) (match-string 3)) @@ -432,7 +432,7 @@ with C-c C-c." (add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-hash-at-point) (defun org-babel-result-hide-spec () - (org-add-to-invisibility-spec '(org-babel-hide-result . t))) + (add-to-invisibility-spec '(org-babel-hide-result . t))) (add-hook 'org-mode-hook 'org-babel-result-hide-spec) (defvar org-babel-hide-result-overlays nil diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 25839f53f..eeee21fe6 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,15 @@ 2010-04-18 Carsten Dominik + * org.el (org-mode, org-org-menu): Use `add-to-invisibility-spec'. + + * org-table.el (orgtbl-mode): Use `add-to-invisibility-spec'. + + * org-compat.el (org-make-overlay, org-delete-overlay) + (org-overlay-start, org-overlay-end, org-overlay-put) + (org-overlay-get, org-overlay-move, org-overlay-buffer): Functions + removed. + (org-add-to-invisibility-spec): Function removed. + * org-html.el (org-export-as-html-and-open): Add argument to kill-buffer. diff --git a/lisp/org-compat.el b/lisp/org-compat.el index e226923d3..3daff847e 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -182,19 +182,6 @@ Works on both Emacs and XEmacs." ;; Invisibility compatibility -(defun org-add-to-invisibility-spec (arg) - "Add elements to `buffer-invisibility-spec'. -See documentation for `buffer-invisibility-spec' for the kind of elements -that can be added." - (cond - ((fboundp 'add-to-invisibility-spec) - (add-to-invisibility-spec arg)) - ((or (null buffer-invisibility-spec) (eq buffer-invisibility-spec t)) - (setq buffer-invisibility-spec (list arg))) - (t - (setq buffer-invisibility-spec - (cons arg buffer-invisibility-spec))))) - (defun org-remove-from-invisibility-spec (arg) "Remove elements from `buffer-invisibility-spec'." (if (fboundp 'remove-from-invisibility-spec) diff --git a/lisp/org-table.el b/lisp/org-table.el index b189818de..c2df70626 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -3454,7 +3454,7 @@ table editor in arbitrary modes.") (concat orgtbl-line-start-regexp "\\|" auto-fill-inhibit-regexp) orgtbl-line-start-regexp)) - (org-add-to-invisibility-spec '(org-cwidth)) + (add-to-invisibility-spec '(org-cwidth)) (when (fboundp 'font-lock-add-keywords) (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords) (org-restart-font-lock)) diff --git a/lisp/org.el b/lisp/org.el index 7cad96290..16c1f91c1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4365,9 +4365,9 @@ The following commands are available: (easy-menu-add org-org-menu) (easy-menu-add org-tbl-menu) (org-install-agenda-files-menu) - (if org-descriptive-links (org-add-to-invisibility-spec '(org-link))) - (org-add-to-invisibility-spec '(org-cwidth)) - (org-add-to-invisibility-spec '(org-hide-block . t)) + (if org-descriptive-links (add-to-invisibility-spec '(org-link))) + (add-to-invisibility-spec '(org-cwidth)) + (add-to-invisibility-spec '(org-hide-block . t)) (when (featurep 'xemacs) (org-set-local 'line-move-ignore-invisible t)) (org-set-local 'outline-regexp org-outline-regexp) @@ -16687,7 +16687,7 @@ See the individual commands for more information." ["Previous link" org-previous-link t] "--" ["Descriptive Links" - (progn (org-add-to-invisibility-spec '(org-link)) (org-restart-font-lock)) + (progn (add-to-invisibility-spec '(org-link)) (org-restart-font-lock)) :style radio :selected (member '(org-link) buffer-invisibility-spec)] ["Literal Links" From b65f1f94894ca9b634f7f98d95fa9c63406a73ba Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 18 Apr 2010 19:58:24 +0200 Subject: [PATCH 4/8] Redefine the functions where XEmacs invisibility has to be turned off --- lisp/ChangeLog | 5 ++++ lisp/org-compat.el | 59 ++++++++++++++++------------------------------ lisp/org-macs.el | 1 - 3 files changed, 25 insertions(+), 40 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eeee21fe6..bbd162605 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2010-04-18 Carsten Dominik + * org-compat.el (org-xemacs-without-invisibility): New macro. + (org-xemacs-without-invisibility): New macro. + (org-indent-to-column, org-indent-line-to, org-move-to-column): + Redefine using the macro `org-xemacs-without-invisibility'. + * org.el (org-mode, org-org-menu): Use `add-to-invisibility-spec'. * org-table.el (orgtbl-mode): Use `add-to-invisibility-spec'. diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 3daff847e..c52758c1d 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -126,6 +126,8 @@ If DELETE is non-nil, delete all those overlays." (if delete (delete-overlay ov) (push ov found)))) found)) +;; Miscellaneous functions + (defun org-add-hook (hook function &optional append local) "Add-hook, compatible with both Emacsen." (if (and local (featurep 'xemacs)) @@ -196,57 +198,36 @@ Works on both Emacs and XEmacs." (member arg buffer-invisibility-spec) nil)) +(defmacro org-xemacs-without-invisibility (&rest body) + "Turn off exents with invisibility while executing BODY." + `(let ((ext-inv (extent-list nil (point-at-bol) (point-at-eol) + 'all-extents-closed-open 'invisible)) + ext-inv-specs) + (dolist (ext ext-inv) + (when (extent-property ext 'invisible) + (add-to-list 'ext-inv-specs (list ext (extent-property + ext 'invisible))) + (set-extent-property ext 'invisible nil))) + ,@body + (dolist (ext-inv-spec ext-inv-specs) + (set-extent-property (car ext-inv-spec) 'invisible + (cadr ext-inv-spec))))) + (defun org-indent-to-column (column &optional minimum buffer) "Work around a bug with extents with invisibility in XEmacs." (if (featurep 'xemacs) - (let ((ext-inv (extent-list - nil (point-at-bol) (point-at-eol) - 'all-extents-closed-open 'invisible)) - ext-inv-specs) - (dolist (ext ext-inv) - (when (extent-property ext 'invisible) - (add-to-list 'ext-inv-specs (list ext (extent-property - ext 'invisible))) - (set-extent-property ext 'invisible nil))) - (indent-to-column column minimum buffer) - (dolist (ext-inv-spec ext-inv-specs) - (set-extent-property (car ext-inv-spec) 'invisible - (cadr ext-inv-spec)))) + (org-xemacs-without-invisibility (indent-to-column column minimum buffer)) (indent-to-column column minimum))) (defun org-indent-line-to (column) "Work around a bug with extents with invisibility in XEmacs." (if (featurep 'xemacs) - (let ((ext-inv (extent-list - nil (point-at-bol) (point-at-eol) - 'all-extents-closed-open 'invisible)) - ext-inv-specs) - (dolist (ext ext-inv) - (when (extent-property ext 'invisible) - (add-to-list 'ext-inv-specs (list ext (extent-property - ext 'invisible))) - (set-extent-property ext 'invisible nil))) - (indent-line-to column) - (dolist (ext-inv-spec ext-inv-specs) - (set-extent-property (car ext-inv-spec) 'invisible - (cadr ext-inv-spec)))) + (org-xemacs-without-invisibility (indent-line-to column)) (indent-line-to column))) (defun org-move-to-column (column &optional force buffer) (if (featurep 'xemacs) - (let ((ext-inv (extent-list - nil (point-at-bol) (point-at-eol) - 'all-extents-closed-open 'invisible)) - ext-inv-specs) - (dolist (ext ext-inv) - (when (extent-property ext 'invisible) - (add-to-list 'ext-inv-specs (list ext (extent-property ext - 'invisible))) - (set-extent-property ext 'invisible nil))) - (move-to-column column force buffer) - (dolist (ext-inv-spec ext-inv-specs) - (set-extent-property (car ext-inv-spec) 'invisible - (cadr ext-inv-spec)))) + (org-xemacs-without-invisibility (move-to-column column force buffer)) (move-to-column column force))) (defun org-get-x-clipboard-compat (value) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index da919f32e..23dd50a11 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -270,7 +270,6 @@ This is in contrast to merely setting it to 0." (setq plist (cddr plist))) p)) - (defun org-replace-match-keep-properties (newtext &optional fixedcase literal string) "Like `replace-match', but add the text properties found original text." From c6ea2a1457f430cbb3eaba56cf2028a457db04e4 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 20 Apr 2010 12:17:06 +0200 Subject: [PATCH 5/8] Use overlay-in and overlay-at instead of compatibility functions --- contrib/ChangeLog | 10 +++++++++- contrib/babel/lisp/org-babel.el | 6 +++--- contrib/lisp/org-toc.el | 4 ++-- lisp/ChangeLog | 19 +++++++++++++++++++ lisp/org-agenda.el | 12 ++++++------ lisp/org-compat.el | 8 +------- lisp/org-src.el | 2 +- lisp/org.el | 12 ++++++------ 8 files changed, 47 insertions(+), 26 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 4f42b55a3..d9b9ac594 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,8 +1,16 @@ +2010-04-20 Carsten Dominik + + * lisp/org-toc.el (org-toc-cycle-subtree) + (org-toc-restore-config): Use overlays-in/at. + + * babel/lisp/org-babel.el (org-babel-hash-at-point) + (org-babel-hide-result-toggle): Use overlays-in/at. + 2010-04-18 Carsten Dominik * babel/lisp/org-babel.el (org-babel-hide-hash): Use `add-to-invisibility-spec'. - (org-babel-result-hide-spec): + (org-babel-result-hide-spec): Use `add-to-invisibility-spec'. * lisp/org-learn.el (require): `calendar' is now required already by org.el on top level. diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index 12a5be47a..b2dd5b9ba 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -427,7 +427,7 @@ with C-c C-c." (interactive) (let ((hash (car (delq nil (mapcar (lambda (ol) (overlay-get ol 'babel-hash)) - (org-overlays-at (or point (point)))))))) + (overlays-at (or point (point)))))))) (when hash (kill-new hash) (message hash)))) (add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-hash-at-point) @@ -475,7 +475,7 @@ with C-c C-c." (if (memq t (mapcar (lambda (overlay) (eq (overlay-get overlay 'invisible) 'org-babel-hide-result)) - (org-overlays-at start))) + (overlays-at start))) (if (or (not force) (eq force 'off)) (mapc (lambda (ov) (when (member ov org-babel-hide-result-overlays) @@ -484,7 +484,7 @@ with C-c C-c." (when (eq (overlay-get ov 'invisible) 'org-babel-hide-result) (delete-overlay ov))) - (org-overlays-at start))) + (overlays-at start))) (setq ov (make-overlay start end)) (overlay-put ov 'invisible 'org-babel-hide-result) ;; make the block accessible to isearch diff --git a/contrib/lisp/org-toc.el b/contrib/lisp/org-toc.el index 16938f1ff..2c5eb9c67 100644 --- a/contrib/lisp/org-toc.el +++ b/contrib/lisp/org-toc.el @@ -188,7 +188,7 @@ specified, then make `org-toc-recenter' use this value." (interactive) (let ((beg (point)) (end (save-excursion (end-of-line) (point))) - (ov (car (org-overlays-at (point)))) + (ov (car (overlays-at (point)))) status) (if ov (setq status (overlay-get ov 'status)) (setq ov (make-overlay beg end))) @@ -416,7 +416,7 @@ current table of contents to it." (save-excursion (goto-char (point-min)) (when (search-forward (car hlcfg0) nil t) - (unless (org-overlays-at (match-beginning 0)) + (unless (overlays-at (match-beginning 0)) (setq ov (make-overlay (match-beginning 0) (match-end 0)))) (cond ((eq (cdr hlcfg0) 'children) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bbd162605..5dc3c6487 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2010-04-20 Carsten Dominik + + * org-compat.el (org-find-overlays): Use overlays-in/at. + + * org.el (org-remove-empty-overlays-at) + (org-outline-overlay-data, org-hide-block-toggle) + (org-format-latex, org-context): Use overlays-in/at. + + * org-src.el (org-edit-src-exit): Use overlays-in/at. + + * org-agenda.el (org-agenda-mark-clocking-task) + (org-agenda-fontify-priorities, org-agenda-dim-blocked-tasks) + (org-agenda-entry-text-hide) + (org-agenda-fix-tags-filter-overlays-at) + (org-agenda-bulk-remove-overlays): Use overlays-in/at. + + * org-compat.el (org-overlays-at): Function removed. + (org-overlays-in): Function removed. + 2010-04-18 Carsten Dominik * org-compat.el (org-xemacs-without-invisibility): New macro. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 93ef92130..e602747d4 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -2797,7 +2797,7 @@ bind it in the options section.") (mapc (lambda (o) (if (eq (overlay-get o 'type) 'org-agenda-clocking) (delete-overlay o))) - (org-overlays-in (point-min) (point-max))) + (overlays-in (point-min) (point-max))) (when (marker-buffer org-clock-hd-marker) (save-excursion (goto-char (point-min)) @@ -2817,7 +2817,7 @@ bind it in the options section.") (interactive) (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-priority) (delete-overlay o))) - (org-overlays-in (point-min) (point-max))) + (overlays-in (point-min) (point-max))) (save-excursion (let ((inhibit-read-only t) b e p ov h l) @@ -2850,7 +2850,7 @@ bind it in the options section.") "Dim currently blocked TODO's in the agenda display." (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo) (delete-overlay o))) - (org-overlays-in (point-min) (point-max))) + (overlays-in (point-min) (point-max))) (save-excursion (let ((inhibit-read-only t) (org-depend-tag-blocked nil) @@ -2979,7 +2979,7 @@ no longer in use." (if (eq (overlay-get o 'org-overlay-type) 'agenda-entry-content) (progn (delete-overlay o) t))) - (org-overlays-in (point-min) (point-max))))) + (overlays-in (point-min) (point-max))))) ;;; Agenda timeline @@ -5591,7 +5591,7 @@ If the line does not have an effort defined, return nil." (defun org-agenda-fix-tags-filter-overlays-at (&optional pos) (setq pos (or pos (point))) (save-excursion - (dolist (ov (org-overlays-at pos)) + (dolist (ov (overlays-at pos)) (when (and (overlay-get ov 'invisible) (eq (overlay-get ov 'type) 'tags-filter)) (goto-char pos) @@ -7409,7 +7409,7 @@ from the list in `org-agenda-bulk-marked-entries'." (mapc (lambda (ov) (and (eq (overlay-get ov 'type) 'org-marked-entry-overlay) (delete-overlay ov))) - (org-overlays-in (or beg (point-min)) (or end (point-max))))) + (overlays-in (or beg (point-min)) (or end (point-max))))) (defun org-agenda-bulk-remove-all-marks () "Remove all marks in the agenda buffer. diff --git a/lisp/org-compat.el b/lisp/org-compat.el index c52758c1d..b5987d597 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -110,16 +110,10 @@ any other entries, and any resulting duplicates will be removed entirely." (if face (org-add-props text nil 'face face)) (overlay-put ovl 'before-string text) (if evap (overlay-put ovl 'evaporate t)))) -(defun org-overlays-at (pos) - (if (featurep 'xemacs) (extents-at pos) (overlays-at pos))) -(defun org-overlays-in (&optional start end) - (if (featurep 'xemacs) - (extent-list nil start end) - (overlays-in start end))) (defun org-find-overlays (prop &optional pos delete) "Find all overlays specifying PROP at POS or point. If DELETE is non-nil, delete all those overlays." - (let ((overlays (org-overlays-at (or pos (point)))) + (let ((overlays (overlays-at (or pos (point)))) ov found) (while (setq ov (pop overlays)) (if (overlay-get ov prop) diff --git a/lisp/org-src.el b/lisp/org-src.el index 54ec4afc9..14fb40278 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -595,7 +595,7 @@ the language, a switch telling if the content should be in a single line." (if (memq t (mapcar (lambda (overlay) (eq (overlay-get overlay 'invisible) 'org-hide-block)) - (org-overlays-at (point)))) + (overlays-at (point)))) ;; Block is hidden; put point at start of block (beginning-of-line 0) ;; Block is visible, put point where it was in the code buffer diff --git a/lisp/org.el b/lisp/org.el index 16c1f91c1..5e5fbbeb1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5660,7 +5660,7 @@ This function is the default value of the hook `org-cycle-hook'." (not (string-match "\\S-" (buffer-substring (overlay-start o) (overlay-end o)))) (delete-overlay o))) - (org-overlays-at pos))) + (overlays-at pos))) (defun org-clean-visibility-after-subtree-move () "Fix visibility issues after moving a subtree." @@ -5830,7 +5830,7 @@ If USE-MARKERS is set, return the positions as markers." (cons (move-marker (make-marker) beg) (move-marker (make-marker) end)) (cons beg end))))) - (org-overlays-in (point-min) (point-max)))))))) + (overlays-in (point-min) (point-max)))))))) (defun org-set-outline-overlay-data (data) "Create visibility overlays for all positions in DATA. @@ -5927,7 +5927,7 @@ the range." (if (memq t (mapcar (lambda (overlay) (eq (overlay-get overlay 'invisible) 'org-hide-block)) - (org-overlays-at start))) + (overlays-at start))) (if (or (not force) (eq force 'off)) (mapc (lambda (ov) (when (member ov org-hide-block-overlays) @@ -5936,7 +5936,7 @@ the range." (when (eq (overlay-get ov 'invisible) 'org-hide-block) (delete-overlay ov))) - (org-overlays-at start))) + (overlays-at start))) (setq ov (make-overlay start end)) (overlay-put ov 'invisible 'org-hide-block) ;; make the block accessible to isearch @@ -15283,7 +15283,7 @@ Some of the options can be changed using the variable (if (eq (overlay-get o 'org-overlay-type) 'org-latex-overlay) (delete-overlay o))) - (org-overlays-in beg end)) + (overlays-in beg end)) (setq ov (make-overlay beg end)) (overlay-put ov 'org-overlay-type 'org-latex-overlay) (if (featurep 'xemacs) @@ -17325,7 +17325,7 @@ and :keyword." (mapcar (lambda (x) (if (memq x org-latex-fragment-image-overlays) x)) - (org-overlays-at (point)))))) + (overlays-at (point)))))) (push (list :latex-fragment (overlay-start o) (overlay-end o)) clist) (push (list :latex-preview From 1ac063248f1990e02e3b30cafd4c32c2193f9549 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 20 Apr 2010 15:37:39 +0200 Subject: [PATCH 6/8] Revert "Call org-reveal after refiling" This reverts commit a30955b050983044b3bd08e9d16e26579003b44c. --- lisp/org.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 5e5fbbeb1..b843664eb 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9661,8 +9661,7 @@ See also `org-refile-use-outline-path' and `org-completion-use-ido'" (when (featurep 'org-inlinetask) (org-inlinetask-remove-END-maybe)) (setq org-markers-to-move nil) - (message "Refiled to \"%s\"" (car it)))))) - (org-reveal)) + (message "Refiled to \"%s\"" (car it))))))) (defun org-refile-goto-last-stored () "Go to the location where the last refile was stored." From 5a62721822ccf5675e1d8d52ae0f10c3f790ed2f Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 20 Apr 2010 18:31:03 +0200 Subject: [PATCH 7/8] Make inline task insertion deal with `org-odd-levels-only' Also make it possible to define a default state for an inline task. Patch by Sebastian Rose. --- lisp/ChangeLog | 4 ++++ lisp/org-inlinetask.el | 26 +++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a552c9fb1..5890329e1 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2010-04-20 Carsten Dominik + * org-inlinetask.el (org-inlinetask-defaut-state): New option. + (org-inlinetask-insert-task): Use `org-inlinetask-defaut-state'. + Obey `org-odd-levels-only'. + * org-compat.el (org-find-overlays): Use overlays-in/at. * org.el (org-remove-empty-overlays-at) diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index aac338b60..9479aea69 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -105,12 +105,28 @@ When nil, they will not be exported." (defvar org-complex-heading-regexp) (defvar org-property-end-re) -(defun org-inlinetask-insert-task () - "Insert an inline task." - (interactive) +(defcustom org-inlinetask-defaut-state nil + "Non-nil means make inline tasks have a TODO keyword initially. +This should be the state `org-inlinetask-insert-task' should use by +default, or nil of no state should be assigned." + :group 'org-inlinetask + :type (choice + (const :tag "No state" nil) + (string :tag "Specific state"))) + +(defun org-inlinetask-insert-task (&optional no-state) + "Insert an inline task. +If prefix arg NO-STATE is set, irgnore `org-inlinetask-defaut-state'." + (interactive "P") (or (bolp) (newline)) - (insert (make-string org-inlinetask-min-level ?*) " \n" - (make-string org-inlinetask-min-level ?*) " END\n") + (let ((indent org-inlinetask-min-level)) + (if org-odd-levels-only + (setq indent (- (* 2 indent) 1))) + (insert (make-string indent ?*) + (if (or no-state (not org-inlinetask-defaut-state)) + " \n" + (concat " " org-inlinetask-defaut-state " \n")) + (make-string indent ?*) " END\n")) (end-of-line -1)) (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task) From aca565ca614bee6c74244040651f186bebde329b Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 20 Apr 2010 20:04:19 +0200 Subject: [PATCH 8/8] Document info links Patch by Nick Dokos. --- doc/org.texi | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/org.texi b/doc/org.texi index ead83726e..0fc2635c5 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -2826,6 +2826,7 @@ gnus:group @r{Gnus group link} gnus:group#id @r{Gnus article link} bbdb:R.*Stallman @r{BBDB link (with regexp)} irc:/irc.com/#emacs/bob @r{IRC link} +info:org:External%20links @r{Info node link (with encoded space)} shell:ls *.org @r{A shell command} elisp:org-agenda @r{Interactive Elisp command} elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate}