------------------------------------------------------------ revno: 412 revision-id: monn...@iro.umontreal.ca-20130627042216-d9duf57nw3gtbuml parent: i...@kanis.fr-20130622095606-kbsyn5kz2rhbux84 committer: Stefan Monnier <monn...@iro.umontreal.ca> branch nick: elpa timestamp: Thu 2013-06-27 00:22:16 -0400 message: * GNUmakefile: Rename from Makefile. Add targets for in-place use. (all, all-in-place): New targets. * admin/archive-contents.el (archive--simple-package-p): Ignore autosave files. (archive--refresh-pkg-file): New function. (archive--write-pkg-file): Print with ' and ` shorthands. * packages/company/company-pysmell.el: Don't require pysmell during compile. * packages/muse/htmlize-hack.el: Don't require htmlize during compile. * packages/shen-mode/shen-mode.el (shen-functions): Define during compile. * smart-operator/smart-operator.el (smart-operator-insert-1): Use pcase. renamed: Makefile => GNUmakefile makefile-20110701202856-l9xk4avwtorg7t6u-1 modified: admin/archive-contents.el archivecontents.el-20110420150621-nxecnw8cfkq6757j-1 packages/company/company-pysmell.el companypysmell.el-20101118182351-xme90jru269t6msr-63 packages/muse/htmlize-hack.el htmlizehack.el-20101118182351-xme90jru269t6msr-73 packages/shen-mode/shen-mode.el shenmode.el-20111006173540-dwpcmozf27xzn478-3 packages/smart-operator/smart-operator.el smart-operator.el GNUmakefile makefile-20110701202856-l9xk4avwtorg7t6u-1
=== renamed file 'Makefile' => 'GNUmakefile' --- a/Makefile 2013-01-10 13:40:29 +0000 +++ b/GNUmakefile 2013-06-27 04:22:16 +0000 @@ -7,6 +7,8 @@ .PHONY: archive-tmp changelogs process-archive archive-full org-fetch clean all do-it +all: all-in-place + ## Set up the source files for direct usage, by pointing ## `package-directory-list' to the site/ directory. site: packages @@ -73,4 +75,75 @@ clean: rm -rf archive $(ARCHIVE_TMP) $(SITE_DIR) -all: site +########## Rules for in-place installation ########## +pkgs := $(foreach pkg, $(wildcard packages/*), \ + $(if $(shell [ -d "$(pkg)" ] && echo true), $(pkg))) + +define SET-diff +$(shell echo "$(1)" "$(2)" "$(2)" | tr ' ' '\n' | sort | uniq -u) +endef + +define FILTER-nonsrc +$(filter-out %-autoloads.el %-pkg.el, $(1)) +endef + +define RULE-srcdeps +$(1): $$(call FILTER-nonsrc, $$(wildcard $$(dir $(1))/*.el)) +endef + +# Compute the set of autolods files and their dependencies. +autoloads := $(foreach pkg, $(pkgs), $(pkg)/$(notdir $(pkg))-autoloads.el) + +$(foreach al, $(autoloads), $(eval $(call RULE-srcdeps, $(al)))) +%-autoloads.el: + @echo 'EMACS -f package-generate-autoloads $@' + @cd $(dir $@); \ + $(EMACS) --batch \ + -l $(CURDIR)/admin/archive-contents.el \ + --eval "(archive--refresh-pkg-file)" \ + --eval "(require 'package)" \ + --eval "(package-generate-autoloads '$$(basename $$(pwd)) \ + \"$$(pwd)\")" + +# Put into elcs the set of elc files we need to keep up-to-date. +# I.e. one for each .el file except for the -pkg.el, the -autoloads.el, and +# the .el files that are marked "no-byte-compile". +els := $(call FILTER-nonsrc, $(wildcard packages/*/*.el)) +naive_elcs := $(patsubst %.el, %.elc, $(els)) +current_elcs := $(wildcard packages/*/*.elc) + +extra_els := $(call SET-diff, $(els), $(patsubst %.elc, %.el, $(current_elcs))) +nbc_els := $(foreach el, $(extra_els), \ + $(if $(shell grep '^;.*no-byte-compile: t' "$(el)"), $(el))) +elcs := $(call SET-diff, $(naive_elcs), $(patsubst %.el, %.elc, $(nbc_els))) + +# '(dolist (al (quote ($(patsubst %, "%", $(autoloads))))) (load (expand-file-name al) nil t))' +%.elc: %.el $(autoloads) + @echo 'EMACS -f batch-byte-compile $<' + @$(EMACS) --batch \ + --eval "(setq package-directory-list '(\"$(abspath packages)\"))" \ + --eval '(package-initialize)' \ + -L $(dir $@) -f batch-byte-compile $< + +# Remove .elc files that don't have a corresponding .el file any more. +extra_elcs := $(call SET-diff, $(current_elcs), $(naive_elcs)) +.PHONY: $(extra_elcs) +$(extra_elcs):; rm $@ + +# # Put into single_pkgs the set of -pkg.el files we need to keep up-to-date. +# # I.e. all the -pkg.el files for the single-file packages. +# single_pkgs:=$(foreach pkg, $(pkgs), \ +# $(word $(words $(call FILTER-nonsrc, \ +# $(wildcard $(pkg)/*.el))), \ +# $(pkg)/$(notdir $(pkg))-pkg.el)) +# #$(foreach al, $(single_pkgs), $(eval $(call RULE-srcdeps, $(al)))) +# %-pkg.el: %.el +# @echo 'EMACS -f package-generate-description-file $@' +# @$(EMACS) --batch \ +# --eval '(require (quote package))' \ +# --eval '(setq b (find-file-noselect "$<"))' \ +# --eval '(setq d (with-current-buffer b (package-buffer-info)))' \ +# --eval '(package-generate-description-file d "$(dir $@)")' + + +all-in-place: $(extra_elcs) $(autoloads) $(elcs) # $(single_pkgs)
=== modified file 'admin/archive-contents.el' --- a/admin/archive-contents.el 2012-11-29 17:21:45 +0000 +++ b/admin/archive-contents.el 2013-06-27 04:22:16 +0000 @@ -1,6 +1,6 @@ ;;; archive-contents.el --- Auto-generate an Emacs Lisp package archive. -;; Copyright (C) 2011, 2012 Free Software Foundation, Inc +;; Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc ;; Author: Stefan Monnier <monn...@iro.umontreal.ca> @@ -132,7 +132,7 @@ (files (directory-files dir nil archive-re-no-dot)) version description req commentary) (dolist (file (prog1 files (setq files ()))) - (unless (string-match "\\.elc\\'" file) + (unless (string-match "\\(?:\\.elc\\|~\\)\\'" file) (push file files))) (setq files (delete (concat pkg "-pkg.el") files)) (setq files (delete (concat pkg "-autoloads.el") files)) @@ -242,7 +242,7 @@ (cons (intern pkg) (vector (version-to-list vers) req (nth 3 exp) 'tar)))) (defun archive--multi-file-package-def (dir pkg) - "Reurn the `define-package' form in the file DIR/PKG-pkg.el." + "Return the `define-package' form in the file DIR/PKG-pkg.el." (let ((pkg-file (expand-file-name (concat pkg "-pkg.el") dir))) (with-temp-buffer (unless (file-exists-p pkg-file) @@ -284,6 +284,17 @@ ;; FIXME: Don't compile the -pkg.el files! (byte-recompile-directory dir 0)))))) +(defun archive--refresh-pkg-file () + (let* ((dir (directory-file-name default-directory)) + (pkg (file-name-nondirectory dir)) + (simple-p (archive--simple-package-p dir pkg))) + (if simple-p + (progn + ;; (message "Refreshing pkg description of %s" pkg) + (apply 'archive--write-pkg-file dir pkg simple-p)) + ;; (message "Not refreshing pkg description of %s" pkg) + ))) + (defun batch-make-site-package (sdir) (let* ((dest (car (file-attributes sdir))) (pkg (file-name-nondirectory (directory-file-name (or dest sdir)))) @@ -297,6 +308,7 @@ (defun archive--write-pkg-file (pkg-dir name version desc requires &rest ignored) (let ((pkg-file (expand-file-name (concat name "-pkg.el") pkg-dir)) (print-level nil) + (print-quoted t) (print-length nil)) (write-region (concat (format ";; Generated package description from %s.el\n" === modified file 'packages/company/company-pysmell.el' --- a/packages/company/company-pysmell.el 2013-04-16 11:40:14 +0000 +++ b/packages/company/company-pysmell.el 2013-06-27 04:22:16 +0000 @@ -1,6 +1,6 @@ ;;; company-pysmell.el --- company-mode completion back-end for pysmell.el -;; Copyright (C) 2009-2011 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011, 2013 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -28,7 +28,7 @@ ;;; Code: (eval-when-compile (require 'cl)) -(require 'pysmell) +(if t (require 'pysmell)) ;Don't load during compilation. (defvar company-pysmell--available-p 'unknown) (make-variable-buffer-local 'company-pysmell--available-p) === modified file 'packages/muse/htmlize-hack.el' --- a/packages/muse/htmlize-hack.el 2010-11-18 18:24:12 +0000 +++ b/packages/muse/htmlize-hack.el 2013-06-27 04:22:16 +0000 @@ -2,7 +2,8 @@ ;; To use it, add the path to this directory to your load path and ;; add (require 'htmlize-hack) to your Emacs init file. -(require 'htmlize) +(eval-when-compile (require 'cl)) +(if t (require 'htmlize)) ; Don't load during compilation. (when (equal htmlize-version "1.34") (defun htmlize-face-size (face) === modified file 'packages/shen-mode/shen-mode.el' --- a/packages/shen-mode/shen-mode.el 2011-11-18 19:50:52 +0000 +++ b/packages/shen-mode/shen-mode.el 2013-06-27 04:22:16 +0000 @@ -1,6 +1,6 @@ ;;; shen-mode.el --- A major mode for editing shen source code -;; Copyright (C) 2011 Free Software Foundation, Inc. +;; Copyright (C) 2011, 2013 Free Software Foundation, Inc. ;; Author: Eric Schulte <schulte.e...@gmail.com> ;; Version: 0.1 @@ -44,6 +44,7 @@ map) "Currently just inherits from `lisp-mode-shared-map'.") +(eval-and-compile (defconst shen-functions '((* "number --> number --> number" "Number multiplication.") (+ "number --> number --> number" "Number addition.") @@ -220,7 +221,7 @@ (warn "string --> string" "Prints the string as a warning and returns \"done\". See strong-warning") (write-to-file "string --> A --> string" "Writes the second input into a file named in the first input. If the file does not exist, it is created, else it is overwritten. If the second input is a string then it is written to the file without the enclosing quotes. The first input is returned.") (y-or-n\? "string --> boolean" "Prints the string as a question and returns true for y and false for n.")) - "Shen functions taken largely from the Qi documentation by Dr. Mark Tarver.") + "Shen functions taken largely from the Qi documentation by Dr. Mark Tarver.")) ;;; Fontification === modified file 'packages/smart-operator/smart-operator.el' --- a/packages/smart-operator/smart-operator.el 2012-10-08 03:51:52 +0000 +++ b/packages/smart-operator/smart-operator.el 2013-06-27 04:22:16 +0000 @@ -1,6 +1,6 @@ ;;; smart-operator.el --- Insert operators with surrounding spaces smartly -;; Copyright (C) 2004, 2005, 2007-2012 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005, 2007-2013 Free Software Foundation, Inc. ;; Author: William Xu <william....@gmail.com> ;; Version: 4.0 @@ -106,11 +106,11 @@ When `only-where' is 'after, we will insert space at back only; when `only-where' is 'before, we will insert space at front only; when `only-where' is 'middle, we will not insert space." - (case only-where - ((before) (insert " " op)) - ((middle) (insert op)) - ((after) (insert op " ")) - (t + (pcase only-where + (`before (insert " " op)) + (`middle (insert op)) + (`after (insert op " ")) + (_ (let ((begin? (bolp))) (unless (or (looking-back (regexp-opt smart-operator-list) (line-beginning-position))