From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#14095: 24.3.50; REGRESSION: `repeat' broken by use of `set-temporary-overlay-map' Date: Fri, 14 Jun 2013 00:14:17 -0400 Message-ID: References: <0485CA7465A447CEAB3F0CCAFFEF4DDE@us.oracle.com> <4cbccd0a-9143-4572-a589-471072bd0aea@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371183312 21689 80.91.229.3 (14 Jun 2013 04:15:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Jun 2013 04:15:12 +0000 (UTC) Cc: 14095-done@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 14 06:15:12 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UnLPp-0003LF-VL for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jun 2013 06:15:10 +0200 Original-Received: from localhost ([::1]:58477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnLPp-0002E7-D1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jun 2013 00:15:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnLPk-0002Al-Lt for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2013 00:15:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnLPj-0005GG-Lm for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2013 00:15:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnLPj-0005Es-Cw for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2013 00:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UnLPi-0004Nk-R9 for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2013 00:15:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jun 2013 04:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14095 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14095-done@debbugs.gnu.org id=D14095.137118326616774 (code D ref 14095); Fri, 14 Jun 2013 04:15:02 +0000 Original-Received: (at 14095-done) by debbugs.gnu.org; 14 Jun 2013 04:14:26 +0000 Original-Received: from localhost ([127.0.0.1]:42846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UnLP7-0004MU-Tf for submit@debbugs.gnu.org; Fri, 14 Jun 2013 00:14:26 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:52833) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UnLP6-0004MF-4t for 14095-done@debbugs.gnu.org; Fri, 14 Jun 2013 00:14:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFpZVy/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DE4FKJA X-IPAS-Result: Av8EABK/CFFFpZVy/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DE4FKJA X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="16368202" Original-Received: from 69-165-149-114.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.149.114]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Jun 2013 00:14:13 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 04934AE2E1; Fri, 14 Jun 2013 00:14:17 -0400 (EDT) In-Reply-To: <4cbccd0a-9143-4572-a589-471072bd0aea@default> (Drew Adams's message of "Thu, 13 Jun 2013 20:42:04 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:75096 Archived-At: > Things seem to work pretty much as they should, but if you do > `C-s C-y C-e C-e' then as soon as you hit the second `C-e' you > see this error msg: "Stack overflow in equal", which comes from > `set-temporary-overlay-map'. Good point, thanks. I've installed a further fix (see below) which should fix this problem. Stefan === modified file 'lisp/subr.el' --- lisp/subr.el 2013-06-13 22:24:52 +0000 +++ lisp/subr.el 2013-06-14 04:08:45 +0000 @@ -3794,12 +3794,15 @@ (if (not load-file-name) ;; Not being provided from a file, run func right now. (funcall func) - (let ((lfn load-file-name)) - (letrec ((fun (lambda (file) + (let ((lfn load-file-name) + ;; Don't use letrec, because equal (in + ;; add/remove-hook) would get trapped in a cycle. + (fun (make-symbol "eval-after-load-helper"))) + (fset fun (lambda (file) (when (equal file lfn) (remove-hook 'after-load-functions fun) - (funcall func))))) - (add-hook 'after-load-functions fun)))))))) + (funcall func)))) + (add-hook 'after-load-functions fun))))))) ;; Add FORM to the element unless it's already there. (unless (member delayed-func (cdr elt)) (nconc elt (list delayed-func))))))) @@ -4282,7 +4285,10 @@ Optional ON-EXIT argument is a function that is called after the deactivation of MAP." - (letrec ((clearfun + (let ((clearfun (make-symbol "clear-temporary-overlay-map"))) + ;; Don't use letrec, because equal (in add/remove-hook) would get trapped + ;; in a cycle. + (fset clearfun (lambda () ;; FIXME: Handle the case of multiple temporary-overlay-maps ;; E.g. if isearch and C-u both use temporary-overlay-maps, Then @@ -4298,7 +4304,7 @@ (t (funcall keep-pred))) (remove-hook 'pre-command-hook clearfun) (internal-pop-keymap map 'overriding-terminal-local-map) - (when on-exit (funcall on-exit)))))) + (when on-exit (funcall on-exit))))) (add-hook 'pre-command-hook clearfun) (internal-push-keymap map 'overriding-terminal-local-map)))