Article View: fj.editor.mule
Article #290Re: c-mode $B$GFIE@$rF~NO$9$k(B
From: Itsushi Minoura
Date: Fri, 04 Feb 2000 00:00
Date: Fri, 04 Feb 2000 00:00
114 lines
5333 bytes
5333 bytes
$BL'1:$G$9(B
fj.editor.mule $B$K<+J,$G$3$&=q$$$?$N$G$9$,!"(B
$B5-;v(B<mitsushi-3101001338550001@ni482b.nibb.ac.jp>
>> Egg ver.3 $B$G%-!<%^%C%W$rBTHr$9$k$@$1$N%Q%C%A$r:n$k$3$H$b$G$-$k$H;W$$$^$9!#(B
$B$=$l$r=q$-$^$7$?$N$GEj9F$7$^$9!#(B
$B$3$N(B salt.el $B$r%m!<%I$9$k$3$H$G(B egg.el $B$N(B toggle-egg-mode $B$H(B
its:select-mode $B$r>e=q$-$7$F!"%P%C%U%!$N%b!<%I$NJQ99$,$"$k$?$S$K%-!<%^%C(B
$B%W$rBTHr$7$F?7$?$K%-!<%^%C%W$r@_Dj$7$^$9!#JT=8Cf$N%P%C%U%!$G%b!<%I$rJQ(B
$B$($k$H!"(BEgg $B$,(B [$B$"(B] $B$HI=<($7$F$$$?$N$,>C$($F$7$^$$$^$9$,!"$=$l$,$3$N%Q%C(B
$B%A%W%m%0%i%`$K$h$k@5>o$JF0:n$G$9!#:FEY(B C-\ $B$7$F(B Egg $B$rF0$+$7$F$/$@$5$$!#(B
;; -*-emacs-lisp-*-
;;
;; salt.el: boiled-egg $B$K$+$1$k1v(B
;; version 1.0 (2000.2.4.)
;; Copyright (C) 2000 by Itsushi Minoura <minoura@eva.hi-ho.ne.jp>
;; All rights reserved.
;; Egg version 3.09 $B$NLdBj(B: $BJT=8Cf$N%P%C%U%!$N%b!<%I$,@Z$jBX$($i$l$?$H(B
;; $B$-!"(Begg-self-insert-command $B$,%b!<%I$NDj5A$K$h$C$F>e=q$-$5$l!"$+$J(B
;; $BF~NO$,$G$-$J$/$J$kLdBj$r2sHr$9$k%Q%C%A!#(B
;; Mule 2.3, Emacs 20.5 + Wnn patch $B$GF0:n$r3NG'!#(B
;; Some parts of this code override Egg version 3.09 functions.
;; Japanese Character Input Package for Egg
;; Coded by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp)
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
;; Or, you can find GNU General Public License at "http://www.gnu.org/".
(if (boundp 'mc-flag)
(set 'enable-multibyte-characters 'mc-flag))
;; kill-all-local-variables $B$G%b!<%I$r%/%j%"$9$k$h$&$K$9$k!#$3$l$i$K$h$C(B
;; $B$F!"%P%C%U%!$N%b!<%I$,JQ99$5$l$k$H!"(BEgg $B$N>uBV$,%j%;%C%H$5$l$k$h$&(B
;; $B$K$J$k!#!JI8=`$G$O$3$l$i$NJQ?t$O(B kill-all-local-variables $B$+$iJ]8n(B
;; $B$5$l$F$$$k!K(B
(put 'mode-line-egg-mode 'permanent-local nil)
(put 'egg:*input-mode* 'permanent-local nil)
(put 'egg:*mode-on* 'permanent-local nil)
(defvar egg-emacs-local-map nil "Original keymap for emacs mode.")
(make-variable-buffer-local 'egg-emacs-local-map)
(defvar egg-local-keymap nil "local keymap used in Egg input mode")
(make-variable-buffer-local 'egg-local-keymap)
(defvar egg-started-in-this-buffer nil
"egg $B$,$3$N%P%C%U%!$G:G=i$K5/F0$5$l$k$H$-$rH=Dj$9$k$?$a$N%U%i%0(B")
(make-variable-buffer-local 'egg-started-in-this-buffer)
(setq-default egg-started-in-this-buffer nil)
(defun toggle-egg-mode ()
"EGG 3.09 $B$N4X?t$rJQ99!#%-!<%^%C%W$rBTHr$7!"(Begg-local-keymap $B>e$K%-!<$r3d$jIU$1$k!#(B"
(interactive)
(if enable-multibyte-characters
(if egg:*mode-on*
(progn
(fence-toggle-egg-mode)
(use-local-map egg-emacs-local-map))
(setq egg:*mode-on* t)
(egg:mode-line-display)
(if (not egg-started-in-this-buffer)
(salt-init-buffer))
(use-local-map egg-local-keymap))))
(defun salt-init-buffer ()
"Egg $B$N%-!<%^%C%W$r%P%C%U%!Kh$K=i4|2=$9$k!#%-!<%^%C%W$rBTHr$7(B egg-self-insert-command $B$N%-!<%P%$%s%I$,%b!<%I$K$h$C$F=q$-49$($i$l$k$N$KBP=h$9$k!#(B"
(let (map)
;; save current mode
(setq map (if (eq (selected-window) (minibuffer-window))
minibuffer-local-map
(current-local-map)))
(setq egg-emacs-local-map (if map (copy-keymap map) nil)
egg-local-keymap (copy-keymap (or egg-emacs-local-map
(make-sparse-keymap)))))
(let ((i 32)) ;; 32 = " "
(while (<= i 126) ;; 126 = "~"
(define-key egg-local-keymap (char-to-string i) 'egg-self-insert-command)
(setq i (1+ i))))
(setq egg-started-in-this-buffer t))
(defun its:select-mode (name)
"$B%b!<%I$K=>$C$F%-!<%^%C%W$rA*Br(B"
(interactive (list (completing-read "ITS mode: " its:*mode-alist*)))
(if (its:get-mode-map name)
(progn
(setq its:*current-map* (its:get-mode-map name))
(egg:mode-line-display)
(if (eq name "downcase")
(use-local-map egg-emacs-local-map)
(use-local-map egg-local-keymap)))
(beep))
)
;;$B$3$3$^$G(B
--
Itsushi Minoura (minoura@eva.hi-ho.ne.jp)
Technical Details
Message-ID:
<87es2r$efg$1@news0.hi-ho.ne.jp>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<86pg73$22lq$1@hoya.cen2.ishikawa-nct.ac.jp> <UEHARA.00Jan31114416@MAIA0.ec.ntts.co.jp> <mitsushi-3101001338550001@ni482b.nibb.ac.jp>Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS X-Google-Thread: 10eba4,47e70cc5d4ab2db9 X-Google-Attributes: gid10eba4,public X-Google-Thread: 10160c,5e609c6e616a7a27,start X-Google-Attributes: gid10160c,public From: minoura@eva.hi-ho.ne.jp (Itsushi Minoura) Subject: Re: c-mode $B$GFIE@$rF~NO$9$k(B Date: 2000/02/04 Message-ID: <87es2r$efg$1@news0.hi-ho.ne.jp> X-Deja-AN: 581550095 References: <86pg73$22lq$1@hoya.cen2.ishikawa-nct.ac.jp> <UEHARA.00Jan31114416@MAIA0.ec.ntts.co.jp> <mitsushi-3101001338550001@ni482b.nibb.ac.jp> Organization: private Newsgroups: fj.editor.mule,fj.sources