Книги автора: Learning GNU Emacs, 3rd Edition
/ Книги автора: Learning GNU Emacs, 3rd Edition
/ Книги автора: Learning GNU Emacs, 3rd Edition
/ Книги автора: Learning GNU Emacs, 3rd Edition
Искусство программирования для UnixThe Art of Unix Programming
/ Книги автора: Learning GNU Emacs, 3rd Edition
Книга: Learning GNU Emacs, 3rd Edition
6.8.2.1 Example
6.8.2.1 Example
Let's say that you write a macro that copies comments from a program to another buffer. The comments in our program are preceded by a slash, so you start the macro with a search for a slash. However, not all comments are worth copying. Following the search with a query lets you decide case by case whether the search has found a comment you want to copy. Table 6-4 shows a macro to copy comments to another buffer.
Table 6-4. Comment-copying macro with a query
Keystrokes | Action |
---|---|
F3 | Start the macro definition. |
C-s / | Search for a slash. |
Enter | Stop the search when it is successful. |
C-x q | Insert a query in the macro; Emacs asks you if you want to proceed at this point when you run the macro. |
M-f | Move forward one word. |
M-b | Move to the beginning of this word. |
C-Space | Set the mark. |
C-e | Move to the end of the line. |
C-f | Move forward one character. |
M-w | Copy the comment to the kill ring. |
C-x b comments | Move to a buffer called comments . |
C-y | Insert the comment in the buffer. |
C-x b | Move back to the original buffer. |
F4 | End the macro definition. |
Оглавление статьи/книги
Похожие страницы
- Chapter 14. Example scripts
- Appendix J. Example scripts code-base
- Example NAT machine in theory
- example rc.firewall
- Example rc.firewall script
- Example rc.DMZ.firewall script
- Example rc.UTIN.firewall script
- Example rc.DHCP.firewall script
- Example rc.flush-iptables script
- Example rc.test-iptables script
- An Example of Conversions in Action
- 6.3.2. Example Web Server Startup Script