all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r108794: lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811).
       [not found] <E1SkNxg-0007ax-Gw@vcs.savannah.gnu.org>
@ 2012-06-29 16:42 ` Stefan Monnier
  2012-06-29 16:57   ` Juanma Barranquero
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-06-29 16:42 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: emacs-devel

> +	  (let ((var (make-symbol "--cl-x--")))
> +	    `(let ((,var ,x))

That's exactly what macroexp-let2 is for.


        Stefan



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r108794: lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811).
  2012-06-29 16:42 ` [Emacs-diffs] /srv/bzr/emacs/trunk r108794: lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811) Stefan Monnier
@ 2012-06-29 16:57   ` Juanma Barranquero
  2012-06-30  4:08     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Juanma Barranquero @ 2012-06-29 16:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Fri, Jun 29, 2012 at 6:42 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> +       (let ((var (make-symbol "--cl-x--")))
>> +         `(let ((,var ,x))
>
> That's exactly what macroexp-let2 is for.

Something like this, you mean?

    Juanma


=== modified file 'lisp/emacs-lisp/cl-lib.el'
--- lisp/emacs-lisp/cl-lib.el	2012-06-28 23:04:27 +0000
+++ lisp/emacs-lisp/cl-lib.el	2012-06-29 16:53:17 +0000
@@ -151,16 +151,15 @@
                   [keywordp form])))
   (if (symbolp place)
       (if (null keys)
-	  (let ((var (make-symbol "--cl-x--")))
-	    `(let ((,var ,x))
-	       (if (memql ,var ,place)
+	  (macroexp-let2 nil var x
+	    `(if (memql ,var ,place)
 		   ;; This symbol may later on expand to actual code which then
 		   ;; trigger warnings like "value unused" since cl-pushnew's return
 		   ;; value is rarely used.  It should not matter that other
 		   ;; warnings may be silenced, since `place' is used earlier and
 		   ;; should have triggered them already.
 		   (with-no-warnings ,place)
-		 (setq ,place (cons ,var ,place)))))
+	       (setq ,place (cons ,var ,place))))
 	(list 'setq place (cl-list* 'cl-adjoin x place keys)))
     (cl-list* 'cl-callf2 'cl-adjoin x place keys)))



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r108794: lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811).
  2012-06-29 16:57   ` Juanma Barranquero
@ 2012-06-30  4:08     ` Stefan Monnier
  2012-06-30  7:01       ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-06-30  4:08 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: emacs-devel

> Something like this, you mean?

Yes, that's exactly what I installed a few minutes ago,


        Stefan



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r108794: lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811).
  2012-06-30  4:08     ` Stefan Monnier
@ 2012-06-30  7:01       ` Andreas Schwab
  2012-06-30 14:21         ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2012-06-30  7:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Juanma Barranquero, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Something like this, you mean?
>
> Yes, that's exactly what I installed a few minutes ago,

Is it intented that users of cl-lib also need to load macroexp (due to
macroexp-const-p)?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r108794: lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811).
  2012-06-30  7:01       ` Andreas Schwab
@ 2012-06-30 14:21         ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2012-06-30 14:21 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Juanma Barranquero, emacs-devel

>>> Something like this, you mean?
>> Yes, that's exactly what I installed a few minutes ago,
> Is it intented that users of cl-lib also need to load macroexp (due to
> macroexp-const-p)?

No, that was an oversight, should be fixed now,


        Stefan



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

end of thread, other threads:[~2012-06-30 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1SkNxg-0007ax-Gw@vcs.savannah.gnu.org>
2012-06-29 16:42 ` [Emacs-diffs] /srv/bzr/emacs/trunk r108794: lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811) Stefan Monnier
2012-06-29 16:57   ` Juanma Barranquero
2012-06-30  4:08     ` Stefan Monnier
2012-06-30  7:01       ` Andreas Schwab
2012-06-30 14:21         ` Stefan Monnier

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.