From 5341d2183082f68c0f8d65ba845bb8a58030d3c3 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 21 Apr 2020 14:15:49 +0200 Subject: emacs: prefer newer files for local stuff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I have some stuff that I've built locally, and in those cases I'd prefer GNU Emacs not picking the first stuff that it sees, but instead pick the newest file, even if that involves stating which file is newer and so on. Signed-off-by: Miquel Sabaté Solà --- .emacs.d/init.org | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to '.emacs.d') diff --git a/.emacs.d/init.org b/.emacs.d/init.org index db15e23..618efcd 100644 --- a/.emacs.d/init.org +++ b/.emacs.d/init.org @@ -172,8 +172,10 @@ Compile the =g.el= script and bind it to @@html:M-g@@. #+BEGIN_SRC elisp (if (file-exists-p (concat user-emacs-directory "lisp/g.elc")) - (load-file (concat user-emacs-directory "lisp/g.elc")) + (let ((load-prefer-newer t)) + (load-file (concat user-emacs-directory "lisp/g.elc"))) (byte-compile-file (concat user-emacs-directory "lisp/g.el") t)) + (global-set-key (kbd "M-g") 'g) #+END_SRC @@ -1985,7 +1987,8 @@ There is this handy minor mode I've built which is [[https://github.com/mssola/w (shell-command "make build")) ;; Then load the byte-compiled files. - (let ((list (directory-files writer-source t ".elc$"))) + (let ((list (directory-files writer-source t ".elc$")) + (load-prefer-newer t)) (while list (load-file (car list)) (setq list (cdr list)))) -- cgit v1.2.3