From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lode leroy Newsgroups: gmane.emacs.help Subject: recompile Date: Wed, 13 Mar 2013 16:17:37 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf301ee811043bf504d7cfe8ad X-Trace: ger.gmane.org 1363222317 26483 80.91.229.3 (14 Mar 2013 00:51:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Mar 2013 00:51:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 14 01:52:22 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UFwP7-0003bK-44 for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Mar 2013 01:52:21 +0100 Original-Received: from localhost ([::1]:58339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFwOk-0000fG-Jf for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Mar 2013 20:51:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFnR5-0000iC-HF for help-gnu-emacs@gnu.org; Wed, 13 Mar 2013 11:17:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFnQx-0000eG-Dq for help-gnu-emacs@gnu.org; Wed, 13 Mar 2013 11:17:47 -0400 Original-Received: from mail-bk0-x22a.google.com ([2a00:1450:4008:c01::22a]:34513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFnQx-0000dv-6q for help-gnu-emacs@gnu.org; Wed, 13 Mar 2013 11:17:39 -0400 Original-Received: by mail-bk0-f42.google.com with SMTP id jk7so520375bkc.15 for ; Wed, 13 Mar 2013 08:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=JjCwptDZVfKgE+xXNmgTyqNewQLpvyZ6EHTwUELD48k=; b=euQqE6/djevLBS8iZx5iPktPI9V8jyyFlXbmhnM4UEWqufV7GTFMO8ubVbF+0c7fLN h0/OeJEU86ZucyK1d8tUtOHqcerOE60Zxe9NN0m05eURvJbw763WhB2YhfQWTpYzEDEz B7fNkZiMzbT25o/YiyjQgAa+NWMj7xf6mz9eh8A090HE+viMz66/MLGsiU9iFmJlUX2B TfzVBSVouMLUhq4DYomHwA2gCV/wKpjNmQk4JmmKKRfD7A3A6aD5fku/dFk3MtI0Fkzh ney0v0jl9aKN1dIvRdTfN48Ecrhtuwj5UpI0tF4NX/XIbVGhBRW6YANJYZPTc775cGhw y4eA== X-Received: by 10.205.26.67 with SMTP id rl3mr7712440bkb.62.1363187857623; Wed, 13 Mar 2013 08:17:37 -0700 (PDT) Original-Received: by 10.204.38.202 with HTTP; Wed, 13 Mar 2013 08:17:37 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4008:c01::22a X-Mailman-Approved-At: Wed, 13 Mar 2013 20:51:35 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89521 Archived-At: --20cf301ee811043bf504d7cfe8ad Content-Type: text/plain; charset=ISO-8859-1 I want to define a keyboard macro that does the following: copy the current line, do a few search-and-replace operations and run it in a shell... I haven't done anything non-trivial in elisp, so I need some help... something along the lines of: (defun recompile-current-line (beginning-of-line) (set-mark-command) (end-of-line) (copy-region-as-kill) (shell-command (replace-regexp "^" "cd ~/build && " current-kill))) can someone give some advice on how to implement this? --20cf301ee811043bf504d7cfe8ad Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I want to define a keyboard macro that does the following:
copy the curr= ent line, do a few search-and-replace operations and run it in a shell...I haven't done anything non-trivial in elisp, so I need some help...<= br>
something along the lines of:

(defun recompile-current-line
= =A0 (beginning-of-line)
=A0 (set-mark-command)
=A0 (end-of-line)
= =A0 (copy-region-as-kill)
=A0 (shell-command
=A0=A0 (replace-regexp &= quot;^" "cd ~/build && "
=A0=A0=A0 current-kill)))

can someone give some advice on how to imp= lement this?
--20cf301ee811043bf504d7cfe8ad--