aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-06-06 20:31:10 +0000
committerChong Yidong2008-06-06 20:31:10 +0000
commite87085e6d5606b545ac0ee6039fe15f32ac7ee1c (patch)
tree31012d7738ff627aedd185c7e5f740387f59a926
parent742764a75fd5b34d1e03b763ada3b1bf68b14bd1 (diff)
downloademacs-e87085e6d5606b545ac0ee6039fe15f32ac7ee1c.tar.gz
emacs-e87085e6d5606b545ac0ee6039fe15f32ac7ee1c.zip
(longlines-re-search-forward): New function.
(longlines-mode): Bind replace-search-function and replace-re-search-function, to ensure that replacement commands treat newlines as spaces.
-rw-r--r--lisp/longlines.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/longlines.el b/lisp/longlines.el
index d160b808a7c..a4dda4b4ec3 100644
--- a/lisp/longlines.el
+++ b/lisp/longlines.el
@@ -119,6 +119,10 @@ are indicated with a symbol."
119 (make-local-variable 'longlines-auto-wrap) 119 (make-local-variable 'longlines-auto-wrap)
120 (set (make-local-variable 'isearch-search-fun-function) 120 (set (make-local-variable 'isearch-search-fun-function)
121 'longlines-search-function) 121 'longlines-search-function)
122 (set (make-local-variable 'replace-search-function)
123 'longlines-search-forward)
124 (set (make-local-variable 'replace-re-search-function)
125 'longlines-re-search-forward)
122 (add-to-list 'buffer-substring-filters 'longlines-encode-string) 126 (add-to-list 'buffer-substring-filters 'longlines-encode-string)
123 (when longlines-wrap-follows-window-size 127 (when longlines-wrap-follows-window-size
124 (let ((dw (if (and (integerp longlines-wrap-follows-window-size) 128 (let ((dw (if (and (integerp longlines-wrap-follows-window-size)
@@ -191,6 +195,8 @@ are indicated with a symbol."
191 (when longlines-wrap-follows-window-size 195 (when longlines-wrap-follows-window-size
192 (kill-local-variable 'fill-column)) 196 (kill-local-variable 'fill-column))
193 (kill-local-variable 'isearch-search-fun-function) 197 (kill-local-variable 'isearch-search-fun-function)
198 (kill-local-variable 'replace-search-function)
199 (kill-local-variable 'replace-re-search-function)
194 (kill-local-variable 'require-final-newline) 200 (kill-local-variable 'require-final-newline)
195 (kill-local-variable 'buffer-substring-filters) 201 (kill-local-variable 'buffer-substring-filters)
196 (kill-local-variable 'use-hard-newlines))) 202 (kill-local-variable 'use-hard-newlines)))
@@ -465,6 +471,10 @@ This is called by `window-configuration-change-hook'."
465 (let ((search-spaces-regexp "[ \n]+")) 471 (let ((search-spaces-regexp "[ \n]+"))
466 (re-search-backward (regexp-quote string) bound noerror count))) 472 (re-search-backward (regexp-quote string) bound noerror count)))
467 473
474(defun longlines-re-search-forward (string &optional bound noerror count)
475 (let ((search-spaces-regexp "[ \n]"))
476 (re-search-forward string bound noerror count)))
477
468;; Loading and saving 478;; Loading and saving
469 479
470(defun longlines-before-revert-hook () 480(defun longlines-before-revert-hook ()