merrickluo / liberime

A emacs dynamic module provide librime bindings for emacs
GNU General Public License v3.0
68 stars 13 forks source link

remove annoy start notice #44

Open shuxiao9058 opened 4 years ago

tumashu commented 4 years ago

😂 这是我专门添加到,因为觉得这个信息很有用,用户应该知道。。。

shuxiao9058 commented 4 years ago

好吧,感觉有点烦人的,那我配置内部处理吧!

tumashu commented 4 years ago

这个issue暂时开着吧,看看其他同学的反馈

在 2020-03-08 10:30:26,"Aaron Chi" notifications@github.com 写道:

好吧,感觉有点烦人的,那我配置内部处理吧!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

shuxiao9058 commented 4 years ago

这是我用禁用提示的方法 ~


;;;; disable annoying notifications
(defcustom message-filter-regexp-list '("^Starting new Ispell process \\[.+\\] \\.\\.\\.$"
                                        "^Ispell process killed$"
                                        ".+expected selector or type assertion, found.+"
                                        ".+expected identifier on left side.+"
                                        "^LSP ::.+"
                                        ".+and \d{1,10} more errors.+"
                                        "Wrote "
                                        "Liberime: start with shared dir" ;;; liberime
                                        )
  "filter formatted message string to remove noisy messages"
  :type '(list string)
  :group 'general)

(defadvice message (around message-filter-by-regexp activate)
  (if (not (ad-get-arg 0))
      ad-do-it
    (let ((formatted-string (apply 'format (ad-get-args 0))))
      (if (and (stringp formatted-string)
               (cl-some (lambda (re) (string-match re formatted-string)) message-filter-regexp-list))
          (let ((inhibit-read-only t))
            (with-current-buffer "*Messages*"
              (goto-char (point-max))
              (insert formatted-string "\n")))
        (progn
          (ad-set-args 0 `("%s" ,formatted-string))
          ad-do-it)))))