Subject: Re: bug#19178: closed (Re: bug#19178: 11.88; 11.88 Xemacs 11.88 problem with env and labels)

From: Uwe Brauer <[email-masked]>
Date: Thu, 27 Nov 2014 11:39:25 +0100

>> "Mos" == Mos  <Mos> writes:

   >> -            ""))))
   >> +            ""))
   >> +         ((nullp type)
   >> +          "")))
   >                  ^^^^

   > Sorry, I meant nil instead of ""

Hi 

I modified (hopefully correctly) your patch, applied it 
then used my old definitions such as 
(defun LaTeX-rem-insert (environment)	;Version:1.20
	(if (y-or-n-p
		 (format "Do you want a title "))
		(let ((title (read-input " Title: ")))
		  (LaTeX-insert-environment "rem" (concat "[" title "]"))
		  (and (LaTeX-label environment)
			   (newline-and-indent)))
	  (LaTeX-insert-environment "rem")
	  (and (LaTeX-label environment)
		   (newline-and-indent))))

and got an error. I attach the modified patch, and the error

regards

Uwe 

diff --git a/latex.el b/latex.el
index 80d2761..fa18167 100644
--- a/latex.el
+++ b/latex.el
@@ -941,7 +941,7 @@ either the prefix or a symbol referring to one."
 
 (make-variable-buffer-local 'LaTeX-label-alist)
 
-(defun LaTeX-label (name type)
+(defun LaTeX-label (name &optional type)
   "Insert a label for NAME at point.
 TYPE can be either environment or section.  If
 `LaTeX-label-function' is a valid function, LaTeX label will
@@ -955,7 +955,9 @@ transfer the job to this function."
 			  LaTeX-section-label
 			(and (listp LaTeX-section-label)
 			     (cdr (assoc name LaTeX-section-label))))
-		    ""))))
+		    ""))
+		 ((nullp type)
+		  nil)))
 	label)
     (when (symbolp prefix)
       (setq prefix (symbol-value prefix)))