all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: [Emacs-diffs] emacs-26 59e8533 1/3: Add save-match-data to abbreviate-file-name (Bug#32201)
Date: Tue, 23 Oct 2018 21:15:12 -0400	[thread overview]
Message-ID: <CAM-tV-_B1+cOJUz-pyOWpTUk5WW0CyDu3HYU84yvP-jN0SkTow@mail.gmail.com> (raw)
In-Reply-To: <jwvr2gpz7jn.fsf-monnier+emacsdiffs@gnu.org>

On Tue, 16 Oct 2018 at 21:50, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> > @@ -1929,7 +1929,7 @@ started Emacs, set `abbreviated-home-dir' to nil so it will be recalculated)."
> >                        (save-match-data
> >                          (string-match "^[a-zA-`]:/$" filename))))
> >                 (equal (get 'abbreviated-home-dir 'home)
> > -                      (expand-file-name "~")))
> > +                      (save-match-data (expand-file-name "~"))))
> >         (setq filename
> >               (concat "~"
> >                       (match-string 1 filename)
>
> Wouldn't it better to read (match-string 1 filename) earlier?
> `save-match-data` is a costly operation compared to (match-string
> 1 filename), so it doesn't make much sense to use it everywhere
> between the match and the final (match-string 1 filename).

Yeah, I think I kind of added it mindlessly, following the
save-match-data in the previous clause.



      reply	other threads:[~2018-10-24  1:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180722012853.24332.54603@vcs0.savannah.gnu.org>
     [not found] ` <20180722012855.5BE0220A19@vcs0.savannah.gnu.org>
2018-10-17  1:50   ` [Emacs-diffs] emacs-26 59e8533 1/3: Add save-match-data to abbreviate-file-name (Bug#32201) Stefan Monnier
2018-10-24  1:15     ` Noam Postavsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAM-tV-_B1+cOJUz-pyOWpTUk5WW0CyDu3HYU84yvP-jN0SkTow@mail.gmail.com \
    --to=npostavs@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.