;; lisp file for xyzzy ver0.2.2.233
;; atkey.l ver.0.0.2.9
;; [2006-06-17]09:28:51(+0900)〜[2024-12-26]16:08:40(+0900)

(provide "atkey")

(in-package "editor")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;; mac win key
;;; コピー＆カット 選択範囲がなければコマンド待ち
(defvar *default-selection-keymap*
  (let ((keymap (make-sparse-keymap)))
    (define-key keymap #\C-c 'copy-selection-and-to-clipboard)
    (define-key keymap #\C-x 'kill-selection-and-to-clipboard)
    keymap))
(setq-default selection-keymap *default-selection-keymap*)
(define-key esc-map #\C-c #'specific-command-prefix)
(define-key esc-map #\C-x #'ctl-x-prefix)

(global-set-key #\C-z 'un_do)
(global-set-key #\C-v 'paste-from-clipboard)
(global-set-key #\C-n 'new-file-text)
;(global-set-key #\C-n 'new-file)
(global-set-key #\C-F4 'close-selected-buffer)
(global-set-key #\C-s 'save-buffer-dialog)
(global-set-key #\M-F4 'kill-xyzzy)
;(global-set-key #\C-q 'kill-xyzzy)
(global-set-key #\C-a 'selection-whole-buffer)
(global-set-key #\C-f 'search-dialog)
(global-set-key #\C-r 'replace-dialog)
(global-set-key #\M-Left 'beginning-of-line)
(global-set-key #\M-Right 'end-of-line)
(global-set-key #\Home 'beginning-of-virtual-line)
(global-set-key #\End 'end-of-virtual-line)
(global-set-key #\C-Left 'backward-word)
(global-set-key #\C-Right 'forward-word)
(global-set-key #\C-Home 'beginning-of-buffer)
(global-set-key #\C-End 'end-of-buffer)

;(set-extended-key-translate-table exkey-S-C-tab #\S-C-F24)
;(set-extended-key-translate-table exkey-C-tab #\C-F24)
;(global-set-key #\S-C-F24 'previous-buffer)
;(global-set-key #\C-F24 'next-buffer)

(global-set-key #\F3 'repeat-forward-search)
(global-set-key #\S-F3 'repeat-backward-search)
;;元(global-set-key #\F3 'show-info-viewer)
;;winhelp.l　Windowsのヘルプファイル(.hlp)用 WinHlp32.exe Win98〜8まで

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;; my key
(global-set-key #\C-^ 're_do)
(global-set-key #\C-b 're_do)
(global-set-key #\M-Up 'move-previous-window)
(global-set-key #\M-Down 'other-window)
(global-set-key #\M-k 'kill-region-to-clipboard)
(global-set-key #\M-c 'copy-region-to-clipboard)
(global-set-key #\C-t 'insert-time)
(global-set-key #\M-Up 'previous-buffer-tab)
(global-set-key #\M-Down 'next-buffer-tab)
;(global-set-key #\M-f 'grep-search-dialog)
;(global-set-key #\M-g 'grep-dialog)
;(global-set-key '(#\C-x #\g) 'grep-dialog)

;;;インクリメンタルサーチ　英語のみ（日本語は変換確定後なので意味がない）
;(require "isearch")
;(global-set-key #\C-s 'isearch-forward)
;(global-set-key #\C-r 'isearch-backward)

;;;;;;;;;;;;;;;;マークのリスト（gmark.l は loadup.l でロードしていないため）
(global-set-key #\C-F2 'cmark-dialog-box)

;;;;;;;;;;;;;;;;GrepBuffer（現在のバッファのみで検索）
(global-set-key #\F5 'grep-search-dialog)

;;;;;;;;;;;;;;;;バッファ選択
(global-set-key #\C-F12 'select-buffer)

;;;;;;;;;;;;;;;;(extend-function.l)
(global-set-key '(#\C-x #\x) 'do-reverse-region)
(global-set-key '(#\C-x #\u) 'string-dotimes)
(global-set-key #\F12 'exchange-buffer)
(global-set-key #\C-- 'insert-hr)
(global-set-key #\C-+ 'insert-hr-plus)
(global-set-key #\C-/ 'insert-hr-slash)
(global-set-key #\C-* 'insert-hr-asterisk)
(global-set-key #\C-. 'insert-hr-ruled-line)

;;;;;;;;;;;;;;;;(adjust-column.l)
(global-set-key #\S-F1 'adjust-shift-1-selection)
(global-set-key #\S-C-F1 'adjust-unshift-1-selection-byte2space)
