From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Le Wang Newsgroups: gmane.emacs.help Subject: Re: Help with emacs scripting Date: Wed, 11 Apr 2012 19:31:22 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6de006c2fbe4104bd6594e7 X-Trace: dough.gmane.org 1334143902 28899 80.91.229.3 (11 Apr 2012 11:31:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Apr 2012 11:31:42 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Daniel Sousa Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 11 13:31:41 2012 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 1SHvm1-0007X6-1o for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Apr 2012 13:31:41 +0200 Original-Received: from localhost ([::1]:52858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHvm0-0003jW-DB for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Apr 2012 07:31:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHvlp-0003jG-V1 for help-gnu-emacs@gnu.org; Wed, 11 Apr 2012 07:31:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHvll-0004fa-4I for help-gnu-emacs@gnu.org; Wed, 11 Apr 2012 07:31:29 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:47607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHvlk-0004fF-SK for help-gnu-emacs@gnu.org; Wed, 11 Apr 2012 07:31:25 -0400 Original-Received: by werj55 with SMTP id j55so625237wer.0 for ; Wed, 11 Apr 2012 04:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tiHruUJEOxV7ASfe4tZUBM0t2owPyvktOL/bASzA2Ks=; b=neUaHUS797IJcvkIZ+zodx+LtLDrJ5EWcJmyiQeriYIDymxI73K+Mug42J+0HrvZzm RN2+KZuELGvgmahPV6Tn3/+5Te7m81s7qcUcTGkCbp5dymM4dz85aGTbECn3cisaU1LW 4NDMQltMi64RZh6Ax/nGaR9ikTFKKdxwRHOhS/gUQrbP7GDD9QyVlqh0M/lcaHzCEjP3 gFhx9psjBKwzna4uXIhjUrBjE2qgfymvWXyePM8CpBK2buG2MCzF+rhzFxS7oz11ciik 7pLkr8sysTIxPKmr4sjbk1VadX2GPm2cHiR6n0IMScwWGcWj8V0cBFMfDN437bYlPI0x Q+bw== Original-Received: by 10.216.135.206 with SMTP id u56mr8644185wei.29.1334143882345; Wed, 11 Apr 2012 04:31:22 -0700 (PDT) Original-Received: by 10.216.226.224 with HTTP; Wed, 11 Apr 2012 04:31:22 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 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:84423 Archived-At: --0016e6de006c2fbe4104bd6594e7 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Apr 9, 2012 at 5:37 PM, Daniel Sousa wrote: > I'm new to emacs and I have not used it much, but I think that it could > really help me on the task I'm currently doing. > > I need to change a web app to make it translatable. Now I have to change a > bunch of .xsl files. What I need to do is find the strings, then replace > them by something like and add to a > .php something like DEFINE("_LANG_FOO","bar"); > > I think it would be really easy to create an emacs script to automatically > do this, but I don't know how to do it. Can anyone help me? > Your question is vague. What does the buffer look like? Where does "foo" come from? Is it derived from the string you're searching for? Where does "bar" come from? It's best to start coding this and come back with specific questions when you get stuck. "Do my homework" type of questions aren't likely to get you a full solution. Best regards, > Daniel Sousa > -- Le --0016e6de006c2fbe4104bd6594e7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Apr 9, 2012 at 5:37 PM, Daniel Sousa <daniel@sousa.me> wrote:
I'm new to emacs and I have not used it much, but I think that it could= really help me on the task I'm currently doing.

I n= eed to change a web app to make it translatable. Now I have to change a bun= ch of .xsl files. What I need to do is find the strings, then replace them = by something like=A0<xsl:value-of select=3D"/xml/lang/foo" /&g= t; and add to a .php something like=A0DEFINE("_LANG_FOO","ba= r");

I think it would be really easy to create an emacs scri= pt to automatically do this, but I don't know how to do it. Can anyone = help me?

Your question is vague.=A0 What does th= e buffer look like?=A0 Where does "foo" come from?=A0 Is it deriv= ed from the string you're searching for?=A0 Where does "bar" = come from?

It's best to start coding this and come back with specific question= s when you get stuck.=A0 "Do my homework" type of questions aren&= #39;t likely to get you a full solution.
=A0

Best regards,
Daniel Sousa


--
Le
--0016e6de006c2fbe4104bd6594e7--