[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A true challenge for Emac and Elisp hackers - at Least I think so
From: |
Matthieu Moy |
Subject: |
Re: A true challenge for Emac and Elisp hackers - at Least I think so |
Date: |
Wed, 12 Oct 2005 15:29:54 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se> writes:
> 2) Write a function which does what you want and bind it to RET key
> *) the function should check if buffer name ends with *.c
Better: bind this function only in c-mode and c++-mode. No test needed
in the command itself.
C-h v c++-mode-map RET
C-h v c-mode-map RET
> *) the function should get current line contents (think of
> functions buffer-substring, point, beginning-of-line, etc.)
and C-h f looking-at RET. You don't even need to get it in a string.
(if (save-excursion
(beginning-of-line)
(looking-at ".*return;")) ; adapt ...
...
...)
> *) compare it with what do you want (string-match maybe?)
> *) either insert "\n" or "; DBG\n"
>
> And also, try "C-h i C-s elisp RET" :)
C-h i m eli TAB RET ;-).
--
Matthieu
Re: A true challenge for Emac and Elisp hackers - at Least I think so, Pascal Bourguignon, 2005/10/12
RE: A true challenge for Emac and Elisp hackers - at Least I think so, Drew Adams, 2005/10/12
Re: A true challenge for Emac and Elisp hackers - at Least I think so, Thien-Thi Nguyen, 2005/10/12