elisp

Lisp Community - Quality tutorials/resources

二次信任 提交于 2019-12-03 03:53:13
问题 As many other people interested in learning Lisp, I feel the resources available are not the best for beginners and eventually prevent many new people from learning it. Do you feel it could be created some sort of community, with a website, forum or something, that provides good (as in quality) resources/tutorials, for Lisp users, possibly translated to several idioms? That way beginners that don't have the necessary skills for writing tutorials could help translating them. Is it a bad idea

Emacs mode for Go? [closed]

白昼怎懂夜的黑 提交于 2019-12-03 03:23:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Is there a suitable Emacs mode for Go? C mode doesn't work without semicolons. The best I have found is the JavaScript mode by Karl Landstrom, since JavaScript also doesn't require semicolons. 回答1: Try misc/emacs/go-mode.el (web link) in the Go distribution. If you are using Emacs 24 and marmalade repo, use M-x

Emacs Lisp Function Guide?

笑着哭i 提交于 2019-12-03 03:14:04
问题 I have been using Emacs for more than three years now but it still takes me days to write even small functions in Lisp. I've looked through GNU Emacs Lisp Reference Manual but it's huge and structured completely opposite from JavaDoc, not from functions to descriptions but the other way around. What will make my life much easier is some sort of small JavaDoc like document with most commonly used Emacs internal functions and they quick description. (point) - returns current position in buffer

Generate Org-mode objects programmatically

佐手、 提交于 2019-12-03 02:55:54
I want to generate strings containing Org-mode text without actually hard-coding the syntax. For example i want to run a function such as (org-generate (org-generate-heading "heading" (org-generate-plain-list '("foo" "bar" "baz"))) and it will return: * heading - foo - bar - baz In other words, i want to create Org-mode documents of arbitrary complexity without micromanaging syntactic features like asterisks and indentation, only via calling functions with parameters, that return some Org objects. Is it possible to do that? Maybe via org-element ? lawlist INITIAL (March 14, 2014): First rough

Setup a personal wiki in Emacs Org-mode

▼魔方 西西 提交于 2019-12-03 02:28:17
I would like to setup a personal wiki in org-mode. So far, I have tried this two ways. My first attempt was using a single "Scientific Notebook.org" file. In this went all my notes - each with its own headline, date and tags (same format as a blog post). I then turned on org-velocity to quickly navigate the file. But this created two problems: first, I use a lot of math in my notes (LaTeX previews are one of the reasons I want to us org). But these take sooooo long to load, I can't images trying to open a file with several thousand entries (all filled with math!!) The other problem I have is

emacs lisp call function with prefix argument programmatically

断了今生、忘了曾经 提交于 2019-12-03 02:03:46
I want to call a function from some elisp code as if I had called it interactively with a prefix argument. Specifically, I want to call grep with a prefix. The closest I've gotten to making it work is using execute-extended-command , but that still requires that I type in the command I want to call with a prefix... ;; calls command with a prefix, but I have to type the command to be called... (global-set-key (kbd "C-c m g") (lambda () (interactive) (execute-extended-command t))) The documentation says that execute-extended-command uses command-execute to execute the command read from the

How can you write multiple statements in elisp 'if' statement?

▼魔方 西西 提交于 2019-12-03 01:47:18
问题 In elisp, there is an 'if' case where I would like to perform many different things: (if condition (do-something) (do-something-else) ...) However, (do-something-else) is executed in the else-case only. How can you specify a block of instructions to execute? For example: (if condition (begin (do-something) (do-something-else) ...)) 回答1: Use progn : (if condition (progn (do-something) (do-something-else))) 回答2: If there's no else required, it might be more readable to use: (when condition (do

How do I byte-compile everything in my .emacs.d directory?

China☆狼群 提交于 2019-12-03 01:29:04
问题 I have decided to check out Emacs, and I liked it very much. Now, I'm using the Emacs Starter Kit, which sort of provides better defaults and some nice customizations to default install of Emacs. I have customized it a little, added some stuff like yasnippet, color-themes, unbound, and other stuff. I've set up a github repository where I keep all of the customizations so I can access them from multiple places or in case something goes bad and I lose my .emacs.d directory. All of this is very

Grab current line in buffer as a string in elisp

て烟熏妆下的殇ゞ 提交于 2019-12-03 01:27:25
How can i collect the buffer's current line as a string value in elisp? i can do this, (let (p1 p2 myLine) (setq p1 (line-beginning-position) ) (setq p2 (line-end-position) ) (setq myLine (buffer-substring-no-properties p1 p2)) ) but is there anyway i can do it in one line as, (with-current-buffer get-current-line) Use thing-at-point : (thing-at-point 'line t) but note that this also returns any newline at the end of the line. 来源: https://stackoverflow.com/questions/27995488/grab-current-line-in-buffer-as-a-string-in-elisp

Getting a list of running Emacs timers

僤鯓⒐⒋嵵緔 提交于 2019-12-03 01:24:10
I've created a timer and stored a reference to it in Emacs with (setq my-timer-store (run-at-time "1 min" 900 'my-func)) I usually execute this elisp in the morning and then stop it from running overnight by executing (cancel-timer my-timer-store) Unfortunately I started the timer twice (without cancelling it in between) so I no longer have a reference to the first one I started and therefore I can't cancel it. Is there a way of listing all the running timers so I can clean up the one I left running. The timers seem to be stored in timer-list and timer-idle-list . 来源: https://stackoverflow.com