elisp

Setting byte-compile-dest-file-function

烈酒焚心 提交于 2019-12-02 07:43:35
I want to set the destination directory for emacs lisp byte compilation using relative path such as ../foo . I figured out I should use byte-compile-dest-file-function , but do not know how to set it. How can I set it? To set the byte-compile-dest-function variable, you can use either customize-variable interactively, or setq in your init file. Since you'll have to write a function doing the job either way, I would recommand the latter, so that everything is in the same place in your init file. For example: (defun my-dest-function (filename) (concat (file-name-directory filename) "../" (file

How set colors for a specific mode?

给你一囗甜甜゛ 提交于 2019-12-02 06:42:27
问题 I'm trying Emacs. I would like to set colors for Eshell. I tried that first with set-foreground-color. But it affects my other modes too. (add-hook 'eshell-mode-hook (lambda ( default ((t (:foreground "#BD8700")))))) But that's not working either. Or it's affecting the colors on other modes/ scratch too. Have anyone a suggestion? This is not a duplicate question, because the other answers change the colors of other buffers as well. 回答1: Here is a link to the documentation regarding remapping

Emacs: Open a specific Info section

此生再无相见时 提交于 2019-12-02 06:34:24
问题 When i do describe-function info , documentation says: Called from a program, FILE-OR-NODE may specify an Info node of the form "(FILENAME)NODENAME". I used this syntax to open specific sections in Emacs manual like eval-expression (info "(emacs)mark") . But now i have three questions: How to find out filename of a certain info file? (example: "elisp" for Emacs Lisp Intro) How to find out the section name? (example: "mark" for "11 The Mark and the Region") Is it possible to list info files

How to match / parse the notes at the end of a task in org-mode

喜夏-厌秋 提交于 2019-12-02 06:19:12
问题 I'm looking for a way to match what I call the "notes", which is the last line (or set of lines) of an org task that says: " These are the notes of the task. " I have composed a really long regexp that may do the job, but I am hoping that org-mode already provides something better: "^\\(\\*\\*\\)\\(?: +\\(Active\\|Next Action\\|Hold\\|Reference\\|Delegated\\|Postponed\\|Waiting\\|Someday\\|Planning\\|Canceled\\|None\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@

How can I map an unknown list of args to start-process in elisp?

大城市里の小女人 提交于 2019-12-02 05:39:16
问题 I'm finally trying to learn elisp but haven't wrapped my head around how to map an unknown list of arguments to variables dynamically. Here's a working function that passes up to three arguments to start-process. But I would like to pass an infinite number of args to the function. (defun create-drush-buffer (command &rest a) (if (locate-dominating-file default-directory "includes/bootstrap.inc") (progn (setq opt1 (car a)) (setq opt2 (cadr a)) (setq opt3 (caddr a)) (setq allopt (concat opt1 "

How set colors for a specific mode?

瘦欲@ 提交于 2019-12-02 05:34:52
I'm trying Emacs. I would like to set colors for Eshell. I tried that first with set-foreground-color. But it affects my other modes too. (add-hook 'eshell-mode-hook (lambda ( default ((t (:foreground "#BD8700")))))) But that's not working either. Or it's affecting the colors on other modes/ scratch too. Have anyone a suggestion? This is not a duplicate question, because the other answers change the colors of other buffers as well. Here is a link to the documentation regarding remapping faces: http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html (defun my-eshell-mode

dired-read-file-name: pop-up dired mode to read-file-name

我们两清 提交于 2019-12-02 05:18:57
Could anyone please give me a hand to briefly pop-up a dired buffer for the purposes of read-file-name : (defun dired-insert-file () (interactive) (setq filename (dired-read-file-name "~/Desktop")) (kill-buffer dired) (get-buffer-create "*foo*") (set-buffer "*foo*") (insert-file filename)) EDIT : Revised example: (require 'dired) (defvar open-with-variable nil) (defvar save-as-variable nil) (defvar save-as-buffer-filename nil) (defun dired-read-file-name (&optional directory) (let* ( output-filename (working-buffer (buffer-name))) (if directory (dired directory) (dired nil)) (if save-as-buffer

Elisp interactive function name

北城余情 提交于 2019-12-02 05:10:50
I'm trying to use the interactive function name feature. On emacs lisp manual it says: ‘a’ A function name (i.e., a symbol satisfying fboundp). Existing, Completion, Prompt. So I tried it with a small test code: (defun testfun1 () (message "hello, world!")) (defun test (abcd) (interactive "aTheme name: ") (abcd)) Emacs gives an error saying, test: Symbol's function definition is void: abcd I tried to test abcd with fboundp, it returns t. So I'm quite confused about how to use the 'a' option in interactive. Any body can give some hints? seh Your function test receives its argument abcd as a

multi-term: Understanding keyboard bindings

∥☆過路亽.° 提交于 2019-12-02 03:53:26
I am a bit confused by the difference between these two lists in multi-term (by the way where is the official repository hosted?) term-bind-key-alist term-unbind-key-list In my head, there should be two things: The keystrokes that we want Emacs to capture itself and to interpret in a specific way (by binding them to commands) The strokes that Emacs sends directly to the shell ("as is"). How exactly do term-unbind-key-list and term-bind-key-alist define these lists and bindings? Also, does multi-term support line mode and character mode ? If so, how does the mode in which we are alter the way

How can I map an unknown list of args to start-process in elisp?

可紊 提交于 2019-12-02 01:28:21
I'm finally trying to learn elisp but haven't wrapped my head around how to map an unknown list of arguments to variables dynamically. Here's a working function that passes up to three arguments to start-process. But I would like to pass an infinite number of args to the function. (defun create-drush-buffer (command &rest a) (if (locate-dominating-file default-directory "includes/bootstrap.inc") (progn (setq opt1 (car a)) (setq opt2 (cadr a)) (setq opt3 (caddr a)) (setq allopt (concat opt1 " " opt2 " " opt3)) (setq b-name (concat "*drush " command " " allopt "*")) (if (buffer-live-p b-name)