Commit 930aae96 authored by Chong Yidong's avatar Chong Yidong
Browse files

* longlines.el (longlinges-search-function)

	(longlines-search-forward, longlines-search-backward): New
	functions.
	(longlines-mode): Set isearch-search-fun-function to
	longlinges-search-function.
parent deceef67
2005-10-14 Chong Yidong <cyd@stupidchicken.com>
* 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.
......
......@@ -109,6 +109,8 @@ are indicated with a symbol."
(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 @@ are indicated with a symbol."
'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 @@ This is called by `window-size-change-functions'."
(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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment