From e91a08594e114e7f775972b1e9ee07a8d46d773b Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sun, 29 Jul 2018 19:37:35 +0200 Subject: [PATCH] Move nil-or-list-of-strings-p to the Org config --- configuration.org | 12 ++++++++++++ init.el | 1 - lisp/utils.el | 14 -------------- 3 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 lisp/utils.el diff --git a/configuration.org b/configuration.org index 8228614..39a56c0 100644 --- a/configuration.org +++ b/configuration.org @@ -51,6 +51,18 @@ I set it up early so I can use it in ~use-package~ calls immediately. * Custom commands and functions +** Utility functions + +*** Check if something is ~nil~ or a list of strings + +#+BEGIN_SRC emacs-lisp +(defun nil-or-list-of-strings-p (var) + "Return t if VAR is either nil or a list holding only strings." + (or (null var) + (not (null (delq nil + (mapcar (lambda (x) (and (stringp x) x)) var)))))) +#+END_SRC + ** Misc text manipulation functions *** Delete the current line diff --git a/init.el b/init.el index d504a10..11df293 100644 --- a/init.el +++ b/init.el @@ -31,7 +31,6 @@ (load "zim") (load "window-manip") (load "xdg-paths") -(load "utils") (defun termux-p () "Check if Emacs is running under Termux." diff --git a/lisp/utils.el b/lisp/utils.el deleted file mode 100644 index fbf804d..0000000 --- a/lisp/utils.el +++ /dev/null @@ -1,14 +0,0 @@ -;;; utils --- Summary - -;;; Commentary: - -;;; Code: - -(defun nil-or-list-of-strings-p (var) - "Return t if VAR is either nil or a list holding only strings." - (or (null var) - (not (null (delq nil - (mapcar (lambda (x) (and (stringp x) x)) var)))))) - -(provide 'utils) -;;; utils.el ends here