From b7dffcb501d30297e2fa8184b587da18f458ca66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Simen=20Heggest=C3=B8yl?= Date: Wed, 27 May 2020 17:17:15 +0200 Subject: [PATCH] Simplify the previous commit * lisp/progmodes/project.el (project--read-project-list): Simplify the previous commit by utilizing the optional OMIT-NULLS argument to 'split-string'. --- lisp/progmodes/project.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index be0b2e4d5f5..a3e81d4d3aa 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -732,13 +732,12 @@ loop using the command \\[fileloop-continue]." (project--ensure-file-exists filename) (with-temp-buffer (insert-file-contents filename) - (let ((dirs (split-string (string-trim (buffer-string)) "\n")) + (let ((dirs (split-string (buffer-string) "\n" t)) (project-list '())) (dolist (dir dirs) - (unless (string-empty-p dir) - (cl-pushnew (file-name-as-directory dir) - project-list - :test #'equal))) + (cl-pushnew (file-name-as-directory dir) + project-list + :test #'equal)) (setq project--list (reverse project-list)))))) (defun project--ensure-read-project-list () -- 2.39.5