Hi. On Wed, May 11, 2011 at 07:00:30AM +0530, Kenneth Gonsalves wrote: > in python to mark strings for translation one does this: > > string: somestring > marked string: _("somestring") > > and in django templates: > string: somestring > marked string: {% trans "somestring" %} > > can anyone suggest a very quick and easy way of doing this?
The macro recommended is good; another method would be to simply use a careful keyboard macro. For instance, go to the top of the buffer, then: C-x ( (start recording) C-s " (search for "\"") C-b ( (prepend the parenthesis) C-s " C-s (search for the closing paren) C-f ) (closing paren) C-x ) Then you can basically just keep doing C-x e, or do C-u 100 C-x e to run the macro, say 100 times. The advantage of this method is that you don't need to write Emacs Lisp. The disadvantage is that it is prone to errors and not flexible. See http://www.emacswiki.org/emacs/KeyboardMacros for details. Kumar -- : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Booting M$ from secondary HDD LOST #318 other=/dev/hdb1 | Make an entry in /etc/lilo.conf as label=DOS | shown to boot M$ from secondary HDD. table=/dev/hdb | This leads BIOS to believe that /hdb map-drive = 0x80 | (secondary HDD) is the primary and to = 0x81 | boots M$/Win normally ... Handy when map-drive = 0x81 | you swap your HDDs around on adding to = 0x80 | a second hard disk ... ####[perisat (at) yahoo.com]################################## : _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc