1
2
3
4
5
6
7
8
9
10
11
12
(defun search-notes (search)
  "Search my notes."
  (interactive
   (list (read-regexp "Search")))
  (let ((b "*grep*")
        (dir "~/notes"))
    (get-buffer-create b)
    (with-current-buffer b
      (cd dir)
      (grep (format "search_notes.py \"%s\"" search)))))

(global-set-key (kbd "C-c n") 'search-notes)