New util function

This commit is contained in:
Jeremy Dormitzer 2019-07-19 10:39:48 -04:00
parent 6448d372d1
commit 175d2d547e

View File

@ -221,6 +221,15 @@ The same but for seconds:
(message (format-time-string "%F %r" seconds)))
#+END_SRC
Checking if a buffer contains a string:
#+BEGIN_SRC emacs-lisp
(defun buffer-contains-substring (string)
(save-excursion
(save-match-data
(goto-char (point-min))
(search-forward string nil t))))
#+END_SRC
** Persisting variables between session
The idea behind this is pretty simple - variables get persisted in ~/.emacs.d/<persisted-vars-file> as a plist of (variable-name variable-value).