help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why does save-match-data do what it does?


From: Marcin Borkowski
Subject: Why does save-match-data do what it does?
Date: Wed, 07 Mar 2018 06:03:37 +0100
User-agent: mu4e 1.1.0; emacs 27.0.50

Hi all,

save-match-data works by assigning the current match data to a temporary
variable, doing its stuff and restoring it again.  Why not this?

--8<---------------cut here---------------start------------->8---
(defmacro save-match-data-icmd (&rest body)
  "An alternative definition of `save-match-data'."
  (declare (indent 0) (debug t))
  `(let ((inhibit-changing-match-data t))
     ,@body))
--8<---------------cut here---------------end--------------->8---

(Of course, without the quoting, for the reason mentioned in subr.el.)

TIA,

--
Marcin Borkowski
http://mbork.pl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]