Hot answers tagged

404

This feature is called Software Flow Control (XON/XOFF flow control) When one end of the data link (in this case the terminal emulator) can't receive any more data (because the buffer is full or nearing full or the user sends C-s) it will send an "XOFF" to tell the sending end of the data link to pause until the "XON" signal is received. What is ...


71

shell is the oldest of these 3 choices. It uses Emacs's comint-mode to run a subshell (e.g. bash). In this mode, you're using Emacs to edit a command line. The subprocess doesn't see any input until you press Enter. Emacs is acting like a dumb terminal. It does support color codes, but not things like moving the cursor around, so you can't run curses-...


32

The three possibilities that come to mind for me: An alias exists for emacs (which you've checked) A function exists for emacs The new emacs binary is not in your shell's PATH hashtable. You can check if you have a function emacs: bash-3.2$ declare -F | fgrep emacs declare -f emacs And remove it: unset -f emacs Your shell also has a PATH hashtable ...


32

Via the manual In the manual (which you can browse inside Emacs in Info: C-h i m Emacs RET): go to the chapter on files, then to the section on visiting (i.e. opening) files. Look for the word “large”: If you try to visit a file larger than large-file-warning-threshold (the default is 10000000, which is about 10 megabytes), Emacs asks you for confirmation ...


32

You can't do it that way. vi is vi and emacs is emacs. If you are not happy with the default editor, do git config --global core.editor path-to-emacs.exe-on-your-machine You can install emacs separately, it doesn't need to be part of your git bash.


30

At the end of my .bashrc script I have added: #so as not to be disturbed by Ctrl-S ctrl-Q in terminals: stty -ixon Edit: over time I have removed this line from my config, as I eventually find it handy to freeze the terminal output with Ctrl-S and resume it with Ctrl-Q. It is not useful everyday, but it's nice to have.


28

Incremental search has this feature, but the replace functions don't. Fortunately, incremental search does have a way to switch to replace mode once you've selected a search term. So: Press C-s to switch to incremental search mode Press C-w to yank the current word into the search buffer. You can keep pressing it to append multiple words, and you can also ...


25

This drove me mad.. until I fixed it. Now there's no scratch, messages, or completions buffers to screw with your flow. Enjoy! Place this in your .emacs: ;; Makes *scratch* empty. (setq initial-scratch-message "") ;; Removes *scratch* from buffer after the mode has been set. (defun remove-scratch-buffer () (if (get-buffer "*scratch*") (kill-...


22

No. There is emacs-nox on CentOS and Fedora. $ sudo yum -y install emacs-nox


21

According to Xahlee page: shell is the standard emacs interface to Operating System's command line interface. term (ansi-term is pretty much same to term today. They were different packages, but now both defined in term.el) is a terminal emulator. It behaves like a dedicated terminal app, such as {xterm, gnome-terminal, puTTY}. It is compatible to more ...


19

After changing the file mode, and before doing any edit, run M-x revert-buffer to reload the file. If the file is now writable, the buffer will no longer be read-only. Alternatively, type C-x C-q (read-only-mode). This makes the buffer no longer read-only. You can edit and even save, but you'll get a confirmation prompt asking whether you want to overwrite ...


19

Hit F10 to open the menu and use the arrow keys to navigate to “Options” → “Customize Emacs” → “All Settings Matching…”. Type mouse and Enter. If your Emacs version doesn't have a menu when running in a terminal then run M-x customize. (This means: press Alt+X, type customize and press Enter.) Navigate to the search box, type mouse and press Enter. Mouse ...


18

As mentioned in the comments, by @ALiX using Ctrl+C+ Ctrl+C (2 times) worked.


16

A good workaround is to pipe the output from less to your editor, e.g. after "echo foo | less" you can do: g|$vim - g will jump to the first line of the file/input, | will invoke the "pipe" action, $ is the mark ("the end"), followed by the command to pipe the range into (vim - in this case, where the "-" means to read the input from stdin).


16

To set: set -o vi Or: set -o emacs (setting one unsets the other. You can do set -o vi +o vi to unset both) To check: if [[ -o emacs ]]; then echo emacs mode elif [[ -o vi ]]; then echo vi mode else echo neither fi That syntax comes from ksh. The set -o vi is POSIX. set -o emacs is not (as Richard Stallman objected to the emacs mode being ...


15

The combination M-! allows you to launch shell commands. You could use it to launch a separate urxvt. M-! urxvt RET I just tried it with xterm (I don't have urxvt) and it did open in the same directory as the file in the buffer. If you want to define a shortcut add something similar in your init file: (global-set-key (kbd "C-c s") (kbd "M-! urxvt RET")) ...


15

The direct answer is probably that vi is part of the POSIX standard (as @jasonwryan also mentioned in a comment), as well as the Single UNIX Specification. As such, anything that calls itself POSIX-compliant probably includes something vi-like, and anything that wants to call itself UNIX has to, or you don't get certified. Not just vi, but the related line ...


13

Use the emacs library ansi-color.el: M-x load-library ansi-color M-: (ansi-color-apply-on-region (point-min) (point-max))


13

You can indent the region, to do this for the whole buffer: mark whole buffer with C-x h (or M-x mark-whole-buffer) run indent region with C-M-\ (or M-x indent-region)


12

There is actually no need for Tom 's custom my-disable-here-document function rebinding the keys. This feature can be enabled and disabled with sh-electric-here-document-mode: (add-hook 'sh-mode-hook (lambda () (sh-electric-here-document-mode -1))) (It can also be toggled for the active buffer via M-x sh-electric-here-document-mode.)


12

You can just define the linum size in your init config so it doesn't depend on default-face: (set-face-attribute 'linum nil :height 100) If you are not using linum-mode as a global default (ie such as a major-mode hook), evaluate the set-face-attribute command on load or else you will get an invalid face: linum error: (eval-after-load "linum" '(set-face-...


12

Yes, don't use which: On some systems, it's an external command implemented as a csh script, which may read a configuration that changes the PATH. There's a builtin for that. Two, even: type and command. The POSIX way: command -v emacs # machine-readable format type emacs # human-only format In bash, you can also use type -p emacs to see ...


12

Colours are provided by the font-lock minor mode. To disable colouring in your current buffer, toggle font-lock-mode off with this command: M-x font-lock-mode To disable font-lock-mode permanently, add to your init file (~/.emacs): (global-font-lock-mode 0) More info is available under Font-Lock in the Gnu Emacs Manual


11

What helped me solve this without editing my .emacs with absolute paths (which I was reluctant to do, as I share the file between different OSs) was installing ispell via brew brew install ispell --with-lang-en as explained in this answer (and my comment).


11

You can put a function like follows into your .emacs and bind it to any key you like. (defun insert-file-name () "Insert the full path file name into the current buffer." (interactive) (insert (buffer-file-name (window-buffer (minibuffer-selected-window))))) Also see this question, it seems to be similar.


11

In the bottom left of your window, you have a cryptic string like 1:@**-. Hover over the colon, it'll tell you something like "line endings: unix, mouse-1 to toggle". (Incidentally, the 1 left to it is the coding system, iso-8859-1 in my case)


11

The command to do that from inside emacs is M-x server-mode The first time you run it, it'll restart the server it's running. The second time, it'll stop the server. To make sure that you're stopping the server, pass a non-positive prefix argument: M-0 M-x server-mode RET


11

Perhaps your confusion arises from not having used an actual terminal. Back when serious computers were the size of several upright refrigerators, a terminal communicated with a central computer over a serial cable using characters and characters only. The characters were part of some standardized character set, e.g. ASCII or EBCDIC, but typically ASCII. ...


11

add (xterm-mouse-mode 1) to your init.el file


10

To change the read-only status of a buffer, use C-xC-q (toggle read-only-mode). To change file permissions, you can run dired on the file's directory (C-xd), search for the file by C-s and use M to change its mode.


Only top voted, non community-wiki answers of a minimum length are eligible