changeset 396:2fc714f03ddf dev

Clarify which element the current class name completions for
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 16 Jan 2015 10:47:48 +0900
parents 5aa8208fbef0
children d9c23841313b
files yahtml.el
diffstat 1 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/yahtml.el	Fri Jan 16 10:39:19 2015 +0900
+++ b/yahtml.el	Fri Jan 16 10:47:48 2015 +0900
@@ -1,9 +1,9 @@
 ;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*-
-;;; (c) 1994-2013 by HIROSE Yuuji [yuuji(@)yatex.org]
-;;; Last modified Fri Jan 16 10:00:10 2015 on firestorm
+;;; (c) 1994-2015 by HIROSE Yuuji [yuuji(@)yatex.org]
+;;; Last modified Fri Jan 16 10:44:54 2015 on firestorm
 ;;; $Id$
 
-(defconst yahtml-revision-number "1.77"
+(defconst yahtml-revision-number "1.78.1"
   "Revision number of running yahtml.el")
 
 ;;; Commentary:
@@ -895,14 +895,16 @@
 	 (save-excursion (insert (format "</%s>" form))))
      (if (search-backward "\"\"" p t) (forward-char 1))))
 
-(defun yahtml-read-css (alist)
+(defun yahtml-read-css (alist &optional element)
   (let ((completion-ignore-case t) (delim " ")
-	(minibuffer-completion-table alist))
+	(minibuffer-completion-table alist)
+	(quotekey (substitute-command-keys "\\[quoted-insert]")))
     (read-from-minibuffer-with-history
-     (substitute-command-keys
-      (if YaTeX-japan
-	  "クラス(複数指定は\\[quoted-insert] SPCで区切る): "
-	"class(or class list delimited by \\[quoted-insert] SPC): "))
+     (if YaTeX-japan
+	 (format "%sクラス(複数指定は%s SPCで区切る): "
+		 (if element (concat element "の") "") quotekey)
+       (format "class%s(multiple class can be delimited by %s SPC): "
+	       (if element (concat " for " element) "") quotekey))
      nil YaTeX-minibuffer-completion-map nil)))
   
 (defvar yahtml-newpage-command "newpage.rb"
@@ -934,7 +936,7 @@
 	   (memq yahtml-current-completion-type '(multiline inline))
 	   (not (string-match "#" form))
 	   (yahtml-make-optional-argument ;should be made generic?
-	    "class" (yahtml-read-css a)))
+	    "class" (yahtml-read-css a form)))
       (if (and (intern-soft addin) (fboundp (intern-soft addin))
 	       (stringp (setq s (funcall (intern addin))))
 	       (string< "" s))
@@ -2144,7 +2146,7 @@
 	(if (and (equal attr "class")	     ;treat "class" attribute specially
 		 (setq css (yahtml-css-get-element-completion-alist tag)))
 	    
-	    (setq new (yahtml-read-css css))
+	    (setq new (yahtml-read-css css tag))
 	  ;;other than "class", read parameter normally
 	  (setq new (yahtml-read-parameter attr)))
 	(goto-char (car (get 'yahtml-on-assignment-p 'region)))

yatex.org