How do I do closures in Emacs Lisp?
Found another solution with lexical-let (defun foo (n) (lexical-let ((n n)) #'(lambda() n))) (funcall (foo 10)) ;; => 10
Found another solution with lexical-let (defun foo (n) (lexical-let ((n n)) #'(lambda() n))) (funcall (foo 10)) ;; => 10
There’s a built-in profiler called ELP. You can try something like M-x elp-instrument-package, enter “vc”, and then try finding a file. Afterwards, M-x elp-results will show you a profile report. (Note that if the time is instead being spent in non-vc-related functions, this technique will not show it, but you can instrument further packages if … Read more
Another easy option is to run highlight-lines-matching-regexp on the expression .\{81\}. Every line with 81 characters or more will be highlighted with the color of your choice.
I found this solution on the EmacsWiki: The problem is the ownership of the directory ~/.emacs.d/server when you also have “Administrators” rights on your account. Create the directory ~/.emacs.d/server and set the owner of this directory to your login name and the problem is gone. As I have a “Dutch” version of Windows 7 I … Read more
This should work: (add-to-list ‘auto-mode-alist ‘(“\\.rr” . R-mode))
If you actually want batch processing of stdin and sending the result to stdout, you can use the –script command line option to Emacs, which will enable you to write code that reads from stdin and writes to stdout and stderr. Here is an example program which is like cat, except that it reverses each … Read more
You can set up your emacs-server to use a tcp connection (not just a local socket), and then on the remote side, tell emacsclient to connect to that tcp connection: In your .emacs (setq server-use-tcp t) (setq server-host “name_of_local_machine”) (server-start) And then on the remote side: emacsclient -f ~/.emacs.d/server/server /`hostname`:/path/to/local/file The above call to emacsclient … Read more
Don’t disable the warning. It’s there for a good reason: ~/.emacs.d shouldn’t be in your load-path. This is because Emacs writes files to this directory, and therefore it’s possible (there are existing cases) for those files to conflict with the names of elisp libraries. If you have this directory in your load path, and you … Read more
Try: (require ‘misc) Then use M-x forward-to-word and see if it does what you want. You can then rebind M-f, etc. To make the _ not a word separator (i.e. make it a word constituent) for C & C++ mode, you would do this: (modify-syntax-entry ?_ “w” c-mode-syntax-table) (modify-syntax-entry ?_ “w” c++-mode-syntax-table) For more information … Read more
If you don’t want to be annoyed by window stealing and resizing, put the following lines in your .emacs for a definitive solution that works even with libraries like gud that tries to open a new frame when they can’t steal your windows : (see this answer for info on the following advice) (defadvice pop-to-buffer … Read more