# HG changeset patch # User HIROSE Yuuji # Date 1401755473 -32400 # Node ID afe97f605d96ffeb8e0cfd33085b0a5400e1ee41 # Parent 1336fbc4ab5ba774d3b60ddb81ae3efdf707eeeb yahtml-insert-amps: `& BackSpace' translate preceding char to entity reference. diff -r 1336fbc4ab5b -r afe97f605d96 yahtml.el --- 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" "")))