annotate lisp/reveal.el @ 42225:8ef1ae58dc29

(smtpmail-send-queued-mail): Use with-temp-buffer instead of find-file-noselect, and bind coding-system-for-read to no-conversion when reading the queued messages. From Simon Josefsson <jas@extundo.com>.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 21 Dec 2001 12:06:21 +0000
parents 19e76eadbf86
children 44b4a14ae7fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
41621
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
1 ;;; reveal.el --- Automatically reveal hidden text at point
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
2
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
3 ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
4
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
5 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
6 ;; Keywords: outlines
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
7
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
8 ;; This file is free software; you can redistribute it and/or modify
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
9 ;; it under the terms of the GNU General Public License as published by
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
10 ;; the Free Software Foundation; either version 2, or (at your option)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
11 ;; any later version.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
12
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
13 ;; This file is distributed in the hope that it will be useful,
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
16 ;; GNU General Public License for more details.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
17
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
19 ;; along with GNU Emacs; see the file COPYING. If not, write to
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
20 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
21 ;; Boston, MA 02111-1307, USA.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
22
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
23 ;;; Commentary:
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
24
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
25 ;; Reveal mode is a minor mode that makes sure that text around point
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
26 ;; is always visible. When point enters a region of hidden text,
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
27 ;; `reveal-mode' temporarily makes it visible.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
28 ;;
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
29 ;; This is normally used in conjunction with `outline-minor-mode',
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
30 ;; `hs-minor-mode', `hide-ifdef-mode', ...
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
31 ;;
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
32 ;; It only works with packages that hide text using overlays.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
33 ;; Packages can provide special support for it by placing
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
34 ;; a function in the `reveal-toggle-invisible' property on the symbol
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
35 ;; used as the value of the `invisible' overlay property.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
36 ;; The function is called right after revealing (or re-hiding) the
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
37 ;; text with two arguments: the overlay and a boolean that's non-nil
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
38 ;; if we have just revealed the text. When revealing, that function
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
39 ;; may re-hide some of the text.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
40
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
41 ;;; Todo:
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
42
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
43 ;; - find other hysteresis features.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
44
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
45 ;;; Code:
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
46
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
47 (require 'pcvs-util)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
48
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
49 (defgroup reveal nil
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
50 "Reveal hidden text on the fly."
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
51 :group 'editing)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
52
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
53 (defcustom reveal-around-mark t
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
54 "Reveal text around the mark, if active."
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
55 :type 'boolean)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
56
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
57 (defvar reveal-open-spots nil)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
58 (make-variable-buffer-local 'reveal-open-spots)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
59
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
60 ;; Actual code
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
61
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
62 (defun reveal-post-command ()
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
63 ;; Refresh the spots that might have changed.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
64 ;; `Refreshing' here means to try and re-hide the corresponding text.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
65 ;; We don't refresh everything correctly:
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
66 ;; - we only refresh spots in the current window.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
67 ;; FIXME: do we actually know that (current-buffer) = (window-buffer) ?
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
68 (with-local-quit
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
69 (let* ((spots (cvs-partition
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
70 (lambda (x)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
71 ;; We refresh any spot in the current window as well
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
72 ;; as any spots associated with a dead window or a window
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
73 ;; which does not show this buffer any more.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
74 (or (eq (car x) (selected-window))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
75 (not (window-live-p (car x)))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
76 (not (eq (window-buffer (car x))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
77 (current-buffer)))))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
78 reveal-open-spots))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
79 (old-ols (mapcar 'cdr (car spots)))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
80 (repeat t)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
81 ;; `post-command-hook' binds it to t, but the user might want to
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
82 ;; interrupt our work if we somehow get stuck in an infinite loop.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
83 (inhibit-quit nil)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
84 inv open)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
85 (setq reveal-open-spots (cdr spots))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
86 ;; Open new overlays.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
87 (while repeat
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
88 (setq repeat nil)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
89 (dolist (ol (nconc (when (and reveal-around-mark mark-active)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
90 (overlays-at (mark)))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
91 (overlays-at (point))))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
92 (push (cons (selected-window) ol) reveal-open-spots)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
93 (setq old-ols (delq ol old-ols))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
94 (when (setq inv (overlay-get ol 'invisible))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
95 (when (or (overlay-get ol 'isearch-open-invisible)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
96 (and (consp buffer-invisibility-spec)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
97 (assq inv buffer-invisibility-spec)))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
98 (overlay-put ol 'reveal-invisible inv)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
99 (overlay-put ol 'invisible nil)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
100 (when (setq open (get inv 'reveal-toggle-invisible))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
101 ;; Use the provided opening function and repeat (since the
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
102 ;; opening function might have hidden a subpart around point).
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
103 (setq repeat t)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
104 (condition-case err
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
105 (funcall open ol t)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
106 (error (message "!!Reveal-show: %s !!" err))))))))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
107 ;; Close old overlays.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
108 (dolist (ol old-ols)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
109 (when (and (setq inv (overlay-get ol 'reveal-invisible))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
110 (eq (current-buffer) (overlay-buffer ol))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
111 (not (rassq ol reveal-open-spots)))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
112 (if (and (>= (point) (save-excursion
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
113 (goto-char (overlay-start ol))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
114 (line-beginning-position 1)))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
115 (<= (point) (save-excursion
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
116 (goto-char (overlay-end ol))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
117 (line-beginning-position 2))))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
118 ;; Still near the overlay: keep it open.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
119 (push (cons (selected-window) ol) reveal-open-spots)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
120 ;; Really close it.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
121 (overlay-put ol 'invisible inv)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
122 (when (setq open (get inv 'reveal-toggle-invisible))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
123 (condition-case err
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
124 (funcall open ol nil)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
125 (error (message "!!Reveal-hide: %s !!" err))))))))))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
126
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
127 ;;;###autoload
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
128 (define-minor-mode reveal-mode
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
129 "Toggle Reveal mode on or off.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
130 Reveal mode renders invisible text around point visible again.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
131
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
132 Interactively, with no prefix argument, toggle the mode.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
133 With universal prefix ARG (or if ARG is nil) turn mode on.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
134 With zero or negative ARG turn mode off."
41778
19e76eadbf86 (reveal-mode): Fix reveal-mode's lighter.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 41621
diff changeset
135 :lighter (global-reveal-mode nil " Reveal")
41621
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
136 (if reveal-mode
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
137 (progn
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
138 (set (make-local-variable 'search-invisible) t)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
139 (add-hook 'post-command-hook 'reveal-post-command nil t))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
140 (kill-local-variable 'search-invisible)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
141 (remove-hook 'post-command-hook 'reveal-post-command t)))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
142
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
143 ;;;###autoload
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
144 (define-minor-mode global-reveal-mode
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
145 "Toggle Reveal mode in all buffers on or off.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
146 Reveal mode renders invisible text around point visible again.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
147
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
148 Interactively, with no prefix argument, toggle the mode.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
149 With universal prefix ARG (or if ARG is nil) turn mode on.
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
150 With zero or negative ARG turn mode off."
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
151 :global t
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
152 (setq-default reveal-mode global-reveal-mode)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
153 (if global-reveal-mode
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
154 (progn
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
155 (setq search-invisible t)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
156 (add-hook 'post-command-hook 'reveal-post-command))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
157 (setq search-invisible 'open) ;FIXME
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
158 (remove-hook 'post-command-hook 'reveal-post-command)))
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
159
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
160 (provide 'reveal)
8835d207e12a Initial commit.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
161 ;;; reveal.el ends here