Function: try-complete-lisp-symbol

try-complete-lisp-symbol is a byte-compiled function defined in hippie-exp.el.gz.

Signature

(try-complete-lisp-symbol OLD)

Documentation

Try to complete word as an Emacs Lisp symbol.

The argument OLD has to be nil the first call of this function, and t for subsequent calls (for further possible completions of the same string). It returns t if a new completion is found, nil otherwise.

Source Code

;; Defined in /usr/src/emacs/lisp/hippie-exp.el.gz
(defun try-complete-lisp-symbol (old)
  "Try to complete word as an Emacs Lisp symbol.
The argument OLD has to be nil the first call of this function, and t
for subsequent calls (for further possible completions of the same
string).  It returns t if a new completion is found, nil otherwise."
  (if (not old)
      (progn
	(he-init-string (he-lisp-symbol-beg) (point))
	(if (not (he-string-member he-search-string he-tried-table))
	    (setq he-tried-table (cons he-search-string he-tried-table)))
	(setq he-expand-list
	      (and (not (equal he-search-string ""))
		   (sort (all-completions he-search-string obarray
                                          (lambda (sym)
					    (or (boundp sym)
						(fboundp sym)
                                                (symbol-plist sym))))
			 #'string-lessp)))))
  (while (and he-expand-list
	      (he-string-member (car he-expand-list) he-tried-table))
    (setq he-expand-list (cdr he-expand-list)))
  (if (null he-expand-list)
      (progn
	(if old (he-reset-string))
	())
      (progn
	(he-substitute-string (car he-expand-list))
	(setq he-expand-list (cdr he-expand-list))
	t)))