unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* [Warning] cl-count (And Other Options)
@ 2012-11-30 22:01 Eric James Michael Ritz
  2012-11-30 22:20 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Eric James Michael Ritz @ 2012-11-30 22:01 UTC (permalink / raw)
  To: help-gnu-emacs

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

I am currently using GNU Emacs 24.2.90.1 (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)
                  (or
                   (member 'statement-block-intro syntax)
                   (member 'brace-list-intro syntax)
                   (member 'brace-list-close syntax)
                   (member 'block-close syntax)))
             (save-excursion
               (let ((count-func (if (fboundp 'cl-count) #'cl-count 
#'count)())))
               (beginning-of-line)
               (delete-char (* (cl-count 'arglist-cont-nonempty syntax)
                               c-basic-offset))))))

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!

[1]: https://github.com/ejmr/php-mode

--
ejmr
南無妙法蓮華經




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-30 22:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-30 22:01 [Warning] cl-count (And Other Options) Eric James Michael Ritz
2012-11-30 22:20 ` Dmitry Gutov
2012-11-30 22:58   ` Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).