Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary tmp files? #8

Open
jacksonrayhamilton opened this issue Jul 4, 2014 · 0 comments
Open

Unnecessary tmp files? #8

jacksonrayhamilton opened this issue Jul 4, 2014 · 0 comments

Comments

@jacksonrayhamilton
Copy link
Contributor

Your implementation saves the output of js-beautify to a tmp file. Can you not simply replace the input region with the shell command's output?

(shell-command-on-region START END COMMAND &optional OUTPUT-BUFFER REPLACE
ERROR-BUFFER DISPLAY-ERROR-BUFFER)
...
Optional fourth arg OUTPUT-BUFFER specifies where to put the
command's output. If the value is a buffer or buffer name, put
the output there. Any other value, including nil, means to
insert the output in the current buffer. In either case, the
output is inserted after point (leaving mark after it).

Optional fifth arg REPLACE, if non-nil, means to insert the
output in place of text from START to END, putting point and mark
around it.

(shell-command-on-region (point-min) (point-max) "js-beautify -f -" nil t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant