Emacs
Read from STDIN
$ emacs --insert <(echo 'hello world')
$ emacs --insert <(cat ~/.bash_profile)
$ emacs --insert <(bin/rails routes --controller=articles)
#!/bin/bash -e
#
# Example usage:
# curl http://example.net/mbox | with-temp-file mutt -f
# curl http://example.net/ | with-temp-file browser
# curl http://example.net/ | with-temp-file emacs
#
test $# -gt 0 ||
exit 1
f="`mktemp -t with-temp-file.XXXXXX`"
trap 'rm -f "$f"' EXIT
cat >"$f"
# less(1)-style tty grabber.
exec </dev/tty || true
# subshell to avoid "w-t-f unset f" not reaping
("$@" "$f")
twb user says:
I was doing it once for the purposes of making alias ed="emacs -batch -f ed-mode"
Line wrapping
In some modes, we don’t want to hard-wrap lines at a certain length, but instead let the lines run as long the person writing the code wants them to be. One such case is for AsciiDoc “ventilated prose” or “one sentence per line” style.
For those cases, M+x auto-fill-mode RET.
Also try enabling and disabling visual-line-mode, which changes the way lines are displayed.
When enabled, my experience has been that it makes lines with links/URLs format less pleasant and readable, so I mostly keep visual-line-mode disabled.
Also see:
Canvas
-
divyaranjan@mathstodon.xyz/117104661248563465" class="bare">https://mastodon.social/@divyaranjan@mathstodon.xyz/117104661248563465
-
https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=d5f515e4a3350079330c2e80f3681d140d649c88