From 175d2d547e78959962236a1593f3520bc5c709de Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 19 Jul 2019 10:39:48 -0400 Subject: [PATCH] New util function --- emacs/init.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index 59010d3..67b1601 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -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/ as a plist of (variable-name variable-value).