all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Joris Steyn <jorissteyn@gmail.com>
Cc: 18845@debbugs.gnu.org
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	[thread overview]
Message-ID: <jwvvbn22pis.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAAwT9LNXS2Wc0+-vOsXSxKu8WR2PTFYoP3DvyZEvAW9S3w2CVg@mail.gmail.com> (Joris Steyn's message of "Sun, 26 Oct 2014 23:02:38 +0100")

>   ; 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)))
 \f
 ;;; 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






      reply	other threads:[~2014-10-30  3:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-26 22:02 bug#18845: 24.4; cc-mode derived modes broken because cl is used but not required Joris Steyn
2014-10-30  3:54 ` Stefan Monnier [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=jwvvbn22pis.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=18845@debbugs.gnu.org \
    --cc=jorissteyn@gmail.com \
    /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.