home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / lucidem / bug / 527 < prev    next >
Encoding:
Text File  |  1993-01-27  |  9.2 KB  |  273 lines

  1. x-gateway: rodan.UU.NET from bug-lucid-emacs to alt.lucid-emacs.bug; Wed, 27 Jan 1993 17:53:46 EST
  2. Date: Wed, 27 Jan 1993 18:29:48 +0100
  3. From: Guido.Bosch%loria.fr@lucid.com (Guido Bosch)
  4. Message-ID: <9301271729.AA08635@moebius.loria.fr>
  5. Subject: Re: vm search bug
  6. Reply-To: bosch%loria.fr@lucid.com (Guido Bosch)
  7. Newsgroups: alt.lucid-emacs.bug
  8. Path: sparky!uunet!wendy-fate.uu.net!bug-lucid-emacs
  9. Sender: bug-lucid-emacs-request@lucid.com
  10. Lines: 261
  11.  
  12. My guess that the vm search bug is due to a modification of the
  13. isearch package was right. Here is the patch that fixes it.
  14.  
  15. Apply it with 
  16.  
  17.     patch < vm-search-patch2 
  18.  
  19. in the vm directory and  byte compile the file vm-search.el. Then tye
  20.  
  21.     rm vm.elc
  22.     make VM
  23.  
  24.  
  25. This should do it.
  26.  
  27.     Guido
  28.  
  29. -------------------------- vm-search-patch2 --------------------------
  30. *** vm-search.el.orig    Wed Jan 27 15:36:21 1993
  31. --- vm-search.el    Wed Jan 27 18:07:58 1993
  32. ***************
  33. *** 80,88 ****
  34.                   (set-window-hscroll (selected-window) 0))
  35.                  (other-window 1))
  36.                (goto-char found-point)))))
  37. !      (let ((char (if quit-flag
  38.                ?\C-g
  39. !                (read-char))))
  40.          (setq quit-flag nil adjusted nil)
  41.          ;; Meta character means exit search.
  42.          (cond ((and (>= char 128)
  43. --- 80,90 ----
  44.                   (set-window-hscroll (selected-window) 0))
  45.                  (other-window 1))
  46.                (goto-char found-point)))))
  47. !      (let* ((char (if quit-flag
  48.                ?\C-g
  49. !                (read-char)))
  50. !         (isearch-cmd (lookup-key isearch-mode-map char)))
  51.          (setq quit-flag nil adjusted nil)
  52.          ;; Meta character means exit search.
  53.          (cond ((and (>= char 128)
  54. ***************
  55. *** 89,101 ****
  56.                  search-exit-option)
  57.             (setq unread-command-event (character-to-event char))
  58.             (throw 'search-done t))
  59. !          ((eq char search-exit-char)
  60.             ;; Esc means exit search normally.
  61.             ;; Except, if first thing typed, it means do nonincremental
  62.             (if (= 0 (length search-string))
  63.                 (vm-nonincremental-search forward regexp))
  64.             (throw 'search-done t))
  65. !          ((= char ?\C-g)
  66.             ;; ^G means the user tried to quit.
  67.             (ding)
  68.             (discard-input)
  69. --- 91,103 ----
  70.                  search-exit-option)
  71.             (setq unread-command-event (character-to-event char))
  72.             (throw 'search-done t))
  73. !          ((eq isearch-cmd 'isearch-exit)
  74.             ;; Esc means exit search normally.
  75.             ;; Except, if first thing typed, it means do nonincremental
  76.             (if (= 0 (length search-string))
  77.                 (vm-nonincremental-search forward regexp))
  78.             (throw 'search-done t))
  79. !          ((eq isearch-cmd 'isearch-abort)
  80.             ;; ^G means the user tried to quit.
  81.             (ding)
  82.             (discard-input)
  83. ***************
  84. *** 108,116 ****
  85.               ;; If search is failing, rub out until it is once more
  86.               ;;  successful.
  87.               (while (not success) (vm-isearch-pop))))
  88. !          ((or (eq char search-repeat-char)
  89. !               (eq char search-reverse-char))
  90. !           (if (eq forward (eq char search-repeat-char))
  91.                 ;; C-s in forward or C-r in reverse.
  92.                 (if (equal search-string "")
  93.                 ;; If search string is empty, use last one.
  94. --- 110,120 ----
  95.               ;; If search is failing, rub out until it is once more
  96.               ;;  successful.
  97.               (while (not success) (vm-isearch-pop))))
  98. !          ((or (eq isearch-cmd 'isearch-repeat-forward)
  99. !               (eq isearch-cmd 'isearch-repeat-backward))
  100. !           (if (eq forward  
  101. !                (eq isearch-cmd 'isearch-repeat-forward))
  102.                 ;; C-s in forward or C-r in reverse.
  103.                 (if (equal search-string "")
  104.                 ;; If search string is empty, use last one.
  105. ***************
  106. *** 122,128 ****
  107.                          search-string ""))
  108.               ;; If already have what to search for, repeat it.
  109.               (or success
  110. !                 (progn (goto-char (if forward (point-min) (point-max)))
  111.                      (setq wrapped t))))
  112.               ;; C-s in reverse or C-r in forward, change direction.
  113.               (setq forward (not forward)))
  114. --- 126,133 ----
  115.                          search-string ""))
  116.               ;; If already have what to search for, repeat it.
  117.               (or success
  118. !                 (progn (goto-char (if forward (point-min) 
  119. !                         (point-max)))
  120.                      (setq wrapped t))))
  121.               ;; C-s in reverse or C-r in forward, change direction.
  122.               (setq forward (not forward)))
  123. ***************
  124. *** 131,137 ****
  125.             (or (equal search-string "")
  126.                 (vm-isearch-search))
  127.             (vm-isearch-push-state))
  128. !          ((= char search-delete-char)
  129.             ;; Rubout means discard last input item and move point
  130.             ;; back.  If buffer is empty, just beep.
  131.             (if (null (cdr cmds))
  132. --- 136,142 ----
  133.             (or (equal search-string "")
  134.                 (vm-isearch-search))
  135.             (vm-isearch-push-state))
  136. !          ((eq isearch-cmd 'isearch-delete-char)
  137.             ;; Rubout means discard last input item and move point
  138.             ;; back.  If buffer is empty, just beep.
  139.             (if (null (cdr cmds))
  140. ***************
  141. *** 138,145 ****
  142.                 (ding)
  143.               (vm-isearch-pop)))
  144.            (t
  145. !           (cond ((or (eq char search-yank-word-char)
  146. !                  (eq char search-yank-line-char))
  147.                ;; ^W means gobble next word from buffer.
  148.                ;; ^Y means gobble rest of line from buffer.
  149.                (let ((word (save-excursion
  150. --- 143,150 ----
  151.                 (ding)
  152.               (vm-isearch-pop)))
  153.            (t
  154. !           (cond ((or (eq isearch-cmd 'isearch-yank-word)
  155. !                  (eq isearch-cmd 'isearch-yank-line))
  156.                ;; ^W means gobble next word from buffer.
  157.                ;; ^Y means gobble rest of line from buffer.
  158.                (let ((word (save-excursion
  159. ***************
  160. *** 148,154 ****
  161.                          (buffer-substring
  162.                       (point)
  163.                       (save-excursion
  164. !                       (if (eq char search-yank-line-char)
  165.                             (end-of-line)
  166.                           (forward-word 1))
  167.                         (point))))))
  168. --- 153,159 ----
  169.                          (buffer-substring
  170.                       (point)
  171.                       (save-excursion
  172. !                       (if (eq isearch-cmd 'isearch-yank-line)
  173.                             (end-of-line)
  174.                           (forward-word 1))
  175.                         (point))))))
  176. ***************
  177. *** 160,166 ****
  178.                ;; Any other control char =>
  179.                ;;  unread it and exit the search normally.
  180.                ((and search-exit-option
  181. !                    (/= char search-quote-char)
  182.                      (or (= char ?\177)
  183.                      (and (< char ? ) (/= char ?\t) (/= char ?\r))))
  184.                 (setq unread-command-event (character-to-event char))
  185. --- 165,171 ----
  186.                ;; Any other control char =>
  187.                ;;  unread it and exit the search normally.
  188.                ((and search-exit-option
  189. !                    (not (eq isearch-cmd 'isearch-quote-char))
  190.                      (or (= char ?\177)
  191.                      (and (< char ? ) (/= char ?\t) (/= char ?\r))))
  192.                 (setq unread-command-event (character-to-event char))
  193. ***************
  194. *** 168,174 ****
  195.                (t
  196.                 ;; Any other character => add it to the
  197.                 ;;  search string and search.
  198. !               (cond ((= char search-quote-char)
  199.                    (setq char (read-quoted-char
  200.                            (vm-isearch-message t))))
  201.                   ((= char ?\r)
  202. --- 173,179 ----
  203.                (t
  204.                 ;; Any other character => add it to the
  205.                 ;;  search string and search.
  206. !               (cond ((eq isearch-cmd 'isearch-quote-char)
  207.                    (setq char (read-quoted-char
  208.                            (vm-isearch-message t))))
  209.                   ((= char ?\r)
  210. ***************
  211. *** 189,195 ****
  212.               ;; Go back to place last successful search started
  213.               ;; or to the last ^S/^R (barrier), whichever is nearer.
  214.               (and regexp success cmds
  215. !              (cond ((memq char '(?* ??))
  216.                   (setq adjusted t)
  217.                   (let ((cs (nth (if forward
  218.                              5 ; other-end
  219. --- 194,200 ----
  220.               ;; Go back to place last successful search started
  221.               ;; or to the last ^S/^R (barrier), whichever is nearer.
  222.               (and regexp success cmds
  223. !              (cond ((eq isearch-cmd 'isearch-*-char)
  224.                   (setq adjusted t)
  225.                   (let ((cs (nth (if forward
  226.                              5 ; other-end
  227. ***************
  228. *** 202,208 ****
  229.                      (if forward
  230.                          (max cs barrier)
  231.                        (min cs barrier)))))
  232. !                    ((eq char ?\|)
  233.                   (setq adjusted t)
  234.                   (goto-char barrier))))
  235.               ;; In reverse regexp search, adding a character at
  236. --- 207,213 ----
  237.                      (if forward
  238.                          (max cs barrier)
  239.                        (min cs barrier)))))
  240. !                    ((eq isearch-cmd 'isearch-|-char)
  241.                   (setq adjusted t)
  242.                   (goto-char barrier))))
  243.               ;; In reverse regexp search, adding a character at
  244. ***************
  245. *** 337,348 ****
  246.       (message "%s" message)
  247.       ;; Read 1 char and switch to word search if it is ^W.
  248.       (setq char (read-char))
  249. !     (if (eq char search-yank-word-char)
  250.       (setq message (if forward "VM Word search: " "VM Word search backward: "))
  251.         ;; Otherwise let that 1 char be part of the search string.
  252.         (setq unread-command-event (character-to-event char)))
  253.       (setq function
  254. !       (if (eq char search-yank-word-char)
  255.             (if forward 'word-search-forward 'word-search-backward)
  256.           (if regexp
  257.           (if forward 're-search-forward 're-search-backward)
  258. --- 342,353 ----
  259.       (message "%s" message)
  260.       ;; Read 1 char and switch to word search if it is ^W.
  261.       (setq char (read-char))
  262. !     (if (eq (lookup-key isearch-mode-map char) 'isearch-yank-word)
  263.       (setq message (if forward "VM Word search: " "VM Word search backward: "))
  264.         ;; Otherwise let that 1 char be part of the search string.
  265.         (setq unread-command-event (character-to-event char)))
  266.       (setq function
  267. !       (if (eq (lookup-key isearch-mode-map char) 'isearch-yank-word)
  268.             (if forward 'word-search-forward 'word-search-backward)
  269.           (if regexp
  270.           (if forward 're-search-forward 're-search-backward)
  271.