Hot answers tagged

356

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 ...


61

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-...


31

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.


29

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 ...


28

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 ...


25

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

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


22

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-...


21

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


20

Nowadays, XEmacs is essentially dead. The last major release was XEmacs 21 in 1999; the last minor release to be promoted stable was XEmacs 21.4 in 2003, and the last maintenance release was XEmacs 21.4.22 in 2009. I don't think there is any major XEmacs feature that isn't in GNU Emacs 23. Historically, XEmacs was for a long time (from the Lucid days in the ...


19

I'll put my $0.02 worth in, as I spent quite a few years using emacs and XEmacs and then moved over to vim. To be fair, I had actually used vi quite a bit around 1990-1992 so I was familiar with its user interface. Emacs Emacs has been described as a lisp system that just happened to be used to write an editor, and there is a grain of truth in this. You ...


19

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 ...


18

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 ...


15

The variable you're looking for is ispell-program-name. Stuff this somewhere in your .emacs: (setq ispell-program-name "/path/to/ispell") Or use M-x set-variable, etc. References: From the sources to ispell.el (defcustom ispell-program-name (or (locate-file "aspell" exec-path exec-suffixes 'file-executable-p) (locate-file "ispell" exec-path ...


15

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 ...


14

I think the piece you're missing is the interactive form. It's how Emacs distinguishes between a function designed to be called by other functions, and a function designed to be called directly by the user. See the Emacs Lisp Intro node Now if you read the definition of ansi-color-apply-on-region, you'll see that it's not designed for interactive use. "...


14

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")) ...


13

First, make sure your TERM is correct at each location: xterm-something (e.g. xterm-256color) inside your local shell running in your iTerm2 window xterm-something inside your shell after SSHing to the Linux system This should be the same as whatever you are using locally in iTerm2, since SSH should be passing it along to the remote side (and, importantly, ...


13

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 ...


13

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


13

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 ...


12

You have to use export EDITOR="emacs -nw" with the quotes, and it should work as expected.


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

import XMonad main = xmonad defaultConfig { modMask = mod4Mask -- Use Super instead of Alt -- more changes } And then press mod+q. Thats all. copied shamelessly from


12

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


11

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).


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

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 ...


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