🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #8768

vm-isearch-forward under emacs19

#8768
From: Bruce Cole
Date: Mon, 12 Jul 1993 20:50
68 lines
3276 bytes
 > vm-isearch-forward gives the error message 
 >        Symbol's valua as variable is void: search-exit-char

VM's vm-search.el contains large chunks of code ripped out from emacs 18's
isearch.el.  I believe it basically needs to be rewritten in order to work
under emacs 19 since isearch.el changed so much.  A non-incremental search
such as the one in RMAIL would be much easier to implement/maintain.

So my interim solution was to replace vm-search.el with a file containing the
existing vm-update-search-position, and then I added the following new code.
This code implements a non-incremental search capability for VM.  The code is
shamelessly stolen/derived from other code found in vm-search.el, and
rmail.el:

(defvar vm-search-last-regexp nil)
(defun vm-search-forward (regexp)
  ""
  (interactive 
   (let ((prompt "VM search (regexp): "))
     (if vm-search-last-regexp
	 (setq prompt (concat prompt
			      "(default "
			      vm-search-last-regexp
			      ") ")))
     (setq regexp (read-string prompt))
     (cond ((not (equal regexp ""))
	    (setq vm-search-last-regexp regexp))
	   ((not vm-search-last-regexp)
	    (error "No previous VM search string")))
     (list vm-search-last-regexp)))
  (vm-follow-summary-cursor)
  (vm-select-folder-buffer)
  (vm-check-for-killed-summary)
  (vm-error-if-folder-empty)
  (vm-set-window-configuration 'searching-folder)
  (if (null (get-buffer-window (current-buffer)))
      (vm-display-current-message-buffer))
  (let ((clip-head (point-min))
	(clip-tail (point-max))
	win
	(old-w (selected-window)))
    (unwind-protect
	(progn (select-window (get-buffer-window (current-buffer)))
	       (widen)
	       (setq win (re-search-forward regexp nil t))
	       (if win
		   (progn
		     (vm-update-search-position t)
		     ;; vm-show-current-message only adjusts (point-max),
		     ;; it doesn't change (point-min).
		     (narrow-to-region
		      (if (< (point) (vm-vheaders-of (car vm-message-pointer)))
			  (vm-start-of (car vm-message-pointer))
			(vm-vheaders-of (car vm-message-pointer)))
		      (point-max))
		     (vm-highlight-headers (car vm-message-pointer)
					   (get-buffer-window
					    (current-buffer)))
		     (vm-show-current-message)
		     (setq vm-system-state 'reading)
		     ;; turn the clipping unwind into a noop
		     (setq clip-head (point-min))
		     (setq clip-tail (point-max)))
		 (ding)
		 (message "Search failed: %s" regexp)))
      (narrow-to-region clip-head clip-tail)
      (select-window old-w))))
(fset 'vm-isearch-forward (symbol-function 'vm-search-forward))
Technical Details
Message-ID: <199307122050.AA08983@regal.cisco.com>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!uunet!wendy-fate.uu.net!bug-vm

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6829,ac2824619dcfc2ed,start
X-Google-Attributes: gidf6829,public
X-Google-ArrivalTime: 1993-07-12 14:07:19 PST
x-gateway: rodan.UU.NET from bug-vm to gnu.emacs.vm.bug; Mon, 12 Jul 1993 16:50:57 EDT
Date: Mon, 12 Jul 1993 13:50:39 -0700
From: bcole@cisco.com (Bruce Cole)
Message-ID: <199307122050.AA08983@regal.cisco.com>
Subject: vm-isearch-forward under emacs19
Newsgroups: gnu.emacs.vm.bug
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!uunet!wendy-fate.uu.net!bug-vm
Sender: bug-vm-request@uunet.uu.net
Lines: 68