yatex
diff yatexgen.el @ 52:5d94deabb9f9
Set YaTeX-indent-line to 'indent-line-function.
Revise fill features.
author | yuuji |
---|---|
date | Sun, 22 Jan 1995 14:20:46 +0000 |
parents | b0371b6ed799 |
children | 48ac97a6b6ce |
line diff
1.1 --- a/yatexgen.el Tue Dec 20 21:00:21 1994 +0000 1.2 +++ b/yatexgen.el Sun Jan 22 14:20:46 1995 +0000 1.3 @@ -1,8 +1,8 @@ 1.4 ;;; -*- Emacs-Lisp -*- 1.5 ;;; YaTeX add-in function generator. 1.6 -;;; yatexgen.el rev.4 1.7 -;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 1.8 -;;; Last modified Sun Dec 11 05:38:35 1994 on VFR 1.9 +;;; yatexgen.el rev.5 1.10 +;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 1.11 +;;; Last modified Sun Jan 22 23:15:34 1995 on landcruiser 1.12 ;;; $Id$ 1.13 1.14 (require 'yatex) 1.15 @@ -142,6 +142,11 @@ 1.16 (defvar YaTeX-generate-message-height 1.17 10 "Window height of YaTeX-generate-message-buffer") 1.18 1.19 +;; Do you need learning for generated function? 1.20 +;; If you need, please tell me (yuuji@ae.keio.ac.jp) 1.21 +;;(defvar YaTeX-generate-variables-for-learning nil) 1.22 +;;(defvar YaTeX-generate-current-completion-table nil) 1.23 + 1.24 ;;; 1.25 ;Generate mode. 1.26 ;;; 1.27 @@ -437,7 +442,7 @@ 1.28 (insert cand "\n")) 1.29 (kill-buffer buf))) 1.30 ;;(set-buffer cb) 1.31 - (concat cands ")")) 1.32 + (setq YaTeX-generate-current-completion-table (concat cands ")"))) 1.33 ) 1.34 (defun YaTeX-generate-corresponding-paren (left) 1.35 (cond 1.36 @@ -457,19 +462,27 @@ 1.37 ")\n") 1.38 ) 1.39 (defun YaTeX-generate-create-completing-read (&optional nth) 1.40 - (concat 1.41 - "(completing-read \"" 1.42 - (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: ")) 1.43 - ": \"\n" 1.44 - (format "'%s\n" (YaTeX-generate-read-completion-table)) 1.45 - "nil " 1.46 - (format "%s)" (y-or-n-p "Require match? "))) 1.47 + (prog1 1.48 + (concat 1.49 + "(completing-read \"" 1.50 + (read-string 1.51 + (if nth (format "Prompt for argument#%d: " nth) "Prompt: ")) 1.52 + ": \"\n" 1.53 + (format "'%s\n" (YaTeX-generate-read-completion-table)) 1.54 + "nil " 1.55 + (format "%s)" (y-or-n-p "Require match? "))) 1.56 + (if nil ;;;(y-or-n-p "Do you need learning for this completion?") 1.57 + (setq YaTeX-generate-variables-for-learning 1.58 + (cons 1.59 + (cons (format "YaTeX-%s-%d" command (or nth 0)) 1.60 + YaTeX-generate-current-completion-table) 1.61 + YaTeX-generate-variables-for-learning)))) 1.62 ) 1.63 (defun YaTeX-generate-create-read-file-name (&optional nth) 1.64 (concat 1.65 "(read-file-name \"" 1.66 (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: ")) 1.67 - ": \" "" nil t \"\")\n") 1.68 + ": \" "" \"\" t \"\")\n") 1.69 ) 1.70 (defun YaTeX-generate-create-read-oneof (&optional nth readpos) 1.71 (concat 1.72 @@ -491,24 +504,23 @@ 1.73 (cond 1.74 ;;Read string 1.75 ((eq type 'string) 1.76 - (concat \"\" (setq leftp (read-string "Left parenthesis: " "{")) 1.77 - \""\n" 1.78 + (concat "\"" (setq leftp (read-string "Left parenthesis: " "(")) 1.79 + "\"\n" 1.80 (YaTeX-generate-create-read-string) 1.81 - \"\" (YaTeX-generate-corresponding-paren leftp) \"\" 1.82 - )) 1.83 - 1.84 + "\"" (YaTeX-generate-corresponding-paren leftp) "\"") 1.85 + ) 1.86 ;;Completing-read 1.87 ((eq type 'completion) 1.88 - (concat \"\" (setq leftp (read-string "Left parenthesis: " "{")) 1.89 - \""\n" 1.90 + (concat "\"" (setq leftp (read-string "Left parenthesis: " "{")) 1.91 + "\"\n" 1.92 (YaTeX-generate-create-completing-read) 1.93 - \"\" (YaTeX-generate-corresponding-paren leftp) \"\") 1.94 + "\"" (YaTeX-generate-corresponding-paren leftp) "\"") 1.95 ) 1.96 ((eq type 'file) 1.97 - (concat \"\" (setq leftp (read-string "Left parenthesis: " "{")) 1.98 - \""\n" 1.99 + (concat "\"" (setq leftp (read-string "Left parenthesis: " "(")) 1.100 + "\"\n" 1.101 (YaTeX-generate-create-read-file-name) 1.102 - \"\" (YaTeX-generate-corresponding-paren leftp) \"\") 1.103 + "\"" (YaTeX-generate-corresponding-paren leftp) "\"") 1.104 ) 1.105 ((eq type 'oneof) 1.106 (YaTeX-generate-create-read-oneof nil t) 1.107 @@ -521,7 +533,6 @@ 1.108 " (concat \"[\" op \"]\")\n" 1.109 " \"\"))\n") 1.110 ) 1.111 - 1.112 ((eq type 'coord) 1.113 (concat "(YaTeX:read-coordinates \"" 1.114 (read-string "Prompt for coordinates: ") 1.115 @@ -576,13 +587,13 @@ 1.116 (defun YaTeX-generate-simple (&optional command) 1.117 "Simple but requiring some elisp knowledge add-in generator." 1.118 (interactive) 1.119 + (setq YaTeX-generate-variables-for-learning nil) 1.120 (or command 1.121 (setq command 1.122 (completing-read 1.123 (format "Making add-in function for (default %s): " section-name) 1.124 (append 1.125 section-table user-section-table tmp-section-table 1.126 - article-table user-article-table 1.127 env-table user-env-table tmp-env-table 1.128 singlecmd-table user-singlecmd-table tmp-singlecmd-table) 1.129 nil nil)