From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Tino Calancha <f92capac@gmail.com>,
Stephen Berman <stephen.berman@gmx.net>,
23781@debbugs.gnu.org
Subject: bug#23781: 25.0.95; read-string with HIST lexically bound
Date: Sat, 25 Jun 2016 23:34:43 -0400 [thread overview]
Message-ID: <CAM-tV-9rrxo71NwWDqfQprOBvp+BcindYJrHwAg3CGjfx3qpJA@mail.gmail.com> (raw)
In-Reply-To: <878txs7s4b.fsf@web.de>
[-- Attachment #1: Type: text/plain, Size: 817 bytes --]
On Sat, Jun 25, 2016 at 7:42 PM, Michael Heerdegen
<michael_heerdegen@web.de> wrote:
> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> > Also, the code in the body of a ‘defun’ or
>> > ‘defmacro’ cannot refer to surrounding lexical variables.
>
>
> This seems a bit unclear to me. It sounds like something like this
> would not work:
>
> ;; -*- lexical-binding: t -*-
> (let ((x 1))
> (defun f () x))
>
> (f) ==> 1
That's indeed what it meant, but this restriction was lifted sometime
after 24.1, see
http://help-gnu-emacs.gnu.narkive.com/uspqRdsq/surrounding-lexical-variable-reference-in-the-body-of-defun
and http://stackoverflow.com/questions/12026137/emacs-the-code-in-the-body-of-a-defun-or-defmacro-cannot-refer-to-surrounding-l.
Updated patch to remove that sentence.
[-- Attachment #2: v2-0001-Add-to-elisp-completion-at-point-s-docstring.patch --]
[-- Type: text/x-patch, Size: 2087 bytes --]
From 3f08a8a535e8fb5dced8bf1474659244ed358125 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
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
+\"<f>\" via the `:annotation-function' property."
(with-syntax-table emacs-lisp-mode-syntax-table
(let* ((pos (point))
(beg (condition-case nil
--
2.8.0
next prev parent reply other threads:[~2016-06-26 3:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 5:19 bug#23781: 25.0.95; read-string with HIST lexically bound Tino Calancha
2016-06-17 15:25 ` Michael Heerdegen
2016-06-23 23:01 ` Noam Postavsky
2016-06-23 23:18 ` Drew Adams
2016-06-25 0:26 ` Noam Postavsky
2016-06-25 10:12 ` Stephen Berman
2016-06-25 16:53 ` Noam Postavsky
2016-06-25 18:53 ` Stephen Berman
2016-06-25 19:46 ` Noam Postavsky
2016-06-25 22:07 ` Stephen Berman
2016-06-25 23:42 ` Michael Heerdegen
2016-06-26 3:34 ` Noam Postavsky [this message]
2016-06-27 0:55 ` Noam Postavsky
2016-07-01 4:07 ` npostavs
2016-06-26 2:23 ` Drew Adams
2016-06-25 21:00 ` Drew Adams
2016-06-25 20:42 ` Drew Adams
2016-06-24 2:24 ` Tino Calancha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAM-tV-9rrxo71NwWDqfQprOBvp+BcindYJrHwAg3CGjfx3qpJA@mail.gmail.com \
--to=npostavs@users.sourceforge.net \
--cc=23781@debbugs.gnu.org \
--cc=f92capac@gmail.com \
--cc=michael_heerdegen@web.de \
--cc=stephen.berman@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.