Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit ce8a7e38 authored by Dimitri Fontaine's avatar Dimitri Fontaine

Fix el-get-byte-compile in recent Emacs snapshot.

byte-compile-file behaviour changed yet again, so stop trying to guess if we
can rely on it and just define our own behaviour.
parent 06e40166
......@@ -15,27 +15,32 @@
(require 'cl) ; yes I like loop
(require 'bytecomp)
;; Emacs < 24
(eval-and-compile
(if (fboundp 'byte-recompile-file)
(defsubst el-get-byte-compile-file (el)
;; Byte-compile runs emacs-lisp-mode-hook; disable it
(let (emacs-lisp-mode-hook)
(byte-recompile-file el)))
(defun el-get-byte-compile-file (el)
"Same as `byte-compile-file', but skips unnecessary compilation.
;; byte-recompile-file:
;;
;; - in Emacs23 will not recompile a file when the source is newer than the
;; bytecode (.elc)
;;
;; - in Emacs24 has another different and unhelpful behavior:
;;
;; If the `.elc' file does not exist, normally this function *does not*
;; compile FILENAME. If ARG is 0, that means compile the file even if it
;; has never been compiled before.
;;
;; so we just define our own
(defun el-get-byte-compile-file (el)
"Byte compile the EL file, and skips unnecessary compilation.
Specifically, if the compiled elc file already exists and is
newer, then compilation will be skipped."
(let ((elc (concat (file-name-sans-extension el) ".elc"))
;; Byte-compile runs emacs-lisp-mode-hook; disable it
emacs-lisp-mode-hook)
(when (or (not (file-exists-p elc))
(file-newer-than-file-p el elc))
(condition-case err
(byte-compile-file el)
((debug error) ;; catch-all, allow for debugging
(message "%S" (error-message-string err)))))))))
newer, then compilation is skipped."
(let ((elc (concat (file-name-sans-extension el) ".elc"))
;; Byte-compile runs emacs-lisp-mode-hook; disable it
emacs-lisp-mode-hook byte-compile-warnings)
(when (or (not (file-exists-p elc))
(file-newer-than-file-p el elc))
(condition-case err
(byte-compile-file el)
((debug error) ;; catch-all, allow for debugging
(message "%S" (error-message-string err)))))))
(defun el-get-byte-compile-file-or-directory (file)
"Byte-compile FILE or all files within it if it is a directory."
......
......@@ -6,9 +6,9 @@
(let ((debug-on-error t)
(debug-ignored-errors '())
(el-get-default-process-sync t)
(el-get-verbose t))
(el-get-verbose t)
(el-get-byte-compile-at-init t))
(require 'el-get)
(message "%S" (el-get-dependencies 'cperl-mode))
(el-get-install "mode-compile")
(el-get-install "cperl-mode"))
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