unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* save-match-data's return value
@ 2002-02-19 15:45 Juanma Barranquero
  2002-02-19 16:27 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Juanma Barranquero @ 2002-02-19 15:45 UTC (permalink / raw)


save-match-data is implemented via unwind-protect and progn; however,
its docstring does not make any reference regarding the value returned
after its execution, though presumably it'll be the last form in BODY,
as in with-temp-buffer, et al.

Is that a part of the interface of save-match-data, and should be
documented, or does it specifically *no* guarantee about the value it
returns?


                                                           /L/e/k/t/u


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: save-match-data's return value
  2002-02-19 15:45 save-match-data's return value Juanma Barranquero
@ 2002-02-19 16:27 ` Stefan Monnier
  2002-02-19 17:06   ` Juanma Barranquero
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2002-02-19 16:27 UTC (permalink / raw)
  Cc: emacs-devel

> save-match-data is implemented via unwind-protect and progn; however,
> its docstring does not make any reference regarding the value returned
> after its execution, though presumably it'll be the last form in BODY,
> as in with-temp-buffer, et al.
> 
> Is that a part of the interface of save-match-data, and should be
> documented, or does it specifically *no* guarantee about the value it
> returns?

Lots of Emacs code relies on it and there is no other meaningful
value to return, so it's just an omission in the documentation.

AFAIK This behavior is shared by all `save-*' and `with-*' macros
and special forms.


	Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: save-match-data's return value
  2002-02-19 16:27 ` Stefan Monnier
@ 2002-02-19 17:06   ` Juanma Barranquero
  0 siblings, 0 replies; 3+ messages in thread
From: Juanma Barranquero @ 2002-02-19 17:06 UTC (permalink / raw)



On Tue, 19 Feb 2002 11:27:28 -0500, "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu> wrote:

> Lots of Emacs code relies on it and there is no other meaningful
> value to return, so it's just an omission in the documentation.

I supposed as much.

> AFAIK This behavior is shared by all `save-*' and `with-*' macros
> and special forms.

Yes, I know, that's why I mentioned with-temp-buffer.


                                                           /L/e/k/t/u


2002-02-19  Juanma Barranquero  <lektu@terra.es>

	* subr.el (save-match-data): Doc fix.

Index: subr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v
retrieving revision 1.287
diff -u -b -r1.287 subr.el
--- subr.el	6 Feb 2002 23:05:44 -0000	1.287
+++ subr.el	19 Feb 2002 17:04:59 -0000
@@ -1450,7 +1450,8 @@
 ;; We used to use an uninterned symbol; the compiler handles that properly
 ;; now, but it generates slower code.
 (defmacro save-match-data (&rest body)
-  "Execute the BODY forms, restoring the global value of the match data."
+  "Execute the BODY forms, restoring the global value of the match data.
+The value returned is the value of the last form in BODY."
   ;; It is better not to use backquote here,
   ;; because that makes a bootstrapping problem
   ;; if you need to recompile all the Lisp files using interpreted code.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

end of thread, other threads:[~2002-02-19 17:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-19 15:45 save-match-data's return value Juanma Barranquero
2002-02-19 16:27 ` Stefan Monnier
2002-02-19 17:06   ` Juanma Barranquero

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).