|
From: | Adam Johnson |
Subject: | Re: [AUCTeX] A bug to add a pair of braces and more? |
Date: | Wed, 01 Nov 2006 11:19:20 -0600 |
On Tue, Oct 31, 2006 at 05:44:25PM -0600, Adam Johnson wrote: ... > Just a thought, can you please produce any operation to delete a pair of > braces, that is to change "{blabla}" to "blabla"? In general, an extra> pair of "{}" will not affect anything, but I'd like to keep my document as> neat as possible. (that is, without extra things like this in the > document.) Very good idea. Most often I would like to delete such a pair of surrounding braces after auctex inserted them automatically for sub/superscripts. Removing braces around one letter sub/superscripts might be an improvement to electric sub/superscripts.
Actually, I do like the the braces around the sub/superscripts for either single or multiple letters, which looks more formal in my viewpoint. You can set TeX-electric-sub-and-superscript to deactive it if you are in such a case a lot.
If this really bothers you or somebody else, how about the following idea to implement it? Use another switch, for example, TeX-minibuffer-sub-and-superscript, if it is turned ON and TeX-electric-sub-and-superscript IS TURNED ON, then when you input a _ or ^ in a math environment, you will be prompted to type the super or subscripts in the minibuffer: a. if only one letter, after press "Enter", there is no extra {} surrounds it and the cursor will follow it. b. if more than one letter, then a pair of {} is added and the cursor will be out of the {}. c. if empty, then back to normal, a pair of {} is added, the cursor is put inside the {}, so people can type their own (may be longer) super/subscript?
Or extend the current TeX-electric-sub-and-superscript to FOUR modes:0 -- As the current status, turn it off, users type {} as they like in the Emacs buffer directly. 1 -- As the current status, add a {} after _ or ^ always, and put the cursor inside the braces. 2 -- Use the minibuffer to type the super/subscripts and add the {} only for multiple letters; cursor will be placed after your input or }; emtpy or white space input to the minibuffer will go back the normal buffer and operate same as 0 (not sure whether it is useful or not, but no hurt at least?) 3 -- Use the minibuffer to type the super/subscripts and add the {} only for multiple letters; cursor will be placed after your input or }; emtpy or white space input to the minibuffer will go back the normal buffer and operate same as 1
For my case, one example is that sometimes I use \textcolor{red}{a big blahblah paragraph} for a draft file to emphasize some parts in color. When I try to remove these colored texts, I can find "\textcolor{red}{" easily and remove them, but the matched closing brace "}" may be difficult. Sometimes, I'd like to just remove "\textcolor{red}", and keep an extra "{}" without error. But I do prefer to removing the extra {} as well if some easy operation can find it and remove it.
-- Adam _________________________________________________________________Get today's hot entertainment gossip http://movies.msn.com/movies/hotgossip?icid=T002MSN03A07001
[Prev in Thread] | Current Thread | [Next in Thread] |