(setq-default case-fold-search nil)
;(setq-default kanji-fileio-code 3) ; JIS
;(setq default-kanji-process-code 3); No convert
;(setq kanji-display-code 3);         JIS
;(setq kanji-input-code 3);           Nazeka Shift-jis
(setq default-file-coding-system *euc-japan*); EUC
(setq default-process-coding-system *euc-japan*unix); EUC
(set-display-coding-system '*euc-japan*)
(set-keyboard-coding-system '*euc-japan*)
;;; switch ^h and ^?
(let ((table (make-string 128 0)))
  (let ((i 0))
    (while (< i 128)
      (aset table i i)
      (setq i (1+ i))))
  (aset table ?\177 ?\^h)
  (aset table ?\^h ?\177)
  (setq keyboard-translate-table table))
;(setq default-kanji-fileio-code-find-file-not-found 3);  JIS
;(setq load-path (cons "/usr/local/elisp" load-path))
;(setq load-path (cons "/mnt/home/xice/elisp" load-path))
(setq load-path (cons "/home/ice/elisp" load-path))

;
;;; === From Here === for canna 
(if (and (boundp 'CANNA) CANNA)
    (progn
      (load-library "canna")
      (canna)))

(setq c-mode-hook
      (function (lambda ()
                  (setq indent-tabs-mode nil))))

(setq-default c-indent-level 0)
(setq-default c-continued-statement-offset 0)
(setq-default c-brace-offset 3)
(setq-default c-brace-imaginary-offset 0)
(setq-default c-label-offset 0)
(setq-default c-argdecl-indent 0)
;;; === To Here ===

(load "boiled-canna")
;;; (load "boiled-egg")
;;; (its-defrule "nn" "ん" nil nil "roma-kana")

;
(autoload 'cmushell "cmushell" "" t)
;
;(autoload 'edict-search-english "edict" 
;	  "Search for a translation of an English word")
;(autoload 'edict-search-kanji "edict" 
;	  "Search for a translation of a Kanji sequence")
;
;(global-set-key "\e*" 'edict-search-english)
;(global-set-key "\e_" 'edict-search-kanji)
;
(autoload 'tex-mode "cmutex" "document" t)
(autoload 'plain-tex-mode "cmutex" "document" t)
(autoload 'latex-mode "cmutex" "document" t)
(setq tex-view-dvi-file-command "xdvi -geometry +0+0 %s")
(setq latex-mode-hook '(lambda () (setq tex-command "jlatex")))
; for mh
(setq mhl-formfile "mhl.mime")
(global-set-key "\C-cr" 'mh-rmail)
(global-set-key "\C-xm" 'mh-smail)
(global-set-key "\C-x4m" 'mh-smail-other-window)

(put 'eval-expression 'disabled nil)
;
;mule で予約語に色を付ける設定
(cond (window-system
       (setq hilit-mode-enable-list
             '(not text-mode)
             hilit-backgrond-mode   'dark
             hilit-inhibit-hooks nil
             hilit-inhibit-rebinding nil)

       (require 'hilit19)
       ))
; for cal.el
(setq general-holidays 
  '((holiday-fixed 1 1 "元旦")
   (holiday-fixed 1 15 "成人の日")
   (holiday-fixed 2 11 "建国記念の日")
   (holiday-fixed 3 20 "春分の日")
   (holiday-fixed 4 29 "緑の日")
   (holiday-fixed 5 3 "憲法記念日")
   (holiday-fixed 5 4 "国民の祝日")
   (holiday-fixed 5 5 "子供の日")
   (holiday-fixed 7 20 "海の日")
   (holiday-fixed 9 15 "敬老の日")
   (holiday-fixed 9 23 "秋分の日")
   (holiday-fixed 10 10 "体育の日")
   (holiday-fixed 11 3 "文化の日")
   (holiday-fixed 11 23 "勤労感謝の日")
   (holiday-fixed 12 23 "天皇誕生日")))
(setq christian-holidays nil)
(setq hebrew-holidays nil)
(setq islamic-holidays nil)
(setq local-holidays nil)
(setq other-holidays nil)
(setq solar-holidays nil)
;
; Simple modification for diary-ins.el by A.Sanada, Oct 13, 1995.
;
; The function calendar-date-string-for-ins provides a form of date
;
;     month/day, year .
;
; In order to use the function when you insert a daily schedule,
; follow those:
;
; 1) First of all, find out a function insert-diary-entry in
; diary-ins.el: i.e. Find out lines begin with 
;
;    (defun insert-diary-entry (arg)
;        ......
;
; 2) In the function, revise a function calendar-date-string into new
;    function calendar-date-string-for-ins as follows.
;
; <<<<<ORIGINAL insert-diary-entry>>>>>
; (defun insert-diary-entry (arg)
;   "Insert a diary entry for the date indicated by point.
; Prefix arg will make the entry nonmarking."
;   (interactive "P")
;   (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t t)
;                      ^^^^^^^^^^^^^^^^^^^^
;                     arg))
;
; <<<<<REVISED insert-diary-entry>>>>>
; (defun insert-diary-entry (arg)
;   "Insert a diary entry for the date indicated by point.
; Prefix arg will make the entry nonmarking."
;   (interactive "P")
;   (make-diary-entry (calendar-date-string-for-ins (calendar-cursor-to-date t) t t) 
;                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;                     arg))
;
; 3) Add the following into your ~/.emacs .
;
; 4) You can edit the line 
;     (defvar calendar-display-form-for-ins
;       '((if dayname (concat dayname ", ")) month "/" day ", " year)
;      "")
;    to change the form of date as you like. For example,
;     (defvar calendar-display-form-for-ins
;       '((if dayname (concat dayname ", ")) month "/" day "/" year)
;      "")
;    will provide a form of month/day/year. (I haven't tried it yet
;    but I have a hunch that it works.)
;
; 5) Have fun!
;
; Atsushi SANADA <sanada@c.oka-pu.ac.jp>
; Faculty of Computer Science & System Engineering,
; Okayama Prefectural University, Okayama, Japan
;
(defvar calendar-display-form-for-ins
  '((if dayname (concat dayname ", ")) month "/" day "/" year)
  "")
(defvar calendar-date-display-form-for-ins
    calendar-display-form-for-ins  "")
(defun calendar-date-string-for-ins (date &optional abbreviate nodayname)
  ""
  (let* ((dayname
          (if nodayname
              nil
            (if abbreviate
                (substring (calendar-day-name date) 0 3)
              (calendar-day-name date))))
         (month (extract-calendar-month date))
         (monthname
          (if abbreviate
            month
            (calendar-month-name month)))
         (day (int-to-string (extract-calendar-day date)))
         (month (int-to-string month))
         (year (int-to-string (extract-calendar-year date))))
    (mapconcat 'eval calendar-date-display-form-for-ins "")))
