* What does (looking-at "\\>") mean?
@ 2009-01-25 15:38 Wang Lei
2009-01-25 16:52 ` Drew Adams
0 siblings, 1 reply; 6+ messages in thread
From: Wang Lei @ 2009-01-25 15:38 UTC (permalink / raw)
To: help-gnu-emacs
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 ?
Many thanks!
--
Regards
Lei
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: What does (looking-at "\\>") mean?
2009-01-25 15:38 What does (looking-at "\\>") mean? Wang Lei
@ 2009-01-25 16:52 ` Drew Adams
0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2009-01-25 16:52 UTC (permalink / raw)
To: 'Wang Lei', help-gnu-emacs
> (looking-at "\\>")
>
> But, I can't figure out what this "\\>" means.
> Could someone give me a explanation ?
Ask Emacs. Emacs will give you an explanation.
`C-h f looking-at' tells you:
,----
| Return t if text after point matches regular expression REGEXP.
| This function modifies the match data that `match-beginning',
| `match-end' and `match-data' access; save and restore the match
| data if you want to preserve them.
`----
IOW, (looking-at "\\>") returns t if the text following the cursor matches the
regexp "\\>".
Now you might want to ask Emacs about regexps...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What does (looking-at "\\>") mean?
[not found] <mailman.5745.1232899168.26697.help-gnu-emacs@gnu.org>
@ 2009-01-25 20:07 ` weber
2009-01-26 0:51 ` Wang Lei
0 siblings, 1 reply; 6+ messages in thread
From: weber @ 2009-01-25 20:07 UTC (permalink / raw)
To: help-gnu-emacs
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 ?
>
> Many thanks!
>
> --
> Regards
> Lei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What does (looking-at "\\>") mean?
2009-01-25 20:07 ` weber
@ 2009-01-26 0:51 ` Wang Lei
2009-01-26 7:00 ` Thierry Volpiatto
0 siblings, 1 reply; 6+ messages in thread
From: Wang Lei @ 2009-01-26 0:51 UTC (permalink / raw)
To: help-gnu-emacs
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 ?
>>
>> Many thanks!
>>
>> --
>> Regards
>> Lei
>
--
Regards
Lei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What does (looking-at "\\>") mean?
2009-01-26 0:51 ` Wang Lei
@ 2009-01-26 7:00 ` Thierry Volpiatto
2009-01-27 2:20 ` Wang Lei
0 siblings, 1 reply; 6+ messages in thread
From: Thierry Volpiatto @ 2009-01-26 7:00 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What does (looking-at "\\>") mean?
2009-01-26 7:00 ` Thierry Volpiatto
@ 2009-01-27 2:20 ` Wang Lei
0 siblings, 0 replies; 6+ messages in thread
From: Wang Lei @ 2009-01-27 2:20 UTC (permalink / raw)
To: help-gnu-emacs
On 1/26/09, Thierry Volpiatto <thierry.volpiatto@gmail.com> wrote:
>
> 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")))
> `----
Problem is solved.:) But, I'll remember this trick. Helpfull!
Thanks!
>
>
>
> --
> A + Thierry Volpiatto
> Location: Saint-Cyr-Sur-Mer - France
>
>
>
>
--
Regards
Lei
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-01-27 2:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-25 15:38 What does (looking-at "\\>") mean? Wang Lei
2009-01-25 16:52 ` Drew Adams
[not found] <mailman.5745.1232899168.26697.help-gnu-emacs@gnu.org>
2009-01-25 20:07 ` weber
2009-01-26 0:51 ` Wang Lei
2009-01-26 7:00 ` Thierry Volpiatto
2009-01-27 2:20 ` Wang Lei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).