unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Matthieu Moy <MatthieuNOSPAM.Moy@imag.fr.invalid>
Subject: Re: A true challenge for Emac and Elisp hackers - at Least I think so
Date: Wed, 12 Oct 2005 15:29:54 +0200	[thread overview]
Message-ID: <vpq64s2g8x9.fsf@ecrins.imag.fr> (raw)
In-Reply-To: mailman.11019.1129123023.20277.help-gnu-emacs@gnu.org

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

  parent reply	other threads:[~2005-10-12 13:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-12 11:48 A true challenge for Emac and Elisp hackers - at Least I think so Sune
2005-10-12 12:49 ` Gian Uberto Lauri
2005-10-12 13:16 ` Slawomir Nowaczyk
     [not found] ` <mailman.11019.1129123023.20277.help-gnu-emacs@gnu.org>
2005-10-12 13:29   ` Matthieu Moy [this message]
2005-10-12 14:04     ` Slawomir Nowaczyk
     [not found]     ` <mailman.11022.1129125880.20277.help-gnu-emacs@gnu.org>
2005-10-12 16:13       ` Giorgos Keramidas
2005-10-12 19:20         ` Chris McMahan
2005-10-12 13:48 ` Pascal Bourguignon
2005-10-12 15:36 ` Drew Adams
2005-10-12 23:28 ` Thien-Thi Nguyen
2005-10-13  9:13   ` Sune
2005-10-13 14:33     ` Joe Corneli
2005-10-13 21:45   ` Sune
2005-10-13 21:49   ` Sune
2005-10-14 13:10     ` Thien-Thi Nguyen
2005-10-15 17:57   ` Sune
2005-10-15 19:57     ` Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpq64s2g8x9.fsf@ecrins.imag.fr \
    --to=matthieunospam.moy@imag.fr.invalid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).