|
@@ -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)
|