emacs-devel
[Top][All Lists]
Advanced

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

Re: find-file-noselect needs save-match-data


From: Herbert Euler
Subject: Re: find-file-noselect needs save-match-data
Date: Sun, 17 Jun 2007 11:26:38 +0800

     ;; cc-cmds.el, line 749
     ;; `}': compact to a one-liner defun?
     (save-match-data
        (when
            (and (eq last-command-char ?\})
                 (memq 'one-liner-defun c-cleanup-list)
                 (c-intersect-lists '(defun-close) syntax)
                 (c-try-one-liner))
          (setq here (- (point-max) pos))))

`save-match-data' is used here, but nothing implies directly that
match-data will be changed in its body.  Some functions change it, but
is called _indirectly_.  One would need to check the source of each
function in its body to see where the match-data is changed.  This is
the only case that the problems caused by unexpected match-data
changes happen.

And adding a new function does not eliminate this case.  The function
itself still needs to be checked, either its source or its docstring.

Regards,
Guanpeng Xu

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/





reply via email to

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