<commit_before>(in-package :cl-user)
(defpackage :lem.isearch
  (:use :cl :lem)
  (:export :*isearch-keymap*
           :isearch-highlight-attribute
           :isearch-highlight-active-attribute
           :isearch-mode
           :isearch-forward
           :isearch-backward
           :isearch-forward-regexp
           :isearch-backward-regexp
           :isearch-forward-symbol
           :isearch-backward-symbol
           :isearch-forward-symbol-at-point
           :isearch-abort
           :isearch-delete-char
           :isearch-raw-insert
           :isearch-end
           :isearch-next
           :isearch-prev
           :isearch-yank
           :isearch-self-insert
           :read-query-replace-args
           :query-replace
           :query-replace-regexp
           :query-replace-symbol))
(in-package :lem.isearch)

(defvar *isearch-keymap* (make-keymap :name '*isearch-keymap*
                                      :undef-hook 'isearch-self-insert))
(defvar *isearch-prompt*)
(defvar *isearch-string*)
(defvar *isearch-prev-string* "")
(defvar *isearch-start-point*)
(defvar *isearch-search-function*)
(defvar *isearch-search-forward-function*)
(defvar *isearch-search-backward-function*)

(define-attribute isearch-highlight-attribute
  (t :background "gray"))

(define-attribute isearch-highlight-active-attribute
  (t :foreground "black" :background "cyan"))

(define-minor-mode isearch-mode
    (:name "isearch"
	   :keymap *isearch-keymap*))

(define-key *global-keymap* "C-s" 'isearch-forward)
(define-key *global-keymap* "C-r" 'isearch-backward)
(define-key *global-keymap* "C-M-s" 'isearch-forward-regexp)
(define-key *global-keymap* "C-M-r" 'isearch-backward-regexp)
(define-key *global-keymap* "M-s _" 'isearch-forward-symbol)
(define-key *global-keymap* "M-s M-_" 'isearch-backward-symbol)
(define-key *global-keymap* "M-s ." 'isearch-forward-symbol-at-point)
(define-key *isearch-keymap* "C-g" 'isearch-abort)
(define-key *isearch-keymap* "C-h" 'isearch-delete-char)
(define-key *isearch-keymap* "[backspace]" 'isearch-delete-char)
(define-key *isearch-keymap* "[del]" 'isearch-delete-char)
(define-key *isearch-keymap* "C-q" 'isearch-raw-insert)
(define-key *isearch-keymap* "C-j" 'isearch-finish)
(define-key *isearch-keymap* "C-m" 'isearch-finish)
(define-key *isearch-keymap* "C-s" 'isearch-next)
(define-key *isearch-keymap* "C-r" 'isearch-prev)
(define-key *isearch-keymap* "C-y" 'isearch-yank)
(define-key *global-keymap* "M-r" 'isearch-replace-highlight)
(define-key *global-keymap* "M-s M-n" 'isearch-next-highlight)
(define-key *global-keymap* "M-s n" 'isearch-next-highlight)
(define-key *global-keymap* "M-s M-p" 'isearch-prev-highlight)
(define-key *global-keymap* "M-s p" 'isearch-prev-highlight)



(defun isearch-overlays (buffer)<commit_msg>キーバインドを追加<commit_after>(in-package :cl-user)
(defpackage :lem.isearch
  (:use :cl :lem)
  (:export :*isearch-keymap*
           :isearch-highlight-attribute
           :isearch-highlight-active-attribute
           :isearch-mode
           :isearch-forward
           :isearch-backward
           :isearch-forward-regexp
           :isearch-backward-regexp
           :isearch-forward-symbol
           :isearch-backward-symbol
           :isearch-forward-symbol-at-point
           :isearch-abort
           :isearch-delete-char
           :isearch-raw-insert
           :isearch-end
           :isearch-next
           :isearch-prev
           :isearch-yank
           :isearch-self-insert
           :read-query-replace-args
           :query-replace
           :query-replace-regexp
           :query-replace-symbol))
(in-package :lem.isearch)

(defvar *isearch-keymap* (make-keymap :name '*isearch-keymap*
                                      :undef-hook 'isearch-self-insert))
(defvar *isearch-prompt*)
(defvar *isearch-string*)
(defvar *isearch-prev-string* "")
(defvar *isearch-start-point*)
(defvar *isearch-search-function*)
(defvar *isearch-search-forward-function*)
(defvar *isearch-search-backward-function*)

(define-attribute isearch-highlight-attribute
  (t :background "gray"))

(define-attribute isearch-highlight-active-attribute
  (t :foreground "black" :background "cyan"))

(define-minor-mode isearch-mode
    (:name "isearch"
	   :keymap *isearch-keymap*))

(define-key *global-keymap* "C-s" 'isearch-forward)
(define-key *global-keymap* "C-r" 'isearch-backward)
(define-key *global-keymap* "C-M-s" 'isearch-forward-regexp)
(define-key *global-keymap* "C-M-r" 'isearch-backward-regexp)
(define-key *global-keymap* "M-s _" 'isearch-forward-symbol)
(define-key *global-keymap* "M-s M-_" 'isearch-backward-symbol)
(define-key *global-keymap* "M-s ." 'isearch-forward-symbol-at-point)
(define-key *isearch-keymap* "C-g" 'isearch-abort)
(define-key *isearch-keymap* "C-h" 'isearch-delete-char)
(define-key *isearch-keymap* "[backspace]" 'isearch-delete-char)
(define-key *isearch-keymap* "[del]" 'isearch-delete-char)
(define-key *isearch-keymap* "C-q" 'isearch-raw-insert)
(define-key *isearch-keymap* "C-j" 'isearch-finish)
(define-key *isearch-keymap* "C-m" 'isearch-finish)
(define-key *isearch-keymap* "C-s" 'isearch-next)
(define-key *isearch-keymap* "C-r" 'isearch-prev)
(define-key *isearch-keymap* "C-y" 'isearch-yank)
(define-key *global-keymap* "M-r" 'isearch-replace-highlight)
(define-key *global-keymap* "M-s M-n" 'isearch-next-highlight)
(define-key *global-keymap* "M-s n" 'isearch-next-highlight)
(define-key *global-keymap* "M-s M-p" 'isearch-prev-highlight)
(define-key *global-keymap* "M-s p" 'isearch-prev-highlight)
(define-key *global-keymap* "[f3]" 'isearch-next-highlight)
(define-key *global-keymap* (list (code-char 279)) 'isearch-prev-highlight) ; shift + F3



(defun isearch-overlays (buffer)
{'fraction_non_alphanumeric': 0.165417465574342, 'fraction_numerical': 0.0008715356458079135, 'mean_word_length': 3.2757078986587183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1419570', 'n_tokens_mistral': 2208, 'n_tokens_neox': 2161, 'n_words': 347}