我在 Emacs 中有这么小的问题。我为 Emacs 绑定helm-do-grep
命令。这真的很有用。
我想在当前文件夹中搜索一些东西。我搜索了一些关于它们都在工作的代码,但我无法像我想要的那样修复它们。
如果你帮我修好它们,我会很高兴谢谢你。
(defvar my/book-notes-directory "~/Dropbox/books")
(defun my/helm-do-grep-book-notes ()
"Search my book notes."
(interactive)
(helm-do-grep-1 (list my/book-notes-directory)))
(defun my-dir-locals-dir ()
"Return the directory local variables directory.
Code taken from `hack-dir-local-variables'."
(let ((variables-file (dir-locals-find-file (or (buffer-file-name) default-directory)))
(dir-name nil))
(cond,
((stringp variables-file)
(setq dir-name (file-name-directory variables-file)))
((consp variables-file)
(setq dir-name (nth 0 variables-file))))
dir-name))