Re: Bug#290635: auctex: Should allow customizeation of LaTeX-item-beamer
David Kastrup <[email protected]>
| Newsgroups | gmane.emacs.auc-tex |
|---|---|
| Message-ID | <[email protected]> |
"Dr. Thomas Baumann" <[email protected]> writes: > On Tue, 18 Jan 2005 10:12:56 +0100 David Kastrup <[email protected]> wrote: > >> I don't think this makes sense. Typing C-u before the command >> certainly is more effort than just typing RET as an answer to the >> prompt. > > I see the point in a customization of the default behaviour for > people not working with overlays at all. And, as Ralf said, in this > case C-u can help adding an overlay spec ocasionally. Ah, ok. But then I would not let C-u invert, but rather always give the prompt, in order not to cause completely inconsistent behavior. What we can do is to not prompt for negative or zero arguments, and always prompt for explicit positive arguments. Something like (if prefix (> (prefix-numeric-value prefix) 0) our-customized-default-variable) > This is implemented in the attached patch. > >> However, the context sensitivity could save typing indeed, at least >> by offering a sensible default: if the previous item in the current >> environment is without beamer tag, offer an empty string for >> completion, if it is of the form <a-b>, offer <b+1-> as completion, >> if it is of the form <a->, offer <a+1->. Something like that. > > Cool idea, but I think this will require more than the usual three > lines of code... I'll put it on the ToDo-list and I'll appreciate > hints and comments. Well, you'd first have to use (LaTeX-find-matching-begin) to get the search limit. Then you'd search backward for "\\item" with that limit. For other functions, it might be appropriate to skip every \item that has not the same LaTeX-find-matching-begin location, so that we refer just to items at the current level. With beamer, it is more likely that the <x-> items continue in the same manner across environments. So strictly speaking, we should probably rather not start with LaTeX-find-matching-begin in the first place, but rather with LaTeX-beamer-find-startofslide. Cough, cough. Once we have \\item, we can match with (looking-at "<\\([0-9]+\\)?\\(-\\([0-9]+\\)?\\)>") and then construct the default replacement according to (match-beginning 0)... (match-beginning 2) being non-nil or nil. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum