Move nil-or-list-of-strings-p to the Org config
This commit is contained in:
parent
7b4a464f02
commit
e91a08594e
@ -51,6 +51,18 @@ I set it up early so I can use it in ~use-package~ calls immediately.
|
|||||||
|
|
||||||
* Custom commands and functions
|
* 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
|
** Misc text manipulation functions
|
||||||
|
|
||||||
*** Delete the current line
|
*** Delete the current line
|
||||||
|
1
init.el
1
init.el
@ -31,7 +31,6 @@
|
|||||||
(load "zim")
|
(load "zim")
|
||||||
(load "window-manip")
|
(load "window-manip")
|
||||||
(load "xdg-paths")
|
(load "xdg-paths")
|
||||||
(load "utils")
|
|
||||||
|
|
||||||
(defun termux-p ()
|
(defun termux-p ()
|
||||||
"Check if Emacs is running under Termux."
|
"Check if Emacs is running under Termux."
|
||||||
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user