[OS X Emacs] bug fixed: Aquamacs 1.4 RC2 performance

David Reitter david.reitter at gmail.com
Wed Jun 11 18:31:52 EDT 2008


Nathaniel,

The real reason for this bug lies in tabbar-map-tabsets, which does  
this:

(lambda (,function)
        "Apply FUNCTION to each tab set, and make a list of the results.
The result is a list just as long as the number of existing tab sets."
        (let (,result)
          (mapatoms
           #'(lambda (,tabset)
               (push (funcall ,function ,tabset) ,result))
           tabbar-tabsets)
          ,result))

`mapatoms' is called, which is executed for each entry in
`tabbar-tabsets'.  Idiotically, mapatoms' second argument (the list of
elements it applies the function to) defaults to `obarray', which is a
list of many many symbols (around 20,000).
When tabbar-mode is off, tabbar-tabsets is empty, i.e. nil.  Elisp
does not distinguish an empty for an undefined argument to a function,
hence `obarray' is used.  That's why you're getting the long delay
when calling tabbar-reformat-all-tabsets.

I've checked in the simply change below.

cc'ing the list, FYI.

- D




--
http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
http://aquamacs.org/donate -- Could we help you? Return the favor and  
support the Aquamacs Project!


*** tabbar.el	13 May 2008 08:55:33 +0100	1.3
--- tabbar.el	11 Jun 2008 23:26:34 +0100	
***************
*** 391,400 ****
          "Apply FUNCTION to each tab set, and make a list of the  
results.
The result is a list just as long as the number of existing tab sets."
          (let (,result)
!            (mapatoms
!             #'(lambda (,tabset)
!                 (push (funcall ,function ,tabset) ,result))
!             tabbar-tabsets)
            ,result)))))

(defun tabbar-make-tabset (name &rest objects)
--- 391,401 ----
          "Apply FUNCTION to each tab set, and make a list of the  
results.
The result is a list just as long as the number of existing tab sets."
          (let (,result)
!            (if tabbar-tabsets
! 	       (mapatoms
! 		#'(lambda (,tabset)
! 		    (push (funcall ,function ,tabset) ,result))
! 		tabbar-tabsets))
            ,result)))))

(defun tabbar-make-tabset (name &rest objects)




-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2193 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-emacs/attachments/20080611/d15e6ff7/attachment.p7s>


More information about the MacOSX-Emacs mailing list