David Kastrup writes: > Ralf Angeli <[EMAIL PROTECTED]> writes:
[...] >> As an example, I often abort the insertion of labels when adding a >> sectioning command and would not want to have everything rolled back >> in this case. But this mostly occurs when I am testing stuff and >> not during normal writing, so this might not be representative. >> >> But we are not (yet) talking about `LaTeX-section' but about >> `TeX-insert-macro'. Currently I don't have an example where it >> could be useful to abort the insertion and be happy with the >> inserted plain macro. So it would be fine with me. What about >> other people? I would appreciate it, if macro insertion worked like environment or section insertion. I have noticed (at least for inserting section `section' and environment `figure'), that there are two phases of inserting stuff. First, the user is asked for details specific for the section or environment. For example, when I want to insert a new figure, there are questions about caption, float position and so on. During the course of answering those questions, I can hit `C-g' and my buffer stays untouched. The very last question handles the label (if there is a caption), and before that, the environment is output. I can define a label or abort, however the buffer (with the newly created environment) is now in a state, where I can build the document. Maybe you should consider two phases, when you let the user insert a section, environment or a macro: * ask the details. If the user wants to abort, let him do so and the buffer is not changed. * if there is a caption, ask for the label. If the user wants no label, let him do so, however, the previously inserted stuff is kept. > I think that we should rather try to have the buffer in reasonable > intermediate states when prompts come up, so that C-g does not leave > them more inconvenient than necessary. And if people don't want to do > the arguments in the AUCTeX way, we should not sulk and say "ok, you > don't get anything then". > >> In case we want that, I could check in the attached patch. (That's >> actually the first macro I've ever written. Nobody tell me that >> this would be better done with something like defalias or >> defun. (c;) > > Macros not in need of being special are more often than not > conveniently written using defsubst. I have not actually taken a look > whether this applies here because I don't think it a really good idea, > anyway. The statement above reflects my observation on one section type and the `figure' environment. Thus it may be that other environment or section types are handled in a different manner. However, wouldn't it be reasonable to force a consistent behavior as sections, environments and macros are inserted? Franz. _______________________________________________ bug-auctex mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-auctex
