unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7101: Please reveal-mode, don't hide my overlays!
@ 2010-09-25 13:23 Lennart Borgman
  2010-09-25 20:57 ` Lennart Borgman
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lennart Borgman @ 2010-09-25 13:23 UTC (permalink / raw)
  To: 7101

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

Am I the only one that gets crazy when reveal hides the overlays
again? At least I mostly find it very frustrating when moving around
in a buffer that uses org-mode.

I can see it is useful sometimes though I do not know how to best
separate those times when it is useful and when it is not. So I will
not try that.

Instead in the attached patch I made the automatic hiding optional and
add a new command for hiding

[-- Attachment #2: reveal-dont-hide.diff --]
[-- Type: application/octet-stream, Size: 1349 bytes --]

=== modified file 'lisp/reveal.el'
--- trunk/lisp/reveal.el	2010-03-12 17:47:22 +0000
+++ patched/lisp/reveal.el	2010-09-25 13:22:19 +0000
@@ -56,6 +56,11 @@
   :type 'boolean
   :group 'reveal)
 
+(defcustom reveal-auto-close nil
+  "Close revealed overlays when leaving them."
+  :type 'boolean
+  :group 'reveal)
+
 (defvar reveal-open-spots nil
   "List of spots in the buffer which are open.
 Each element has the form (WINDOW . OVERLAY).")
@@ -92,7 +97,8 @@
                           (cdr x))))
                       reveal-open-spots))))
           (setq old-ols (reveal-open-new-overlays old-ols))
-          (reveal-close-old-overlays old-ols))
+          (when reveal-auto-close
+            (reveal-close-old-overlays old-ols)))
       (error (message "Reveal: %s" err)))))
 
 (defun reveal-open-new-overlays (old-ols)
@@ -180,6 +186,14 @@
                 (delq (rassoc ol reveal-open-spots)
                       reveal-open-spots)))))))
 
+(defun reveal-close-revealed ()
+  "Close revealed overlays.
+This does not close the overlay where point is in the selected
+window."
+  (interactive)
+  (let ((reveal-auto-close t))
+    (reveal-post-command)))
+
 (defvar reveal-mode-map
   (let ((map (make-sparse-keymap)))
     ;; Override the default move-beginning-of-line and move-end-of-line


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-19 15:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-25 13:23 bug#7101: Please reveal-mode, don't hide my overlays! Lennart Borgman
2010-09-25 20:57 ` Lennart Borgman
2010-10-07 10:23 ` Stefan Monnier
2010-10-07 10:33   ` Lennart Borgman
2020-09-19 15:46 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).