Redefine the functions where XEmacs invisibility has to be turned off
This commit is contained in:
parent
97e20048b2
commit
b65f1f9489
|
@ -1,5 +1,10 @@
|
||||||
2010-04-18 Carsten Dominik <carsten.dominik@gmail.com>
|
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.el (org-mode, org-org-menu): Use `add-to-invisibility-spec'.
|
||||||
|
|
||||||
* org-table.el (orgtbl-mode): Use `add-to-invisibility-spec'.
|
* org-table.el (orgtbl-mode): Use `add-to-invisibility-spec'.
|
||||||
|
|
|
@ -126,6 +126,8 @@ If DELETE is non-nil, delete all those overlays."
|
||||||
(if delete (delete-overlay ov) (push ov found))))
|
(if delete (delete-overlay ov) (push ov found))))
|
||||||
found))
|
found))
|
||||||
|
|
||||||
|
;; Miscellaneous functions
|
||||||
|
|
||||||
(defun org-add-hook (hook function &optional append local)
|
(defun org-add-hook (hook function &optional append local)
|
||||||
"Add-hook, compatible with both Emacsen."
|
"Add-hook, compatible with both Emacsen."
|
||||||
(if (and local (featurep 'xemacs))
|
(if (and local (featurep 'xemacs))
|
||||||
|
@ -196,11 +198,9 @@ Works on both Emacs and XEmacs."
|
||||||
(member arg buffer-invisibility-spec)
|
(member arg buffer-invisibility-spec)
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
(defun org-indent-to-column (column &optional minimum buffer)
|
(defmacro org-xemacs-without-invisibility (&rest body)
|
||||||
"Work around a bug with extents with invisibility in XEmacs."
|
"Turn off exents with invisibility while executing BODY."
|
||||||
(if (featurep 'xemacs)
|
`(let ((ext-inv (extent-list nil (point-at-bol) (point-at-eol)
|
||||||
(let ((ext-inv (extent-list
|
|
||||||
nil (point-at-bol) (point-at-eol)
|
|
||||||
'all-extents-closed-open 'invisible))
|
'all-extents-closed-open 'invisible))
|
||||||
ext-inv-specs)
|
ext-inv-specs)
|
||||||
(dolist (ext ext-inv)
|
(dolist (ext ext-inv)
|
||||||
|
@ -208,45 +208,26 @@ Works on both Emacs and XEmacs."
|
||||||
(add-to-list 'ext-inv-specs (list ext (extent-property
|
(add-to-list 'ext-inv-specs (list ext (extent-property
|
||||||
ext 'invisible)))
|
ext 'invisible)))
|
||||||
(set-extent-property ext 'invisible nil)))
|
(set-extent-property ext 'invisible nil)))
|
||||||
(indent-to-column column minimum buffer)
|
,@body
|
||||||
(dolist (ext-inv-spec ext-inv-specs)
|
(dolist (ext-inv-spec ext-inv-specs)
|
||||||
(set-extent-property (car ext-inv-spec) 'invisible
|
(set-extent-property (car ext-inv-spec) 'invisible
|
||||||
(cadr ext-inv-spec))))
|
(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)
|
||||||
|
(org-xemacs-without-invisibility (indent-to-column column minimum buffer))
|
||||||
(indent-to-column column minimum)))
|
(indent-to-column column minimum)))
|
||||||
|
|
||||||
(defun org-indent-line-to (column)
|
(defun org-indent-line-to (column)
|
||||||
"Work around a bug with extents with invisibility in XEmacs."
|
"Work around a bug with extents with invisibility in XEmacs."
|
||||||
(if (featurep 'xemacs)
|
(if (featurep 'xemacs)
|
||||||
(let ((ext-inv (extent-list
|
(org-xemacs-without-invisibility (indent-line-to column))
|
||||||
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))))
|
|
||||||
(indent-line-to column)))
|
(indent-line-to column)))
|
||||||
|
|
||||||
(defun org-move-to-column (column &optional force buffer)
|
(defun org-move-to-column (column &optional force buffer)
|
||||||
(if (featurep 'xemacs)
|
(if (featurep 'xemacs)
|
||||||
(let ((ext-inv (extent-list
|
(org-xemacs-without-invisibility (move-to-column column force buffer))
|
||||||
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))))
|
|
||||||
(move-to-column column force)))
|
(move-to-column column force)))
|
||||||
|
|
||||||
(defun org-get-x-clipboard-compat (value)
|
(defun org-get-x-clipboard-compat (value)
|
||||||
|
|
|
@ -270,7 +270,6 @@ This is in contrast to merely setting it to 0."
|
||||||
(setq plist (cddr plist)))
|
(setq plist (cddr plist)))
|
||||||
p))
|
p))
|
||||||
|
|
||||||
|
|
||||||
(defun org-replace-match-keep-properties (newtext &optional fixedcase
|
(defun org-replace-match-keep-properties (newtext &optional fixedcase
|
||||||
literal string)
|
literal string)
|
||||||
"Like `replace-match', but add the text properties found original text."
|
"Like `replace-match', but add the text properties found original text."
|
||||||
|
|
Loading…
Reference in New Issue