Skip to content

Commit

Permalink
complete/mandb: fix an encoding prpblem of utf8 manuals
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jan 25, 2021
1 parent 5504bbc commit 7a4a480
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ble.pp
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ function ble-update {

ble/bin/.freeze-utility-path "${_ble_init_posix_command_list[@]}" # <- this uses ble/util/assign.
ble/bin/.freeze-utility-path man
ble/bin/.freeze-utility-path nroff mandoc gzip bzcat lzcat xzcat # used by core-complete.sh
ble/bin/.freeze-utility-path groff nroff mandoc gzip bzcat lzcat xzcat # used by core-complete.sh
# Solaris: .freeze-utility-path で上書きされた awk を戻す
ble/bin/awk.use-solaris-xpg4

Expand Down
7 changes: 6 additions & 1 deletion lib/core-complete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2565,7 +2565,12 @@ function ble/complete/mandb/search-file {
return 1
}

if ble/is-function ble/bin/nroff; then
if ble/is-function ble/bin/groff; then
_ble_complete_mandb_convert_type=man
function ble/complete/mandb/convert-mandoc {
ble/bin/groff -k -Tutf8 -man
}
elif ble/is-function ble/bin/nroff; then
_ble_complete_mandb_convert_type=man
function ble/complete/mandb/convert-mandoc {
ble/bin/nroff -Tutf8 -man
Expand Down
8 changes: 5 additions & 3 deletions memo/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

- complete/mandb: support mandb in FreeBSD `#D1432` 6c54f79
- decode (`ble-decode-kbd`): support various specifications of key sequences `#D1439` 0f01cab
- edit: support new option `bleopt edit_line_type={logical,graphical}` (motivated by 3ximus) `#D1442` 40ae242
- edit: support new options `bleopt edit_line_type={logical,graphical}` (motivated by 3ximus) `#D1442` 40ae242
- complete: support new options `bleopt complete_limit{,_auto}` (contributed by timjrd) `#D1445` b13f114 5504bbc

## Changes

Expand All @@ -25,11 +26,12 @@
- global: suppress missing locale errors (reported by 3ximus) `#D1440` 4d3c595
- edit (sword): fix definition of `sword` (shell words) `#D1441` f923388
- edit (kill/copy): combine multiple kills and copies (suggested by 3ximus) `#D1443` 66564e1
- edit (`kill-forward-logical-line`): fix a bug not deleting newline at the end of the line `#D1443` 0000000
- edit (`kill-forward-logical-line`): fix a bug not deleting newline at the end of the line `#D1443` 09cf7f1
- complete (mandb): fix an encoding prpblem of utf8 manuals `#D1446` 0000000

## Internal changes and fixes

- main: include hostname in local runtime directory `#D1444` 0000000
- main: include hostname in local runtime directory `#D1444` 6494836

<!---------------------------------------------------------------------------->
# ble-0.4.0-devel2
Expand Down
48 changes: 34 additions & 14 deletions note.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1202,14 +1202,18 @@ bash_tips

2021-01-22

* syntax: 引数が沢山あると cygwin で滅茶苦茶遅い
* highlight: 引数が沢山あると cygwin で滅茶苦茶遅い

これは様々な種類のパス名展開を試そうとするのが原因だろうか。
command 名と同様にキャッシュする様にしても良いのではないだろうか。
でも少しずつ微妙に異なる引数が沢山ある場合には結局遅い。
それよりは着色自体の高速化について考えた方が良いのではないか。

* chat でも遅くなるかどうかについて確認する。
やはり微妙に遅い様な気がする。

何が遅くなっている原因化について確認する必要がある。
例えば fork している可能性はあるだろうか。

2021-01-08

Expand Down Expand Up @@ -1416,19 +1420,6 @@ bash_tips
分けてから sort するのではなくて sort してから分けるべきではないか。
同じ意味を持つオプションは連続されて表示されて欲しい。

2020-11-02

* done: source:file において substr を実装する。

* done: filter を自前で実行する場合には cand/yield 内部での filter は不要。
これは flag_source_filter=1 を設定して実行する事にした。

* patch: timjrd を README/acknowledgement に追加する。

* patch: complete_limit_reached にリークが存在している。
ちゃんと source:* や candidates/generate などのコメントに使う変数を記述して、
それから auto-complete の中で candidates/generate を呼び出す前に local で宣言する。

2020-09-07

* complete: メニュー絞り込みが働いている状態で単一確定ができない場合がある
Expand Down Expand Up @@ -3730,6 +3721,35 @@ bash_tips

2021-01-25

* mandb: man のオプションの情報が文字化けしている [#D1446]

% キャッシュが全然使われていない。毎回再生成されている様に見える
% と思ったが、これは単に core-complete.sh が更新されたから、
% それに応じて更新されているというだけの事だった。

データを再生成してもやはり同様に文字化けしてしまう。

調べると nroff は UTF-8 には対応していない様だ。groff は groff -k にて
UTF-8 に対応する様だ。更に -k に加えて -Tutf8 も必要だった。

groff ではなくて nroff の時にはどうするのかという問題は残るが、まあ groff
のないシステムでは UTF-8 の man は存在しないと思って良い気がする。なので取
り敢えずは気にしない事にする。

* 2020-11-02 complete: support complete_limit{,_auto} (contributed by timjrd) [#D1445]
https://github.com/akinomyoga/ble.sh/issues/64
https://github.com/akinomyoga/ble.sh/issues/65

これは時間はかかったが無事に merge まで行った。

* done: source:file において substr を実装する。
* done: filter を自前で実行する場合には cand/yield 内部での filter は不要。
これは flag_source_filter=1 を設定して実行する事にした。
* done: timjrd を README/acknowledgement に追加する。
* done: complete_limit_reached にリークが存在している。
ちゃんと source:* や candidates/generate などのコメントに使う変数を記述して、
それから auto-complete の中で candidates/generate を呼び出す前に local で宣言する。

* main: nfs の上に _ble_base_run があると問題になるのでは [#D1444]
取り敢えずローカルに runtime directory を作る時には $HOSTNAME も含める事にした。
XDG_RUNTIME_DIR 及び /tmp を使う場合には host specific であると期待してその儘にする。
Expand Down

0 comments on commit 7a4a480

Please sign in to comment.