116 |
(add-hook 'window-configuration-change-hook |
(add-hook 'window-configuration-change-hook |
117 |
'longlines-window-change-function nil t)) |
'longlines-window-change-function nil t)) |
118 |
(let ((buffer-undo-list t) |
(let ((buffer-undo-list t) |
119 |
|
(inhibit-read-only t) |
120 |
(mod (buffer-modified-p))) |
(mod (buffer-modified-p))) |
121 |
;; Turning off undo is OK since (spaces + newlines) is |
;; Turning off undo is OK since (spaces + newlines) is |
122 |
;; conserved, except for a corner case in |
;; conserved, except for a corner case in |
137 |
(setq buffer-file-format (delete 'longlines buffer-file-format)) |
(setq buffer-file-format (delete 'longlines buffer-file-format)) |
138 |
(if longlines-showing |
(if longlines-showing |
139 |
(longlines-unshow-hard-newlines)) |
(longlines-unshow-hard-newlines)) |
140 |
(let ((buffer-undo-list t)) |
(let ((buffer-undo-list t) |
141 |
|
(inhibit-read-only t)) |
142 |
(longlines-encode-region (point-min) (point-max))) |
(longlines-encode-region (point-min) (point-max))) |
143 |
(remove-hook 'change-major-mode-hook 'longlines-mode-off t) |
(remove-hook 'change-major-mode-hook 'longlines-mode-off t) |
144 |
(remove-hook 'before-kill-functions 'longlines-encode-region t) |
(remove-hook 'before-kill-functions 'longlines-encode-region t) |
146 |
(remove-hook 'post-command-hook 'longlines-post-command-function t) |
(remove-hook 'post-command-hook 'longlines-post-command-function t) |
147 |
(remove-hook 'window-configuration-change-hook |
(remove-hook 'window-configuration-change-hook |
148 |
'longlines-window-change-function t) |
'longlines-window-change-function t) |
149 |
(kill-local-variable 'fill-column))) |
(when longlines-wrap-follows-window-size |
150 |
|
(kill-local-variable 'fill-column)) |
151 |
|
(kill-local-variable 'require-final-newline) |
152 |
|
(kill-local-variable 'buffer-substring-filters) |
153 |
|
(kill-local-variable 'use-hard-newlines))) |
154 |
|
|
155 |
(defun longlines-mode-off () |
(defun longlines-mode-off () |
156 |
"Turn off longlines mode. |
"Turn off longlines mode. |