From mboxrd@z Thu Jan 1 00:00:00 1970 From: gregory@dynapse.com (Gregory J. Grubbs) Subject: Re: Problem refiling using IDO with flex matching Date: Sat, 14 Nov 2009 11:20:15 -0700 Message-ID: <87zl6p7yu8.fsf@dynapse.com> References: <87my2pyrqp.fsf@dynapse.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9NEs-0004uF-Tf for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 13:20:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9NEn-0004tk-ER for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 13:20:45 -0500 Received: from [199.232.76.173] (port=39115 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9NEn-0004th-7d for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 13:20:41 -0500 Received: from lo.gmane.org ([80.91.229.12]:53797) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N9NEm-00051d-Ma for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 13:20:41 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1N9NEl-00089M-6f for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 19:20:39 +0100 Received: from 72.42.83.192 ([72.42.83.192]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Nov 2009 19:20:39 +0100 Received: from gregory by 72.42.83.192 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Nov 2009 19:20:39 +0100 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: emacs-orgmode@gnu.org gregory@dynapse.com (Gregory J. Grubbs) writes: > Hi, all. > > I find that using IDO with fuzzy matching turned on is making org-refile > unusable. The problem is that emacs will lock up for up to 45 seconds > for each character I type, as ido searches through 3 levels of headings > in all my archive files. I like having ido turned on for this, as it > allows me to type a word that is unique to a 3rd-level heading, and jump > right to that without having to find it hierarchically. But I can live > without flex matching for this purpose. > > There is no hook run at the beginning of org-refile, so I have tried > using defadvice to turn off flex matching. For some reason, it isn't > working for me: > > (defadvice org-refile-pseudo-hook (before org-refile) > "do some customizations prior to running org-refile" > (setq ido-enable-flex-matching nil)) > (ad-activate 'org-refile-pseudo-hook) > > I've tried doing the above as "around" advice as well as "before" > advice. In either case, flex matching is still turned on when I invoke > org-refile. > > I suppose an alternative would be to add a hook variable to be run near > the beginning of org-refile. But I would still love to be enlightened > about the correct use of defadvice! > > FWIW, here are what I think are my relevant variable settings (the > verify function could be suspected of slowing things down, but selection > is very fast with ido flex matching off): > (ido-everywhere 1) > (setq ido-enable-flex-matching t) > (setq org-goto-interface 'outline-path-completion) > (setq org-outline-path-complete-in-steps nil) > (setq org-refile-targets '((org-agenda-files :maxlevel . 3)) > org-refile-use-outline-path 'file > org-refile-target-verify-function > (lambda () > (not (member "ARCHIVE" (org-get-tags))))) > > > > _______________________________________________ > 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 I clearly should not be allowed to play with sharp objects. The following is working now: --8<---------------cut here---------------start------------->8--- (defadvice org-refile (before org-refile-pseudo-hook dis) (setq ido-enable-flex-matching nil)) (ad-enable-advice 'org-refile 'before 'org-refile-pseudo-hook) (ad-activate 'org-refile) --8<---------------cut here---------------end--------------->8---