diff options
| author | Chong Yidong | 2005-11-19 17:29:20 +0000 |
|---|---|---|
| committer | Chong Yidong | 2005-11-19 17:29:20 +0000 |
| commit | b39aa4fdf7969f4918ddd253aca4aaab9785e371 (patch) | |
| tree | b560cd13c97a347b44f9baf864bd71e0079b90a2 | |
| parent | b4483658c52c40ec393697d0b4d2fcce8b875859 (diff) | |
| download | emacs-b39aa4fdf7969f4918ddd253aca4aaab9785e371.tar.gz emacs-b39aa4fdf7969f4918ddd253aca4aaab9785e371.zip | |
* longlines.el (longlines-before-revert-hook)
(longlines-after-revert-hook): New functions.
(longlines-mode): Turn off longlines temporarily when reverting.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/longlines.el | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 434e634e826..28108231a61 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2005-11-19 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * longlines.el (longlines-before-revert-hook) | ||
| 4 | (longlines-after-revert-hook): New functions. | ||
| 5 | (longlines-mode): Turn off longlines temporarily when reverting. | ||
| 6 | |||
| 1 | 2005-11-19 Andreas Schwab <schwab@suse.de> | 7 | 2005-11-19 Andreas Schwab <schwab@suse.de> |
| 2 | 8 | ||
| 3 | * emacs-lisp/shadow.el: Handle compressed files. | 9 | * emacs-lisp/shadow.el: Handle compressed files. |
diff --git a/lisp/longlines.el b/lisp/longlines.el index b168db3b6dd..eff7d32a468 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el | |||
| @@ -108,6 +108,7 @@ are indicated with a symbol." | |||
| 108 | (set (make-local-variable 'require-final-newline) nil) | 108 | (set (make-local-variable 'require-final-newline) nil) |
| 109 | (add-to-list 'buffer-file-format 'longlines) | 109 | (add-to-list 'buffer-file-format 'longlines) |
| 110 | (add-hook 'change-major-mode-hook 'longlines-mode-off nil t) | 110 | (add-hook 'change-major-mode-hook 'longlines-mode-off nil t) |
| 111 | (add-hook 'before-revert-hook 'longlines-before-revert-hook nil t) | ||
| 111 | (make-local-variable 'buffer-substring-filters) | 112 | (make-local-variable 'buffer-substring-filters) |
| 112 | (set (make-local-variable 'isearch-search-fun-function) | 113 | (set (make-local-variable 'isearch-search-fun-function) |
| 113 | 'longlinges-search-function) | 114 | 'longlinges-search-function) |
| @@ -166,6 +167,7 @@ are indicated with a symbol." | |||
| 166 | (remove-hook 'before-kill-functions 'longlines-encode-region t) | 167 | (remove-hook 'before-kill-functions 'longlines-encode-region t) |
| 167 | (remove-hook 'after-change-functions 'longlines-after-change-function t) | 168 | (remove-hook 'after-change-functions 'longlines-after-change-function t) |
| 168 | (remove-hook 'post-command-hook 'longlines-post-command-function t) | 169 | (remove-hook 'post-command-hook 'longlines-post-command-function t) |
| 170 | (remove-hook 'before-revert-hook 'longlines-before-revert-hook t) | ||
| 169 | (remove-hook 'window-configuration-change-hook | 171 | (remove-hook 'window-configuration-change-hook |
| 170 | 'longlines-window-change-function t) | 172 | 'longlines-window-change-function t) |
| 171 | (when longlines-wrap-follows-window-size | 173 | (when longlines-wrap-follows-window-size |
| @@ -430,10 +432,18 @@ This is called by `window-size-change-functions'." | |||
| 430 | 432 | ||
| 431 | ;; Loading and saving | 433 | ;; Loading and saving |
| 432 | 434 | ||
| 435 | (defun longlines-before-revert-hook () | ||
| 436 | (add-hook 'after-revert-hook 'longlines-after-revert-hook nil t) | ||
| 437 | (longlines-mode 0)) | ||
| 438 | |||
| 439 | (defun longlines-after-revert-hook () | ||
| 440 | (remove-hook 'after-revert-hook 'longlines-after-revert-hook t) | ||
| 441 | (longlines-mode 1)) | ||
| 442 | |||
| 433 | (add-to-list | 443 | (add-to-list |
| 434 | 'format-alist | 444 | 'format-alist |
| 435 | (list 'longlines "Automatically wrap long lines." nil | 445 | (list 'longlines-encode "Encode long lines." nil nil |
| 436 | 'longlines-decode-region 'longlines-encode-region t nil)) | 446 | 'longlines-encode-region t nil)) |
| 437 | 447 | ||
| 438 | (provide 'longlines) | 448 | (provide 'longlines) |
| 439 | 449 | ||