[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/reveal.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/reveal.el [lexbind] |
Date: |
Thu, 04 Nov 2004 08:30:45 -0500 |
Index: emacs/lisp/reveal.el
diff -c emacs/lisp/reveal.el:1.6.2.2 emacs/lisp/reveal.el:1.6.2.3
*** emacs/lisp/reveal.el:1.6.2.2 Tue Oct 14 23:51:22 2003
--- emacs/lisp/reveal.el Thu Nov 4 13:12:40 2004
***************
*** 1,6 ****
;;; reveal.el --- Automatically reveal hidden text at point
! ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
;; Author: Stefan Monnier <address@hidden>
;; Keywords: outlines
--- 1,6 ----
;;; reveal.el --- Automatically reveal hidden text at point
! ;; Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
;; Author: Stefan Monnier <address@hidden>
;; Keywords: outlines
***************
*** 59,64 ****
--- 59,67 ----
(defvar reveal-open-spots nil)
(make-variable-buffer-local 'reveal-open-spots)
+ (defvar reveal-last-tick nil)
+ (make-variable-buffer-local 'reveal-last-tick)
+
;; Actual code
(defun reveal-post-command ()
***************
*** 90,105 ****
(overlays-at (point))))
(push (cons (selected-window) ol) reveal-open-spots)
(setq old-ols (delq ol old-ols))
! (let ((open (overlay-get ol 'reveal-toggle-invisible)))
(when (or open
! (let ((inv (overlay-get ol 'invisible)))
! (and inv (symbolp inv)
! (or (setq open (or (get inv
'reveal-toggle-invisible)
! (overlay-get ol
'isearch-open-invisible-temporary)))
! (overlay-get ol 'isearch-open-invisible)
! (and (consp buffer-invisibility-spec)
! (assq inv buffer-invisibility-spec)))
! (overlay-put ol 'reveal-invisible inv))))
(if (null open)
(overlay-put ol 'invisible nil)
;; Use the provided opening function and repeat (since the
--- 93,108 ----
(overlays-at (point))))
(push (cons (selected-window) ol) reveal-open-spots)
(setq old-ols (delq ol old-ols))
! (let ((open (overlay-get ol 'reveal-toggle-invisible)) inv)
(when (or open
! (and (setq inv (overlay-get ol 'invisible))
! (symbolp inv)
! (or (setq open (or (get inv 'reveal-toggle-invisible)
! (overlay-get ol
'isearch-open-invisible-temporary)))
! (overlay-get ol 'isearch-open-invisible)
! (and (consp buffer-invisibility-spec)
! (assq inv buffer-invisibility-spec)))
! (overlay-put ol 'reveal-invisible inv)))
(if (null open)
(overlay-put ol 'invisible nil)
;; Use the provided opening function and repeat (since the
***************
*** 113,139 ****
(setq repeat nil)
(overlay-put ol 'invisible nil))))))))
;; Close old overlays.
! (dolist (ol old-ols)
! (when (and (eq (current-buffer) (overlay-buffer ol))
! (not (rassq ol reveal-open-spots)))
! (if (and (>= (point) (save-excursion
! (goto-char (overlay-start ol))
! (line-beginning-position 1)))
! (<= (point) (save-excursion
! (goto-char (overlay-end ol))
! (line-beginning-position 2))))
! ;; Still near the overlay: keep it open.
! (push (cons (selected-window) ol) reveal-open-spots)
! ;; Really close it.
! (let ((open (overlay-get ol 'reveal-toggle-invisible)) inv)
! (if (or open
! (and (setq inv (overlay-get ol 'reveal-invisible))
! (setq open (or (get inv 'reveal-toggle-invisible)
! (overlay-get ol
'isearch-open-invisible-temporary)))))
! (condition-case err
! (funcall open ol t)
! (error (message "!!Reveal-hide: %s !!" err)))
! (overlay-put ol 'invisible inv)))))))
(error (message "Reveal: %s" err)))))
;;;###autoload
--- 116,154 ----
(setq repeat nil)
(overlay-put ol 'invisible nil))))))))
;; Close old overlays.
! (if (not (eq reveal-last-tick
! (setq reveal-last-tick (buffer-modified-tick))))
! ;; The buffer was modified since last command: let's refrain from
! ;; closing any overlay because it tends to behave poorly when
! ;; inserting text at the end of an overlay (basically the overlay
! ;; should be rear-advance when it's open, but things like
! ;; outline-minor-mode make it non-rear-advance because it's
! ;; a better choice when it's closed).
! (dolist (ol old-ols)
! (push (cons (selected-window) ol) reveal-open-spots))
! ;; The last command was only a point motion or some such
! ;; non-buffer-modifying command. Let's close whatever can be closed.
! (dolist (ol old-ols)
! (when (and (eq (current-buffer) (overlay-buffer ol))
! (not (rassq ol reveal-open-spots)))
! (if (and (>= (point) (save-excursion
! (goto-char (overlay-start ol))
! (line-beginning-position 1)))
! (<= (point) (save-excursion
! (goto-char (overlay-end ol))
! (line-beginning-position 2))))
! ;; Still near the overlay: keep it open.
! (push (cons (selected-window) ol) reveal-open-spots)
! ;; Really close it.
! (let ((open (overlay-get ol 'reveal-toggle-invisible)) inv)
! (if (or open
! (and (setq inv (overlay-get ol 'reveal-invisible))
! (setq open (or (get inv 'reveal-toggle-invisible)
! (overlay-get ol
'isearch-open-invisible-temporary)))))
! (condition-case err
! (funcall open ol t)
! (error (message "!!Reveal-hide: %s !!" err)))
! (overlay-put ol 'invisible inv))))))))
(error (message "Reveal: %s" err)))))
;;;###autoload
***************
*** 171,175 ****
(provide 'reveal)
! ;;; arch-tag: 96ba0242-2274-4ed7-8e10-26bc0707b4d8
;;; reveal.el ends here
--- 186,190 ----
(provide 'reveal)
! ;; arch-tag: 96ba0242-2274-4ed7-8e10-26bc0707b4d8
;;; reveal.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/reveal.el [lexbind],
Miles Bader <=