[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: elisp questions for Advanced Closing brackets function
From: |
TheLonelyStar |
Subject: |
RE: elisp questions for Advanced Closing brackets function |
Date: |
Tue, 20 May 2008 13:04:14 -0700 (PDT) |
Hi,
Thanks for your help! I am sorry if I should have found this information in
the manual.
What do you mean by the "onboard elisp manual"?
This:
http://www.gnu.org/software/emacs/manual/elisp.html ?
I have a another question for which I did not find an answer in the link
above:
I want the closing-parentese function to be more general.
I want to call the same funciton for "]", ")" and "}".
So i would bind this function to all these keys.
But how can the function know by which key it was invoked?
I thought, the key would be given as argument ... but if it is I do not know
how to format the argument to the correct character.
Thanks!
Nathan
Drew Adams wrote:
>
>> - How do I check if the character under (point) is a whitespace?
>
> See function `looking-at'.
>
>> - In an "if" statement, how do I put more than one expression
>> into the else case? Like this:
>> (if condition (do-if-case) ((do-else-case) (do-more-else-case))
>
> Just drop the parens around the else-case parts.
>
> (if (some-test)
> (the-then-part)
> (an-else-part)
> (another-else-part)
> (and-another))
>
> `if' allows any number of sexps in the else part. See also `cond' and
> `when'.
>
>> - If I have a funcion like this:
>> (defun adanced-closing-bracket (arg) ...)
>> How do I compare (arg) to the character under point?
>
> You can compare characters with `eq'. `char-after' picks up the character
> at a
> given buffer position.
>
> (eq arg (char-after (point)))
>
> The onboard Elisp manual is your friend.
> See also the onboard manual "Emacs Lisp Intro".
>
>
>
>
>
--
View this message in context:
http://www.nabble.com/elisp-questions-for-Advanced-Closing-brackets-function-tp17346961p17349504.html
Sent from the Emacs - Help mailing list archive at Nabble.com.