[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r114548: * lisp/emacs-lisp/lisp-mode.el (eval-defun-
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] trunk r114548: * lisp/emacs-lisp/lisp-mode.el (eval-defun-2): Simplify, using lexical-binding. |
Date: |
Mon, 07 Oct 2013 05:11:54 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 114548
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2013-10-07 01:11:50 -0400
message:
* lisp/emacs-lisp/lisp-mode.el (eval-defun-2): Simplify, using
lexical-binding.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/emacs-lisp/lisp-mode.el lispmode.el-20091113204419-o5vbwnq5f7feedwu-205
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-10-07 05:10:06 +0000
+++ b/lisp/ChangeLog 2013-10-07 05:11:50 +0000
@@ -1,5 +1,7 @@
2013-10-07 Stefan Monnier <address@hidden>
+ * emacs-lisp/lisp-mode.el (eval-defun-2): Simplify, using
lexical-binding.
+
* emacs-lisp/tq.el (tq-create): Use a closure instead of `(lambda...).
* progmodes/ruby-mode.el: Fix recently added tests.
=== modified file 'lisp/emacs-lisp/lisp-mode.el'
--- a/lisp/emacs-lisp/lisp-mode.el 2013-08-08 23:59:14 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el 2013-10-07 05:11:50 +0000
@@ -1,4 +1,4 @@
-;;; lisp-mode.el --- Lisp mode, and its idiosyncratic commands -*- coding:
utf-8 -*-
+;;; lisp-mode.el --- Lisp mode, and its idiosyncratic commands -*-
lexical-binding:t -*-
;; Copyright (C) 1985-1986, 1999-2013 Free Software Foundation, Inc.
@@ -917,27 +917,25 @@
(save-excursion
;; Arrange for eval-region to "read" the (possibly) altered form.
;; eval-region handles recording which file defines a function or
- ;; variable. Re-written using `apply' to avoid capturing
- ;; variables like `end'.
- (apply
- #'eval-region
- (let ((standard-output t)
- beg end form)
- ;; Read the form from the buffer, and record where it ends.
- (save-excursion
- (end-of-defun)
- (beginning-of-defun)
- (setq beg (point))
- (setq form (read (current-buffer)))
- (setq end (point)))
- ;; Alter the form if necessary.
- (setq form (eval-sexp-add-defvars (eval-defun-1 (macroexpand form))))
- (list beg end standard-output
- `(lambda (ignore)
- ;; Skipping to the end of the specified region
- ;; will make eval-region return.
- (goto-char ,end)
- ',form))))))
+ ;; variable.
+ (let ((standard-output t)
+ beg end form)
+ ;; Read the form from the buffer, and record where it ends.
+ (save-excursion
+ (end-of-defun)
+ (beginning-of-defun)
+ (setq beg (point))
+ (setq form (read (current-buffer)))
+ (setq end (point)))
+ ;; Alter the form if necessary.
+ (let ((form (eval-sexp-add-defvars
+ (eval-defun-1 (macroexpand form)))))
+ (eval-region beg end standard-output
+ (lambda (_ignore)
+ ;; Skipping to the end of the specified region
+ ;; will make eval-region return.
+ (goto-char end)
+ form))))))
;; The result of evaluation has been put onto VALUES. So return it.
(car values))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r114548: * lisp/emacs-lisp/lisp-mode.el (eval-defun-2): Simplify, using lexical-binding.,
Stefan Monnier <=