summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-04-18 19:58:24 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-04-18 19:58:24 +0200
commitb65f1f94894ca9b634f7f98d95fa9c63406a73ba (patch)
treead514427dc29f2e8535a2d2e7c15d581d53dfc08
parent97e20048b2ef6e793a6387bfc3eb5bdedd6226e4 (diff)
downloadorg-mode-b65f1f94894ca9b634f7f98d95fa9c63406a73ba.tar.gz
Redefine the functions where XEmacs invisibility has to be turned off
-rwxr-xr-xlisp/ChangeLog5
-rw-r--r--lisp/org-compat.el59
-rw-r--r--lisp/org-macs.el1
3 files changed, 25 insertions, 40 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eeee21f..bbd1626 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
2010-04-18 Carsten Dominik <carsten.dominik@gmail.com>
+ * 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 3daff84..c52758c 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 da919f3..23dd50a 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."