From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Markert Subject: Re: Problem with autoloads Date: Tue, 28 Jun 2011 20:11:52 +0200 Message-ID: <87tyb9966v.wl%markert.michael@googlemail.com> References: <877h87xloq.wl%markert.michael@googlemail.com> <20110627105743.15d7f5fd@kuru.homelinux.net> <87zkl29ams.wl%markert.michael@googlemail.com> <18297.1309220005@alphaville.dokosmarshall.org> <20110627180134.661ecfaa@kuru.homelinux.net> <29444.1309242825@alphaville.dokosmarshall.org> <87y60m8mv8.wl%markert.michael@googlemail.com> <20110628003034.2d21f8b2@kuru.homelinux.net> <1051.1309270501@alphaville.dokosmarshall.org> <2700.1309274280@alphaville.dokosmarshall.org> <87vcvq7x11.wl%markert.michael@googlemail.com> <3940.1309278232@alphaville.dokosmarshall.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Tue_Jun_28_20:11:51_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbclU-0007bJ-32 for emacs-orgmode@gnu.org; Tue, 28 Jun 2011 14:12:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbclR-0007n3-8u for emacs-orgmode@gnu.org; Tue, 28 Jun 2011 14:11:59 -0400 Received: from mail-fx0-f52.google.com ([209.85.161.52]:47686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbclQ-0007mi-RE for emacs-orgmode@gnu.org; Tue, 28 Jun 2011 14:11:57 -0400 Received: by fxd18 with SMTP id 18so435981fxd.39 for ; Tue, 28 Jun 2011 11:11:55 -0700 (PDT) In-Reply-To: <3940.1309278232@alphaville.dokosmarshall.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: Bastien , org-mode mailing list --pgp-sign-Multipart_Tue_Jun_28_20:11:51_2011-1 Content-Type: text/plain; charset=US-ASCII On 28 Jun 2011, Nick Dokos wrote: > Michael Markert wrote: >> >> Problem: autoload.el generates file names with lisp/ prefix. > > For you and Suvayu, but not for me. It's the discrepancy > that bothers me. I dug into emacs because I thought "Sure, there must be some change in the meantime", well now I'm bothered, too. The bzr autoloads.el is identical to mine. But this code makes me curious: #+begin_src emacs-lisp (defun autoload-file-load-name (file) "Compute the name that will be used to load FILE." ;; OUTFILE should be the name of the global loaddefs.el file, which ;; is expected to be at the root directory of the files we're ;; scanning for autoloads and will be in the `load-path'. (let* ((outfile (default-value 'generated-autoload-file)) (name (file-relative-name file (file-name-directory outfile))) (names '()) (dir (file-name-directory outfile))) ;; If `name' has directory components, only keep the ;; last few that are really needed. (while name (setq name (directory-file-name name)) (push (file-name-nondirectory name) names) (setq name (file-name-directory name))) (while (not name) (cond ((null (cdr names)) (setq name (car names))) ((file-exists-p (expand-file-name "subdirs.el" dir)) ;; FIXME: here we only check the existence of subdirs.el, ;; without checking its content. This makes it generate wrong load ;; names for cases like lisp/term which is not added to load-path. (setq dir (expand-file-name (pop names) dir))) (t (setq name (mapconcat 'identity names "/"))))) (if (string-match "\\.elc?\\(\\.\\|\\'\\)" name) (substring name 0 (match-beginning 0)) name))) #+end_src emacs-lisp if I read it correctly we decompose our path-name (say lisp/org.el), by rebasing it on outfile (org-install.el, which gives lisp/org.el) and split in dirs, which gives '("lisp" "org.el"), then we are in the else branch, build "lisp/org.el" and then in the last if we chop of the ".el". I can't see how you get there correct path names :( Michael --pgp-sign-Multipart_Tue_Jun_28_20:11:51_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCAAGBQJOChlnAAoJEHHMVUK0UjKVgbwP/2wStqcsIwiPUtBpbuP8wADt Gwgp1+L2jhl03L4cuCSEmdg/FriZ34PwP72oCDL/xXGktCkp4rpA3ol8YOpX49U5 chVTgCr39+wQBTMy4A38njUb4GYr0LjkUfQK4q8k6ywEuG4yAEW8aJ8q9HORVTjt dEfBOwGOb+dwEn+JSyhKaOnh+M5TfpTJ997NQs7YP8UzMm9bOdlkArQ74t1GxI+s cf8yH7VdBO/PIew+tkF7VbWYYofI0KsMOFHExzJWRaKQnIJCSfJldsDrvXZ0wwiK ewMpo9H9W8fi/lOp9AR/oLl+TPh5WfmpuurMtMnUDdDhPkg1Jso42ABo8JZmPY9y MnLb7nE9Sot/fAojJ3Go9LYwzF8Xt/pprIR8OdlrsI1u7xdPjKYx0GghBWRGHEDA Dl+yvICotqYvq9l0x2o+3Kxig8eIygor+RvGrTJbZUMbGAkci6iAM6burvaPkBnd vLdXrOMlSyNUKxaJ6PQdwB1suKF/AZpCNnnHvQKfvmIErT+9LRV1UCgGQ/uLbgm0 xXOTMD6AZ/BemOGmDyRyEvcZybPgrcrzDaLecS1nF+q166hAYVgKO9fPYKQZTqaY FxjRFYZoNdEPhY6z+mp7GPMEe9FhsBhBWUVAFaUXvvmv2qXRkQwBhnnPykjdhf66 uhD+dHzHn0Fki6BshOwa =qPJY -----END PGP SIGNATURE----- --pgp-sign-Multipart_Tue_Jun_28_20:11:51_2011-1--