1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-27 10:55:04 +00:00

Use overlay-in and overlay-at instead of compatibility functions

This commit is contained in:
Carsten Dominik 2010-04-20 12:17:06 +02:00
parent b65f1f9489
commit c6ea2a1457
8 changed files with 47 additions and 26 deletions

View File

@ -1,8 +1,16 @@
2010-04-20 Carsten Dominik <carsten.dominik@gmail.com>
* 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 <carsten.dominik@gmail.com>
* 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.

View File

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

View File

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

View File

@ -1,3 +1,22 @@
2010-04-20 Carsten Dominik <carsten.dominik@gmail.com>
* 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 <carsten.dominik@gmail.com>
* org-compat.el (org-xemacs-without-invisibility): New macro.

View File

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

View File

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

View File

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

View File

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