Ticket #88: invisibility.patch

File invisibility.patch, 2.9 KB (added by David Aspinall, 17 years ago)
Line 
1*** generic/proof-script.el     2004-04-18 01:39:59.000000000 +0200
2--- /usr/share/emacs/site-lisp/ProofGeneral/generic/proof-script.el     2007-02-27 20:45:51.000000000 +0100
3***************
4*** 521,539 ****
5    "Clear record of script portion names and types from internal list.
6  Also clear all visibility specifications."
7    (setq pg-script-portions nil)
8-   (setq buffer-invisibility-spec
9-       (if (listp buffer-invisibility-spec)
10-           ;; FIXME: inefficient
11-           (append
12-            (mapcar (lambda (propellips)
13-                      (if (memq (car propellips) pg-visibility-specs)
14-                          nil (list propellips)))
15-                    buffer-invisibility-spec))
16          ;; NB: if invisibility spec was t, we loose here: we need
17          ;; it to be a list unfortunately, whereas other code may
18          ;; want `t'.  That's annoying.
19          ;; (FIXME: should tell GNU/X Emacs developers).
20!         nil)))
21 
22  (defun pg-add-script-element (elt)
23    (add-to-list pg-script-portions elt))
24--- 521,537 ----
25    "Clear record of script portion names and types from internal list.
26  Also clear all visibility specifications."
27    (setq pg-script-portions nil)
28    ;; NB: if invisibility spec was t, we loose here: we need
29    ;; it to be a list unfortunately, whereas other code may
30    ;; want `t'.  That's annoying.
31    ;; (FIXME: should tell GNU/X Emacs developers).
32!   (let ((propellips buffer-invisibility-spec))
33!     (setq buffer-invisibility-spec nil)
34!     (while (consp propellips)
35!       (if (or (eq (car propellips) t)
36!             (not (memq (caar propellips) pg-visibility-specs)))
37!         (add-to-list 'buffer-invisibility-spec (car propellips)))
38!       (setq propellips (cdr propellips)))))
39 
40  (defun pg-add-script-element (elt)
41    (add-to-list pg-script-portions elt))
42***************
43*** 605,617 ****
44  (defun pg-make-element-invisible (idiom id)
45    "Make element ID of type IDIOM invisible, with ellipsis."
46    (let ((visspec  (cons (pg-visname idiom id) t)))
47!     (add-to-list 'buffer-invisibility-spec visspec)
48!     (add-to-list 'pg-visibility-specs visspec)))
49 
50  (defun pg-make-element-visible (idiom id)
51    "Make element ID of type IDIOM visible."
52!   (setq buffer-invisibility-spec
53!       (remassq (pg-visname idiom id) buffer-invisibility-spec)))
54 
55  (defun pg-toggle-element-visibility (idiom id)
56    "Toggle visibility of script element of type IDIOM, named ID."
57--- 603,616 ----
58  (defun pg-make-element-invisible (idiom id)
59    "Make element ID of type IDIOM invisible, with ellipsis."
60    (let ((visspec  (cons (pg-visname idiom id) t)))
61!     (add-to-invisibility-spec visspec)
62!     (let ((buffer-invisibility-spec pg-visibility-specs))
63!       (add-to-invisibility-spec visspec)
64!       (setq pg-visibility-specs buffer-invisibility-spec))))
65 
66  (defun pg-make-element-visible (idiom id)
67    "Make element ID of type IDIOM visible."
68!   (remove-from-invisibility-spec (pg-visname idiom id)))
69 
70  (defun pg-toggle-element-visibility (idiom id)
71    "Toggle visibility of script element of type IDIOM, named ID."