Commit 4c58f559 authored by Noam Postavsky's avatar Noam Postavsky

fix more compilation warnings, missing functions

some functions were changed or introduced in 24.3
parent 71423ff5
......@@ -6,6 +6,10 @@ before_install:
sudo apt-get install -qq
emacs-snapshot-el emacs-snapshot-gtk emacs-snapshot;
fi
- if [ $($EMACS -Q -batch --eval '(message "%d" emacs-major-version)' 2>&1) -lt 24 ] ; then
mkdir pkg &&
curl -o pkg/package.el http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el;
fi
env:
- EMACS=emacs
- EMACS=emacs-snapshot
......
......@@ -105,7 +105,7 @@ With optional arg RECURSIVE, do so in all subdirectories as well."
(not (file-newer-than-file-p elc el)))
do (progn
(message "el-get-byte-compile: Cleaning stale compiled file %s" elc)
(delete-file elc nil)))
(delete-file elc)))
;; Process subdirectories recursively
(when recursive
(loop for dir in (directory-files dir 'full)
......
......@@ -304,6 +304,14 @@ object or a file path."
(insert-file-contents file-or-buffer)
(el-get-check-recipe-in-current-buffer file-or-buffer))))
(eval-when-compile
(unless (fboundp 'file-name-base) ; new in 24.3
(defun file-name-base (&optional filename)
"Return the base name of the FILENAME: no directory, no extension.
FILENAME defaults to `buffer-file-name'."
(file-name-sans-extension
(file-name-nondirectory (or filename (buffer-file-name)))))))
(defun el-get-check-recipe-in-current-buffer (recipe-file-name)
(let ((recipe (save-excursion
(goto-char (point-min))
......
......@@ -722,6 +722,19 @@ itself.")
(let ((el-get-elpa-do-refresh 'once))
(mapc 'el-get-update (el-get-list-package-names-with-status "installed")))))
(eval-when-compile
(unless (fboundp 'user-error) ; new in 24.3
(defun user-error (format &rest args)
"Signal a pilot error, making error message by passing all args to `format'.
In Emacs, the convention is that error messages start with a capital
letter but *do not* end with a period. Please follow this convention
for the sake of consistency.
This is just like `error' except that `user-error's are expected to be the
result of an incorrect manipulation on the part of the user, rather than the
result of an actual problem."
(while t
(signal 'user-error (list (apply #'format format args)))))))
;;;###autoload
(defun el-get-update-packages-of-type (type)
"Update all installed packages of type TYPE."
......
......@@ -17,6 +17,9 @@
(require 'package nil t)
(declare-function el-get-package-is-installed "el-get" (package))
;; pretend these old functions exist to keep byte compiler in 24.4 quiet
(declare-function package-desc-doc "package" (desc))
(declare-function package-desc-vers "package" (desc))
(defcustom el-get-elpa-install-hook nil
"Hook run after ELPA package install."
......@@ -80,6 +83,12 @@ the recipe, then return nil."
(shell-command
(format "cd %s && ln -s \"%s\" \"%s\"" el-get-dir elpa-dir package)))))))
(eval-when-compile
;; `condition-case-unless-debug' was introduced in 24.1, but was
;; actually added in 23.1 as `condition-case-no-debug'
(unless (fboundp 'condition-case-unless-debug)
(defalias 'condition-case-unless-debug 'condition-case-no-debug)))
(defun el-get-elpa-install (package url post-install-fun)
"Ask elpa to install given PACKAGE."
(let* ((elpa-dir (el-get-elpa-package-directory package))
......
......@@ -3,7 +3,7 @@
set -ex
# for now, just require no warnings or errors during compilation
$EMACS -Q -L . -L methods -batch --eval '(setq byte-compile-error-on-warn t)' \
$EMACS -Q -L pkg/ -L . -L methods/ -batch --eval '(setq byte-compile-error-on-warn t)' \
-f batch-byte-compile *.el methods/*.el
# TODO: actually run some tests
......
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