elisp

Setting flycheck-clang-include-path in .dir-locals using projectile

孤者浪人 提交于 2021-01-27 19:47:38
问题 Trying to set flycheck-clang-include-path without the need to include the full path of the project include directories using projectile, but I get errors... So this works: ((nil . ( (company-clang-arguments . ( "/home/user/Downloads/project/headers" "/home/user/Downloads/project/source/mon" )) (flycheck-clang-include-path . ( "/home/user/Downloads/project/headers" "/home/user/Downloads/project/source/mon" )) ))) But this does not: ((nil . ( (company-clang-arguments . ( (concat "-I"

Is there an apply-command-to-each-line-in-region in emacs?

最后都变了- 提交于 2020-12-29 12:25:54
问题 I have a bunch of links saved in an orgmode file, say... http://www.stackoverflow.com http://www.google.com http://www.github.com I can open each one by having the cursor on the link and doing C-c C-o , and it conveniently pops up my default browser and opens that link in a tab. Now suppose I have like 20 of these links. Is there a convenient way to apply a function like this to each line within a selected region, without recording an explicit macro? I'd imagine it looking something like...

Can Emacs Lisp assign a lambda form to a variable like Scheme?

不想你离开。 提交于 2020-04-14 07:23:11
问题 While investigating Emacs Lisp's symbol cells, I found out that for an example function like (defun a (&rest x) x) I can call (symbol-function 'a) , which returns (lambda (&rest x) x) . I can then use it if I want > ((lambda (&rest x) x) 1 2 3 4 5) (1 2 3 4 5) which has the same functionality as the original function above. Now, this reminds me of Scheme where a lambda expression is the body of the function and is assigned to a variable name with Scheme's all-purpose define . For example

In elisp, how do I apply backquote to lists read from files

人走茶凉 提交于 2020-02-05 16:15:47
问题 I would like to take a large list (think faces in an emacs theme) and break it up into smaller lists in separate files. The problem I have is applying (backquote) to the lists once I've read them in. Here is the code I have been using to experiment with solutions: (defvar x 23) (defun read-from-file (file) (with-temp-buffer (insert-file-contents file) (read (current-buffer)))) ;;(defun apply-macro (macro arg-list) ;; (eval ;; `(,macro ,@(loop for arg in arg-list ;; collect `(quote ,arg)))))

In elisp, how do I apply backquote to lists read from files

落爺英雄遲暮 提交于 2020-02-05 16:13:33
问题 I would like to take a large list (think faces in an emacs theme) and break it up into smaller lists in separate files. The problem I have is applying (backquote) to the lists once I've read them in. Here is the code I have been using to experiment with solutions: (defvar x 23) (defun read-from-file (file) (with-temp-buffer (insert-file-contents file) (read (current-buffer)))) ;;(defun apply-macro (macro arg-list) ;; (eval ;; `(,macro ,@(loop for arg in arg-list ;; collect `(quote ,arg)))))

Mirroring location in file in two opened buffers side by side

末鹿安然 提交于 2020-02-02 11:04:19
问题 I am trying to find a package/function in emacs where it would have both files opened side by side to be at same line location mirroring the movement of whichever buffer is moving. Meaning, for two buffers opened side by side, moving in one of the buffers (page up/down, moving cursor.,..etc) would have the same movements in the other buffer. More specifically, when opening a buffer (and while activating this mode) the opened buffer should already be at the line position of the one that is

Mirroring location in file in two opened buffers side by side

爱⌒轻易说出口 提交于 2020-02-02 11:03:33
问题 I am trying to find a package/function in emacs where it would have both files opened side by side to be at same line location mirroring the movement of whichever buffer is moving. Meaning, for two buffers opened side by side, moving in one of the buffers (page up/down, moving cursor.,..etc) would have the same movements in the other buffer. More specifically, when opening a buffer (and while activating this mode) the opened buffer should already be at the line position of the one that is

Open dired and select the file associated with the previous buffer?

送分小仙女□ 提交于 2020-02-02 01:53:52
问题 Let's say I am editing blah.txt with Emacs and I decide to open dired to rename the file blah.txt. When I press C-x d RET (or C-x C-f RET ), a dired buffer will show up to display the content of the directory containing blah.txt , but the cursor will not be on blah.txt . So I need to search my file first ( C-s blah.txt ) to place my cursor on it and then I can rename it ( R ). How do I automate or remove the step C-s blah.txt ? 回答1: dired-jump is exactly what you want. (autoload 'dired-jump