X

Emacs Part 54

2022/12/02(金) 11:08:33.82
GNU Emacs - GNU Project - Free Software Foundation (FSF)
https://www.gnu.org/software/emacs/

EmacsWiki: サイトマップ
http://www.emacswiki.org/emacs/

前スレ
Emacs Part 51
https://mevius.2ch.net/test/read.cgi/unix/1514601894/
Emacs Part 50
https://mevius.2ch.net/test/read.cgi/unix/1482097785/
Emacs Part 52
https://mevius.5ch.net/test/read.cgi/unix/1585125902/
Emacs Part 53
https://mevius.5ch.net/test/read.cgi/unix/1621758062/
2023/10/19(木) 16:47:35.01
いつからかwdiredでquery-replaceするとこんなエラーが出る。

search-within-boundaries: Invalid search bound (wrong side of point)

migemoを使わなければいいみたいですが同じエラーが出ませんか?

"GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0) of 2023-09-24"
262名無しさん@お腹いっぱい。
垢版 |
2023/10/19(木) 19:22:46.52
>>261
出ませんでした。

やってみたこと
1. emacs -Q
2. migemoの設定を評価
3. 適当なディレクトリを訪問
4. 適当なテキストファイルを m でマーク
5. Q
6. . → \&
7. !

バージョン
% emacs --version | head -2
GNU Emacs 30.0.50
Development version 6254b23a3878 on master branch; build date 2023-10-17.

migemo.el は以下のgithubから
https://github.com/emacs-jp/migemo
2023/10/19(木) 20:37:49.64
ありがとうございます。

お尋ねしたのはdired-ではなくwdired-modeのバッファで
ファイル名に対してquery-replace等で置換を実行した場合です。

diredでディレクトリを表示してM-x wdired-change-to-wdired-mode
M-%等でファイル名に対して置換を実行
264名無しさん@お腹いっぱい。
垢版 |
2023/10/19(木) 21:22:43.33
>>263
ああ勘違いと思い込みが…失礼
たしかにエラーになりました

Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)")
search-backward-lax-whitespace("" 243 t nil)
search-within-boundaries(search-backward-lax-whitespace #f(compiled-function (pos) #<bytecode 0x1e30baf7ad7d9999>) #f(compiled-function (pos) #<bytecode 0x2004b02663e6e61>) "" nil t nil)
apply(search-within-boundaries (search-backward-lax-whitespace #f(compiled-function (pos) #<bytecode 0x1e30baf7ad7d9999>) #f(compiled-function (pos) #<bytecode 0x2004b02663e6e61>) "" nil t))
#f(compiled-function (&rest args2) #<bytecode -0x173727a9d0bd10ae>)("" nil t)
replace-search("" nil nil nil t nil)
perform-replace("" "" t nil nil nil nil nil nil nil nil)
query-replace("" "" nil nil nil nil nil)
funcall-interactively(query-replace "" "" nil nil nil nil nil)
command-execute(query-replace)
265名無しさん@お腹いっぱい。
垢版 |
2023/10/20(金) 08:57:15.08
https://pastebin.com/Vu7suStk

migemo.el を直接修正する場合は
isearch-search-fun-migemo の本体(cond式)を

(lambda (string &optional bound noerror count)
(funcall ...
string bound noerror count))

で囲む(... のところに元のcond式を置く)
2023/10/20(金) 21:55:23.38
ありがとうございます。
上掲のコードを評価してwdiredでquery-replaceを実行すると正常に動作することが確認しました。

ただ私もまだよく理解していないんですが、
これをそのまま~/.emacs等に書くとquery-replaceで次のようなエラーが出てしまいます。

funcall: Symbol’s value as variable is void: fun
267名無しさん@お腹いっぱい。
垢版 |
2023/10/20(金) 22:13:52.12
>>266
ファイルの先頭に次の行を追加してみてください。

;; -*- lexical-binding: t -*-
2023/10/20(金) 23:00:15.89
ありがとうございます。

ちょっと私にはいろいろ手に負えそうになかったので助かりました。
レスを投稿する

5ちゃんねるの広告が気に入らない場合は、こちらをクリックしてください。

ニューススポーツなんでも実況