From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: daniel@bigwalter.net (Daniel Jensen) Newsgroups: gmane.emacs.devel Subject: Re: apropos-library: Check for null library in load-history Date: Wed, 11 Feb 2009 23:47:07 +0100 Message-ID: <87iqngwpzo.fsf@orme.bigwalter.net> References: <87r624wrec.fsf@orme.bigwalter.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1234392454 10347 80.91.229.12 (11 Feb 2009 22:47:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Feb 2009 22:47:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 11 23:48:50 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 1LXNst-00031r-Ab for ged-emacs-devel@m.gmane.org; Wed, 11 Feb 2009 23:48:47 +0100 Original-Received: from localhost ([127.0.0.1]:48749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXNrZ-0002MB-Ft for ged-emacs-devel@m.gmane.org; Wed, 11 Feb 2009 17:47:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXNrV-0002M6-Gx for emacs-devel@gnu.org; Wed, 11 Feb 2009 17:47:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXNrT-0002Kf-VC for emacs-devel@gnu.org; Wed, 11 Feb 2009 17:47:21 -0500 Original-Received: from [199.232.76.173] (port=37816 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXNrT-0002KV-Q1 for emacs-devel@gnu.org; Wed, 11 Feb 2009 17:47:19 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:41195 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LXNrT-0006XO-GM for emacs-devel@gnu.org; Wed, 11 Feb 2009 17:47:19 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LXNrR-0004V2-Km for emacs-devel@gnu.org; Wed, 11 Feb 2009 22:47:17 +0000 Original-Received: from 81-231-84-106-no39.tbcn.telia.com ([81.231.84.106]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Feb 2009 22:47:17 +0000 Original-Received: from daniel by 81-231-84-106-no39.tbcn.telia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Feb 2009 22:47:17 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 81-231-84-106-no39.tbcn.telia.com X-Face: SNGmwsN&0DaHhS0!*%\@y"Wc^).,<; VsqY#}K/NJ:A Z6_>Md7x$Z9C1%BAu41M'12-8(f2{H*8OsnYv,K+y.szl1K>}{uC/>2?; k[KUiD=$}@z>odk|7Tk7i $A|{j7LhTt!:SdVp5Z, kKA247}--"-QLedxCbw|#&bh=R]Rd)kx{q+T'fG)9ayG`+\@g'3vx1Fd3bl -`3}Guvr!A"Z);"$|]CXW>YR5m"<[L Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) Cancel-Lock: sha1:YN5BBaYVu36NVSJud9AJ0dHXFhk= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:108992 Archived-At: I wrote: > apropos-library does not handle a null library name in load-history > correctly. This patch fixes the problem. Actually this still leaves `nil' in the completion collection. There was also another bug that I missed in the first patch. Here's another one. --- emacs/lisp/apropos.el 2009-01-05 04:18:41.000000000 +0100 +++ emacs-mod/lisp/apropos.el 2009-02-11 23:43:12.000000000 +0100 @@ -570,16 +570,17 @@ thus be found in `load-history'." (interactive (let ((libs - (nconc (delq nil - (mapcar - (lambda (l) + (delq nil (nconc + (mapcar + (lambda (l) + (when (stringp l) (setq l (file-name-nondirectory l)) (while (not (equal (setq l (file-name-sans-extension l)) l))) - l) - (mapcar 'car load-history))) - (mapcar 'car load-history)))) + l)) + (mapcar 'car load-history)) + (mapcar 'car load-history))))) (list (completing-read "Describe library: " libs nil t)))) (let ((symbols nil) ;; (autoloads nil) @@ -592,7 +593,7 @@ (re (concat "\\(?:\\`\\|[\\/]\\)" (regexp-quote file) "\\(\\.\\|\\'\\)"))) (while (and lh (null lh-entry)) - (if (string-match re (caar lh)) + (if (and (caar lh) (string-match re (caar lh))) (setq lh-entry (car lh)) (setq lh (cdr lh))))) (unless lh-entry (error "Unknown library `%s'" file)))