From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: [patch] now possible to search for text in folded blocks Date: Wed, 19 Aug 2009 15:19:22 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdsZA-000735-9V for emacs-orgmode@gnu.org; Wed, 19 Aug 2009 17:19:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdsZ5-0006wW-Be for emacs-orgmode@gnu.org; Wed, 19 Aug 2009 17:19:31 -0400 Received: from [199.232.76.173] (port=47149 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdsZ5-0006wS-50 for emacs-orgmode@gnu.org; Wed, 19 Aug 2009 17:19:27 -0400 Received: from mail-px0-f176.google.com ([209.85.216.176]:53733) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MdsZ4-0003oq-NG for emacs-orgmode@gnu.org; Wed, 19 Aug 2009 17:19:27 -0400 Received: by pxi6 with SMTP id 6so3072095pxi.27 for ; Wed, 19 Aug 2009 14:19:25 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode --=-=-= Please apply, I don't *think* this can break anything. Thanks -- Eric --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-now-possible-to-search-for-text-inside-of-folded-blo.patch >From f73d4b67c027209905dd90868d57440ceacdea28 Mon Sep 17 00:00:00 2001 From: Eric Schulte 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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --=-=-=--