Re: [Orgmode] [patch] now possible to search for text in folded blocks
Applied, thanks. - Carsten On Aug 19, 2009, at 10:19 PM, Eric Schulte wrote: Please apply, I don't *think* this can break anything. Thanks -- Eric From f73d4b67c027209905dd90868d57440ceacdea28 Mon Sep 17 00:00:00 2001 From: Eric Schulte schulte.e...@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 ___ 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 ___ 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
Re: [Orgmode] [patch] now possible to search for text in folded blocks
hi, i've implemented a simple idea, but thought it could be done in a better way. Need your feedback. At work, i am running emacs+org-mode on windoze-xp computer, and i am happy with my setup. Whenever i am away from my computer, or i am off for the day, i generally lock my workstation and just leave (I dont shut my system down). The org-mode clock runs even when i am not doing anything. I want it to switch it to default task when i am away. So, i developed a simple application which makes use of 'emacsclientw' and sends messages to emacs-server to notify the status of my workstation. Briefly, my setup is like this : in my orged.el -8-8-- ;;- ;; for listening to windows-session events. ;;- ;; sets default task. ;; @todo make it more intutive (require 'org-clock) (set-marker org-clock-default-task 34 (find-file ~/orged/personal/personal.org)) ;; Custom org-win-lock and org-win-unlock functions. (defun org-win-lock() runs org-preferences when workstation gets locked Switches to default task. (interactive) (find-file (buffer-file-name (marker-buffer org-clock-default-task))) (goto-char org-clock-default-task) (org-clock-in)) (defun org-win-unlock() runs org-preferences when workstation gets un-locked Switches to interrupted task. (interactive) (find-file (buffer-file-name (marker-buffer org-clock-interrupted-task))) (goto-char org-clock-default-task) (org-clock-in)) ;; start the server and notification application. (server-start) (start-process eval-a-exe buf-eval-a-exe ~/sandbox/windows-lock-notif/a.exe) -8-8-- i also wrote a small application which polls on session events and send messages to this emacs-server (see attachment). My question is : Can it be done better? main.c Description: Binary data ___ 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
Re: [Orgmode] [patch] now possible to search for text in folded blocks
On Thu, Aug 20, 2009 at 3:33 PM, Yuvagnuy...@gmail.com wrote: hi, i've implemented a simple idea, but thought it could be done in a better [snip] really sorry, i forgot to edit the subject. Please ignore my mail in this thread. ;-( -- YUVA ___ 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
[Orgmode] [patch] now possible to search for text in folded blocks
Please apply, I don't *think* this can break anything. Thanks -- Eric From f73d4b67c027209905dd90868d57440ceacdea28 Mon Sep 17 00:00:00 2001 From: Eric Schulte schulte.e...@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 ___ 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