[Top][All Lists]

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

[Warning] cl-count (And Other Options)

From: Eric James Michael Ritz
Subject: [Warning] cl-count (And Other Options)
Date: Fri, 30 Nov 2012 17:01:58 -0500
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0

First my apologies if this email would be more appropriate elsewhere.

I am currently using GNU Emacs (i686-pc-linux-gnu, GTK+
Version 2.24.13), compiled on the 24th of November 2012.  In a
function in my php-mode [1] I have the following function definition:

    (defun php-unindent-closure ()
      (let ((syntax (mapcar 'car c-syntactic-context)))
        (if (and (member 'arglist-cont-nonempty syntax)
                  (member 'statement-block-intro syntax)
                  (member 'brace-list-intro syntax)
                  (member 'brace-list-close syntax)
                  (member 'block-close syntax)))
(let ((count-func (if (fboundp 'cl-count) #'cl-count #'count)())))
              (delete-char (* (cl-count 'arglist-cont-nonempty syntax)

The key thing to note (unless you see something glaringly wrong with
it) is the call to `cl-count`.  When I compile the file containing the
function I receive the following warning:

Compiling file /home/eric/Projects/php-mode/php-mode.el at Fri Nov 30 16:49:05 2012

    In php-unindent-closure:
php-mode.el:436:8:Warning: malformed let binding: `(count-func (if (fboundp
        (quote cl-count)) (function cl-count) (function count)) nil)

The warning leads me to believe that use of `cl-count` is not
encouraged.  Is that the case?  And if so, what would be my best
alternative which would not trigger a warning?

Thank you in advanced!



reply via email to

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