changeset 319:afe97f605d96 dev

yahtml-insert-amps: `& BackSpace' translate preceding char to entity reference.
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 03 Jun 2014 09:31:13 +0900
parents 1336fbc4ab5b
children 1bbc6cff5b6c
files yahtml.el
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/yahtml.el	Thu Apr 24 22:48:06 2014 +0900
+++ b/yahtml.el	Tue Jun 03 09:31:13 2014 +0900
@@ -1,6 +1,6 @@
 ;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*-
 ;;; (c) 1994-2013 by HIROSE Yuuji [yuuji(@)yatex.org]
-;;; Last modified Fri Jan 17 19:10:27 2014 on firestorm
+;;; Last modified Tue Jun  3 09:28:49 2014 on firestorm
 ;;; $Id$
 
 (defconst yahtml-revision-number "1.76"
@@ -1711,7 +1711,8 @@
     (while l
       (setq mess (format "%s %c" mess (car (car l)) (cdr (car l)))
 	    l (cdr l)))
-    (message "Char-entity reference:  %s  SPC=& RET=&; Other=&#..;" mess)
+    (message "Char-entity reference:  %s  SPC=& RET=&; BS=%s Other=&#..;"
+	     mess (if YaTeX-japan "直前の文字" "Preceding-Char"))
     (setq c (read-char))
     (cond
      ((equal c (car-safe (assoc c list)))
@@ -1721,7 +1722,11 @@
       (forward-char -1))
      ((equal c ? )
       (insert ?&))
-     (t (insert (format "&#%d;" c))))))
+     ((and (memq c '(127 8))
+	   (setq c (preceding-char))
+	   (delete-backward-char 1)
+	   nil))			;Fall through to the next 't block
+     (t (insert (format "&#%x;" c))))))
 
 (defun yahtml:!--\#include ()
   (let ((file (yahtml-read-parameter "file" "")))

yatex.org