1.5. Emacs as a Work Environment

1.5.1. Shell Mode

Shell mode lets you access the UNIX shell without leaving Emacs. A rule of thumb in shell mode is that you preface all ordinary control sequences with C-c. For example, to interrupt a command, type C-c C-c.

To Keystrokes Command Name
Enter shell mode ESC x shell,
Interrupt current job; equivalent to C-c in UNIX shells C-c C-c comint-interrupt-subjob
Delete a character; if at end of buffer send an EOF character C-d comint-delchar-or- maybe-eof
Send EOF character C-c C-d comint-send-eof
Erase current line; C-u> in UNIX shells C-c C-u comint-kill-input
Suspend or stop a job; C-z in UNIX shells C-c C-z comint-stop-subjob
Display previous command; repeat to display earlier commands ESC p comint-previous-input
Display subsequent commands; repeat to display more recent commands ESC n comint-next-input
Execute command on current line RETURN comint-send-input
Complete command, filename, or variable name TAB comint-dynamic- complete
Delete output from last command C-c C-o comint-kill-output
Move last line of output to bottom of window C-c C-e comint-show-maximum- output

1.5.2. Working with Dired

Dired is Emacs's directory editor. It provides a convenient way to manage files and directories.

To Keystrokes Command Name
Start Dired C-x d dired
Copy C dired-do-copy
Flag for deletion d dired-flag-file-deletion
Delete immediately D dired-do-delete
Open file or directory e or f dired-find-file
Reread the directory from disk g revert-buffer
Change group permissions G dired-do-chgrp
Remove line from display (don't delete it) k dired-do-kill-lines
Mark with * m dired-mark
Move to the next line n dired-next-line
Find file in another window; move there o dired-find-file-other- window
Find file in another window; don't move there C-o dired-display-file
Print file P dired-do-print
Quit Dired q dired-quit
Query-replace string in marked files Q dired-do-query-replace
Rename file R dired-do-rename
Unmark file u dired-unmark
View file v dired-view-file
Delete files flagged with D x dired-do-flagged-delete
Compress file Z dired-do-compress
Unmark all files (no matter what the mark was) ESC DEL dired-unmark-all-files
Flag backup files for deletion; C-u ~ removes flags ~ dired-flag-backup-files
Flag auto-save files for deletion; C-u # removes flags # dired-flag-auto-save-files
Flag numbered backups for deletion . dired-clean-directory
Mark directories with *;C-u * / unmarks * / dired-mark-directories
Compare this file to the file at the mark = dired-diff
Compare this file with its backup file ESC = dired-backup-diff
Execute shell command on this file ! dired-do-shell-command
Move to the next file marked with * or D ESC } dired-next-marked-file
Move to previous file marked with * or D ESC { dired-prev-marked-file
Flag for deletion files that match regular expression % d dired-flag-files-regexp
Mark files that match regular expression % m dired-mark-files-regexp
Create a directory + dired-create-directory
Move to next directory > dired-next-dirline
Move to previous directory < dired-prev-dirline
Sort the Dired display by date or filename (toggles between these) s dired-sort-toggle-or-edit

1.5.3. Printing

To Keystrokes Command Name
Print buffer (similar to UNIX pr | lpr) ESC x print-buffer
Print the region (similar to UNIX pr | lpr) ESC x print-region
Print buffer with no page numbers (similar to UNIX lpr) ESC x lpr-buffer
Print region with no page numbers (similar to UNIX lpr) ESC x lpr-region
From Dired, insert the default print command in the minibuffer p
Print the buffer with formatting intact ESC x ps-print-buffer-with-faces

1.5.4. Calendar and Diary Commands

To Keystrokes Command Name
Display the day of the year p d calendar-print-day-of-year
Scroll the other window SPACE scroll-other-window
Quit calendar q exit-calendar
Add a weekly entry based on the day of the week i w insert-weekly-diary-entry
Add an annual entry i y insert-yearly-diary-entry
Add an entry for a particular day i d insert-diary-entry
Add an entry for the day of the month i m insert-monthly-diary- entry
Add an entry to recur every n days i c insert-cyclic-diary-entry
Add a block entry i b insert-block-diary-entry
Display diary entries in a different typeface, color, or marked with a plus sign m mark-diary-entries
Display diary file s show-all-diary-entries
Mark regions by time rather than horizontally C-SPACE or C-@ calendar-set-mark

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset