Commit fdaaf515 authored by Ryan C. Thompson's avatar Ryan C. Thompson

Cleanup indentation with custom indent rules

parent e341deec
......@@ -391,7 +391,7 @@ makes it easier to conditionally splice a command into the list.
(mapcar #'shell-quote-argument (plist-get c :args))
(plist-get c :args)))
(sync (el-get-plist-get-with-default c :sync
el-get-default-process-sync))
el-get-default-process-sync))
(stdin (plist-get c :stdin))
(default-directory (if cdir
(file-name-as-directory
......
......@@ -18,11 +18,11 @@
(defun el-get-dependencies (packages)
"Return the list of packages to install in order."
(multiple-value-bind (plist all-sorted-p non-sorted)
(topological-sort
(apply 'append (mapcar 'el-get-dependencies-graph (el-get-as-list packages))))
(if all-sorted-p
plist
(error "Couldn't sort package dependencies for \"%s\"" package))))
(topological-sort
(apply 'append (mapcar 'el-get-dependencies-graph (el-get-as-list packages))))
(if all-sorted-p
plist
(error "Couldn't sort package dependencies for \"%s\"" package))))
(defun el-get-dependencies-graph (package)
"Return the graph of packages on which PACKAGE depends"
......@@ -60,36 +60,36 @@ in the topological ordering (i.e., the first value)."
and whose cdr is a list of dependants of vertex."
(or (gethash v entries)
(puthash v (cons 0 '()) entries))))
;; populate entries initially
(dolist (gvertex graph)
(destructuring-bind (vertex &rest dependencies) gvertex
(let ((ventry (entry vertex)))
(dolist (dependency dependencies)
(let ((dentry (entry dependency)))
(unless (funcall test dependency vertex)
(incf (car ventry))
(push vertex (cdr dentry))))))))
;; L is the list of sorted elements, and S the set of vertices
;; with no outstanding dependencies.
(let ((L '())
(S (loop for entry being each hash-value of entries
using (hash-key vertex)
when (zerop (car entry)) collect vertex)))
;; Until there are no vertices with no outstanding dependencies,
;; process vertices from S, adding them to L.
(do* () ((endp S))
(let* ((v (pop S)) (ventry (entry v)))
(remhash v entries)
(dolist (dependant (cdr ventry) (push v L))
(when (zerop (decf (car (entry dependant))))
(push dependant S)))))
;; return (1) the list of sorted items, (2) whether all items
;; were sorted, and (3) if there were unsorted vertices, the
;; hash table mapping these vertices to their dependants
(let ((all-sorted-p (zerop (hash-table-count entries))))
(values (nreverse L)
all-sorted-p
(unless all-sorted-p
entries)))))))
;; populate entries initially
(dolist (gvertex graph)
(destructuring-bind (vertex &rest dependencies) gvertex
(let ((ventry (entry vertex)))
(dolist (dependency dependencies)
(let ((dentry (entry dependency)))
(unless (funcall test dependency vertex)
(incf (car ventry))
(push vertex (cdr dentry))))))))
;; L is the list of sorted elements, and S the set of vertices
;; with no outstanding dependencies.
(let ((L '())
(S (loop for entry being each hash-value of entries
using (hash-key vertex)
when (zerop (car entry)) collect vertex)))
;; Until there are no vertices with no outstanding dependencies,
;; process vertices from S, adding them to L.
(do* () ((endp S))
(let* ((v (pop S)) (ventry (entry v)))
(remhash v entries)
(dolist (dependant (cdr ventry) (push v L))
(when (zerop (decf (car (entry dependant))))
(push dependant S)))))
;; return (1) the list of sorted items, (2) whether all items
;; were sorted, and (3) if there were unsorted vertices, the
;; hash table mapping these vertices to their dependants
(let ((all-sorted-p (zerop (hash-table-count entries))))
(values (nreverse L)
all-sorted-p
(unless all-sorted-p
entries)))))))
(provide 'el-get-dependencies)
......@@ -213,8 +213,8 @@ which defaults to installed, required and removed. Example:
(el-get-package-def package-or-source)
package-or-source)))
(el-get-plist-get-with-default
def :minimum-emacs-version
0)))
def :minimum-emacs-version
0)))
(defun el-get-version-to-list (version)
"Convert VERSION to a standard version list.
......@@ -330,24 +330,24 @@ object or a file path."
(incf numerror)))
(destructuring-bind (&key type url autoloads features builtin
&allow-other-keys)
recipe
;; Is github type used?
(when (and (eq type 'git) (string-match "//github.com/" url))
(insert "* Use `:type github' for github type recipe\n")
(incf numerror))
;; Warn when `:autoloads nil' is specified.
(when (and (null autoloads) (plist-member recipe :autoloads))
(insert "* WARNING: Are you sure you don't need autoloads?
recipe
;; Is github type used?
(when (and (eq type 'git) (string-match "//github.com/" url))
(insert "* Use `:type github' for github type recipe\n")
(incf numerror))
;; Warn when `:autoloads nil' is specified.
(when (and (null autoloads) (plist-member recipe :autoloads))
(insert "* WARNING: Are you sure you don't need autoloads?
This property should be used only when the library takes care of
the autoload.\n"))
;; Warn when `:features t' is specified
(when features
(insert "* WARNING: Are you sure you need features?
;; Warn when `:features t' is specified
(when features
(insert "* WARNING: Are you sure you need features?
If this library has `;;;###autoload' comment (a.k.a autoload cookie),
you don't need `:features'.\n"))
;; Check if `:builtin' is used with an integer
(when (integerp builtin)
(insert "* WARNING: Usage of integers for :builtin is obsolete.
;; Check if `:builtin' is used with an integer
(when (integerp builtin)
(insert "* WARNING: Usage of integers for :builtin is obsolete.
Use a version string like \"24.3\" instead.\n")))
;; Check for required properties.
(loop for key in '(:description :name)
......
......@@ -314,12 +314,12 @@ t', this error is suppressed (but nothing is updated)."
(unless (el-get-package-is-installed package)
(error "Package %s is not installed. Cannot update recipe." package))
(destructuring-bind (update-p added-disallowed removed-disallowed)
(el-get-diagnosis-properties cached-recipe source)
(when (or added-disallowed removed-disallowed)
;; Emit a verbose message if `noerror' is t (but still quit
;; the function).
(funcall (if noerror 'el-get-verbose-message 'error)
"Tried to add non-whitelisted properties:
(el-get-diagnosis-properties cached-recipe source)
(when (or added-disallowed removed-disallowed)
;; Emit a verbose message if `noerror' is t (but still quit
;; the function).
(funcall (if noerror 'el-get-verbose-message 'error)
"Tried to add non-whitelisted properties:
%s
......@@ -331,15 +331,15 @@ into/from source:
%s
Maybe you should use `el-get-update' or `el-get-reinstall' on %s instead?"
(if added-disallowed (pp-to-string added-disallowed) "()")
(if removed-disallowed (pp-to-string removed-disallowed) "()")
(pp-to-string cached-recipe)
(el-get-source-name cached-recipe))
(return-from el-get-merge-properties-into-status))
(when update-p
(if save-to-file
(el-get-save-package-status package "installed" source)
(plist-put (cdr (assq package package-status-alist))
'recipe source))))))
(if added-disallowed (pp-to-string added-disallowed) "()")
(if removed-disallowed (pp-to-string removed-disallowed) "()")
(pp-to-string cached-recipe)
(el-get-source-name cached-recipe))
(return-from el-get-merge-properties-into-status))
(when update-p
(if save-to-file
(el-get-save-package-status package "installed" source)
(plist-put (cdr (assq package package-status-alist))
'recipe source))))))
(provide 'el-get-status)
This diff is collapsed.
......@@ -151,10 +151,10 @@ password prompt."
(add-hook 'el-get-apt-get-remove-hook 'el-get-dpkg-remove-symlink)
(el-get-register-method :apt-get
:install #'el-get-apt-get-install
:update #'el-get-apt-get-install
:remove #'el-get-apt-get-remove
:install-hook #'el-get-apt-get-install-hook
:remove-hook #'el-get-apt-get-remove-hook)
:install #'el-get-apt-get-install
:update #'el-get-apt-get-install
:remove #'el-get-apt-get-remove
:install-hook #'el-get-apt-get-install-hook
:remove-hook #'el-get-apt-get-remove-hook)
(provide 'el-get-apt-get)
......@@ -90,10 +90,10 @@
(add-hook 'el-get-brew-remove-hook 'el-get-dpkg-remove-symlink)
(el-get-register-method :brew
:install #'el-get-brew-install
:update #'el-get-brew-update
:remove #'el-get-brew-remove
:install-hook #'el-get-brew-install-hook
:remove-hook #'el-get-brew-remove-hook)
:install #'el-get-brew-install
:update #'el-get-brew-update
:remove #'el-get-brew-remove
:install-hook #'el-get-brew-install-hook
:remove-hook #'el-get-brew-remove-hook)
(provide 'el-get-brew)
......@@ -26,10 +26,10 @@
(funcall post-install-fun package)))
(el-get-register-method :builtin
:install #'el-get-builtin-install
:update #'el-get-builtin-install
:remove #'el-get-rmdir
:install-hook #'el-get-builtin-install-hook)
:install #'el-get-builtin-install
:update #'el-get-builtin-install
:remove #'el-get-rmdir
:install-hook #'el-get-builtin-install-hook)
(el-get-register-method-alias :no-op :builtin)
......
......@@ -57,9 +57,9 @@
post-update-fun)))
(el-get-register-method :bzr
:install #'el-get-bzr-branch
:update #'el-get-bzr-pull
:remove #'el-get-rmdir
:install-hook el-get-bzr-branch-hook)
:install #'el-get-bzr-branch
:update #'el-get-bzr-pull
:remove #'el-get-rmdir
:install-hook el-get-bzr-branch-hook)
(provide 'el-get-bzr)
......@@ -140,9 +140,9 @@ Enable this if you want el-get to honor these settings"
post-update-fun)))
(el-get-register-method :cvs
:install #'el-get-cvs-checkout
:update #'el-get-cvs-update
:remove #'el-get-rmdir
:install-hook #'el-get-cvs-checkout-hook)
:install #'el-get-cvs-checkout
:update #'el-get-cvs-update
:remove #'el-get-rmdir
:install-hook #'el-get-cvs-checkout-hook)
(provide 'el-get-cvs)
......@@ -57,9 +57,9 @@
post-update-fun)))
(el-get-register-method :darcs
:install #'el-get-darcs-get
:update #'el-get-darcs-pull
:remove #'el-get-rmdir
:install-hook #'el-get-darcs-get-hook)
:install #'el-get-darcs-get
:update #'el-get-darcs-pull
:remove #'el-get-rmdir
:install-hook #'el-get-darcs-get-hook)
(provide 'el-get-darcs)
......@@ -171,12 +171,12 @@ the recipe, then return nil."
(concat "http://melpa.milkbox.net/#" package)))))
(el-get-register-method :elpa
:install #'el-get-elpa-install
:update #'el-get-elpa-update
:remove #'el-get-elpa-remove
:install-hook #'el-get-elpa-install-hook
:remove-hook #'el-get-elpa-remove-hook
:guess-website #'el-get-elpa-guess-website)
:install #'el-get-elpa-install
:update #'el-get-elpa-update
:remove #'el-get-elpa-remove
:install-hook #'el-get-elpa-install-hook
:remove-hook #'el-get-elpa-remove-hook
:guess-website #'el-get-elpa-guess-website)
;;;
;;; Functions to maintain a local recipe list from ELPA
......
......@@ -42,7 +42,7 @@
(el-get-github-guess-website package)))
(el-get-register-derived-method :emacsmirror :github
:install #'el-get-emacsmirror-clone
:guess-website #'el-get-emacsmirror-guess-website)
:install #'el-get-emacsmirror-clone
:guess-website #'el-get-emacsmirror-guess-website)
(provide 'el-get-emacsmirror)
......@@ -45,9 +45,9 @@ filename.el ;;; filename.el --- description"
(format "%s%s.el" el-get-emacswiki-base-url package))
(el-get-register-derived-method :emacswiki :http
:install #'el-get-emacswiki-install
:update #'el-get-emacswiki-install
:guess-website #'el-get-emacswiki-guess-website)
:install #'el-get-emacswiki-install
:update #'el-get-emacswiki-install
:guess-website #'el-get-emacswiki-guess-website)
;;;
;;; Functions to maintain a local recipe list from EmacsWiki
......
......@@ -77,10 +77,10 @@
(add-hook 'el-get-fink-remove-hook 'el-get-dpkg-remove-symlink)
(el-get-register-method :fink
:install #'el-get-fink-install
:update #'el-get-fink-install
:remove #'el-get-fink-remove
:install-hook #'el-get-fink-install-hook
:remove-hook #'el-get-fink-remove-hook)
:install #'el-get-fink-install
:update #'el-get-fink-install
:remove #'el-get-fink-remove
:install-hook #'el-get-fink-install-hook
:remove-hook #'el-get-fink-remove-hook)
(provide 'el-get-fink)
......@@ -159,10 +159,10 @@ using `el-get-rmdir' as usual."
(el-get-rmdir package))
(el-get-register-method :fossil
:install #'el-get-fossil-clone
:update #'el-get-fossil-update
:remove #'el-get-fossil-rmdir
:install-hook #'el-get-fossil-clone-hook
:compute-checksum #'el-get-fossil-compute-checksum)
:install #'el-get-fossil-clone
:update #'el-get-fossil-update
:remove #'el-get-fossil-rmdir
:install-hook #'el-get-fossil-clone-hook
:compute-checksum #'el-get-fossil-compute-checksum)
(provide 'el-get-fossil)
......@@ -80,8 +80,8 @@
post-update-fun)))
(el-get-register-derived-method :git-svn :git
:install #'el-get-git-svn-clone
:update #'el-get-git-svn-update
:install-hook #'el-get-git-svn-clone-hook)
:install #'el-get-git-svn-clone
:update #'el-get-git-svn-update
:install-hook #'el-get-git-svn-clone-hook)
(provide 'el-get-git-svn)
......@@ -56,7 +56,7 @@ found."
(shallow (unless (and (string-prefix-p "http" url)
(not (string-prefix-p "http://github.com" url)))
(el-get-plist-get-with-default source :shallow
el-get-git-shallow-clone)))
el-get-git-shallow-clone)))
(clone-args (append '("--no-pager" "clone")
(when shallow '("--depth" "1"))
(cond
......@@ -160,10 +160,10 @@ found."
(shell-command-to-string cmd))))
(el-get-register-method :git
:install #'el-get-git-clone
:update #'el-get-git-pull
:remove #'el-get-rmdir
:install-hook #'el-get-git-clone-hook
:compute-checksum #'el-get-git-compute-checksum)
:install #'el-get-git-clone
:update #'el-get-git-pull
:remove #'el-get-rmdir
:install-hook #'el-get-git-clone-hook
:compute-checksum #'el-get-git-compute-checksum)
(provide 'el-get-git)
......@@ -43,8 +43,8 @@
(el-get-http-tar-install package url post-install-fun)))
(el-get-register-derived-method :github-tar :http-tar
:install #'el-get-github-tar-install
:update #'el-get-github-tar-install
:guess-website #'el-get-github-guess-website)
:install #'el-get-github-tar-install
:update #'el-get-github-tar-install
:guess-website #'el-get-github-guess-website)
(provide 'el-get-github-tar)
......@@ -41,8 +41,8 @@
(el-get-http-zip-install package url post-install-fun)))
(el-get-register-derived-method :github-zip :http-zip
:install #'el-get-github-zip-install
:update #'el-get-github-zip-install
:guess-website #'el-get-github-guess-website)
:install #'el-get-github-zip-install
:update #'el-get-github-zip-install
:guess-website #'el-get-github-guess-website)
(provide 'el-get-github-zip)
......@@ -91,7 +91,7 @@ USERNAME and REPONAME are strings."
(el-get-github-url-private 'https username reponame)))
(el-get-register-derived-method :github :git
:install #'el-get-github-clone
:guess-website #'el-get-github-guess-website)
:install #'el-get-github-clone
:guess-website #'el-get-github-guess-website)
(provide 'el-get-github)
......@@ -47,9 +47,9 @@
(setenv "GOPATH" gopath)))
(el-get-register-method :go
:install #'el-get-go-install
:update #'el-get-go-install
:remove #'el-get-rmdir
:install-hook #'el-get-go-install-hook)
:install #'el-get-go-install
:update #'el-get-go-install
:remove #'el-get-rmdir
:install-hook #'el-get-go-install-hook)
(provide 'el-get-go)
......@@ -88,10 +88,10 @@
hash)))
(el-get-register-method :hg
:install #'el-get-hg-clone
:update #'el-get-hg-pull
:remove #'el-get-rmdir
:install-hook #'el-get-hg-clone-hook
:compute-checksum #'el-get-hg-compute-checksum)
:install #'el-get-hg-clone
:update #'el-get-hg-pull
:remove #'el-get-rmdir
:install-hook #'el-get-hg-clone-hook
:compute-checksum #'el-get-hg-compute-checksum)
(provide 'el-get-hg)
......@@ -73,10 +73,10 @@
(add-hook 'el-get-http-tar-install-hook 'el-get-http-unpack-cleanup-extract-hook)
(el-get-register-method :http-tar
:install #'el-get-http-tar-install
:update #'el-get-http-tar-install
:remove #'el-get-rmdir
:install-hook #'el-get-http-tar-install-hook
:update-hook #'el-get-http-tar-install-hook)
:install #'el-get-http-tar-install
:update #'el-get-http-tar-install
:remove #'el-get-rmdir
:install-hook #'el-get-http-tar-install-hook
:update-hook #'el-get-http-tar-install-hook)
(provide 'el-get-http-tar)
......@@ -52,10 +52,10 @@
(add-hook 'el-get-http-zip-install-hook 'el-get-http-unpack-cleanup-extract-hook)
(el-get-register-method :http-zip
:install #'el-get-http-zip-install
:update #'el-get-http-zip-install
:remove #'el-get-rmdir
:install-hook #'el-get-http-zip-install-hook
:update-hook #'el-get-http-zip-install-hook)
:install #'el-get-http-zip-install
:update #'el-get-http-zip-install
:remove #'el-get-rmdir
:install-hook #'el-get-http-zip-install-hook
:update-hook #'el-get-http-zip-install-hook)
(provide 'el-get-http-zip)
......@@ -97,12 +97,12 @@ into the package :localname option or its `file-name-nondirectory' part."
(plist-get (el-get-package-def package) :url))
(el-get-register-method :http
:install #'el-get-http-install
:update #'el-get-http-install
:remove #'el-get-rmdir
:install-hook #'el-get-http-install-hook
:compute-checksum #'el-get-http-compute-checksum
:guess-website #'el-get-http-guess-website)
:install #'el-get-http-install
:update #'el-get-http-install
:remove #'el-get-rmdir
:install-hook #'el-get-http-install-hook
:compute-checksum #'el-get-http-compute-checksum
:guess-website #'el-get-http-guess-website)
(el-get-register-method-alias :ftp :http)
......
......@@ -64,10 +64,10 @@
(add-hook 'el-get-pacman-remove-hook 'el-get-dpkg-remove-symlink)
(el-get-register-method :pacman
:install #'el-get-pacman-install
:update #'el-get-pacman-install
:remove #'el-get-pacman-remove
:install-hook #'el-get-pacman-install-hook
:remove-hook #'el-get-pacman-remove-hook)
:install #'el-get-pacman-install
:update #'el-get-pacman-install
:remove #'el-get-pacman-remove
:install-hook #'el-get-pacman-install-hook
:remove-hook #'el-get-pacman-remove-hook)
(provide 'el-get-pacman)
......@@ -67,9 +67,9 @@
post-update-fun)))
(el-get-register-method :svn
:install #'el-get-svn-checkout
:update #'el-get-svn-update
:remove #'el-get-rmdir
:install-hook #'el-get-svn-checkout-hook)
:install #'el-get-svn-checkout
:update #'el-get-svn-update
:remove #'el-get-rmdir
:install-hook #'el-get-svn-checkout-hook)
(provide 'el-get-svn)
......@@ -15,7 +15,7 @@
(defmacro suppress-messages (&rest body)
"Run body with `message' redefined as a no-op."
`(flet ((message (&rest ignored) nil))
(progn ,@body)))
(progn ,@body)))
(put 'suppress-messages 'lisp-indent-function
(get 'progn 'lisp-indent-function))
......
......@@ -8,7 +8,7 @@
"0")
(el-get-register-derived-method :builtin-with-checksum :builtin
:compute-checksum #'el-get-builtin-compute-checksum)
:compute-checksum #'el-get-builtin-compute-checksum)
(setq debug-on-error t
el-get-verbose t
......
......@@ -63,6 +63,6 @@
;; Install, then set the recipe to nil in the status file, then uninstall
(el-get-install 'a)
(flet ((el-get-package-def (&rest ignored) nil))
(el-get-save-package-status 'a "installed"))
(el-get-save-package-status 'a "installed"))
(el-get-remove 'a)
(assert-package-fully-removed 'a)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment