yatex

diff yatexadd.el @ 61:b9f753846b6b

Bug fix release
author yuuji
date Mon, 07 Apr 1997 20:07:48 +0000
parents 48ac97a6b6ce
children 36a48185b95a
line diff
     1.1 --- a/yatexadd.el	Wed May 01 15:35:40 1996 +0000
     1.2 +++ b/yatexadd.el	Mon Apr 07 20:07:48 1997 +0000
     1.3 @@ -1,8 +1,8 @@
     1.4  ;;; -*- Emacs-Lisp -*-
     1.5  ;;; YaTeX add-in functions.
     1.6  ;;; yatexadd.el rev.13
     1.7 -;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     1.8 -;;; Last modified Sat Apr 27 21:38:36 1996 on NSR
     1.9 +;;; (c )1991-1997 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    1.10 +;;; Last modified Fri Jan 24 18:00:45 1997 on supra
    1.11  ;;; $Id$
    1.12  
    1.13  ;;;
    1.14 @@ -91,6 +91,7 @@
    1.15  
    1.16  (defun YaTeX:table ()
    1.17    "YaTeX add-in function for table environment."
    1.18 +  (setq env-name "tabular")
    1.19    (YaTeX:read-position "htbp")
    1.20  )
    1.21  
    1.22 @@ -388,16 +389,25 @@
    1.23  (defun YaTeX::ref (argp &optional labelcmd refcmd)
    1.24    (cond
    1.25     ((= argp 1)
    1.26 -    (save-excursion
    1.27 -      (let ((lnum 0) e0 label label-list (buf (current-buffer))
    1.28 -	    (labelcmd (or labelcmd "label")) (refcmd (or refcmd "ref"))
    1.29 -	    (p (point)) initl line)
    1.30 -	(goto-char (point-min))
    1.31 -	(message "Collecting labels...")
    1.32 -	(save-window-excursion
    1.33 -	  (YaTeX-showup-buffer
    1.34 -	   YaTeX-label-buffer (function (lambda (x) (window-width x))))
    1.35 +    (let ((lnum 0) e0 label label-list (buf (current-buffer))
    1.36 +	  (labelcmd (or labelcmd "label")) (refcmd (or refcmd "ref"))
    1.37 +	  (p (point)) initl line cf)
    1.38 +      (message "Collecting labels...")
    1.39 +      (save-window-excursion
    1.40 +	(YaTeX-showup-buffer
    1.41 +	 YaTeX-label-buffer (function (lambda (x) (window-width x))))
    1.42 +	(if (fboundp 'select-frame) (setq cf (selected-frame)))
    1.43 +	(if (eq (window-buffer (minibuffer-window)) buf)
    1.44 +	    (progn
    1.45 +	      (other-window 1)
    1.46 +	      (setq buf (current-buffer))
    1.47 +	      (set-buffer buf)
    1.48 +	      ;(message "cb=%s" buf)(sit-for 3)
    1.49 +	      ))
    1.50 +	(save-excursion
    1.51 +	  (goto-char (point-min))
    1.52  	  (with-output-to-temp-buffer YaTeX-label-buffer
    1.53 +	    (princ (format "=== LABELS in [%s] ===\n" (buffer-name buf)))
    1.54  	    (while (YaTeX-re-search-active-forward
    1.55  		    (concat "\\\\" labelcmd "\\b")
    1.56  		    (regexp-quote YaTeX-comment-prefix) nil t)
    1.57 @@ -422,21 +432,24 @@
    1.58  	    (princ YaTeX-label-menu-any)
    1.59  	    );with
    1.60  	  (goto-char p)
    1.61 +	  (or initl (setq initl lnum))
    1.62  	  (message "Collecting %s...Done" labelcmd)
    1.63 +	  (if (fboundp 'select-frame) (select-frame cf))
    1.64  	  (YaTeX-showup-buffer YaTeX-label-buffer nil t)
    1.65  	  (YaTeX::label-setup-key-map)
    1.66  	  (setq truncate-lines t)
    1.67  	  (setq buffer-read-only t)
    1.68  	  (use-local-map YaTeX-label-select-map)
    1.69  	  (message YaTeX-label-guide-msg)
    1.70 -	  (goto-line (or initl lnum))	;goto recently defined label line
    1.71 +	  (goto-line (1+ initl)) ;goto recently defined label line
    1.72  	  (unwind-protect
    1.73  	      (progn
    1.74  		(recursive-edit)
    1.75  		(set-buffer (get-buffer YaTeX-label-buffer)) ;assertion
    1.76  		(beginning-of-line)
    1.77 -		(setq line (count-lines (point-min)(point)))
    1.78 +		(setq line (1- (count-lines (point-min)(point))))
    1.79  		(cond
    1.80 +		 ((= line -1) (setq label ""))
    1.81  		 ((= line lnum) (setq label (YaTeX-label-other)))
    1.82  		 ((= line (1+ lnum))
    1.83  		  (save-excursion