Function: try-complete-lisp-symbol-partially

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

Signature

(try-complete-lisp-symbol-partially OLD)

Documentation

Try to complete as an Emacs Lisp symbol, as many characters as unique.

The argument OLD has to be nil the first call of this function. It returns t if a unique, possibly partial, completion is found, nil otherwise.

Source Code

;; Defined in /usr/src/emacs/lisp/hippie-exp.el.gz
(defun try-complete-lisp-symbol-partially (old)
  "Try to complete as an Emacs Lisp symbol, as many characters as unique.
The argument OLD has to be nil the first call of this function.  It
returns t if a unique, possibly partial, completion is found, nil
otherwise."
  (let ((expansion ()))
    (if (not old)
	(progn
	  (he-init-string (he-lisp-symbol-beg) (point))
	  (if (not (string= he-search-string ""))
	      (setq expansion
		    (try-completion he-search-string obarray
                                    (lambda (sym)
				      (or (boundp sym)
					  (fboundp sym)
                                          (symbol-plist sym))))))
	  (if (or (eq expansion t)
		  (string= expansion he-search-string)
		  (he-string-member expansion he-tried-table))
	      (setq expansion ()))))

  (if (not expansion)
      (progn
	(if old (he-reset-string))
	())
      (progn
	(he-substitute-string expansion)
	t))))