all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH 1/3] emacs: Handle compiled and compressed autoloads.
Date: Sun,  6 Dec 2015 13:39:18 +0300	[thread overview]
Message-ID: <1449398360-9794-2-git-send-email-alezost@gmail.com> (raw)
In-Reply-To: <1449398360-9794-1-git-send-email-alezost@gmail.com>

* emacs/guix-emacs.el (guix-emacs-autoloads-regexp): New variable.
  (guix-emacs-find-autoloads-in-directory): Return a list of autoloads
  without extensions.
---
 emacs/guix-emacs.el | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/emacs/guix-emacs.el b/emacs/guix-emacs.el
index 6515b3d..948d2f2 100644
--- a/emacs/guix-emacs.el
+++ b/emacs/guix-emacs.el
@@ -37,6 +37,12 @@ they are successfully installed."
 (defvar guix-emacs-autoloads nil
   "List of the last loaded Emacs autoloads.")
 
+(defvar guix-emacs-autoloads-regexp
+  (rx (group (* any) "-autoloads")
+      ".el" (zero-or-one "c") (zero-or-one ".gz")
+      string-end)
+  "Regexp to match Emacs 'autoloads' file.")
+
 (defun guix-emacs-directory (&optional profile)
   "Return directory with Emacs packages installed in PROFILE.
 If PROFILE is nil, use `guix-user-profile'."
@@ -44,8 +50,15 @@ If PROFILE is nil, use `guix-user-profile'."
                     (or profile guix-user-profile)))
 
 (defun guix-emacs-find-autoloads-in-directory (directory)
-  "Return list of Emacs 'autoloads' files in DIRECTORY."
-  (directory-files directory 'full-name "-autoloads\\.el\\'" 'no-sort))
+  "Return a list of Emacs 'autoloads' files in DIRECTORY.
+The files in the list do not have extensions (.el, .elc)."
+  (cl-remove-duplicates
+   (delq nil
+        (mapcar (lambda (file)
+                  (when (string-match guix-emacs-autoloads-regexp file)
+                    (match-string 1 file)))
+                (directory-files directory 'full-name nil 'no-sort)))
+   :test #'string=))
 
 (defun guix-emacs-subdirs (directory)
   "Return list of DIRECTORY subdirectories."
-- 
2.6.3

  reply	other threads:[~2015-12-06 10:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 10:39 [PATCH 0/3] Update 'emacs-w3m' and improve loading emacs autoloads Alex Kost
2015-12-06 10:39 ` Alex Kost [this message]
2015-12-07 23:00   ` [PATCH 1/3] emacs: Handle compiled and compressed autoloads Ludovic Courtès
2015-12-09  8:53     ` Alex Kost
2015-12-09 13:58       ` Ludovic Courtès
2015-12-10 10:26         ` Alex Kost
2015-12-11  9:51           ` Ludovic Courtès
2015-12-11 11:42             ` Alex Kost
2015-12-06 10:39 ` [PATCH 2/3] gnu: emacs-w3m: Use 'modify-syntax' Alex Kost
2015-12-07 23:00   ` Ludovic Courtès
2015-12-06 10:39 ` [PATCH 3/3] gnu: emacs-w3m: Update to 1.4.538+0.20141022 Alex Kost
2015-12-07 23:00   ` Ludovic Courtès

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449398360-9794-2-git-send-email-alezost@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.