emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/longlines.el


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/longlines.el
Date: Fri, 14 Oct 2005 15:56:42 -0400

Index: emacs/lisp/longlines.el
diff -c emacs/lisp/longlines.el:1.10 emacs/lisp/longlines.el:1.11
*** emacs/lisp/longlines.el:1.10        Thu Sep  1 16:17:10 2005
--- emacs/lisp/longlines.el     Fri Oct 14 19:56:38 2005
***************
*** 109,114 ****
--- 109,116 ----
          (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,153 ****
--- 150,156 ----
                   '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)))
***************
*** 380,385 ****
--- 383,409 ----
      (let ((mod (buffer-modified-p)))
        (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
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]