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#18845: 24.4; cc-mode derived modes broken because cl is used but not required Date: Wed, 29 Oct 2014 23:54:28 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414641344 32432 80.91.229.3 (30 Oct 2014 03:55:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Oct 2014 03:55:44 +0000 (UTC) Cc: 18845@debbugs.gnu.org To: Joris Steyn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 30 04:55:37 2014 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 1Xjgpi-0004kp-Nq for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Oct 2014 04:55:34 +0100 Original-Received: from localhost ([::1]:50726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xjgpi-0006Fe-76 for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Oct 2014 23:55:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjgpS-0006B1-Pu for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 23:55:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjgpL-0003gM-8Z for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 23:55:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjgpD-0003TU-AL; Wed, 29 Oct 2014 23:55:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XjgpC-0002rJ-FU; Wed, 29 Oct 2014 23:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 30 Oct 2014 03:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18845 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: X-Debbugs-Original-Cc: bug-cc-mode@gnu.org, 18845@debbugs.gnu.org Original-Received: via spool by 18845-submit@debbugs.gnu.org id=B18845.141464127710941 (code B ref 18845); Thu, 30 Oct 2014 03:55:02 +0000 Original-Received: (at 18845) by debbugs.gnu.org; 30 Oct 2014 03:54:37 +0000 Original-Received: from localhost ([127.0.0.1]:39625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xjgom-0002qO-GE for submit@debbugs.gnu.org; Wed, 29 Oct 2014 23:54:36 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:20631) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xjgok-0002q9-Px for 18845@debbugs.gnu.org; Wed, 29 Oct 2014 23:54:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvAMAOatTlRFpY87/2dsb2JhbABcgw6DYoZ+yDmDGgQCAoEcFwEBfIQDAQEDAVYjBQsLNBIUGA0kiEsJy3IBAQEBAQEEAQEBAR6RCAeESwWyIIFvgjSBYCGCegEBAQ X-IPAS-Result: AvAMAOatTlRFpY87/2dsb2JhbABcgw6DYoZ+yDmDGgQCAoEcFwEBfIQDAQEDAVYjBQsLNBIUGA0kiEsJy3IBAQEBAQEEAQEBAR6RCAeESwWyIIFvgjSBYCGCegEBAQ X-IronPort-AV: E=Sophos;i="5.04,797,1406606400"; d="scan'208";a="95561675" Original-Received: from 69-165-143-59.dsl.teksavvy.com (HELO pastel.home) ([69.165.143.59]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Oct 2014 23:54:28 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 6657B7CFF; Wed, 29 Oct 2014 23:54:28 -0400 (EDT) In-Reply-To: (Joris Steyn's message of "Sun, 26 Oct 2014 23:02:38 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.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:95284 > ; Symbol's function definition is void: set-difference > (c-lang-const c-matchers-2 c) Indeed. One way to solve these problems is to replace those calls with calls to cl-set-difference. Alan, what do you think? > ; Symbol's function definition is void: cl-macroexpand-all > (c-lang-defconst c-other-kwds t nil) I fixed this one with the patch below, > (eval-when-compile > (if (and (= emacs-major-version 24) (= emacs-minor-version 4)) > (require 'cl))) It's pretty ugly, but yes that should work. > would that be fine and won't there be a future 24.4 release that fixes > this issue? The 24.4 release is over, so no there won't be another 24.4. And hopefully this will be fixed in 24.5. Stefan === modified file 'lisp/progmodes/cc-defs.el' --- lisp/progmodes/cc-defs.el 2014-02-09 12:34:25 +0000 +++ lisp/progmodes/cc-defs.el 2014-10-30 03:46:48 +0000 @@ -169,6 +169,10 @@ (put 'cc-eval-when-compile 'lisp-indent-hook 0)) +(eval-and-compile + (defalias 'c--macroexpand-all + (if (fboundp 'macroexpand-all) + 'macroexpand-all 'cl-macroexpand-all))) ;;; Macros. @@ -1834,12 +1838,9 @@ immediately, i.e. at the same time as the `c-lang-defconst' form itself is evaluated." ;; Evaluate at macro expansion time, i.e. in the - ;; `cl-macroexpand-all' inside `c-lang-defconst'. + ;; `c--macroexpand-all' inside `c-lang-defconst'. (eval form)) -;; Only used at compile time - suppress "might not be defined at runtime". -(declare-function cl-macroexpand-all "cl" (form &optional env)) - (defmacro c-lang-defconst (name &rest args) "Set the language specific values of the language constant NAME. The second argument can optionally be a docstring. The rest of the @@ -1881,7 +1882,7 @@ (let* ((sym (intern (symbol-name name) c-lang-constants)) ;; Make `c-lang-const' expand to a straightforward call to - ;; `c-get-lang-constant' in `cl-macroexpand-all' below. + ;; `c-get-lang-constant' in `c--macroexpand-all' below. ;; ;; (The default behavior, i.e. to expand to a call inside ;; `eval-when-compile' should be equivalent, since that macro @@ -1944,7 +1945,7 @@ ;; reason, but we also use this expansion handle ;; `c-lang-defconst-eval-immediately' and to register ;; dependencies on the `c-lang-const's in VAL.) - (setq val (cl-macroexpand-all val)) + (setq val (c--macroexpand-all val)) (setq bindings (cons (cons assigned-mode val) bindings) args (cdr args)))) === modified file 'lisp/progmodes/cc-langs.el' --- lisp/progmodes/cc-langs.el 2014-06-14 23:54:39 +0000 +++ lisp/progmodes/cc-langs.el 2014-10-30 03:47:12 +0000 @@ -213,7 +213,6 @@ ;; These are defined in cl as aliases to the cl- versions. ;(declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys) t) ;(declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest) t) -;(declare-function cl-macroexpand-all "cl" (form &optional env)) (eval-and-compile ;; Some helper functions used when building the language constants. @@ -3183,7 +3182,7 @@ `(lambda () ;; This let sets up the context for `c-mode-var' and similar - ;; that could be in the result from `cl-macroexpand-all'. + ;; that could be in the result from `c--macroexpand-all'. (let ((c-buffer-is-cc-mode ',mode) current-var source-eval) (c-make-emacs-variables-local) @@ -3193,12 +3192,12 @@ (setq ,@(let ((c-buffer-is-cc-mode mode) (c-lang-const-expansion 'immediate)) ;; `c-lang-const' will expand to the evaluated - ;; constant immediately in `cl-macroexpand-all' + ;; constant immediately in `c--macroexpand-all' ;; below. (cl-mapcan (lambda (init) `(current-var ',(car init) - ,(car init) ,(macroexpand-all + ,(car init) ,(c--macroexpand-all (elt init 1)))) ;; Note: The following `append' copies the ;; first argument. That list is small, so