From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lele Gaifax Newsgroups: gmane.emacs.help Subject: Easier way to edit a splitted long string Date: Fri, 04 Oct 2013 00:55:16 +0200 Organization: Nautilus Entertainments Message-ID: <87vc1eufqj.fsf@nautilus.nautilus> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1380840957 19834 80.91.229.3 (3 Oct 2013 22:55:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Oct 2013 22:55: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 Fri Oct 04 00:55:59 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 1VRroN-0006vj-7K for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Oct 2013 00:55:59 +0200 Original-Received: from localhost ([::1]:45538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRroM-0002SU-Uj for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Oct 2013 18:55:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRro0-0002MY-8D for help-gnu-emacs@gnu.org; Thu, 03 Oct 2013 18:55:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRrnt-0006xI-VU for help-gnu-emacs@gnu.org; Thu, 03 Oct 2013 18:55:36 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:45623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRrnt-0006xE-PK for help-gnu-emacs@gnu.org; Thu, 03 Oct 2013 18:55:29 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VRrns-0006Xz-BH for help-gnu-emacs@gnu.org; Fri, 04 Oct 2013 00:55:28 +0200 Original-Received: from 151.62.27.154 ([151.62.27.154]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Oct 2013 00:55:28 +0200 Original-Received: from lele by 151.62.27.154 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Oct 2013 00:55:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 62 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 151.62.27.154 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:1qkRYeABSZB7s9EM2EXL6yCPMMI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:93824 Archived-At: Hi all, I'm looking for an easier way to edit a "template", that is a long string representing a "prototype" text used to generate an HTML page, contained in JavaScript source. As an brief example, consider the following piece of code: { xtype: 'container', itemId: 'header', tpl: [ '
', '
', '
{profession}
', ' {fullname}', ' {city} — {country}', ' {state_label}', '
', '
' ], layout: { type: 'hbox' } }, As you can see, the template is just a JS array of strings, one for each line: before use, all the strings are "joined" (that is, concatenated) together into a single big one. As you may imagine, editing the template as is is very boring! Today, chatting with a friend about it, I had a flashback about some Emacs mode I used very long ago which I'm not able to find: it allowed to edit long C comments in a recursive edit, "stripping" away the "box" decoration (or just the start-comment and end-comment markers) as well as the text indentation on enter, and restoring the same kind of decoration on exit. Applied to my case, that would mean entering into a recursive edit buffer with the following content:
{profession}
{fullname} {city} — {country} {state_label}
It does not seem so difficult to achieve (even for an elisp newbie as I am) and I could give it a try, but I wonder if something similar already exists. Any hint will be very appreciated, thanks a lot, bye, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929.