Closed tsutsui closed 1 month ago
修正すべきポイントについては追って記載予定。
AIておくれロボに聞いた内容をメモ。
■ Warning (comp): mozc.el:122:2: Warning: Package cl is deprecated
これは cl
パッケージのインポートを cl-lib
に変更すればOK
これは emacs 24以降で使用可能
■ Warning (comp): mozc.el:206:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
'variable' といった記載(コメント内を含む)を `variable' あるいは \'variable' などとすればOK (追記:逆だったので訂正)
■ Warning (comp): mozc.el:394:17: Warning: ‘case’ is an obsolete alias (as of 27.1); use ‘cl-case’ instead.
これはそのまま case
を cl-case
に置き換えればOK
■ Warning (comp): mozc.el:394:22: Warning: Case 'eisu-toggle will match ‘quote’. If that’s intended, write (eisu-toggle quote) instead. Otherwise, don’t quote ‘eisu-toggle’.
これは前述の「 case
を cl-case
に置き換える」で合わせて解消される
■ Warning (comp): mozc.el:1257:16: Warning: ‘incf’ is an obsolete alias (as of 27.1); use ‘cl-incf’ instead.
これもそのまま incf
を cl-incf
に置き換えればOKと思われる
■ Warning (comp): mozc.el:1762:10: Warning: ‘inhibit-changing-match-data’ is an obsolete variable (as of 29.1); use ‘save-match-data’ instead.
save-match-data
は emacs 28 以降のみらしいので、切り替えの記載が必要。
(defun mozc-string-match-p (regexp string &optional start)
"Same as `string-match' except this function never change the match data.
REGEXP, STRING and optional START are the same as for `string-match'.
This function is equivalent to `string-match-p', which is available since Emacs 23."
(if (boundp 'inhibit-changing-match-data)
;; Emacs 28 以前のバージョンで使うロボ
(let ((inhibit-changing-match-data t))
(string-match regexp string start))
;; Emacs 29 以降のバージョンで使うロボ
(save-match-data
(string-match regexp string start))))
ただ、新しい mozc から変更を持ってくるほうがよいかもしれない。
ざっと見て以下なので、持ってきたほうが良さそう。 https://github.com/google/mozc/commits/master/src/unix/emacs/mozc.el
■ Warning (comp): mozc.el:122:2: Warning: Package cl is deprecated
これは
cl
パッケージのインポートをcl-lib
に変更すればOK
修正済み
■ Warning (comp): mozc.el:206:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
`variable' といった記載(コメント内を含む)を ’variable' あるいは \`variable' などとすればOK
これは修正されていないっぽい
■ Warning (comp): mozc.el:394:17: Warning: ‘case’ is an obsolete alias (as of 27.1); use ‘cl-case’ instead.
これはそのまま
case
をcl-case
に置き換えればOK
修正済み
■ Warning (comp): mozc.el:394:22: Warning: Case 'eisu-toggle will match ‘quote’. If that’s intended, write (eisu-toggle quote) instead. Otherwise, don’t quote ‘eisu-toggle’.
これは前述の「
case
をcl-case
に置き換える」で合わせて解消される
これも直してあるっぽい
■ Warning (comp): mozc.el:1257:16: Warning: ‘incf’ is an obsolete alias (as of 27.1); use ‘cl-incf’ instead.
これもそのまま
incf
をcl-incf
に置き換えればOKと思われる
修正済み
■ Warning (comp): mozc.el:1762:10: Warning: ‘inhibit-changing-match-data’ is an obsolete variable (as of 29.1); use ‘save-match-data’ instead.
save-match-data
は emacs 28 以降のみらしいので、切り替えの記載が必要。(defun mozc-string-match-p (regexp string &optional start) "Same as `string-match' except this function never change the match data. REGEXP, STRING and optional START are the same as for `string-match'. This function is equivalent to `string-match-p', which is available since Emacs 23." (if (boundp 'inhibit-changing-match-data) ;; Emacs 28 以前のバージョンで使うロボ (let ((inhibit-changing-match-data t)) (string-match regexp string start)) ;; Emacs 29 以降のバージョンで使うロボ (save-match-data (string-match regexp string start))))
mozc-string-match-p ()
自体が string-match-p ()
を持たないemacs23 以前用の互換関数で、これ自体が削除されている。
cl-lib
が emacs 24 以降なのでどのみち upstream に合わせれば良い。
`variable' といった記載(コメント内を含む)を ’variable' あるいは \`variable' などとすればOK
これの雑差分(未テスト)
--- mozc-2.26.4282.100/src/unix/emacs/mozc.el.orig 2024-07-07 16:26:55.652537483 +0900
+++ mozc-elisp226/work.x86_64/mozc-2.26.4282.100/src/unix/emacs/mozc.el 2024-07-07 17:04:09.327449502 +0900
@@ -220,10 +220,10 @@
have many user settings on their side.
You can change a variety of user settings through a GUI command
-line tool 'mozc_tool' which must be shipped with the mozc server.
+line tool `mozc_tool' which must be shipped with the mozc server.
The command line tool may be installed to /usr/lib/mozc or /usr/lib
directory.
-You need a command line option '--mode=config_dialog' as the
+You need a command line option `--mode=config_dialog' as the
following.
$ /usr/lib/mozc/mozc_tool --mode=config_dialog
@@ -589,11 +589,11 @@
of a wrapped line, this function returns the position information exactly
at the point.
-For example, suppose the following line in the buffer and the point is at 'd'
-\(the beginning of character 'd'),
+For example, suppose the following line in the buffer and the point is at \'d'
+\(the beginning of character \'d'),
....... abc[wrap]
def...
-\(cdr (posn-actual-col-row (posn-at-point AT_D))) is the same number at 'c' on
+\(cdr (posn-actual-col-row (posn-at-point AT_D))) is the same number at \'c' on
a terminal.
In a word, this function is a fixed version of `posn-at-point'."
@@ -1425,8 +1425,8 @@
Using this ID, the program recognizes which response corresponds to
a certain request avoiding cross talk.
-This sequence number is called 'event-id' in the helper process,
-which doesn't have to be a *sequence* number.")
+This sequence number is called `event-id' in the helper process,
+which doesn\'t have to be a *sequence* number.")
(defun mozc-session-create (&optional forcep)
"Create a Mozc session if necessary and return it.
@@ -1465,8 +1465,8 @@
The resulting protocol buffer, which is represented as alist, is
mozc::commands::Output in C++. Return nil on error.
-KEY-LIST is a list of a key code (97 = ?a), key symbols ('space, 'shift,
-'meta and so on), and/or a string which represents the preedit to be
+KEY-LIST is a list of a key code (97 = ?a), key symbols (\'space, \'shift,
+\'meta and so on), and/or a string which represents the preedit to be
inserted (\"\\u3061\")."
(when (mozc-session-create)
(apply #'mozc-session-execute-command 'SendKey key-list)))
@@ -1722,10 +1722,10 @@
Return a found value, or nil if not found.
KEY and KEYS can be a symbol or integer.
-For example, (mozc-protobuf-get protobuf 'key1 2 'key3) is equivalent to
- (cdr (assq 'key3
+For example, (mozc-protobuf-get protobuf \'key1 2 \'key3) is equivalent to
+ (cdr (assq \'key3
(nth 2
- (cdr (assq 'key1
+ (cdr (assq \'key1
protobuf)))))
except for error handling. This is similar to
protobuf.key1(2).key3()
まだ追加で怒られているようなので確認する
stop Warning (comp): mozc.el:584:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
stop Warning (comp): mozc.el:1464:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
stop Warning (comp): mozc.el:1721:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
追加で訊くとどうも以下のようである
https://gist.github.com/tsutsui/974db8ec7c00ba6bba000b9c7bd90eb5 とりあえずこれで警告は消える。意図通り動いているかは別途考える。
https://mail-index.netbsd.org/pkgsrc-changes/2024/08/03/msg304277.html コミットした。 次回のイメージ作成時に確認する。
pkgsrc-2024Q3 で警告がでないことを確認
20240707版の emacs 29.4 で
mozc.el
に対して以下の警告が出ている修正すべきポイントについては追って記載予定。 ただ、新しい mozc から変更を持ってくるほうがよいかもしれない。