# HG changeset patch # User Chong Yidong # Date 1129319798 0 # Node ID b63142efae15afa61bf40e4a19a0847028c185ca # Parent 88d998016498df8a42df8bf91da7128788c1d226 * longlines.el (longlinges-search-function) (longlines-search-forward, longlines-search-backward): New functions. (longlines-mode): Set isearch-search-fun-function to longlinges-search-function. diff -r 88d998016498 -r b63142efae15 lisp/ChangeLog --- a/lisp/ChangeLog Fri Oct 14 17:15:40 2005 +0000 +++ b/lisp/ChangeLog Fri Oct 14 19:56:38 2005 +0000 @@ -1,5 +1,11 @@ 2005-10-14 Chong Yidong + * longlines.el (longlinges-search-function) + (longlines-search-forward, longlines-search-backward): New + functions. + (longlines-mode): Set isearch-search-fun-function to + longlinges-search-function. + * mouse.el (mouse-drag-region-1): Handle the case where a double-click event is bound to an arbitrary function. diff -r 88d998016498 -r b63142efae15 lisp/longlines.el --- a/lisp/longlines.el Fri Oct 14 17:15:40 2005 +0000 +++ b/lisp/longlines.el Fri Oct 14 19:56:38 2005 +0000 @@ -109,6 +109,8 @@ (add-to-list 'buffer-file-format 'longlines) (add-hook 'change-major-mode-hook 'longlines-mode-off nil t) (make-local-variable 'buffer-substring-filters) + (set (make-local-variable 'isearch-search-fun-function) + 'longlinges-search-function) (add-to-list 'buffer-substring-filters 'longlines-encode-string) (when longlines-wrap-follows-window-size (set (make-local-variable 'fill-column) @@ -148,6 +150,7 @@ 'longlines-window-change-function t) (when longlines-wrap-follows-window-size (kill-local-variable 'fill-column)) + (kill-local-variable 'isearch-search-fun-function) (kill-local-variable 'require-final-newline) (kill-local-variable 'buffer-substring-filters) (kill-local-variable 'use-hard-newlines))) @@ -381,6 +384,27 @@ (longlines-wrap-region (point-min) (point-max)) (set-buffer-modified-p mod)))) +;; Isearch + +(defun longlinges-search-function () + (cond + (isearch-word + (if isearch-forward 'word-search-forward 'word-search-backward)) + (isearch-regexp + (if isearch-forward 're-search-forward 're-search-backward)) + (t + (if isearch-forward + 'longlines-search-forward + 'longlines-search-backward)))) + +(defun longlines-search-forward (string &optional bound noerror count) + (let ((search-spaces-regexp "[ \n]")) + (re-search-forward (regexp-quote string) bound noerror count))) + +(defun longlines-search-backward (string &optional bound noerror count) + (let ((search-spaces-regexp "[ \n]")) + (re-search-backward (regexp-quote string) bound noerror count))) + ;; Loading and saving (add-to-list