yatex
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 diff
1.1 --- a/yahtml.el Thu Apr 24 22:48:06 2014 +0900 1.2 +++ b/yahtml.el Tue Jun 03 09:31:13 2014 +0900 1.3 @@ -1,6 +1,6 @@ 1.4 ;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*- 1.5 ;;; (c) 1994-2013 by HIROSE Yuuji [yuuji(@)yatex.org] 1.6 -;;; Last modified Fri Jan 17 19:10:27 2014 on firestorm 1.7 +;;; Last modified Tue Jun 3 09:28:49 2014 on firestorm 1.8 ;;; $Id$ 1.9 1.10 (defconst yahtml-revision-number "1.76" 1.11 @@ -1711,7 +1711,8 @@ 1.12 (while l 1.13 (setq mess (format "%s %c" mess (car (car l)) (cdr (car l))) 1.14 l (cdr l))) 1.15 - (message "Char-entity reference: %s SPC=& RET=&; Other=&#..;" mess) 1.16 + (message "Char-entity reference: %s SPC=& RET=&; BS=%s Other=&#..;" 1.17 + mess (if YaTeX-japan "直前の文字" "Preceding-Char")) 1.18 (setq c (read-char)) 1.19 (cond 1.20 ((equal c (car-safe (assoc c list))) 1.21 @@ -1721,7 +1722,11 @@ 1.22 (forward-char -1)) 1.23 ((equal c ? ) 1.24 (insert ?&)) 1.25 - (t (insert (format "&#%d;" c)))))) 1.26 + ((and (memq c '(127 8)) 1.27 + (setq c (preceding-char)) 1.28 + (delete-backward-char 1) 1.29 + nil)) ;Fall through to the next 't block 1.30 + (t (insert (format "&#%x;" c)))))) 1.31 1.32 (defun yahtml:!--\#include () 1.33 (let ((file (yahtml-read-parameter "file" "")))