Function: idlwave-find-key

idlwave-find-key is a byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-find-key KEY-RE &optional DIR NOMARK LIMIT)

Documentation

Move to next match of the regular expression KEY-RE.

Matches inside comments or string constants will be ignored. If DIR is negative, the search will be backwards. At a successful match, the mark is pushed unless NOMARK is non-nil. Searches are limited to LIMIT. Searches are case-insensitive and use a special syntax table which treats $ and _ as word characters. Return value is the beginning of the match or (in case of failure) nil.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/idlwave.el.gz
(defun idlwave-find-key (key-re &optional dir nomark limit)
  "Move to next match of the regular expression KEY-RE.
Matches inside comments or string constants will be ignored.
If DIR is negative, the search will be backwards.
At a successful match, the mark is pushed unless NOMARK is non-nil.
Searches are limited to LIMIT.
Searches are case-insensitive and use a special syntax table which
treats `$' and `_' as word characters.
Return value is the beginning of the match or (in case of failure) nil."
  (setq dir (or dir 0))
  (let ((case-fold-search t)
	(search-func (if (> dir 0) 're-search-forward 're-search-backward))
	found)
    (with-syntax-table idlwave-find-symbol-syntax-table
     (save-excursion
       (catch 'exit
	 (while (funcall search-func key-re limit t)
	   (if (not (idlwave-quoted))
	       (throw 'exit (setq found (match-beginning 0)))
	     (if (or (and (> dir 0) (eobp))
		     (and (< dir 0) (bobp)))
		 (throw 'exit nil)))))))
    (if found
	(progn
	  (if (not nomark) (push-mark))
	  (goto-char found)
	  found)
      nil)))