elisp

Emacs takes unbelievably long to start

早过忘川 提交于 2019-12-01 03:55:36
Yesterday, I :q 'd Vim to try Emacs for a while. I've started using Elisp (which is a hundred times better than VimScript), but even when I first installed it (via yum ), and had changed nothing, it took about 30 seconds to start, and still does (both GUI and -nw ). I checked the *Messages* buffer: Loading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el (source)...done Loading /usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el (source)...done The files seem to be specific to the RPM package I installed. I tried changing their names, yet there was no difference. It still

Getting Emacs fill-paragraph to play nice with javadoc-like comments

南楼画角 提交于 2019-12-01 03:10:35
I'm writing an Emacs major mode for an APL dialect I use at work. I've gotten basic font locking to work, and after setting comment-start and comment-start-skip, comment/uncomment region and fill paragraph also work. However, comment blocks often contain javadoc style comments and i would like fill-paragraph to avoid glueing together lines starting with such commands. If I have this (\ instead of javadoc @): # This is a comment that is long and should be wrapped. # \arg Description of argument # \ret Description of return value M-q gives me: # This is a comment that is long and # should be

How do I delete the newline from a process output?

浪尽此生 提交于 2019-12-01 03:08:47
I call git get the toplevel dir (according to Is there a way to get the git root directory in one command? ). (let ((tmpbuffer (get-buffer-create (make-temp-name "git")))) (call-process "git" nil tmpbuffer nil "rev-parse" "--show-toplevel") (with-current-buffer tmpbuffer (with-output-to-string (princ (buffer-string)) (kill-buffer)))) But there's a trailing newline in the string returned. I'm not sure how to get rid of it. I think you can do (replace-regexp-in-string "\n$" "" (shell-command-to-string "git rev-parse --show-toplevel")) If you only want to remove a newline at the very end of the

What does the double minus (--) convention in function names mean in Emacs Lisp

随声附和 提交于 2019-12-01 02:04:18
I've been reading through a number of Emacs Lisp packages and have come across the convention of some functions being declared with -- after the library prefix, e.g.: (defun eproject--combine-regexps (regexp-list) I'm wondering if this a convention for declaring "private" functions to the library but so far I haven't found anything in the Emacs Coding guidelines. Emacs doesn't have any support for namespaces, packages, libraries or modules. Emacs sources therefore use foo- as a prefix for a foo library, and in some cases foo-- is used for bindings that are supposed to be internal. There is

process.exit(0): output disappears?

一个人想着一个人 提交于 2019-12-01 01:10:30
Emacs lisp command calling node hello.js : (call-process "node" nil t nil "hello.js") Two variants of hello.js : hello_1.js : console.log('Hello world!'); Output: Hello world! 0 hello_2.js : console.log('Hello world!'); process.exit(5); Output (no output from log statement!): 5 What is the reason that process.exit(5) causes output to be suppressed? Notes: I experienced the problem in GNU Emacs 24.3.1 (i386-mingw-nt5.1.2600) of 2013-03-17 on MARVIN in combination with Node.js v0.10.18 , running on Windows XP/SP3/32 . I tried EShell to execute the node command line: no output process.exit()

For Emacs, how to store what view-lossage collects into an external file?

可紊 提交于 2019-12-01 01:07:53
For Emacs, how do I store what view-lossage collects into an external file? Ideally I'd like to store these keystroke data into an external log file incrementally and automatically, meaning it is done so by default when Emacs is started. In Emacs 24 at least (I can't check a prior version right now), the docstring for view-lossage states: Display last 300 input keystrokes. To record all your input on a file, use `open-dribble-file'. And C-h f open-dribble-file RET tells me: open-dribble-file is an interactive built-in function in `C source code'. (open-dribble-file FILE) Start writing all

How do I set buffer local variable from Eval: in .dir-local.el?

拈花ヽ惹草 提交于 2019-11-30 23:18:04
Why this works ((nil . ((compilation-directory . "/home/vava/code_directory/") (compilation-command . "rake")) )) and this doesn't? ((nil . ((Eval . (setq compilation-directory "/home/vava/code_directory")) (compilation-command . "rake")) )) What I'm doing wrong here? I have set enable-local-eval in .emacs. Emacs Lisp is case-sensitive: try lower-case "eval": ((nil . ((eval . (setq compilation-directory "/home/vava/code_directory")) (compilation-command . "rake")))) Also, the name of the file for directory-local variables is .dir-locals.el , not .dir-local.el as in the question headline.

Getting Emacs fill-paragraph to play nice with javadoc-like comments

自古美人都是妖i 提交于 2019-11-30 23:05:16
问题 I'm writing an Emacs major mode for an APL dialect I use at work. I've gotten basic font locking to work, and after setting comment-start and comment-start-skip, comment/uncomment region and fill paragraph also work. However, comment blocks often contain javadoc style comments and i would like fill-paragraph to avoid glueing together lines starting with such commands. If I have this (\ instead of javadoc @): # This is a comment that is long and should be wrapped. # \arg Description of

What does the double minus (--) convention in function names mean in Emacs Lisp

蓝咒 提交于 2019-11-30 22:20:03
问题 I've been reading through a number of Emacs Lisp packages and have come across the convention of some functions being declared with -- after the library prefix, e.g.: (defun eproject--combine-regexps (regexp-list) I'm wondering if this a convention for declaring "private" functions to the library but so far I haven't found anything in the Emacs Coding guidelines. 回答1: Emacs doesn't have any support for namespaces, packages, libraries or modules. Emacs sources therefore use foo- as a prefix

Emacs — calculating new window-start/end without redisplay

╄→гoц情女王★ 提交于 2019-11-30 21:38:23
Is it possible to calculate a new window-start/end without a redisplay occurring? If so, then an example would be greatly appreciated. If not, then what is the best way to approximate it? Example : We want to move to a new area of the buffer somewhere off screen, and place overlays when we get there. We might be using page-down or scroll-down or paragraph-down or end-of-buffer. When we get to that new point, we want to calculate the new window-start and the new window-end . However, we want to avoid a momentary naked looking buffer without any overlays. Ideally, the redisplay would occur once