unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19785: 25.0.50; Let apply-partially make use of `lexical-binding'
@ 2015-02-05 17:47 David Kastrup
  2015-02-08 20:02 ` Artur Malabarba
  0 siblings, 1 reply; 3+ messages in thread
From: David Kastrup @ 2015-02-05 17:47 UTC (permalink / raw)
  To: 19785

[-- Attachment #1: Type: text/plain, Size: 116 bytes --]


This patch was discussed in the thread
<URL:http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00784.html>.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Let-apply-partially-make-use-of-lexical-binding-in-s.patch --]
[-- Type: text/x-diff, Size: 1455 bytes --]

From 3ebbe29b9e7c9112933bdbad1b8f38119524d11e Mon Sep 17 00:00:00 2001
From: David Kastrup <dak@gnu.org>
Date: Sun, 25 Jan 2015 20:42:46 +0100
Subject: [PATCH] Let apply-partially make use of lexical binding in subr.el

* subr.el (apply-partially): Use lexical binding here.

See
<URL:http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00784.html>
for discussion.
---
 lisp/ChangeLog | 4 ++++
 lisp/subr.el   | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 694a35b..9e8602a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-25  David Kastrup  <dak@gnu.org>
+
+	* subr.el (apply-partially): Use lexical binding here.
+
 2015-02-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* delsel.el: Deprecate the `kill' option.  Use lexical-binding.
diff --git a/lisp/subr.el b/lisp/subr.el
index 68cd230..496f711 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -136,8 +136,8 @@ ARGS is a list of the first N arguments to pass to FUN.
 The result is a new function which does the same as FUN, except that
 the first N arguments are fixed at the values with which this function
 was called."
-  `(closure (t) (&rest args)
-            (apply ',fun ,@(mapcar (lambda (arg) `',arg) args) args)))
+  (lambda (&rest args2)
+    (apply fun (append args args2))))
 
 (defmacro push (newelt place)
   "Add NEWELT to the list stored in the generalized variable PLACE.
-- 
2.1.0


[-- Attachment #3: Type: text/plain, Size: 3993 bytes --]



Configured using:
 `configure --without-toolkit-scroll-bars'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB

Important settings:
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: InactiveMinibuffer

Minor modes in effect:
  TeX-PDF-mode: t
  diff-auto-refine-mode: t
  desktop-save-mode: t
  minibuffer-electric-default-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug apropos face-remap thingatpt eieio-opt speedbar
sb-image ezimage dframe shr-color color pp rfc2368 gnus-topic ispell shr
dom subr-x pcase browse-url nnir flow-fill mm-archive gnus-dup mule-util
smiley gnus-cite gnus-async gnus-bcklg gnus-kill qp gnus-ml disp-table
pop3 nndir nndraft nnmh gnutls network-stream nsm auth-source cl-macs
eieio eieio-core starttls nnml nnfolder nnnil gnus-agent gnus-srvr
gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime password-cache dig nntp gnus-cache gnus-sum gnus-group
gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls utf7 netrc
nnoo parse-time gnus-spec gnus-int gnus-range gnus-win sendmail
mail-extr sort mailcap misearch multi-isearch find-func debug gv
help-mode message format-spec rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
gmm-utils mailheader sh-script smie executable make-mode smerge-mode
scheme latexenc nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph
nxml-enc xmltok dired-x dired python json tex-info texinfo autorevert
filenotify cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs lilypond-mode compile comint ansi-color ring
bug-reference add-log preview prv-emacs reftex-dcr reftex-auc reftex
reftex-vars tex-bar tex-buf toolbar-x noutline outline font-latex
byte-opt bytecomp byte-compile cl-extra cconv latex edmacro kmacro
tex-style tex dbus xml crm jka-compr vc-git diff-mode easy-mmode info
easymenu package epg-config advice desktop frameset minibuf-eldef gnus
gnus-ems nnheader gnus-util mail-utils mm-util help-fns mail-prsvr
wid-edit cl-loaddefs cl-lib cus-start cus-load preview-latex tex-site
auto-loads server time-date tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 8 657308 150234)
 (symbols 24 52872 282)
 (miscs 20 1516 1461)
 (strings 16 118000 23120)
 (string-bytes 1 3627798)
 (vectors 8 45942)
 (vector-slots 4 1754129 45462)
 (floats 8 493 717)
 (intervals 28 36535 7536)
 (buffers 520 285)
 (heap 1024 55304 18053))

-- 
David Kastrup

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#19785: 25.0.50; Let apply-partially make use of `lexical-binding'
  2015-02-05 17:47 bug#19785: 25.0.50; Let apply-partially make use of `lexical-binding' David Kastrup
@ 2015-02-08 20:02 ` Artur Malabarba
  2015-02-09 14:42   ` David Kastrup
  0 siblings, 1 reply; 3+ messages in thread
From: Artur Malabarba @ 2015-02-08 20:02 UTC (permalink / raw)
  To: David Kastrup; +Cc: 19785

Applied.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#19785: 25.0.50; Let apply-partially make use of `lexical-binding'
  2015-02-08 20:02 ` Artur Malabarba
@ 2015-02-09 14:42   ` David Kastrup
  0 siblings, 0 replies; 3+ messages in thread
From: David Kastrup @ 2015-02-09 14:42 UTC (permalink / raw)
  To: Artur Malabarba; +Cc: 19785

Artur Malabarba <bruce.connor.am@gmail.com> writes:

> Applied.

Thanks.  In case of problems, this code looks much more maintainable
than the previous version.  Also much less likely subject to bit rot due
to changes in the byte compiler.

-- 
David Kastrup





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-09 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 17:47 bug#19785: 25.0.50; Let apply-partially make use of `lexical-binding' David Kastrup
2015-02-08 20:02 ` Artur Malabarba
2015-02-09 14:42   ` David Kastrup

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).