109 |
(add-to-list 'buffer-file-format 'longlines) |
(add-to-list 'buffer-file-format 'longlines) |
110 |
(add-hook 'change-major-mode-hook 'longlines-mode-off nil t) |
(add-hook 'change-major-mode-hook 'longlines-mode-off nil t) |
111 |
(make-local-variable 'buffer-substring-filters) |
(make-local-variable 'buffer-substring-filters) |
112 |
|
(set (make-local-variable 'isearch-search-fun-function) |
113 |
|
'longlinges-search-function) |
114 |
(add-to-list 'buffer-substring-filters 'longlines-encode-string) |
(add-to-list 'buffer-substring-filters 'longlines-encode-string) |
115 |
(when longlines-wrap-follows-window-size |
(when longlines-wrap-follows-window-size |
116 |
(set (make-local-variable 'fill-column) |
(set (make-local-variable 'fill-column) |
150 |
'longlines-window-change-function t) |
'longlines-window-change-function t) |
151 |
(when longlines-wrap-follows-window-size |
(when longlines-wrap-follows-window-size |
152 |
(kill-local-variable 'fill-column)) |
(kill-local-variable 'fill-column)) |
153 |
|
(kill-local-variable 'isearch-search-fun-function) |
154 |
(kill-local-variable 'require-final-newline) |
(kill-local-variable 'require-final-newline) |
155 |
(kill-local-variable 'buffer-substring-filters) |
(kill-local-variable 'buffer-substring-filters) |
156 |
(kill-local-variable 'use-hard-newlines))) |
(kill-local-variable 'use-hard-newlines))) |
384 |
(longlines-wrap-region (point-min) (point-max)) |
(longlines-wrap-region (point-min) (point-max)) |
385 |
(set-buffer-modified-p mod)))) |
(set-buffer-modified-p mod)))) |
386 |
|
|
387 |
|
;; Isearch |
388 |
|
|
389 |
|
(defun longlinges-search-function () |
390 |
|
(cond |
391 |
|
(isearch-word |
392 |
|
(if isearch-forward 'word-search-forward 'word-search-backward)) |
393 |
|
(isearch-regexp |
394 |
|
(if isearch-forward 're-search-forward 're-search-backward)) |
395 |
|
(t |
396 |
|
(if isearch-forward |
397 |
|
'longlines-search-forward |
398 |
|
'longlines-search-backward)))) |
399 |
|
|
400 |
|
(defun longlines-search-forward (string &optional bound noerror count) |
401 |
|
(let ((search-spaces-regexp "[ \n]")) |
402 |
|
(re-search-forward (regexp-quote string) bound noerror count))) |
403 |
|
|
404 |
|
(defun longlines-search-backward (string &optional bound noerror count) |
405 |
|
(let ((search-spaces-regexp "[ \n]")) |
406 |
|
(re-search-backward (regexp-quote string) bound noerror count))) |
407 |
|
|
408 |
;; Loading and saving |
;; Loading and saving |
409 |
|
|
410 |
(add-to-list |
(add-to-list |