Table E-11. Shell mode commands ( Chapter 5 Chapter 5. Emacs as a Work Environment Many of the everyday things you do from a command prompt can be done from within Emacs. You can execute commands, work with directories, and print files—all without leaving Emacs. Changing tasks is as simple as jumping between buffers. What's important about this? Of course, it's nice to be able to move between tasks easily. What's even more important is that you have the same editing environment no matter what you're doing: you can use all of the Emacs editing commands to work on a file, give shell commands, then start up Dired, the directory editor, to do some file maintenance. It is simple to move text from one window to another. You can execute a command and then use Emacs commands to cut and paste the results into a file. If you're trying to compile a program and keep getting error messages, you can save the interactive session as a file and confer with someone about the problem. Despite the many advantages of modern window systems, Emacs often provides the best way to integrate the many kinds of work you do daily. Much of the information in this chapter involves integration between Emacs and the operating system. Emacs is most commonly a Unix editor, so forgive us for a bias in that direction. But we are happy to report that for users of GNU Emacs on other platforms, integration with the operating system is still available; you can use shell mode to run commands and can edit directories with Dired. There's no reason to leave Emacs no matter what your platform is.
)
Keystrokes |
Command name |
Action |
( none ) |
shell |
Enter shell mode. |
C-c C-c Signals → BREAK |
comint-interrupt-subjob |
Interrupt current job; equivalent to C-c. |
C-c C-z Signals → STOP |
comint-stop-subjob |
Suspend or stop a job; C-zin Unix shells. |
M-p In/Out → Previous Input |
comint-previous-input |
Retrieve previous commands (can be repeated to find earlier commands). |
M-n In/Out → Next Input |
comint-next-input |
Retrieve subsequent commands (can be repeated to find more recent commands). |
Enter |
comint-send-input |
Send input on current line. |
Tab |
comint-dynamic-complete |
Complete current command, filename, or variable name. |
Table E-12. Dired commands
Table E-12. Dired commands ( Chapter 5 Chapter 5. Emacs as a Work Environment Many of the everyday things you do from a command prompt can be done from within Emacs. You can execute commands, work with directories, and print files—all without leaving Emacs. Changing tasks is as simple as jumping between buffers. What's important about this? Of course, it's nice to be able to move between tasks easily. What's even more important is that you have the same editing environment no matter what you're doing: you can use all of the Emacs editing commands to work on a file, give shell commands, then start up Dired, the directory editor, to do some file maintenance. It is simple to move text from one window to another. You can execute a command and then use Emacs commands to cut and paste the results into a file. If you're trying to compile a program and keep getting error messages, you can save the interactive session as a file and confer with someone about the problem. Despite the many advantages of modern window systems, Emacs often provides the best way to integrate the many kinds of work you do daily. Much of the information in this chapter involves integration between Emacs and the operating system. Emacs is most commonly a Unix editor, so forgive us for a bias in that direction. But we are happy to report that for users of GNU Emacs on other platforms, integration with the operating system is still available; you can use shell mode to run commands and can edit directories with Dired. There's no reason to leave Emacs no matter what your platform is.
)
Keystrokes |
Command name |
Action |
C-x d File → Open Directory |
dired |
Start Dired. |
C Operate → Copy to |
dired-do-copy |
Copy file. |
d Mark → Flag |
dired-flag-file-deletion |
Flag for deletion. |
D Operate → Delete |
dired-do-delete |
Query for immediate deletion. |
f |
dired-advertised-find-file |
Find (so you can edit). |
g Immediate → Refresh |
revert-buffer |
Reread the directory from disk. |
m or * m Mark → Mark |
dired-mark |
Mark with *. |
Q Operate → Query Replace in Files |
dired-do-query-replace |
Query replace string in marked files. |
R Operate → Rename to |
dired-do-rename |
Rename file. |
s |
dired-sort-toggle-or-edit |
Sort the Dired display by date or by filename (toggles between these). |
t Mark → Toggle Marks |
dired-toggle-marks |
Toggle marks on files and directories; pressing tonce marks all unmarked files and directories; pressing tagain restores original marks. |
u Mark → Unmark |
dired-unmark |
Remove mark. |
+ Immediate → Create Directory |
dired-create-directory |
Create a directory. |
* ! or M-Del Mark → Unmark All |
dired-unmark-all-files |
Remove all marks from all files. |
Table E-13. Macro commands
Table E-13. Macro commands ( Chapter 6)
Keystrokes |
Command name |
Action |
C-x ( |
kmacro-start-macro |
Start macro definition. |
F3 |
kmacro-start-macro-or-insert-counter |
Start macro definition. If pressed while defining a macro, insert a counter. |
C-x ) |
kmacro-end-macro |
End macro definition. |
F4 |
kmacro-end-or-call-macro |
End macro definition (if definition is in progress) or invoke last keyboard macro. |
C-x e |
kmacro-end-and-call-macro |
Execute last keyboard macro defined. Can type eto repeat macro. |
C-x C-k n |
name-last-kbd-macro |
Name the last macro you created (before saving it). |
C-x C-k e |
edit-kbd-macro |
Edit a keyboard macro by typing C-x efor the last keyboard macro defined, M-xfor a named macro, C-h lfor lossage, or keystrokes for a macro bound to a key. |
C-x C-k Enter |
kmacro-edit-macro |
Edit the last keyboard macro. |
Table E-14. Outline mode commands
Читать дальше