From: Jason Morehouse
Subject: dump question
Date: 
Message-ID: <9usNd.274$Ub4.78273@news20.bellglobal.com>
Heya.  I'm a php programmer trying to hack a php-mode for emacs and am a 
little over my head in lisp, but looking for a couple pointers.

I've have this for keyword matching:

(defconst php-keywords
   (eval-when-compile
     (regexp-opt '("array" "bool" "boolean" "etc...")))
   "PHP types.")

I also have a list of functions for auto-completion:

(defvar php-completion-liste
   (list
    '("array")
    '("bool")
    '("boolean")
    '("etc...")
))

As you can see, it's pretty redundent and wasteful to have the two 
separate collections.  What would be the best way to combine the two?  I 
haven't been able to find a function that is equivalent to regexp-opt 
for a list.

If i try and use the list for the keywords, emacs gives the error: Wrong 
type argument: stringp, ("array")... as I assume it should.


Much thanks,
-J

-- 
Jason Morehouse
Vendorama - Create your own online store
http://www.vendorama.com

From: Harald Hanche-Olsen
Subject: Re: dump question
Date: 
Message-ID: <pco8y618reu.fsf@shuttle.math.ntnu.no>
+ Jason Morehouse <··@rm.spam-vendorama.com>:

| Heya.  I'm a php programmer trying to hack a php-mode for emacs and am
| a little over my head in lisp, but looking for a couple pointers.

Wrong group.  This group is mainly for discussions of Common Lisp.
I'll give you a couple pointers, but if you have further questions
please take them to an emacs news group.

| I've have this for keyword matching:
| 
| (defconst php-keywords
|    (eval-when-compile
|      (regexp-opt '("array" "bool" "boolean" "etc...")))
|    "PHP types.")
| 
| I also have a list of functions for auto-completion:
| 
| (defvar php-completion-liste
|    (list
|     '("array")
|     '("bool")
|     '("boolean")
|     '("etc...")
| ))

It is quicker to type: '(("array") ("bool") ...)

| As you can see, it's pretty redundent and wasteful to have the two
| separate collections.  What would be the best way to combine the two?
| I haven't been able to find a function that is equivalent to
| regexp-opt for a list.
| 
| If i try and use the list for the keywords, emacs gives the error:
| Wrong type argument: stringp, ("array")... as I assume it should.

Try: (mapcar php-completion-liste).

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
  than thinking does: but it deprives us of whatever chance there is
  of getting closer to the truth.  -- C.P. Snow
From: Kalle Olavi Niemitalo
Subject: Re: dump question
Date: 
Message-ID: <87lla0cieu.fsf@Astalo.kon.iki.fi>
Harald Hanche-Olsen <······@math.ntnu.no> writes:

> Wrong group.  This group is mainly for discussions of Common Lisp.
> I'll give you a couple pointers, but if you have further questions
> please take them to an emacs news group.

You may be correct about Emacs, which has its own newsgroups.
However, for Lisp dialects not so endowed, comp.lang.lisp is the
right group.

> Try: (mapcar php-completion-liste).

That is valid is neither Common Lisp nor Emacs Lisp.
(mapcar #'car php-completion-liste) works in both.