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#11780: 24.1.50; vc-annotate fails for files in RCS. ("cl.el" `flet' problem?) Date: Wed, 27 Jun 2012 10:26:15 -0400 Message-ID: References: <83k3yv9qik.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1340807238 7008 80.91.229.3 (27 Jun 2012 14:27:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jun 2012 14:27:18 +0000 (UTC) Cc: Richard Copley , 11780@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 27 16:27:17 2012 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 1SjtDA-0003td-Bf for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 16:27:16 +0200 Original-Received: from localhost ([::1]:58815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjtDA-0007Pl-AF for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 10:27:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjtCw-0007B4-6H for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:27:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SjtCp-0006vn-P6 for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:27:01 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjtCp-0006vh-LQ for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:26:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SjtGn-0008BJ-V0 for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jun 2012 14:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11780 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11780-submit@debbugs.gnu.org id=B11780.134080742531408 (code B ref 11780); Wed, 27 Jun 2012 14:31:01 +0000 Original-Received: (at 11780) by debbugs.gnu.org; 27 Jun 2012 14:30:25 +0000 Original-Received: from localhost ([127.0.0.1]:60441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SjtGC-0008AW-Q0 for submit@debbugs.gnu.org; Wed, 27 Jun 2012 10:30:25 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:57363) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SjtGB-0008AN-5N for 11780@debbugs.gnu.org; Wed, 27 Jun 2012 10:30:23 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09sr+Nd/2dsb2JhbABEsEiDSYEIghUBAQQBViMQCw4mEhQYDSSIHAW6CZBEA6MzgViDBYE6Gg X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="192191151" Original-Received: from 108-175-227-93.dsl.teksavvy.com (HELO pastel.home) ([108.175.227.93]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 27 Jun 2012 10:26:15 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 4DC03592B0; Wed, 27 Jun 2012 10:26:15 -0400 (EDT) In-Reply-To: (Glenn Morris's message of "Tue, 26 Jun 2012 21:13:29 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:61327 Archived-At: >> Does the patch below fix things? > Well no, because there are multiple `flet's in the file and that's not > the one giving the immediate error. Duh, right. I have a patch to make flet behave as before, but that behavior is a real horror, so I'd really prefer to move away from it: cl-flet implements the Common-Lisp semantics, which is a lot saner. Does the patch below fix things, this time? Stefan === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2012-06-23 04:24:06 +0000 +++ lisp/emacs-lisp/cl-macs.el 2012-06-27 12:58:16 +0000 @@ -1570,7 +1570,6 @@ (setq cl--labels-convert-cache (cons f res)) res)))))) -;;; This should really have some way to shadow 'byte-compile properties, etc. ;;;###autoload (defmacro cl-flet (bindings &rest body) "Make temporary function definitions. @@ -1596,6 +1595,18 @@ (cons (cons 'function #'cl--labels-convert) newenv))))))) ;;;###autoload +(defmacro cl-flet* (bindings &rest body) + "Make temporary function definitions. +Like `cl-flet' but the definitions can refer to previous ones. + +\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" + (declare (indent 1) (debug ((&rest (cl-defun)) cl-declarations body))) + (cond + ((null bindings) (macroexp-progn body)) + ((null (cdr bindings)) `(cl-flet ,bindings ,@body)) + (t `(cl-flet (,(pop bindings)) (cl-flet* ,bindings ,@body))))) + +;;;###autoload (defmacro cl-labels (bindings &rest body) "Make temporary function bindings. The bindings can be recursive. Assumes the use of `lexical-binding'. === modified file 'lisp/vc/vc-rcs.el' --- lisp/vc/vc-rcs.el 2012-06-06 01:28:08 +0000 +++ lisp/vc/vc-rcs.el 2012-06-27 13:06:53 +0000 @@ -679,7 +679,7 @@ ;; Apply reverse-chronological edits on the trunk, computing and ;; accumulating forward-chronological edits after some point, for ;; later. - (flet ((r/d/a () (vector pre + (cl-flet ((r/d/a () (vector pre (cdr (assq 'date meta)) (cdr (assq 'author meta))))) (while (when (setq pre cur cur (cdr (assq 'next meta))) @@ -769,7 +769,7 @@ ht) (setq maxw (max w maxw)))) (let ((padding (make-string maxw 32))) - (flet ((pad (w) (substring-no-properties padding w)) + (cl-flet ((pad (w) (substring-no-properties padding w)) (render (rda &rest ls) (propertize (apply 'concat @@ -1306,7 +1306,8 @@ ;; to "de-@@-format" the printed representation as the first step ;; to translating it into some value. See internal func `gather'. @-holes) - (flet ((sw () (skip-chars-forward " \t\n")) ; i.e., `[:space:]' + (cl-flet* + ((sw () (skip-chars-forward " \t\n")) ; i.e., `[:space:]' (at (tag) (save-excursion (eq tag (read buffer)))) (to-eol () (buffer-substring-no-properties (point) (progn (forward-line 1) @@ -1331,7 +1332,7 @@ (cons tok (if proc (funcall proc) (buffer-substring-no-properties b e)))) - (k-semi (name &optional proc) (tok+val 'to-semi name proc)) + (k-semi (name &optional proc) (tok+val #'to-semi name proc)) (gather () (let ((pairs `(,e ,@@-holes ,b)) acc) (while pairs @@ -1340,15 +1341,15 @@ acc) (setq pairs (cddr pairs))) (apply 'concat acc))) - (k-one@ (name &optional later) (tok+val 'to-one@ name + (k-one@ (name &optional later) (tok+val #'to-one@ name (if later (lambda () t) - 'gather)))) + #'gather)))) (save-excursion (goto-char (point-min)) ;; headers (setq context 'headers) - (flet ((hpush (name &optional proc) + (cl-flet ((hpush (name &optional proc) (push (k-semi name proc) headers))) (hpush 'head) (when (at 'branch) @@ -1391,7 +1392,7 @@ (when (< (car ls) 100) (setcar ls (+ 1900 (car ls)))) (apply 'encode-time (nreverse ls))))) - ,@(mapcar 'k-semi '(author state)) + ,@(mapcar #'k-semi '(author state)) ,(k-semi 'branches (lambda () (split-string @@ -1421,7 +1422,8 @@ ;; only the former since it behaves identically to the ;; latter in the absence of "@@".) sub) - (flet ((incg (beg end) (let ((b beg) (e end) @-holes) + (cl-flet ((incg (beg end) + (let ((b beg) (e end) @-holes) (while (and asc (< (car asc) e)) (push (pop asc) @-holes)) ;; Self-deprecate when work is done. @@ -1429,7 +1431,7 @@ ;; Thanks B.Mandelbrot, for complex sum. ;; O beauteous math! --the Unvexed Bum (unless asc - (setq sub 'buffer-substring-no-properties)) + (setq sub #'buffer-substring-no-properties)) (gather)))) (while (and (sw) (not (eobp)) @@ -1449,8 +1451,8 @@ (setcdr (cadr rev) (gather)) (if @-holes (setq asc (nreverse @-holes) - sub 'incg) - (setq sub 'buffer-substring-no-properties)) + sub #'incg) + (setq sub #'buffer-substring-no-properties)) (goto-char b) (setq acc nil) (while (< (point) e)