From 3f08a8a535e8fb5dced8bf1474659244ed358125 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 25 Jun 2016 16:23:04 -0400 Subject: [PATCH v2] Add to elisp-completion-at-point's docstring * lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Document position dependent behavior. Remove mention of obsolete restriction regarding lexical binding for defun and defmacro, this no longer applies since 61b108cc 2012-05-29 "* lisp/emacs-lisp/byte-run.el (defmacro, defun): Move from C..." (Bug #19854). --- doc/lispref/variables.texi | 3 +-- lisp/progmodes/elisp-mode.el | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index b4d6857..a2d6481 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1038,8 +1038,7 @@ Lexical Binding functions which take a symbol argument (like @code{symbol-value}, @code{boundp}, and @code{set}) can only retrieve or modify a variable's dynamic binding (i.e., the contents of its symbol's value -cell). Also, the code in the body of a @code{defun} or -@code{defmacro} cannot refer to surrounding lexical variables. +cell). @node Using Lexical Binding @subsection Using Lexical Binding diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 7ad8871..850ebb4 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -455,7 +455,11 @@ elisp--company-location ((facep sym) (find-definition-noselect sym 'defface))))) (defun elisp-completion-at-point () - "Function used for `completion-at-point-functions' in `emacs-lisp-mode'." + "Function used for `completion-at-point-functions' in `emacs-lisp-mode'. +The returned completions depend on whether point is in a function +or variable position; in positions where both are +possible (e.g. quoted symbols), functions are annotated with +\"\" via the `:annotation-function' property." (with-syntax-table emacs-lisp-mode-syntax-table (let* ((pos (point)) (beg (condition-case nil -- 2.8.0