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

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

Re: What does (looking-at "\\>") mean?


From: Thierry Volpiatto
Subject: Re: What does (looking-at "\\>") mean?
Date: Mon, 26 Jan 2009 08:00:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Wang Lei <wanglei.198112@gmail.com> writes:

> I searched in elisp-info, but forgot emacs-info. :( Now, I got it.
> Thanks for your all!
>
> On 1/25/09, weber <hugows@gmail.com> wrote:
>> From the emacs info on regexps:
>>
>> `\>'
>>      matches the empty string, but only at the end of a word.  `\>'
>>      matches at the end of the buffer only if the contents end with a
>>      word-constituent character.
>>
>> HTH
>> Hugo
>>
>> Wang Lei wrote:
>>> Hi, all.
>>>
>>> I copied a piece of code like this:
>>>
>>> (defun my-indent-or-complete ()
>>>   (interactive)
>>>   (if (looking-at "\\>")
>>>       (hippie-expand nil)
>>>     (indent-for-tab-command)))
>>>
>>> But, I can't figure out what this "\\>" means. Could someone give me a
>>> explanation ?

With this little function, you can understand what looking at does:

Write a word in scratch buffer and leave point at end of word, then do
M-x test-looking-at

Then put the point at the beginning of word and run again test-looking-at

,----
| (defun test-looking-at ()
|   (interactive)
|   (if (looking-at "\\>")
|       (message "There is nothing after point")
|       (message "there is something after point")))
`----



-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





reply via email to

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