Re: Bug#290635: auctex: Should allow customizeation of LaTeX-item-beamer

"Dr. Thomas Baumann" <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
On Tue, 18 Jan 2005 10:12:56 +0100 David Kastrup <[email protected]> wrote:

> T. Baumann <[email protected]> writes:
> 
> > Frank Küster <frank <at> kuesterei.ch> writes:
> >
> >> a user of beamer.el in Debian has reported the following wishlist
bug:
> >> 
> >> Jorgen Schaefer <forcer <at> debian.org> wrote:
> >> 
> >> > Package: auctex
> >> > Version: 11.53-1
> >> > Severity: wishlist
> >> >
> >> > LaTeX-item-beamer should have an option that stops it from
reading an
> >> > overlay argument (or otherwise allow that (setq LaTeX-item-list
...) in the
> >> > TeX-add-style-hook to be overridden). Not all people use overlays
> >> > extensively, and for those who don't it's annoying to always say
"no,
> >> > really, I don't want overlays"...
> >> 
> >> As far as I can see, TeX-arg-beamer-overlay-spec is still always
and
> >> unconditionally called in TeX-item-beamer.
> >> 
> >> As usual, it seems to me that a customizable option along with a
C-u
> >> toggle would be the best solution.
> >
> > The following patch should add the C-u functionality. I'll get back
with the
> > customization this week after I checked other style files...
> 
> 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.

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.

Thomas
> 
> -- 
> David Kastrup, Kriemhildstr. 15, 44793 Bochum
beamer.patch (application/octet-stream, 1.4 KB)
--- beamer.el	2005-01-13 06:58:31.000000000 +0100
+++ /home/tb/src/lisp/beamer.el	2005-01-18 10:38:11.366652776 +0100
@@ -18,12 +18,18 @@
 
 ;;; Code:
 
+(defvar LaTeX-beamer-section-labels-flag nil
+  "If non-nil section labels are added")
+
+(defcustom LaTeX-beamer-item-overlay-flag t
+  "If nil do not query for an overlay in itemize-like environments."
+  :type 'boolean
+  :group 'LaTeX-macro)
+
 (TeX-add-style-hook
  "beamer"
  (lambda ()
-   (defvar beamer-use-section-labels-flag nil
-     "Controls whether section labels are added")
-   (unless beamer-use-section-labels-flag
+   (unless LaTeX-beamer-section-labels-flag
      (make-local-variable 'LaTeX-section-hook)
      (setq LaTeX-section-hook
 	   '(LaTeX-section-heading
@@ -130,10 +136,16 @@
       (insert TeX-grop TeX-grcl))))
 
 (defun LaTeX-item-beamer ()
-  "Insert a new item with an optional overlay argument."
+  "Insert a new item with an optional overlay argument. 
+If the prefix argument is given the overlay specification is not asked for."
+  (if (listp current-prefix-arg)
+      (setq current-prefix-arg (car current-prefix-arg))
+    current-prefix-arg)
   (TeX-insert-macro "item")
   (delete-horizontal-space)
-  (TeX-arg-beamer-overlay-spec 0)
+  (if (or (and current-prefix-arg (not LaTeX-beamer-item-overlay-flag))
+          (and (not current-prefix-arg) LaTeX-beamer-item-overlay-flag))
+      (TeX-arg-beamer-overlay-spec 0))
   (insert " ")
   (indent-according-to-mode))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.