From: jadamson@partners.org (Joel J. Adamson)
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Speeding up hook function
Date: Fri, 14 Mar 2008 10:26:56 -0400 [thread overview]
Message-ID: <87ve3p2xfz.fsf@W0053328.mgh.harvard.edu> (raw)
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.
next reply other threads:[~2008-03-14 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 14:26 Joel J. Adamson [this message]
2008-03-19 1:00 ` Speeding up hook function Xavier Maillard
2008-03-19 17:31 ` Joel J. Adamson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ve3p2xfz.fsf@W0053328.mgh.harvard.edu \
--to=jadamson@partners.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).