foldout.el 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. ;;; foldout.el --- folding extensions for outline-mode and outline-minor-mode
  2. ;; Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc.
  3. ;; Author: Kevin Broadey <KevinB@bartley.demon.co.uk>
  4. ;; Maintainer: FSF
  5. ;; Created: 27 Jan 1994
  6. ;; Version: 1.10
  7. ;; Keywords: folding, outlines
  8. ;; This file is part of GNU Emacs.
  9. ;; GNU Emacs is free software: you can redistribute it and/or modify
  10. ;; it under the terms of the GNU General Public License as published by
  11. ;; the Free Software Foundation, either version 3 of the License, or
  12. ;; (at your option) any later version.
  13. ;; GNU Emacs is distributed in the hope that it will be useful,
  14. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;; GNU General Public License for more details.
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  19. ;;; Commentary:
  20. ;; This file provides folding editor extensions for outline-mode and
  21. ;; outline-minor-mode buffers. What's a "folding editor"? Read on...
  22. ;;
  23. ;; Imagine you're in an outline-mode buffer and you've hidden all the text and
  24. ;; subheadings under your level-1 headings. You now want to look at the stuff
  25. ;; hidden under one of these headings. Normally you'd do C-c C-e (show-entry)
  26. ;; to expose the body or C-c C-i to expose the child (level-2) headings.
  27. ;;
  28. ;; With foldout, you do C-c C-z (foldout-zoom-subtree). This exposes the body
  29. ;; and child subheadings and narrows the buffer so that only the level-1
  30. ;; heading, the body and the level-2 headings are visible. If you now want to
  31. ;; look under one of the level-2 headings, position the cursor on it and do C-c
  32. ;; C-z again. This exposes the level-2 body and its level-3 child subheadings
  33. ;; and narrows the buffer again. You can keep on zooming in on successive
  34. ;; subheadings as much as you like. A string in the modeline tells you how
  35. ;; deep you've gone.
  36. ;;
  37. ;; When zooming in on a heading you might only want to see the child
  38. ;; subheadings. You do this by specifying a numeric argument: C-u C-c C-z.
  39. ;; You can specify the number of levels of children too (c.f. show-children):
  40. ;; e.g. M-2 C-c C-z exposes two levels of child subheadings. Alternatively,
  41. ;; you might only be interested in the body. You do this by specifying a
  42. ;; negative argument: M-- C-c C-z. You can also cause the whole subtree to be
  43. ;; expanded, similar to C-c C-s (show-subtree), by specifying a zero argument:
  44. ;; M-0 C-c C-z.
  45. ;;
  46. ;; While you're zoomed in you can still use outline-mode's exposure and hiding
  47. ;; functions. It won't upset foldout at all. Also, since the buffer is
  48. ;; narrowed, "global" editing actions will only affect the stuff under the
  49. ;; zoomed-in heading. This is useful for restricting changes to a particular
  50. ;; chapter or section of your document.
  51. ;;
  52. ;; You unzoom (exit) a fold by doing C-c C-x (foldout-exit-fold). This hides
  53. ;; all the text and subheadings under the top-level heading and returns you to
  54. ;; the previous view of the buffer. Specifying a numeric argument exits that
  55. ;; many folds. Specifying a zero argument exits *all* folds.
  56. ;;
  57. ;; You might want to exit a fold *without* hiding the text and subheadings.
  58. ;; You do this by specifying a negative argument. For example, M--2 C-c C-x
  59. ;; exits two folds and leaves the text and subheadings exposed.
  60. ;;
  61. ;; Foldout also provides mouse bindings for entering and exiting folds and for
  62. ;; showing and hiding text. Hold down Meta and Control, then click a mouse
  63. ;; button as follows:-
  64. ;;
  65. ;; mouse-1 (foldout-mouse-zoom) zooms in on the heading clicked on:-
  66. ;;
  67. ;; single click expose body
  68. ;; double click expose subheadings
  69. ;; triple click expose body and subheadings
  70. ;; quad click expose entire subtree
  71. ;;
  72. ;; mouse-2 (foldout-mouse-show) exposes text under the heading clicked on:-
  73. ;;
  74. ;; single click expose body
  75. ;; double click expose subheadings
  76. ;; triple click expose body and subheadings
  77. ;; quad click expose entire subtree
  78. ;;
  79. ;; mouse-3 (foldout-mouse-hide-or-exit) hides text under the heading clicked
  80. ;; on or exits the fold:-
  81. ;;
  82. ;; single click hide subtree
  83. ;; double click exit fold and hide text
  84. ;; triple click exit fold without hiding text
  85. ;; quad click exit all folds and hide text
  86. ;;
  87. ;; You can change the modifier keys used by setting `foldout-mouse-modifiers'.
  88. ;;; Installation:
  89. ;; To use foldout, put this in your .emacs:-
  90. ;;
  91. ;; (require 'foldout)
  92. ;;
  93. ;; If you don't want it loaded until you need it, try this instead:-
  94. ;;
  95. ;; (eval-after-load "outline" '(require 'foldout))
  96. ;;; Advertisements:
  97. ;; Get out-xtra.el by Per Abrahamsen <abraham@iesd.auc.dk> for more
  98. ;; outline-mode goodies. In particular, `outline-hide-sublevels' makes
  99. ;; setup a lot easier.
  100. ;;
  101. ;; folding.el by Jamie Lokier <u90jl@ecs.ox.ac.uk> supports folding by
  102. ;; recognizing special marker text in you file.
  103. ;;
  104. ;; c-outline.el (by me) provides outline-mode support to recognize `C'
  105. ;; statements as outline headings, so with foldout you can have a folding `C'
  106. ;; code editor without having to put in start- and end-of-fold markers. This
  107. ;; is a real winner!
  108. ;;; ChangeLog:
  109. ;; 1.10 21-Mar-94
  110. ;; foldout.el is now part of the GNU Emacs distribution!!
  111. ;; Put in changes made by RMS to version 1.8 to keep the diffs to a minimum.
  112. ;; bugfix: numeric arg to foldout-exit-fold wasn't working - looks like I don't
  113. ;; know how to use the Common LISP `loop' macro after all, so use `while'
  114. ;; instead.
  115. ;; 1.9 15-Mar-94
  116. ;; Didn't test that very well, did I? The change to foldout-zoom-subtree
  117. ;; affected foldout-mouse-zoom: if the heading under the `level n' one clicked
  118. ;; on was at `level n+2' then it didn't get exposed. Sorry about that!
  119. ;; 1.8 15-Mar-94
  120. ;; Changed meaning of prefix arg to foldout-zoom-subtree. arg > 0 now means
  121. ;; "expose that many children" instead of just "expose children" so it is more
  122. ;; like `show-children' (C-c C-i). Arg of C-u on its own only shows one level
  123. ;; of children, though, so you can still zoom by doing C-u C-c C-z.
  124. ;;
  125. ;; I can't think of a good meaning for the value of a negative prefix. Any
  126. ;; suggestions?
  127. ;;
  128. ;; Added advertisement for my c-outline.el package. Now you can have a folding
  129. ;; editor for c-mode without any effort!
  130. ;; 1.7 7-Mar-94
  131. ;; I got fed up trying to work out how many blank lines there were outside the
  132. ;; narrowed region when inside a fold. Now *all* newlines before the following
  133. ;; heading are *in* the narrowed region. Thus, if the cursor is at point-max,
  134. ;; the number of blank lines above it is the number you'll get above the next
  135. ;; heading.
  136. ;;
  137. ;; Since all newlines are now inside the narrowed region, when exiting a fold
  138. ;; add a newline at the end of the region if there isn't one so that the
  139. ;; following heading doesn't accidentally get joined to the body text.
  140. ;;
  141. ;; Bugfix: `foldout-mouse-modifiers' should be `defvar', not `defconst'.
  142. ;;
  143. ;; Use "cond" instead of "case" so that lemacs-19.9 users can use the mouse.
  144. ;;
  145. ;; Improve "Commentary" entry on using the mouse.
  146. ;;
  147. ;; Add "Installation" keyword.
  148. ;; 1.6 3-Mar-94
  149. ;; Add mouse support functions foldout-mouse-zoom, foldout-mouse-show,
  150. ;; foldout-mouse-hide-or-exit.
  151. ;; 1.5 11-Feb-94
  152. ;; Rename `foldout-enter-subtree' to `foldout-zoom-subtree' and change
  153. ;; keystroke from C-g to C-z. This is more mnemonic and leaves C-g alone, as
  154. ;; users expect this to cancel the current key sequence.
  155. ;;
  156. ;; Added better commentary at the request of RMS. Added stuff to comply with
  157. ;; the lisp-mnt.el conventions. Added instructions on how best to load the
  158. ;; package.
  159. ;; 1.4 2-Feb-94
  160. ;; Bugfix: end-of-fold marking was wrong:-
  161. ;;
  162. ;; End of narrowed region should be one character on from
  163. ;; (outline-end-of-subtree) so it includes the end-of-line at the end of the
  164. ;; last line of the subtree.
  165. ;;
  166. ;; End-of-fold marker should be outside the narrowed region so text inserted
  167. ;; at the end of the region goes before the marker. Need to make a special
  168. ;; case for end-of-buffer because it is impossible to set a marker that will
  169. ;; follow eob. Bummer.
  170. ;; 1.3 28-Jan-94
  171. ;; Changed `foldout-zoom-subtree'. A zero arg now makes it expose the entire
  172. ;; subtree on entering the fold. As before, < 0 shows only the body and > 0
  173. ;; shows only the subheadings.
  174. ;; 1.2 28-Jan-94
  175. ;; Fixed a dumb bug - didn't make `foldout-modeline-string' buffer-local :-(
  176. ;;
  177. ;; Changed `foldout-exit-fold' to use prefix arg to say how many folds to exit.
  178. ;; Negative arg means exit but don't hide text. Zero arg means exit all folds.
  179. ;;
  180. ;; Added `foldout-inhibit-key-bindings' to inhibit key bindings.
  181. ;; 1.1 27-Jan-94
  182. ;; Released to the net. Inspired by a question in gnu.emacs.help from
  183. ;; Jason D Lohn <jlohn@eng.umd.edu>.
  184. ;;; Code:
  185. (require 'outline)
  186. ;; something has gone very wrong if outline-minor-mode isn't bound now.
  187. (if (not (boundp 'outline-minor-mode))
  188. (error "Can't find outline-minor-mode"))
  189. (defvar foldout-fold-list nil
  190. "List of start and end markers for the folds currently entered.
  191. An end marker of nil means the fold ends after (point-max).")
  192. (make-variable-buffer-local 'foldout-fold-list)
  193. (defvar foldout-modeline-string nil
  194. "Modeline string announcing that we are in an outline fold.")
  195. (make-variable-buffer-local 'foldout-modeline-string)
  196. ;; put our minor mode string immediately following outline-minor-mode's
  197. (or (assq 'foldout-modeline-string minor-mode-alist)
  198. (let ((outl-entry (memq (assq 'outline-minor-mode minor-mode-alist)
  199. minor-mode-alist))
  200. (foldout-entry '((foldout-modeline-string foldout-modeline-string))))
  201. ;; something's wrong with outline if we can't find it
  202. (if (null outl-entry)
  203. (error "Can't find outline-minor-mode in minor-mode-alist"))
  204. ;; slip our fold announcement into the list
  205. (setcdr outl-entry (nconc foldout-entry (cdr outl-entry)))
  206. ))
  207. ;; outline-flag-region has different `flag' values in outline.el and
  208. ;; noutline.el for hiding and showing text.
  209. (defconst foldout-hide-flag
  210. (if (featurep 'noutline) t ?\^M))
  211. (defconst foldout-show-flag
  212. (if (featurep 'noutline) nil ?\n))
  213. (defun foldout-zoom-subtree (&optional exposure)
  214. "Open the subtree under the current heading and narrow to it.
  215. Normally the body and the immediate subheadings are exposed, but
  216. optional arg EXPOSURE \(interactively with prefix arg\) changes this:-
  217. EXPOSURE > 0 exposes n levels of subheadings (c.f. show-children)
  218. EXPOSURE < 0 exposes only the body
  219. EXPOSURE = 0 exposes the entire subtree"
  220. (interactive "P")
  221. (save-excursion
  222. (widen)
  223. (outline-back-to-heading)
  224. (let* ((exposure-value (prefix-numeric-value exposure))
  225. (start (point))
  226. (start-marker (point-marker))
  227. (end (progn (outline-end-of-subtree)
  228. (skip-chars-forward "\n\^M")
  229. (point)))
  230. ;; I need a marker that will follow the end of the region even when
  231. ;; text is inserted right at the end. Text gets inserted *after*
  232. ;; markers, so I need it at end+1. Unfortunately I can't set a
  233. ;; marker at (point-max)+1, so I use nil to mean the region ends at
  234. ;; (point-max).
  235. (end-marker (if (eobp) nil (set-marker (make-marker) (1+ end))))
  236. )
  237. ;; narrow to this subtree
  238. (narrow-to-region start end)
  239. ;; show the body and/or subheadings for this heading
  240. (goto-char start)
  241. (cond
  242. ((null exposure)
  243. (show-entry)
  244. (show-children))
  245. ((< exposure-value 0)
  246. (show-entry))
  247. ((consp exposure)
  248. (show-children))
  249. ((> exposure-value 0)
  250. (show-children exposure-value))
  251. (t
  252. (show-subtree))
  253. )
  254. ;; save the location of the fold we are entering
  255. (setq foldout-fold-list (cons (cons start-marker end-marker)
  256. foldout-fold-list))
  257. ;; update the modeline
  258. (foldout-update-modeline)
  259. )))
  260. (defun foldout-exit-fold (&optional num-folds)
  261. "Return to the ARG'th enclosing fold view. With ARG = 0 exit all folds.
  262. Normally causes exited folds to be hidden, but with ARG < 0, -ARG folds are
  263. exited and text is left visible."
  264. (interactive "p")
  265. (let ((hide-fold t) start-marker end-marker
  266. beginning-of-heading end-of-subtree)
  267. ;; check there are some folds to leave
  268. (if (null foldout-fold-list)
  269. (error "Not in a fold!"))
  270. (cond
  271. ;; catch a request to leave all folds
  272. ((zerop num-folds)
  273. (setq num-folds (length foldout-fold-list)))
  274. ;; have we been told not to hide the fold?
  275. ((< num-folds 0)
  276. (setq hide-fold nil
  277. num-folds (- num-folds)))
  278. )
  279. ;; limit the number of folds if we've been told to exit too many
  280. (setq num-folds (min num-folds (length foldout-fold-list)))
  281. ;; exit the folds
  282. (widen)
  283. (while (not (zerop num-folds))
  284. ;; get the fold at the top of the stack
  285. (setq start-marker (car (car foldout-fold-list))
  286. end-marker (cdr (car foldout-fold-list))
  287. foldout-fold-list (cdr foldout-fold-list)
  288. num-folds (1- num-folds))
  289. ;; Make sure there is a newline at the end of this fold,
  290. ;; otherwise the following heading will get joined to the body
  291. ;; text.
  292. (if end-marker
  293. (progn
  294. (goto-char end-marker)
  295. (forward-char -1)
  296. (or (memq (preceding-char) '(?\n ?\^M))
  297. (insert ?\n))))
  298. ;; If this is the last fold to exit, hide the text unless we've
  299. ;; been told not to. Note that at the moment point is at the
  300. ;; beginning of the following heading if there is one.
  301. ;; Also, make sure that the newline before the following heading
  302. ;; is \n otherwise it will be hidden. If there is a newline
  303. ;; before this one, make it visible too so we do the same as
  304. ;; outline.el and leave a blank line before the heading.
  305. (when (zerop num-folds)
  306. (if end-marker
  307. (setq beginning-of-heading (point)
  308. end-of-subtree (progn (forward-char -1)
  309. (if (memq (preceding-char)
  310. '(?\n ?\^M))
  311. (forward-char -1))
  312. (point))))
  313. ;; hide the subtree
  314. (when hide-fold
  315. (goto-char start-marker)
  316. (hide-subtree))
  317. ;; make sure the next heading is exposed
  318. (if end-marker
  319. (outline-flag-region end-of-subtree beginning-of-heading
  320. foldout-show-flag)))
  321. ;; zap the markers so they don't slow down editing
  322. (set-marker start-marker nil)
  323. (if end-marker (set-marker end-marker nil))
  324. )
  325. ;; narrow to the enclosing fold if there is one
  326. (if foldout-fold-list
  327. (progn
  328. (setq start-marker (car (car foldout-fold-list))
  329. end-marker (cdr (car foldout-fold-list)))
  330. (narrow-to-region start-marker
  331. (if end-marker
  332. (1- (marker-position end-marker))
  333. (point-max)))
  334. ))
  335. (recenter)
  336. ;; update the modeline
  337. (foldout-update-modeline)
  338. ))
  339. (defun foldout-update-modeline ()
  340. "Set the modeline string to indicate our fold depth."
  341. (let ((depth (length foldout-fold-list)))
  342. (setq foldout-modeline-string
  343. (cond
  344. ;; if we're not in a fold, keep quiet
  345. ((zerop depth)
  346. nil)
  347. ;; in outline-minor-mode we're after "Outl:xx" in the modeline
  348. (outline-minor-mode
  349. (format ":%d" depth))
  350. ;; otherwise just announce the depth (I guess we're in outline-mode)
  351. ((= depth 1)
  352. " Inside 1 fold")
  353. (t
  354. (format " Inside %d folds" depth))
  355. ))))
  356. (defun foldout-mouse-zoom (event)
  357. "Zoom in on the heading clicked on.
  358. How much is exposed by the zoom depends on the number of mouse clicks:-
  359. 1 expose body
  360. 2 expose subheadings
  361. 3 expose body and subheadings
  362. 4 expose entire subtree"
  363. (interactive "@e")
  364. ;; swallow intervening mouse events so we only get the final click-count.
  365. (setq event (foldout-mouse-swallow-events event))
  366. ;; go to the heading clicked on
  367. (foldout-mouse-goto-heading event)
  368. ;; zoom away
  369. (foldout-zoom-subtree
  370. (let ((nclicks (event-click-count event)))
  371. (cond
  372. ((= nclicks 1) -1) ; body only
  373. ((= nclicks 2) '(1)) ; subheadings only
  374. ((= nclicks 3) nil) ; body and subheadings
  375. (t 0))))) ; entire subtree
  376. (defun foldout-mouse-show (event)
  377. "Show what is hidden under the heading clicked on.
  378. What gets exposed depends on the number of mouse clicks:-
  379. 1 expose body
  380. 2 expose subheadings
  381. 3 expose body and subheadings
  382. 4 expose entire subtree"
  383. (interactive "@e")
  384. ;; swallow intervening mouse events so we only get the final click-count.
  385. (setq event (foldout-mouse-swallow-events event))
  386. ;; expose the text
  387. (foldout-mouse-goto-heading event)
  388. (let ((nclicks (event-click-count event)))
  389. (cond
  390. ((= nclicks 1) (show-entry))
  391. ((= nclicks 2) (show-children))
  392. ((= nclicks 3) (show-entry) (show-children))
  393. (t (show-subtree)))))
  394. (defun foldout-mouse-hide-or-exit (event)
  395. "Hide the subtree under the heading clicked on, or exit a fold.
  396. What happens depends on the number of mouse clicks:-
  397. 1 hide subtree
  398. 2 exit fold and hide text
  399. 3 exit fold without hiding text
  400. 4 exit all folds and hide text"
  401. (interactive "@e")
  402. ;; swallow intervening mouse events so we only get the final click-count.
  403. (setq event (foldout-mouse-swallow-events event))
  404. ;; hide or exit
  405. (let ((nclicks (event-click-count event)))
  406. (if (= nclicks 1)
  407. (progn
  408. (foldout-mouse-goto-heading event)
  409. (hide-subtree))
  410. (foldout-exit-fold
  411. (cond
  412. ((= nclicks 2) 1) ; exit and hide
  413. ((= nclicks 3) -1) ; exit don't hide
  414. (t 0)))))) ; exit all
  415. (defun foldout-mouse-swallow-events (event)
  416. "Swallow intervening mouse events so we only get the final click-count.
  417. Signal an error if the final event isn't the same type as the first one."
  418. (let ((initial-event-type (event-basic-type event)))
  419. (while (null (sit-for (/ double-click-time 1000.0) 'nodisplay))
  420. (setq event (read-event)))
  421. (or (eq initial-event-type (event-basic-type event))
  422. (error "")))
  423. event)
  424. (defun foldout-mouse-goto-heading (event)
  425. "Go to the heading where the mouse event started. Signal an error
  426. if the event didn't occur on a heading."
  427. (goto-char (posn-point (event-start event)))
  428. (or (outline-on-heading-p)
  429. ;; outline.el sometimes treats beginning-of-buffer as a heading
  430. ;; even though outline-on-heading returns nil.
  431. (save-excursion (beginning-of-line) (bobp))
  432. (error "Not a heading line")))
  433. ;;; Keymaps:
  434. (defvar foldout-inhibit-key-bindings nil
  435. "Set non-nil before loading foldout to inhibit key bindings.")
  436. (defvar foldout-mouse-modifiers '(meta control)
  437. "List of modifier keys to apply to foldout's mouse events.
  438. The default (meta control) makes foldout bind its functions to
  439. M-C-down-mouse-{1,2,3}.
  440. Valid modifiers are shift, control, meta, alt, hyper and super.")
  441. (if foldout-inhibit-key-bindings
  442. ()
  443. (define-key outline-mode-map "\C-c\C-z" 'foldout-zoom-subtree)
  444. (define-key outline-mode-map "\C-c\C-x" 'foldout-exit-fold)
  445. (let ((map (lookup-key outline-minor-mode-map outline-minor-mode-prefix)))
  446. (unless map
  447. (setq map (make-sparse-keymap))
  448. (define-key outline-minor-mode-map outline-minor-mode-prefix map))
  449. (define-key map "\C-z" 'foldout-zoom-subtree)
  450. (define-key map "\C-x" 'foldout-exit-fold))
  451. (let* ((modifiers (apply 'concat
  452. (mapcar (function
  453. (lambda (modifier)
  454. (vector
  455. (cond
  456. ((eq modifier 'shift) ?S)
  457. ((eq modifier 'control) ?C)
  458. ((eq modifier 'meta) ?M)
  459. ((eq modifier 'alt) ?A)
  460. ((eq modifier 'hyper) ?H)
  461. ((eq modifier 'super) ?s)
  462. (t (error "invalid mouse modifier %s"
  463. modifier)))
  464. ?-)))
  465. foldout-mouse-modifiers)))
  466. (mouse-1 (vector (intern (concat modifiers "down-mouse-1"))))
  467. (mouse-2 (vector (intern (concat modifiers "down-mouse-2"))))
  468. (mouse-3 (vector (intern (concat modifiers "down-mouse-3")))))
  469. (define-key outline-mode-map mouse-1 'foldout-mouse-zoom)
  470. (define-key outline-mode-map mouse-2 'foldout-mouse-show)
  471. (define-key outline-mode-map mouse-3 'foldout-mouse-hide-or-exit)
  472. (define-key outline-minor-mode-map mouse-1 'foldout-mouse-zoom)
  473. (define-key outline-minor-mode-map mouse-2 'foldout-mouse-show)
  474. (define-key outline-minor-mode-map mouse-3 'foldout-mouse-hide-or-exit)
  475. ))
  476. (provide 'foldout)
  477. ;;; foldout.el ends here