changeset 290:1a4332ecc58b dev

For emacs-24.3+ and NEmacs(last-command-{char,event} handling)
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 27 Jan 2013 23:34:29 +0900
parents 9f3a86e5d216
children 027c4e8d98ce
files yahtml.el yatex.el yatexadd.el yatexlib.el yatexmth.el yatexsec.el
diffstat 6 files changed, 20 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/yahtml.el	Sun Jan 27 18:50:23 2013 +0900
+++ b/yahtml.el	Sun Jan 27 23:34:29 2013 +0900
@@ -1,6 +1,6 @@
 ;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*-
 ;;; (c) 1994-2012 by HIROSE Yuuji [yuuji(@)yatex.org]
-;;; Last modified Sat Sep  1 07:28:17 2012 on firestorm
+;;; Last modified Sun Jan 27 20:11:00 2013 on firestorm
 ;;; $Id$
 
 (defconst yahtml-revision-number "1.76"
@@ -921,7 +921,7 @@
    (let ((addin (concat "yahtml:" (downcase form))) s a)
      (concat
       (and (setq a (yahtml-css-get-element-completion-alist form))
-	   (not (equal last-command-char ?\C-j))
+	   (not (equal (YaTeX-last-key) ?\C-j))
 	   (memq yahtml-current-completion-type '(multiline inline))
 	   (not (string-match "#" form))
 	   (yahtml-make-optional-argument ;should be made generic?
--- a/yatex.el	Sun Jan 27 18:50:23 2013 +0900
+++ b/yatex.el	Sun Jan 27 23:34:29 2013 +0900
@@ -1,6 +1,6 @@
 ;;; yatex.el --- Yet Another tex-mode for emacs //–ì’¹// -*- coding: sjis -*-
 ;;; (c)1991-2012 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Thu Oct 25 16:24:50 2012 on firestorm
+;;; Last modified Sun Jan 27 20:10:46 2013 on firestorm
 ;;; $Id$
 ;;; The latest version of this software is always available at;
 ;;; http://www.yatex.org/
@@ -1363,7 +1363,7 @@
   (setplist 'YaTeX-jmode nil))
 
 (defun YaTeX-self-insert (arg)
-  (call-interactively (global-key-binding (char-to-string last-command-char))))
+  (call-interactively (global-key-binding (char-to-string (YaTeX-last-key)))))
 (defun YaTeX-insert-inherit (&rest args)
   (apply (if (fboundp 'insert-and-inherit) 'insert-and-inherit 'insert)
 	   args))
@@ -1398,7 +1398,7 @@
      ((and (= (preceding-char) ?\\ )
 	   (/= (char-after (- (point) 2)) ?\\ )
 	   (not (YaTeX-in-math-mode-p)))
-      (YaTeX-insert-inherit last-command-char "\n")
+      (YaTeX-insert-inherit (YaTeX-last-key) "\n")
       (indent-to (max 0 col))
       (YaTeX-insert-inherit "\\]")
       (beginning-of-line)
--- a/yatexadd.el	Sun Jan 27 18:50:23 2013 +0900
+++ b/yatexadd.el	Sun Jan 27 23:34:29 2013 +0900
@@ -1,7 +1,7 @@
 ;;; yatexadd.el --- YaTeX add-in functions
 ;;; yatexadd.el rev.20
 ;;; (c)1991-2012 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Sat Sep  1 08:08:21 2012 on firestorm
+;;; Last modified Sun Jan 27 20:11:23 2013 on firestorm
 ;;; $Id$
 
 ;;; Code:
@@ -432,7 +432,7 @@
 (defun YaTeX::label-search-tag ()
   (interactive)
   (let ((case-fold-search t)
-	(tag (regexp-quote (char-to-string last-command-char))))
+	(tag (regexp-quote (char-to-string (YaTeX-last-key)))))
     (cond
      ((save-excursion
 	(forward-char 1)
--- a/yatexlib.el	Sun Jan 27 18:50:23 2013 +0900
+++ b/yatexlib.el	Sun Jan 27 23:34:29 2013 +0900
@@ -1,7 +1,7 @@
 ;;; yatexlib.el --- YaTeX and yahtml common libraries
 ;;; 
 ;;; (c)1994-2012 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Sat Sep  1 08:12:09 2012 on firestorm
+;;; Last modified Sun Jan 27 20:09:01 2013 on firestorm
 ;;; $Id$
 
 ;;; Code:
@@ -839,11 +839,18 @@
 ;; Interface function for windows.el
 ;;;
 ;;;###autoload
+(fset 'YaTeX-last-key
+      (if (fboundp 'win:last-key)
+	  'win:last-key
+	'(lambda () (if (boundp 'last-command-char)
+			last-command-char
+		      last-command-event))))
 (defun YaTeX-switch-to-window ()
   "Switch to windows.el's window decided by last pressed key."
   (interactive)
   (or (featurep 'windows) (error "Why don't you use `windows.el'?"))
-  (win-switch-to-window 1 (- last-command-char win:base-key)))
+  (win-switch-to-window 1 (- (YaTeX-last-key) win:base-key)))
+
 
 ;;;###autoload
 (defun YaTeX-command-to-string (cmd)
--- a/yatexmth.el	Sun Jan 27 18:50:23 2013 +0900
+++ b/yatexmth.el	Sun Jan 27 23:34:29 2013 +0900
@@ -1,7 +1,7 @@
 ;;; yatexmth.el --- YaTeX math-mode-specific functions
 ;;; 
 ;;; (c)1993-2012 by HIROSE Yuuji [yuuji@yatex.org]
-;;; Last modified Sat Sep  1 08:13:08 2012 on firestorm
+;;; Last modified Sun Jan 27 20:10:03 2013 on firestorm
 ;;; $Id$
 
 ;;; Commentary:
@@ -700,7 +700,7 @@
   (interactive "P")
   (let*((key (or initial "")) regkey str  last-char list i
 	(case-fold-search nil) match sign
-	(this-key (char-to-string last-command-char))
+	(this-key (char-to-string (YaTeX-last-key)))
 	(alistsym (cdr (assoc this-key YaTeX-math-key-list)))
 	(alistname (symbol-name alistsym))
 	(alist (symbol-value alistsym))
--- a/yatexsec.el	Sun Jan 27 18:50:23 2013 +0900
+++ b/yatexsec.el	Sun Jan 27 23:34:29 2013 +0900
@@ -1,7 +1,7 @@
 ;;; yatexsec.el --- YaTeX sectioning browser
 ;;; 
 ;;; (c) 1994-2012 by HIROSE Yuuji [yuuji@yatex.org]
-;;; Last modified Sat Sep  1 08:13:52 2012 on firestorm
+;;; Last modified Sun Jan 27 20:11:45 2013 on firestorm
 ;;; $Id$
 
 ;;; Code:
@@ -181,7 +181,7 @@
 (defun YaTeX-sectioning-hide ()
   "Call YaTeX-sectioning-hide-under with argument according to pressed key."
   (interactive)
-  (YaTeX-sectioning-hide-under (- last-command-char ?0)))
+  (YaTeX-sectioning-hide-under (- (YaTeX-last-key) ?0)))
 
 (defun YaTeX-sectioning-help ()
   "Show help of sectioning."

yatex.org