emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [patch] now possible to search for text in folded blocks
Date: Wed, 19 Aug 2009 15:19:22 -0600	[thread overview]
Message-ID: <m28whfec2t.fsf@gmail.com> (raw)

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

Please apply, I don't *think* this can break anything. Thanks -- Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-now-possible-to-search-for-text-inside-of-folded-blo.patch --]
[-- Type: text/x-patch, Size: 2717 bytes --]

From f73d4b67c027209905dd90868d57440ceacdea28 Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Wed, 19 Aug 2009 15:17:09 -0600
Subject: [PATCH] now possible to search for text inside of folded blocks

---
 lisp/org.el |   38 ++++++++++++++++++++++++--------------
 1 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index e2cdce8..14adeda 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5364,24 +5364,34 @@ the range."
     (beginning-of-line)
     (if (re-search-forward org-block-regexp nil t)
         (let ((start (- (match-beginning 4) 1)) ;; beginning of body
-              (end (match-end 0))
-	      ov) ;; end of entire body
+              (end (match-end 0)) ;; end of entire body
+              ov)
           (if (memq t (mapcar (lambda (overlay)
                                 (eq (org-overlay-get overlay 'invisible)
-				    'org-hide-block))
+                                    'org-hide-block))
                               (org-overlays-at start)))
-	      (if (or (not force) (eq force 'off))
-		  (mapc (lambda (ov)
-			  (when (member ov org-hide-block-overlays)
-			    (setq org-hide-block-overlays
-				  (delq ov org-hide-block-overlays)))
-			  (when (eq (org-overlay-get ov 'invisible)
-				    'org-hide-block)
-			    (org-delete-overlay ov)))
-			(org-overlays-at start)))
-	    (setq ov (org-make-overlay start end))
+              (if (or (not force) (eq force 'off))
+                  (mapc (lambda (ov)
+                          (when (member ov org-hide-block-overlays)
+                            (setq org-hide-block-overlays
+                                  (delq ov org-hide-block-overlays)))
+                          (when (eq (org-overlay-get ov 'invisible)
+                                    'org-hide-block)
+                            (org-delete-overlay ov)))
+                        (org-overlays-at start)))
+            (setq ov (org-make-overlay start end))
             (org-overlay-put ov 'invisible 'org-hide-block)
-	    (push ov org-hide-block-overlays)))
+            ;; make the block accessible to isearch
+            (org-overlay-put
+             ov 'isearch-open-invisible
+             (lambda (ov)
+               (when (member ov org-hide-block-overlays)
+                 (setq org-hide-block-overlays
+                       (delq ov org-hide-block-overlays)))
+               (when (eq (org-overlay-get ov 'invisible)
+                         'org-hide-block)
+                 (org-delete-overlay ov))))
+            (push ov org-hide-block-overlays)))
       (error "Not looking at a source block"))))
 
 ;; org-tab-after-check-for-cycling-hook
-- 
1.6.4.73.gc144


[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2009-08-19 21:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19 21:19 Eric Schulte [this message]
2009-08-20  7:59 ` [patch] now possible to search for text in folded blocks Carsten Dominik
2009-08-20 10:03 ` Yuva
2009-08-20 10:05   ` Yuva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m28whfec2t.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).