[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copy/iSearch/Occur on folded outline view?

From: Bastien
Subject: Re: Copy/iSearch/Occur on folded outline view?
Date: Wed, 06 Feb 2013 16:56:57 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

Hi Drew,

"Drew Adams" <> writes:

>> > You may also consider to define an toggle command for
>> > `search-invisible', and bind it in `isearch-mode-map'
>> very nice, thank you, I had to install cl-lib first, but then it works
>> like a charm, very helpfull when even the collapsed headlines 
>> (3 levels) of your .emacs are some 260 lines. 
> FYI, Isearch+ also provides toggle key `C-+' for this.

I'm willing to allow this for org-mode.

Do you mind if I borrow your idea and add this code to Org?


(define-key isearch-mode-map [(control ?+)] 'org-isearch-toggle-invisible)

(defvar org-search-invisibile-default)
(defun org-isearch-toggle-invisible ()
  "Toggle regexp searching on or off."
  (unless (boundp 'org-search-invisibile-default)
    (setq org-search-invisibile-default search-invisible))
  (setq search-invisible
        (cond ((eq search-invisible 'open) nil)
              ((eq search-invisible nil) 'open)))
  (let ((message-log-max nil))
    (message "%s%s [search %svisible]"
             (isearch-message-prefix nil isearch-nonincremental)
             (if search-invisible "in" "")))
  (setq isearch-success t isearch-adjusted t)
  (sit-for 1)
  (add-hook 'isearch-mode-end-hook
            (lambda () (setq search-invisible org-search-invisibile-default)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]