From 4d28d444af32ddf4af5900786473fadacc43e4b1 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 19 Jan 2021 15:07:57 +0800 Subject: QoL changes. * bongo.el: Use header-line now. Try to improve the tick. * dired-conf.el: Require dired-x. * elisp.el: Hide Eldoc on the mode line. * text-conf.el (assq): Hide auto-fill-mode on the mode line. * modeline.el (modeline-format-left): Display minor modes information. (modeline-minor-modes-name-len-max): Max length of displayed minor modes. (modeline-format-minor-modes): Display minor modes information. (durand-mouse-minor-mode-menu): Make the default minor mode menu work with my custom mode line. * rime-conf.el ("emacs-rime"): Bind a key to set the input method to rime in the minibuffer, so that I can use this input method to search the buffer, for example. --- rime-conf.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'rime-conf.el') diff --git a/rime-conf.el b/rime-conf.el index 8bb25fd..d3afae3 100644 --- a/rime-conf.el +++ b/rime-conf.el @@ -12,7 +12,8 @@ (use-package "dash.el" 'dash) (use-package "emacs-rime" 'rime - (define-key global-map (vector ?\s-i) #'toggle-input-method) + (define-key global-map (vector ?\s-i) #'durand-set-input-method) + (define-key minibuffer-local-map (vector ?\s-i) #'durand-set-input-method) (setq rime-librime-root "~/elisp_packages/librime/dist") (add-to-list 'rime-translate-keybindings "RET") (add-to-list 'rime-translate-keybindings "[") @@ -21,6 +22,14 @@ ;; rime-show-candidate 'posframe rime-user-data-dir (expand-file-name "rime" load-file-directory)) +;;;###autoload + (defun durand-set-input-method () + "Set the input method to \"rime\" or nil." + (interactive) + (cond + ((string= current-input-method "rime") (set-input-method nil)) + ((set-input-method "rime")))) + ;;; HACK: Fix a function (defun durand-rime-send-keybinding-a () "Fix a weird function." -- cgit v1.2.3-18-g5258