elisp

I can't find this: How do I use 4 SPACES instead of a TAB in EMACS?

别来无恙 提交于 2019-11-30 21:37:09
I am making the jump to EMACS, and I can't find what I need to do in my .emacs file to get php-mode AND all other modes to insert 4 spaces instead of a TAB. Help? UPDATE: When I hit tab I still get 8 spaces in a plain file with the given answers. In php-mode I still get 2 spaces. Hitting tab in php mode does nothing, tab in regular EMACS adds 8 spaces. UPDATE2: This is what I have in my .emacs : (require 'color-theme) (color-theme-calm-forest) (setq-default indent-tabs-mode nil) (setq-default tab-width 4) (setq c-basic-offset 4) Still in regular files 8 spaces, and in PHP files the tabbing

Emacs 23, OS X, multi-tty and emacsclient

让人想犯罪 __ 提交于 2019-11-30 21:24:26
How can I get emacs 23 working nicely in multi-tty mode on OS X? I've added (server-start) to my .emacs, and have discovered that running /Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n ~/myfile.txt will open it in my emacs.app, but it doesn't bring emacs to the front. So, how can I get emacs.app to come to the front when I run emacsclient? (I've considered writing a function that puts the current frame to the front every time a file is opened, or maybe writing an Applescript to do a similar job that could be called at the same time as emacsclient) Is the emacsclient within emacs.app

Help writing emacs lisp for emacs etags search

天涯浪子 提交于 2019-11-30 21:23:17
I'm looking for some help developing what I think should be an easy program. I want something similar to Emacs tags-search command, but I want to collect all search results into a buffer. (I want to see all results of M-,) I'm thinking this python style pseudo code should work, but I have no idea how to do this in emacs lisp? Any help would be greatly appreciated. def myTagsGrep(searchValue): for aFile in the tag list: result = grep aFile seachValue if len(result) > 0: print aFile # to the buffer print result # to the buffer I would like to be able to browse through the buffer with the same

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

江枫思渺然 提交于 2019-11-30 20:54:18
问题 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. 回答1: 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

process.exit(0): output disappears?

若如初见. 提交于 2019-11-30 20:05:05
问题 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 ,

Make emacs next-buffer skip *Messages* buffer

白昼怎懂夜的黑 提交于 2019-11-30 19:06:24
I'd like to make a simple change to Emacs so that the next-buffer and previous-buffer commands (which I have bound to C-x <RIGHT> and C-x <LEFT> will skip over the *Messages* buffer. I'm using Emacs 24 and the Emacs Starter Kit . I've read the following related questions and answers, but they are not what I want: Buffer cycling in Emacs: avoiding scratch and Messages buffer Emacs disable *Messages* buffer Emacs Lisp Buffer out of focus function? Here are some of the reasons why they don't work: I'd like to keep it as simple as possible. Fewer configuration changes are better. I don't want to

Word wrap for Emacs print buffer to PDF

泄露秘密 提交于 2019-11-30 18:25:19
问题 I use this function for printing a buffer's content to PDF (from my .emacs file:) (defun print-to-pdf () (interactive) (ps-spool-buffer-with-faces) (switch-to-buffer "*PostScript*") (write-file "/tmp/tmp.ps") (kill-buffer "tmp.ps") (setq cmd (concat "ps2pdf14 /tmp/tmp.ps /home/user/" (buffer-name) ".pdf")) (shell-command cmd) (shell-command "rm /tmp/tmp.ps") (message (concat "Saved to: /home/user/" (buffer-name) ".pdf")) ) I cannot, however, find a way to enable or apply the visual-line minor

Emacs — How to replace nth element of a list with a let-bound variable

强颜欢笑 提交于 2019-11-30 15:44:22
I have not found any examples of how to replace the nth element of a list without first adding every element ( one-by-one ) with the function add-to-ordered-list -- e.g., (add-to-ordered-list 'the-list 'a 1) . That requires subsequently deleting the element -- e.g., (delq a the-list) . The third step in the process is to add the new element -- e.g., (add-to-ordered-list 'the-list "HELLO-WORLD!" 1) . As the following function named variable-list-example uses 26 elements, I'm looking for a better way than first adding all 26 elements ( one-by-one ) to essentially assign each element a position

Make Emacs less aggressive about indentation

独自空忆成欢 提交于 2019-11-30 15:26:34
Emacs reindents the current line whenever I type certain things, like ";" or "//". This is pretty annoying, since there are a whole lot of places where it isn't smart enough to indent correctly. How do I disable this feature? I still want to be able to indent the line with TAB, but I don't want any source code I type to cause it to reindent. (I'm using Dylan Moonfire's C# mode, but this probably applies to any cc-mode.) Try running c-toggle-electric-state to turn off the electric action of these characters. You can do this as part of a c-mode-common-hook, or toggle the state manually by

Inconsistent M-x align-regexp vs. C-u M-x align-regexp behaviour

独自空忆成欢 提交于 2019-11-30 15:06:36
I've tried to write some new align rules for emacs and found this strange and inconsistent behaviour. Current buffer contents: "some thing" like => this hello => world and => again After typing M-x align-regexp RET [[:lower:]]+\(\s-+\)=> RET result looks as desired: "some thing" like => this hello => world and => again But after C-u M-x align-regexp RET [[:lower:]]+\(\s-+\)=> RET 1 RET 1 RET y RET I get this instead: "some thing" like => this hello => world and => again The same (wrong) thing happens if I put this into align-rules-list . How to fix this? I want to get the results like first.