Every Emacs command has a name that you can use to run it. Forconvenience, many commands also have key bindings. You can run thosecommands by typing the keys, or run them by name. Most Emacs commandshave no key bindings, so the only way to run them is by name. (See Key Bindings, for how to set up key bindings.)
9 Running Commands by Name
Bash offers many useful emacs-style keybindings for simple commandline editing. For example, Ctrl+w deletes ('kills') word left from the cursor. Another keybinding, Alt+d is supposed to be a 'mirror' of the first one. It is supposed to delete a word right from the cursor. Shadow of your smile samsung ringtone download. However, I have noticed, these two keybindings do not act completely.
By convention, a command name consists of one or more words,separated by hyphens; for example,
auto-fill-mode ormanual-entry . Command names mostly use complete English wordsto make them easier to remember.
To run a command by name, start with M-x, type the commandname, then terminate it with <RET>. M-x uses the minibufferto read the command name. The string ‘M-x’ appears at thebeginning of the minibuffer as a prompt to remind you to enter acommand name to be run. <RET> exits the minibuffer and runs thecommand. See Minibuffer, for more information on the minibuffer.
You can use completion to enter the command name. For example,to invoke the command
forward-char , you can type
or
Note that
forward-char is the same command that you invoke withthe key C-f. The existence of a key binding does not stop youfrom running the command by name.
Download Emacs For Mac
When M-x completes on commands, it ignores the commands thatare declared obsolete; for these, you will have to type theirfull name. Obsolete commands are those for which newer, betteralternatives exist, and which are slated for removal in some futureEmacs release.
To cancel the M-x and not run a command, type C-g insteadof entering the command name. This takes you back to command level.
To pass a numeric argument to the command you are invoking withM-x, specify the numeric argument before M-x. Theargument value appears in the prompt while the command name is beingread, and finally M-x passes the argument to that command. Forexample, to pass the numeric argument of 42 to the command
forward-char you can type C-u 42 M-x forward-char<RET>.
When the command you run with M-x has a key binding, Emacsmentions this in the echo area after running the command. Forexample, if you type M-x forward-word, the message says that youcan run the same command by typing M-f. You can turn off thesemessages by setting the variable
suggest-key-bindings tonil . The value of suggest-key-bindings can also be anumber, in which case Emacs will show the binding for that manyseconds before removing it from display. The default behavior is todisplay the binding for 2 seconds.
Commands that don't have key bindings, can still be invoked aftertyping less than their full name at the ‘M-x’ prompt. Emacsmentions such shorthands in the echo area if they are significantlyshorter than the full command name, and
extended-command-suggest-shorter is non-nil . Thesetting of suggest-key-bindings affects these hints as well.
In this manual, when we speak of running a command by name, we oftenomit the <RET> that terminates the name. Thus we might sayM-x auto-fill-mode rather than M-x auto-fill-mode <RET>. We mention the <RET> only for emphasis, such as whenthe command is followed by arguments.
Emacs Mac Port
M-x works by running the command
execute-extended-command , which is responsible for reading thename of another command and invoking it.
As many Mac OS X/Emacs users know, OS X has many of the Emacs key bindings defined for the entire system. Thus, bindings like 【Ctrl+f】, 【Ctrl+b】, 【Ctrl+a】, 【Ctrl+e】, 【Ctrl+k】, 【Ctrl+y】, 【Ctrl+p】, 【Ctrl+n】, and a few others work across the whole system.
Less well known is that the Cocoa Text System is customizable and you can add other Emacs bindings to make a comfortable and familiar environment whether you’re in Emacs, Mail, Safari, or whatever. Even better is that Jacob Rus has already compiled the necessary bindings for you so all you need do is download the file and install it in the proper place on your system.
The full explanation is available here but the TL;DR is:
Emacs For Mac Os![]()
There’s lot of information at the site, though, so it’s well worth a look. It has bindings with 【Esc】 rather than 【⌥ Opt】 as the 【Meta】 key,
BBEdit key bindings for any heretics reading this, and many other tidbits as well. But if you just want Emacs key bindings where 【⌥ Opt】 is the 【Meta】 key, then just follow the 3 steps above.
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |