From 4867305a823e50af918d6e16c7d8b1114a526214 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 16 May 2017 08:48:33 -0400 Subject: [PATCH] Better fix for compiler warning Hi, In mardown-mode you installed commit da6f82a260fd647031ddbe5f46fc2f15aa9fd33c Author: Jason Blevins Date: Mon May 15 21:41:47 2017 -0400 Fix byte compiler warning but I suggest you fix it by simply swapping the defalias and the if instead. This way the byte-compiler doesn't need to collect and compare the set of definitions present in each branch of the `if` (which it doesn't bother to do), and instead it immediately sees that `markdown-directory-files-recursively` is always defined. Here's a corresponding patch on top of the current head, Stefan --- markdown-mode.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/markdown-mode.el b/markdown-mode.el index 353ccbe..bb01fcb 100644 --- a/markdown-mode.el +++ b/markdown-mode.el @@ -2419,9 +2419,11 @@ backwards compatibility." (= lastc ?\\))))) ;; Provide a function to find files recursively Emacs 24 -;; In Emacs 25, this can be replaced by directory-files-recursively. -(defun markdown-directory-files-recursively (dir regexp) - "Return list of all files under DIR that have file names matching REGEXP. +(defalias 'markdown-directory-files-recursively + (if (fboundp 'directory-files-recursively) + 'directory-files-recursively + (lambda (dir regexp) + "Return list of all files under DIR that have file names matching REGEXP. This function works recursively. Files are returned in \"depth first\" order, and files from each directory are sorted in alphabetical order. Each file name appears in the returned list in its absolute form. @@ -2443,7 +2445,7 @@ here for backwards compatibility." full-file regexp)))) (when (string-match regexp file) (push (expand-file-name file dir) files))))) - (nconc result (nreverse files)))) + (nconc result (nreverse files)))))) ;;; Markdown Parsing Functions ================================================ -- 2.11.4.GIT