From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Simplify `do-after-load-evaluation' Date: Sat, 29 Aug 2009 21:41:57 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1251575049 4534 80.91.229.12 (29 Aug 2009 19:44:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Aug 2009 19:44:09 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 29 21:44:02 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MhTqD-0001Ct-9d for ged-emacs-devel@m.gmane.org; Sat, 29 Aug 2009 21:44:01 +0200 Original-Received: from localhost ([127.0.0.1]:53432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhTqC-0001Tz-JG for ged-emacs-devel@m.gmane.org; Sat, 29 Aug 2009 15:44:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MhTq5-0001PC-RI for emacs-devel@gnu.org; Sat, 29 Aug 2009 15:43:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MhTq1-0001E2-RG for emacs-devel@gnu.org; Sat, 29 Aug 2009 15:43:53 -0400 Original-Received: from [199.232.76.173] (port=37556 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhTq1-0001Dj-M0 for emacs-devel@gnu.org; Sat, 29 Aug 2009 15:43:49 -0400 Original-Received: from mail-fx0-f226.google.com ([209.85.220.226]:52200) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MhTq1-0005GM-72 for emacs-devel@gnu.org; Sat, 29 Aug 2009 15:43:49 -0400 Original-Received: by fxm26 with SMTP id 26so2636719fxm.42 for ; Sat, 29 Aug 2009 12:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=yGK3FoZslLYG7bfOaLomkhrvkf8AL2tdzR8EbQWjzGI=; b=uHcUwSW8XJZzvBhL7XszQlo6SFXa0H+7BjMb4d+WPX+FWzC++HTfZ/bo7TFz53954j jaN8Wl/3h89Q2uXhBfNBSrgCEWfc1LUM8zlkKpkqaMyH49va5Mv73YdnJgM2lNU/FULJ NehzXgwkrbwtCtiUL2xbT8aIvD82dII6RQU30= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=LaMw+U7J8MAhT2XeRCHl5gb02yEH6ozUbnEMeOqPcKPl4auY8lNB9teHaiNLhaDwCE q8xUC8bOKdGZoNH/Ax+f7bzz3n12MRZvaZXJuWKKrwaGDaeltooYKpAtJJhEFKJIMS0a 7ygWHfkHtg6+nQC+eyCQwprxzoYun/LG5Ls6c= Original-Received: by 10.239.130.29 with SMTP id 29mr238852hbh.135.1251575026757; Sat, 29 Aug 2009 12:43:46 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114845 Archived-At: I was going to remove unused local vars file-element and file-elements from `do-after-load-evaluation', but on second thought, would someone object to the following simplification? (The original code is a bit opaque for the really simple work it does): Index: subr.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v retrieving revision 1.646 diff -u -2 -r1.646 subr.el --- subr.el 27 Aug 2009 04:24:08 -0000 1.646 +++ subr.el 29 Aug 2009 19:36:31 -0000 @@ -1689,14 +1689,9 @@ "Evaluate all `eval-after-load' forms, if any, for ABS-FILE. ABS-FILE, a string, should be the absolute true name of a file just loaded." - (let ((after-load-elts after-load-alist) - a-l-element file-elements file-element form) - (while after-load-elts - (setq a-l-element (car after-load-elts) - after-load-elts (cdr after-load-elts)) - (when (and (stringp (car a-l-element)) - (string-match (car a-l-element) abs-file)) - (while (setq a-l-element (cdr a-l-element)) ; discard the file name - (setq form (car a-l-element)) - (eval form)))))) + (dolist (a-l-element after-load-alist) + (when (and (stringp (car a-l-element)) + (string-match-p (car a-l-element) abs-file)) + ;; discard the file name regexp + (mapc #'eval (cdr a-l-element))))) (defun eval-next-after-load (file)