all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric James Michael Ritz <lobbyjones@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: [Warning] cl-count (And Other Options)
Date: Fri, 30 Nov 2012 17:01:58 -0500	[thread overview]
Message-ID: <50B92CD6.20809@gmail.com> (raw)

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
南無妙法蓮華經




             reply	other threads:[~2012-11-30 22:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-30 22:01 Eric James Michael Ritz [this message]
2012-11-30 22:20 ` [Warning] cl-count (And Other Options) Dmitry Gutov
2012-11-30 22:58   ` Drew Adams

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=50B92CD6.20809@gmail.com \
    --to=lobbyjones@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.