;;; sym-comp.el --- mode-dependent symbol completion
-;; Copyright (C) 2004, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2008-2016 Free Software Foundation, Inc.
;; Author: Dave Love <fx@gnu.org>
;; Keywords: extensions
point."
(save-restriction
;; Narrow in case point is in the middle of a symbol -- we want
- ;; just the preceeding part.
+ ;; just the preceding part.
(narrow-to-region (point-min) (point))
(current-word)))
pattern))
;; In case the transform needs to access it.
(symbol-completion-predicate predicate)
- (completion-annotate-function
+ (completion-extra-properties
(if (functionp symbol-completion-transform-function)
- (lambda (str)
- (car-safe (cdr-safe
- (funcall symbol-completion-transform-function
- str)))))))
+ '(:annotation-function
+ (lambda (str)
+ (car-safe (cdr-safe
+ (funcall symbol-completion-transform-function
+ str))))))))
(completion-in-region (- (point) (length pattern)) (point)
completions predicate)))
\f
-(eval-when-compile (require 'hippie-exp))
+(defvar he-search-string)
+(defvar he-tried-table)
+(defvar he-expand-list)
+(declare-function he-init-string "hippie-exp" (beg end))
+(declare-function he-string-member "hippie-exp" (str lst &optional trans-case))
+(declare-function he-substitute-string "hippie-exp" (str &optional trans-case))
+(declare-function he-reset-string "hippie-exp" ())
;;;###autoload
(defun symbol-completion-try-complete (old)
used something like this in a major mode which provides symbol
completion:
- (if (featurep 'hippie-exp)
- (set (make-local-variable 'hippie-expand-try-functions-list)
- (cons 'symbol-completion-try-complete
+ (if (featurep \\='hippie-exp)
+ (set (make-local-variable \\='hippie-expand-try-functions-list)
+ (cons \\='symbol-completion-try-complete
hippie-expand-try-functions-list)))"
(when (and symbol-completion-symbol-function
symbol-completion-completions-function)
(provide 'sym-comp)
-;; arch-tag: 6fcce616-f3c4-4751-94b4-710e83144124
;;; sym-comp.el ends here