help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: elisp questions for Advanced Closing brackets function


From: Pierre Lorenzon
Subject: Re: elisp questions for Advanced Closing brackets function
Date: Wed, 21 May 2008 08:18:35 +0200 (CEST)

Hi Nathan,

I hvae two suggestions which are not very precise : excuse me
for that ! 

1. First have a look at all the already developped lisp code :
there's maybe what you need or something very near.

2. If you absolutely want to implement it by yourself (which
can be very instructive), I'll suggest to look at the regexp
manipulations in emacs-lisp. I suspect that some of the
functions you try to implement might be shorter, simpler and
faster just using regexp. I would not be surprised as well that
some of your question could be solved in terms of syntax
tables.

Regards

Pierre


From: TheLonelyStar <address@hidden>
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.
> 
> 
> 




reply via email to

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