Skip to content

Commit 52a95ba

Browse files
authored
Merge pull request #1166 from tsuyoshicho/update/20221015/print
Update print.{txt,jax}
2 parents 13ca845 + c1a6819 commit 52a95ba

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

doc/print.jax

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*print.txt* For Vim バージョン 9.0. Last change: 2022 Jan 23
1+
*print.txt* For Vim バージョン 9.0. Last change: 2022 Oct 01
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -154,13 +154,16 @@ VMS での初期設定は、標準の印刷デバイスか、指定されてい
154154
このオプションを設定するときは、関数を使うと、スペースをエスケープしなくてもい
155155
いので簡単です。例: >
156156
157-
:set printexpr=PrintFile(v:fname_in)
158-
:function PrintFile(fname)
159-
: call system("ghostview " .. a:fname)
160-
: call delete(a:fname)
157+
:set printexpr=PrintFile()
158+
:function PrintFile()
159+
: call system("ghostview " .. v:fname_in)
160+
: call delete(v:fname_in)
161161
: return v:shell_error
162162
:endfunc
163163
164+
オプションに関数呼び出しのみが設定されている場合は、より効率的です、
165+
|expr-option-function| を参照。
166+
164167
ファイルを読み込む前に制御を返す印刷プログラムもあるので注意してください。ファ
165168
イルをすぐに削除してしまうと、印刷できないかもしれません。ほとんどの場合、その
166169
ようなプログラムには、印刷した後でファイルを削除するオプションが用意されていま

en/print.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*print.txt* For Vim version 9.0. Last change: 2022 Jan 23
1+
*print.txt* For Vim version 9.0. Last change: 2022 Oct 01
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -158,13 +158,16 @@ currently specified printdevice: >
158158
If you change this option, using a function is an easy way to avoid having to
159159
escape all the spaces. Example: >
160160
161-
:set printexpr=PrintFile(v:fname_in)
162-
:function PrintFile(fname)
163-
: call system("ghostview " .. a:fname)
164-
: call delete(a:fname)
161+
:set printexpr=PrintFile()
162+
:function PrintFile()
163+
: call system("ghostview " .. v:fname_in)
164+
: call delete(v:fname_in)
165165
: return v:shell_error
166166
:endfunc
167167
168+
It is more efficient if the option is set to just a function call,
169+
see |expr-option-function|.
170+
168171
Be aware that some print programs return control before they have read the
169172
file. If you delete the file too soon it will not be printed. These programs
170173
usually offer an option to have them remove the file when printing is done.

0 commit comments

Comments
 (0)