TAILIEUCHUNG - An Introduction to Programming in Emacs Lisp phần 4

Trong chương cuối cùng, chúng tôi đã giới thiệu một số công bằng của các chức năng và các hình thức đặc biệt. Ở đây họ được mô tả ngắn gọn, cùng với một vài chức năng tương tự đã không được đề cập. eval-cuối-sexp Đánh giá biểu thức biểu tượng cuối cùng trước | The save-restriction Special Form 77 6 Narrowing and Widening Narrowing is a feature of Emacs that makes it possible for you to focus on a specific part of a buffer and work without accidentally changing other parts. Narrowing is normally disabled since it can confuse novices. With narrowing the rest of a buffer is made invisible as if it weren t there. This is an advantage if for example you want to replace a word in one part of a buffer but not in another you narrow to the part you want and the replacement is carried out only in that section not in the rest of the buffer. Searches will only work within a narrowed region not outside of one so if you are fixing a part of a document you can keep yourself from accidentally finding parts you do not need to fix by narrowing just to the region you want. The key binding for narrow-to-region is C-x n n. However narrowing does make the rest of the buffer invisible which can scare people who inadvertently invoke narrowing and think they have deleted a part of their file. Moreover the undo command which is usually bound to C-x u does not turn off narrowing nor should it so people can become quite desperate if they do not know that they can return the rest of a buffer to visibility with the widen command. The key binding for widen is C-x n w. Narrowing is just as useful to the Lisp interpreter as to a human. Often an Emacs Lisp function is designed to work on just part of a buffer or conversely an Emacs Lisp function needs to work on all of a buffer that has been narrowed. The what-line function for example removes the narrowing from a buffer if it has any narrowing and when it has finished its job restores the narrowing to what it was. On the other hand the countlines function which is called by what-line uses narrowing to restrict itself to just that portion of the buffer in which it is interested and then restores the previous situation. The save-restriction Special Form In Emacs Lisp you can use the save-restriction .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.