help-gnu-emacs
[Top][All Lists]
Advanced

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

Speeding up hook function


From: Joel J. Adamson
Subject: Speeding up hook function
Date: Fri, 14 Mar 2008 10:26:56 -0400

Howdy,

I've got the following function set as a hook for ibuffer.  This closes
all filter groups when I enter ibuffer.

(defun ibuffer-toggle-all-filters ()
  (interactive)
  (if (not (eq major-mode 'ibuffer-mode))
      nil
    (progn
      (goto-char 0)
      (setq prev-point 0)
      (ibuffer-forward-filter-group)
      (while (< prev-point (point))
        (setq prev-point (point))
        (ibuffer-forward-filter-group)
        (ibuffer-toggle-filter-group)))))


This does what I want, but it's really slow.  Any suggestions on how to
speed it up?

Thanks,
Joel
-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109
Public key: http://pgp.mit.edu

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.







reply via email to

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