-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathframes.texi
2939 lines (2461 loc) · 128 KB
/
frames.texi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
@c Copyright (C) 1990-1995, 1998-1999, 2001-2015 Free Software
@c Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@node Frames
@chapter フレーム
@cindex フレーム
@dfn{フレーム}(frame)とは、1つかそれ以上のEmacsのウィンドウ(@pxref{Windows})を
収めているスクリーン上のオブジェクトです。
It is the kind of object called a
``window'' in the terminology of graphical environments; but we can't
call it a ``window'' here, because Emacs uses that word in a different
way. In Emacs Lisp, a @dfn{frame object} is a Lisp object that
represents a frame on the screen. @xref{Frame Type}.
フレームには最初は1つのウィンドウ(およびミニバッファ用ウィンドウ)が
ありますが、それを上下や左右に小さなウィンドウに分割できます。
@xref{Splitting Windows}.
@cindex terminal
A @dfn{terminal} is a display device capable of displaying one or
more Emacs frames. In Emacs Lisp, a @dfn{terminal object} is a Lisp
object that represents a terminal. @xref{Terminal Type}.
@cindex text terminal
@cindex graphical terminal
@cindex graphical display
There are two classes of terminals: @dfn{text terminals} and
@dfn{graphical terminals}. Text terminals are non-graphics-capable
displays, including @command{xterm} and other terminal emulators. On
a text terminal, each Emacs frame occupies the terminal's entire
screen; although you can create additional frames and switch between
them, the terminal only shows one frame at a time. Graphical
terminals, on the other hand, are managed by graphical display systems
such as the X Window System, which allow Emacs to show multiple frames
simultaneously on the same display.
On GNU and Unix systems, you can create additional frames on any
available terminal, within a single Emacs session, regardless of
whether Emacs was started on a text or graphical terminal. Emacs can
display on both graphical and text terminals simultaneously. This
comes in handy, for instance, when you connect to the same session
from several remote locations. @xref{Multiple Terminals}.
@defun framep object
この述語関数は、@var{object}がフレームならば非@code{nil}値を返し、
さもなければ@code{nil}を返す。
For a frame, the value indicates which
kind of display the frame uses:
@table @code
@item t
The frame is displayed on a text terminal.
@item x
The frame is displayed on an X graphical terminal.
@item w32
The frame is displayed on a MS-Windows graphical terminal.
@item ns
The frame is displayed on a GNUstep or Macintosh Cocoa graphical
terminal.
@item pc
The frame is displayed on an MS-DOS terminal.
@end table
@end defun
@defun frame-terminal &optional frame
This function returns the terminal object that displays @var{frame}.
If @var{frame} is @code{nil} or unspecified, it defaults to the
selected frame.
@end defun
@defun terminal-live-p object
This predicate returns a non-@code{nil} value if @var{object} is a
terminal that is live (i.e., not deleted), and @code{nil} otherwise.
For live terminals, the return value indicates what kind of frames are
displayed on that terminal; the list of possible values is the same as
for @code{framep} above.
@end defun
@menu
* Creating Frames:: Creating additional frames.
* Multiple Terminals:: Displaying on several different devices.
* Frame Parameters:: Controlling frame size, position, font, etc.
* Terminal Parameters:: Parameters common for all frames on terminal.
* Frame Titles:: Automatic updating of frame titles.
* Deleting Frames:: Frames last until explicitly deleted.
* Finding All Frames:: How to examine all existing frames.
* Minibuffers and Frames:: How a frame finds the minibuffer to use.
* Input Focus:: Specifying the selected frame.
* Visibility of Frames:: Frames may be visible or invisible, or icons.
* Raising and Lowering:: Raising a frame makes it hide other windows;
lowering it makes the others hide it.
* Frame Configurations:: Saving the state of all frames.
* Mouse Tracking:: Getting events that say when the mouse moves.
* Mouse Position:: Asking where the mouse is, or moving it.
* Pop-Up Menus:: Displaying a menu for the user to select from.
* Dialog Boxes:: Displaying a box to ask yes or no.
* Pointer Shape:: Specifying the shape of the mouse pointer.
* Window System Selections:: Transferring text to and from other X clients.
* Drag and Drop:: Internals of Drag-and-Drop implementation.
* Color Names:: Getting the definitions of color names.
* Text Terminal Colors:: Defining colors for text terminals.
* Resources:: Getting resource values from the server.
* Display Feature Testing:: Determining the features of a terminal.
@end menu
@node Creating Frames
@section フレームの作成
@cindex frame creation
新たなフレームを作成するには、関数@code{make-frame}を呼び出す。
@deffn Command make-frame &optional alist
この関数は新たなフレームを作成し、現在のバッファを表示する。
引数@var{alist}はフレームパラメータを指定する連想リストである。
@xref{Frame Parameters}. If you specify the
@code{terminal} parameter in @var{alist}, the new frame is created on
that terminal. Otherwise, if you specify the @code{window-system}
frame parameter in @var{alist}, that determines whether the frame
should be displayed on a text terminal or a graphical terminal.
@xref{Window Systems}. If neither is specified, the new frame is
created in the same terminal as the selected frame.
@var{alist}で指定していないパラメータは、
変数@code{default-frame-alist}の値に従って決まる(@pxref{Initial Parameters})。
それでも決まらないパラメータは、
標準のXリソースやそれにかわる読者のオペレーティングシステムの設定を使う
(@pxref{X Resources,, X Resources,
emacs, The GNU Emacs Manual})。
After the frame is created, Emacs
applies any parameters listed in @code{frame-inherited-parameters}
(see below) and not present in the argument, taking the values from
the frame that was selected when @code{make-frame} was called.
Note that on multi-monitor displays (@pxref{Multiple Terminals}), the
window manager might position the frame differently than specified by
the positional parameters in @var{alist} (@pxref{Position
Parameters}). For example, some window managers have a policy of
displaying the frame on the monitor that contains the largest part of
the window (a.k.a.@: the @dfn{dominating} monitor).
This function itself does not make the new frame the selected frame.
@xref{Input Focus}. The previously selected frame remains selected.
On graphical terminals, however, the windowing system may select the
new frame for its own reasons.
@end deffn
@defvar before-make-frame-hook
@code{make-frame}がフレームを実際に作成する直前に実行するノーマルフック。
@end defvar
@defvar after-make-frame-functions
@code{make-frame}がフレームを作成後に実行するアブノーマルフック。
@code{after-make-frame-functions}の各関数は、1つの引数、
つまり、作成したばかりのフレームを受け取る。
@end defvar
@defvar frame-inherited-parameters
This variable specifies the list of frame parameters that a newly
created frame inherits from the currently selected frame. For each
parameter (a symbol) that is an element in the list and is not present
in the argument to @code{make-frame}, the function sets the value of
that parameter in the created frame to its value in the selected
frame.
@end defvar
@node Multiple Terminals
@section 複数端末
@cindex 端末、複数
@cindex multi-tty
@cindex 複数のX端末
@cindex displays, multiple
Emacs represents each terminal as a @dfn{terminal object} data type
(@pxref{Terminal Type}). On GNU and Unix systems, Emacs can use
multiple terminals simultaneously in each session. On other systems,
it can only use a single terminal. Each terminal object has the
following attributes:
@itemize @bullet
@item
The name of the device used by the terminal (e.g., @samp{:0.0} or
@file{/dev/tty}).
@item
The terminal and keyboard coding systems used on the terminal.
@xref{Terminal I/O Encoding}.
@item
The kind of display associated with the terminal. This is the symbol
returned by the function @code{terminal-live-p} (i.e., @code{x},
@code{t}, @code{w32}, @code{ns}, or @code{pc}). @xref{Frames}.
@item
A list of terminal parameters. @xref{Terminal Parameters}.
@end itemize
There is no primitive for creating terminal objects. Emacs creates
them as needed, such as when you call @code{make-frame-on-display}
(described below).
@defun terminal-name &optional terminal
This function returns the file name of the device used by
@var{terminal}. If @var{terminal} is omitted or @code{nil}, it
defaults to the selected frame's terminal. @var{terminal} can also be
a frame, meaning that frame's terminal.
@end defun
@defun terminal-list
This function returns a list of all live terminal objects.
@end defun
@defun get-device-terminal device
This function returns a terminal whose device name is given by
@var{device}. If @var{device} is a string, it can be either the file
name of a terminal device, or the name of an X display of the form
@samp{@var{host}:@var{server}.@var{screen}}. If @var{device} is a
frame, this function returns that frame's terminal; @code{nil} means
the selected frame. Finally, if @var{device} is a terminal object
that represents a live terminal, that terminal is returned. The
function signals an error if its argument is none of the above.
@end defun
@defun delete-terminal &optional terminal force
This function deletes all frames on @var{terminal} and frees the
resources used by it. It runs the abnormal hook
@code{delete-terminal-functions}, passing @var{terminal} as the
argument to each function.
If @var{terminal} is omitted or @code{nil}, it defaults to the
selected frame's terminal. @var{terminal} can also be a frame,
meaning that frame's terminal.
Normally, this function signals an error if you attempt to delete the
sole active terminal, but if @var{force} is non-@code{nil}, you are
allowed to do so. Emacs automatically calls this function when the
last frame on a terminal is deleted (@pxref{Deleting Frames}).
@end defun
@defvar delete-terminal-functions
An abnormal hook run by @code{delete-terminal}. Each function
receives one argument, the @var{terminal} argument passed to
@code{delete-terminal}. Due to technical details, the functions may
be called either just before the terminal is deleted, or just
afterwards.
@end defvar
@cindex terminal-local variables
A few Lisp variables are @dfn{terminal-local}; that is, they have a
separate binding for each terminal. The binding in effect at any time
is the one for the terminal that the currently selected frame belongs
to. These variables include @code{default-minibuffer-frame},
@code{defining-kbd-macro}, @code{last-kbd-macro}, and
@code{system-key-alist}. They are always terminal-local, and can
never be buffer-local (@pxref{Buffer-Local Variables}).
On GNU and Unix systems, each X display is a separate graphical
terminal. When Emacs is started from within the X window system, it
uses the X display specified by the @env{DISPLAY} environment
variable, or by the @samp{--display} option (@pxref{Initial Options,,,
emacs, The GNU Emacs Manual}). Emacs can connect to other X displays
via the command @code{make-frame-on-display}. Each X display has its
own selected frame and its own minibuffer windows; however, only one
of those frames is ``@emph{the} selected frame'' at any given moment
(@pxref{Input Focus}). Emacs can even connect to other text
terminals, by interacting with the @command{emacsclient} program.
@xref{Emacs Server,,, emacs, The GNU Emacs Manual}.
@cindex X display names
@cindex display name on X
A single X server can handle more than one display. Each X display
has a three-part name,
@samp{@var{hostname}:@var{displaynumber}.@var{screennumber}}. The
first part, @var{hostname}, specifies the name of the machine to which
the display is physically connected. The second part,
@var{displaynumber}, is a zero-based number that identifies one or
more monitors connected to that machine that share a common keyboard
and pointing device (mouse, tablet, etc.). The third part,
@var{screennumber}, identifies a zero-based screen number (a separate
monitor) that is part of a single monitor collection on that X server.
When you use two or more screens belonging to one server, Emacs knows
by the similarity in their names that they share a single keyboard.
Systems that don't use the X window system, such as MS-Windows,
don't support the notion of X displays, and have only one display on
each host. The display name on these systems doesn't follow the above
3-part format; for example, the display name on MS-Windows systems is
a constant string @samp{w32}, and exists for compatibility, so that
you could pass it to functions that expect a display name.
@deffn Command make-frame-on-display display &optional parameters
新たなフレームをディスプレイ@var{display}上に作成する。
他のフレームパラメータは@var{parameters}から得る。
@var{display} should be the name of an X display (a string).
Before creating the frame, this function ensures that Emacs is ``set
up'' to display graphics. For instance, if Emacs has not processed X
resources (e.g., if it was started on a text terminal), it does so at
this time. In all other respects, this function behaves like
@code{make-frame} (@pxref{Creating Frames}).
@end deffn
@defun x-display-list
Emacsが接続しているXディスプレイを表すリストを返す。
リストの要素は文字列であり、それぞれはディスプレイ名である。
@end defun
@defun x-open-connection display &optional xrm-string must-succeed
この関数はXディスプレイ@var{display}との接続を、フレームは作らずに開く。
Normally, Emacs Lisp
programs need not call this function, as @code{make-frame-on-display}
calls it automatically. The only reason for calling it is to check
whether communication can be established with a given X display.
この関数を呼び出す唯一の理由は、
当該ディスプレイと通信可能かどうか検査するためである。
省略可能な引数@var{xrm-string}が@code{nil}でなければ、
ファイル@file{.Xresources}で使われ書式と同じ
リソース名と値を表す文字列である。
@xref{X Resources,, X Resources, emacs, The
GNU Emacs Manual}.
これに指定した値は、Xサーバー自体に記録されているリソースの値に優先し、
Emacsが当該ディスプレイ上に作成するすべてのフレームに適用される。
この文字列の例を以下に示す。
@example
"*BorderWidth: 3\n*InternalBorder: 2\n"
@end example
If @var{must-succeed} is non-@code{nil}, failure to open the connection
terminates Emacs. Otherwise, it is an ordinary Lisp error.
@end defun
@defun x-close-connection display
この関数はディスプレイ@var{display}との接続を閉じる。
これを行うまえに、
まず当該ディスプレイ上に作ったフレームをすべて削除しなければならない
(@pxref{Deleting Frames})。
@end defun
@cindex multi-monitor
On some ``multi-monitor'' setups, a single X display outputs to more
than one physical monitor. You can use the functions
@code{display-monitor-attributes-list} and @code{frame-monitor-attributes}
to obtain information about such setups.
@defun display-monitor-attributes-list &optional display
This function returns a list of physical monitor attributes on
@var{display}, which can be a display name (a string), a terminal, or
a frame; if omitted or @code{nil}, it defaults to the selected frame's
display. Each element of the list is an association list,
representing the attributes of a physical monitor. The first element
corresponds to the primary monitor. The attribute keys and values
are:
@table @samp
@item geometry
Position of the top-left corner of the monitor's screen and its size,
in pixels, as @samp{(@var{x} @var{y} @var{width} @var{height})}. Note
that, if the monitor is not the primary monitor, some of the
coordinates might be negative.
@item workarea
Position of the top-left corner and size of the work area (``usable''
space) in pixels as @samp{(@var{x} @var{y} @var{width} @var{height})}.
This may be different from @samp{geometry} in that space occupied by
various window manager features (docks, taskbars, etc.)@: may be
excluded from the work area. Whether or not such features actually
subtract from the work area depends on the platform and environment.
Again, if the monitor is not the primary monitor, some of the
coordinates might be negative.
@item mm-size
Width and height in millimeters as @samp{(@var{width} @var{height})}
@item frames
List of frames that this physical monitor dominates (see below).
@item name
Name of the physical monitor as @var{string}.
@item source
Source of the multi-monitor information as @var{string};
e.g., @samp{XRandr} or @samp{Xinerama}.
@end table
@var{x}, @var{y}, @var{width}, and @var{height} are integers.
@samp{name} and @samp{source} may be absent.
A frame is @dfn{dominated} by a physical monitor when either the
largest area of the frame resides in that monitor, or (if the frame
does not intersect any physical monitors) that monitor is the closest
to the frame. Every (non-tooltip) frame (whether visible or not) in a
graphical display is dominated by exactly one physical monitor at a
time, though the frame can span multiple (or no) physical monitors.
Here's an example of the data produced by this function on a 2-monitor
display:
@lisp
(display-monitor-attributes-list)
@result{}
(((geometry 0 0 1920 1080) ;; @r{Left-hand, primary monitor}
(workarea 0 0 1920 1050) ;; @r{A taskbar occupies some of the height}
(mm-size 677 381)
(name . "DISPLAY1")
(frames #<frame emacs@@host *Messages* 0x11578c0>
#<frame emacs@@host *scratch* 0x114b838>))
((geometry 1920 0 1680 1050) ;; @r{Right-hand monitor}
(workarea 1920 0 1680 1050) ;; @r{Whole screen can be used}
(mm-size 593 370)
(name . "DISPLAY2")
(frames)))
@end lisp
@end defun
@defun frame-monitor-attributes &optional frame
This function returns the attributes of the physical monitor
dominating (see above) @var{frame}, which defaults to the selected frame.
@end defun
@node Frame Parameters
@section フレームパラメータ
@cindex frame parameters
フレームには、その見ためやふるまいを制御する多くのパラメータがあります。
フレームのパラメータの種類は、使用する表示機構に依存します。
フレームパラメータはグラフィック表示向けです。
多くのパラメータはテキスト端末に適用されたときは効果がありません。
@code{height}、@code{width}、@code{name}、@code{title}、
@code{menu-bar-lines}、@code{buffer-list}、
そして@code{buffer-predicate}のパラメータだけが意味を持ちます。
If the
terminal supports colors, the parameters @code{foreground-color},
@code{background-color}, @code{background-mode} and
@code{display-type} are also meaningful. If the terminal supports
frame transparency, the parameter @code{alpha} is also meaningful.
@menu
* Parameter Access:: How to change a frame's parameters.
* Initial Parameters:: Specifying frame parameters when you make a frame.
* Window Frame Parameters:: List of frame parameters for window systems.
* Size and Position:: Changing the size and position of a frame.
* Geometry:: Parsing geometry specifications.
@end menu
@node Parameter Access
@subsection フレームパラメータの参照
これらの関数は、フレームのパラメータの値を読んだり変更するためのものです。
@defun frame-parameter frame parameter
This function returns the value of the parameter @var{parameter} (a
symbol) of @var{frame}. If @var{frame} is @code{nil}, it returns the
selected frame's parameter. If @var{frame} has no setting for
@var{parameter}, this function returns @code{nil}.
@end defun
@defun frame-parameters &optional frame
関数@code{frame-parameters}は、
@var{frame}のすべてのパラメータとそれらの値から成る連想リストを返す。
If @var{frame} is
@code{nil} or omitted, this returns the selected frame's parameters
@end defun
@defun modify-frame-parameters frame alist
この関数は、@var{alist}の要素に基づいてフレーム@var{frame}の
パラメータを変更する。
@var{alist}の各要素は@code{(@var{parm} . @var{value})}の形であり、
@var{parm}はパラメータを表すシンボルである。
@var{alist}に指定しないパラメータの値は変更されない。
If @var{frame} is @code{nil}, it defaults to the selected
frame.
@end defun
@defun set-frame-parameter frame parm value
This function sets the frame parameter @var{parm} to the specified
@var{value}. If @var{frame} is @code{nil}, it defaults to the
selected frame.
@end defun
@defun modify-all-frames-parameters alist
This function alters the frame parameters of all existing frames
according to @var{alist}, then modifies @code{default-frame-alist}
(and, if necessary, @code{initial-frame-alist}) to apply the same
parameter values to frames that will be created henceforth.
@end defun
@node Initial Parameters
@subsection 初期フレームのパラメータ
@cindex parameters of initial frame
読者のファイル(@pxref{Init
File})で@code{initial-frame-alist}に設定すれば、
起動時の初期フレームのパラメータを指定できます。
@defopt initial-frame-alist
この変数の値は、初期フレームを作るときに
使用するパラメータの値から成る連想リストである。
この変数を指定すれば初期フレームの見ためを指定できるが、
それ以降に作成するフレームには影響しない。
各要素はつぎの形である。
@example
(@var{parameter} . @var{value})
@end example
Emacsは初期設定ファイルを読むまえに初期フレームを作る。
このファイルを読んだあとに、Emacsは@code{initial-frame-alist}を検査し
異なる値が設定されているパラメータをすでに作成した初期フレームに適用する。
これらの設定がフレームの大きさと位置や見ために関するものであると、
指定とは違うフレームが現れてから指定したものに変わるのを目にする。
これがわずらわしい場合には、Xリソースにも同じ大きさと位置や見ためを指定する。
Xリソースはフレームを作成するまえに適用される。
@xref{X Resources,, X Resources, emacs, The GNU Emacs Manual}。
Xリソースの設定は、典型的にはすべてのフレームに適用される。
初期フレームだけに特定のXリソースを指定し、
それ以降のフレームに適用したくない場合には、つぎのようにする。
パラメータを@code{default-frame-alist}で指定し、
以降のフレーム向けのXリソースを無効にする。
そしてそれらが初期フレームに影響しないように、
@code{initial-frame-alist}のパラメータでXリソースに一致する値を指定する。
@end defopt
@cindex minibuffer-only frame
これらのパラメータにミニバッファ専用のフレームを作る
@code{(minibuffer . nil)}を指定しているのに
@dfn{ミニバッファ専用フレーム}を作っていないと、Emacsがそれを作成します。
@defopt minibuffer-frame-alist
この変数の値は、初期のミニバッファ専用フレームを作るときに使用する
パラメータの連想リストである。
(i.e., the minibuffer-only
frame that Emacs creates if @code{initial-frame-alist} specifies a
frame with no minibuffer)
@end defopt
@defopt default-frame-alist
これは、Emacsのすべてのフレーム、つまり、
初期フレームとそれ以降のフレームのフレームパラメータのデフォルト値を
指定する連想リストである。
Xウィンドウシステムを使っているときには、多くの場合、
Xリソースによっても同じ結果を得られる。
Setting this variable does not affect existing frames. Furthermore,
functions that display a buffer in a separate frame may override the
default parameters by supplying their own parameters.
@end defopt
Emacsを起動するときにウィンドウの姿形を指定するオプションを使うと、
それらは@code{initial-frame-alist}または@code{default-frame-alist}に要素を追加することで効果を発揮します。
Options
which affect just the initial frame, such as @samp{--geometry} and
@samp{--maximized}, add to @code{initial-frame-alist}; the others add
to @code{default-frame-alist}. @pxref{Emacs Invocation,, Command Line
Arguments for Emacs Invocation, emacs, The GNU Emacs Manual}.
@node Window Frame Parameters
@subsection ウィンドウフレームのパラメータ
@cindex frame parameters for windowed displays
フレームのパラメータの種類は、使用する表示機構に依存します。
ウィンドウフレームにおいて特別な意味を持つパラメータの一覧をつぎに示します。
これらのうち、@code{name}、@code{title}、@code{height}、
@code{width}、@code{buffer-list}、@code{buffer-predicate}は
端末フレームでも意味を持ち、
@code{tty-color-mode}はテキスト端末でしか意味を持たない。
@menu
* Basic Parameters:: Parameters that are fundamental.
* Position Parameters:: The position of the frame on the screen.
* Size Parameters:: Frame's size.
* Layout Parameters:: Size of parts of the frame, and
enabling or disabling some parts.
* Buffer Parameters:: Which buffers have been or should be shown.
* Management Parameters:: Communicating with the window manager.
* Cursor Parameters:: Controlling the cursor appearance.
* Font and Color Parameters:: Fonts and colors for the frame text.
@end menu
@node Basic Parameters
@subsubsection Basic Parameters
These frame parameters give the most basic information about the
frame. @code{title} and @code{name} are meaningful on all terminals.
@table @code
@vindex display, a frame parameter
@item display
このフレームを開くディスプレイ。
環境変数@env{DISPLAY}と同様に、
@samp{@var{host}:@var{dpy}.@var{screen}}の形の文字列であること。
@xref{Multiple Terminals}, for
more details about display names.
@vindex display-type, a frame parameter
@item display-type
このパラメータはこのフレームで使用可能な表示色の範囲を表す。
値は、@code{color}、@code{grayscale}、@code{mono}のいずれかである。
@vindex title, a frame parameter
@item title
フレームが@code{nil}以外のタイトルであれば、
フレーム向けのウィンドウシステムの枠にタイトルが現れる。
また、@code{mode-line-frame-identification}に@samp{%F}
(@pxref{%-Constructs})を使っていれば、
当該フレームのモード行にもタイトルが現れる。
Emacsがウィンドウシステムを使っていない場合には、
これは普通はモード行に表示され一度に1つのフレームだけを表示できる。
@xref{Frame Titles}。
@vindex name, a frame parameter
@item name
フレームの名前。
パラメータ@code{title}を指定しないか@code{nil}であると、
フレーム名はフレームタイトルのデフォルトになる。
名前を指定しないと、Emacsが自動的にフレーム名を設定する
(@pxref{Frame Titles})。
フレームを作るときにフレーム名を明示的に指定すると、
その名前は(Emacsの実行形式ファイルの名前のかわりに)
フレーム向けのXリソースを探すためにも使われる。
@item explicit-name
If the frame name was specified explicitly when the frame was created,
this parameter will be that name. If the frame wasn't explicitly
named, this parameter will be @code{nil}.
@end table
@node Position Parameters
@subsubsection Position Parameters
@cindex window position on display
@cindex frame position
Position parameters' values are normally measured in pixels, but on
text terminals they count characters or lines instead.
@table @code
@vindex left, a frame parameter
@item left
スクリーンの左端を基準にしたピクセル単位の左端位置。
この値は以下のいずれかである。
@table @asis
@item 整数
正の整数は、フレームの左端とスクリーンの左端を関係を定める。
負の整数は、フレームの右端とスクリーンの右端を関係を定める。
@item @code{(+ @var{pos})}
スクリーンの左端を基準にしたウィンドウの左端位置を指定する。
The integer @var{pos} may be positive or negative; a
negative value specifies a position outside the screen or on a monitor
other than the primary one (for multi-monitor displays).
@item @code{(- @var{pos})}
スクリーンの右端を基準にしたウィンドウの右端位置を指定する。
The integer @var{pos} may be positive or negative; a
negative value specifies a position outside the screen or on a monitor
other than the primary one (for multi-monitor displays).
@end table
Some window managers ignore program-specified positions. If you want to
be sure the position you specify is not ignored, specify a
non-@code{nil} value for the @code{user-position} parameter as well.
@vindex top, a frame parameter
@item top
The screen position of the top (or bottom) edge, in pixels, with respect
to the top (or bottom) edge of the screen. It works just like
@code{left}, except vertically instead of horizontally.
@vindex icon-left, a frame parameter
@item icon-left
スクリーンの左端を基準にした
フレームのアイコンのピクセル単位の左端位置。
ウィンドウマネージャがアイコン化の機能を持つ場合、フレームをアイコンにしたときに効果を発揮する。
If you specify a value for this parameter, then you must also specify a
value for @code{icon-top} and vice versa.
@vindex icon-top, a frame parameter
@item icon-top
スクリーンの上端を基準にした
フレームのアイコンのピクセル単位の上端位置。
ウィンドウマネージャがアイコン化の機能を持つ場合、フレームをアイコンにしたときに効果を発揮する。
@vindex user-position, a frame parameter
@item user-position
パラメータ@code{left}と@code{top}でスクリーン上の位置を指定して
フレームを作るときに、このパラメータは指定位置が、
(利用者がなんらかの方法で与えた)ユーザー指定のものなのか、
(プログラムが選んだ)プログラム指定のものなのかを指定する。
@code{nil}以外の値であるとユーザー指定の位置であることを意味する。
@cindex window positions and window managers
ウィンドウマネージャはユーザー指定の位置を一般に尊重し、
プログラム指定の位置も尊重するものもある。
しかしその多くはプログラム指定の位置を無視し、
デフォルトに基づいてウィンドウを配置したり、
マウスでユーザーに配置させる。
@code{twm}を含むウィンドウマネージャには、
プログラム指定の位置に従うかそれらを無視するかを
ユーザーが指定できるものもある。
@code{make-frame}を呼び出すときには、
パラメータ@code{left}と@code{top}の値がユーザーの希望を表す場合には
このパラメータの値には@code{nil}以外を指定すること。
さもなければ@code{nil}を指定する。
@end table
@node Size Parameters
@subsubsection Size Parameters
@cindex window size on display
Frame parameters specify frame sizes in character units. On
graphical displays, the @code{default} face determines the actual
pixel sizes of these character units (@pxref{Face Attributes}).
@table @code
@vindex height, a frame parameter
@item height
フレームの内側の文字単位の高さ(@pxref{Size and Position})。
@vindex width, a frame parameter
@item width
フレームの内側の文字単位の幅(@pxref{Size and Position})。
@vindex user-size, a frame parameter
@item user-size
This does for the size parameters @code{height} and @code{width} what
the @code{user-position} parameter (@pxref{Position Parameters,
user-position}) does for the position parameters @code{top} and
@code{left}.
@cindex full-screen frames
@vindex fullscreen, a frame parameter
@item fullscreen
Specify that width, height or both shall be maximized. The value
@code{fullwidth} specifies that width shall be as wide as possible. The
value @code{fullheight} specifies that height shall be as tall as
possible. The value @code{fullboth} specifies that both the width and
the height shall be set to the size of the screen. The value
@code{maximized} specifies that the frame shall be maximized.
The difference between @code{maximized} and @code{fullboth} is that a
maximized frame usually keeps its title bar and the buttons for resizing
and closing the frame. Also, maximized frames typically avoid hiding
any task bar or panels displayed on the desktop. ``Fullboth'' frames,
on the other hand, usually omit the title bar and occupy the entire
available screen space.
``Fullheight'' and ``fullwidth'' frames are more similar to maximized
frames in this regard. However, these typically display an external
border which might be absent with maximized frames. Hence the heights
of maximized and fullheight frames and the widths of maximized and
fullwidth frames often differ by a few pixels.
With some window managers you may have to customize the variable
@code{frame-resize-pixelwise} (@pxref{Size and Position}) in order to
make a frame truly appear ``maximized'' or ``fullscreen''. Moreover,
some window managers might not support smooth transition between the
various fullscreen or maximization states. Customizing the variable
@code{x-frame-normalize-before-maximize} can help to overcome that.
@vindex fullscreen-restore, a frame parameter
@item fullscreen-restore
This parameter specifies the desired ``fullscreen'' state of the frame
after invoking the @code{toggle-frame-fullscreen} command (@pxref{Frame
Commands,,, emacs, The GNU Emacs Manual}) in the ``fullboth'' state.
Normally this parameter is installed automatically by that command when
toggling the state to fullboth. If, however, you start Emacs in the
fullboth state, you have to specify the desired behavior in your initial
file as, for example
@example
(setq default-frame-alist
'((fullscreen . fullboth) (fullscreen-restore . fullheight)))
@end example
This will give a new frame full height after typing in it @key{F11} for
the first time.
@end table
@node Layout Parameters
@subsubsection Layout Parameters
@cindex layout parameters of frames
@cindex frame layout parameters
These frame parameters enable or disable various parts of the
frame, or control their sizes.
@table @code
@vindex border-width, a frame parameter
@item border-width
ウィンドウ枠のピクセル単位の幅。
@vindex internal-border-width, a frame parameter
@item internal-border-width
枠とテキスト(またはフリンジ)のあいだのピクセル単位の間隔。
@vindex vertical-scroll-bars, a frame parameter
@item vertical-scroll-bars
フレームに垂直スクロール用のスクロールバーを付けるかどうか、
どちら側に付けるかを表す。
指定できる値は、@code{left}、@code{right}、あるいは
スクロールバーなしを意味する@code{nil}。
@vindex horizontal-scroll-bars, a frame parameter
@item horizontal-scroll-bars
水平スクロール用のスクロールバーを付けるかどうかを表す。
(@code{t} and @code{bottom} mean yes, @code{nil} means no).
@vindex scroll-bar-width, a frame parameter
@item scroll-bar-width
垂直スクロールバーのピクセル単位の幅。
@code{nil} meaning to
use the default width.
@vindex scroll-bar-height, a frame parameter
@item scroll-bar-height
The height of horizontal scroll bars, in pixels, or @code{nil} meaning
to use the default height.
@vindex left-fringe, a frame parameter
@vindex right-fringe, a frame parameter
@item left-fringe
@itemx right-fringe
The default width of the left and right fringes of windows in this
frame (@pxref{Fringes}). If either of these is zero, that effectively
removes the corresponding fringe.
When you use @code{frame-parameter} to query the value of either of
these two frame parameters, the return value is always an integer.
When using @code{set-frame-parameter}, passing a @code{nil} value
imposes an actual default value of 8 pixels.
@vindex right-divider-width, a frame parameter
@item right-divider-width
The width (thickness) reserved for the right divider (@pxref{Window
Dividers}) of any window on the frame, in pixels. A value of zero means
to not draw right dividers.
@vindex bottom-divider-width, a frame parameter
@item bottom-divider-width
The width (thickness) reserved for the bottom divider (@pxref{Window
Dividers}) of any window on the frame, in pixels. A value of zero means
to not draw bottom dividers.
@vindex menu-bar-lines frame parameter
@item menu-bar-lines
フレームの上端に割り当てるメニューバー向けの行の個数。
メニューバーモードが有効ならデフォルトは1で、そうでなければ0である。
@xref{Menu Bars,,,emacs, The GNU Emacs Manual}.
@vindex tool-bar-lines frame parameter
@item tool-bar-lines
The number of lines to use for the tool bar. The default is 1 if Tool
Bar mode is enabled, and 0 otherwise. @xref{Tool Bars,,,emacs, The
GNU Emacs Manual}.
@vindex tool-bar-position frame parameter
@item tool-bar-position
The position of the tool bar. Currently only for the GTK tool bar.
Value can be one of @code{top}, @code{bottom} @code{left}, @code{right}.
The default is @code{top}.
@vindex line-spacing, a frame parameter
@item line-spacing
Additional space to leave below each text line, in pixels (a positive
integer). @xref{Line Height}, for more information.
@end table
@node Buffer Parameters
@subsubsection Buffer Parameters
@cindex frame, which buffers to display
@cindex buffers to display on frame
These frame parameters, meaningful on all kinds of terminals, deal
with which buffers have been, or should, be displayed in the frame.
@table @code
@vindex minibuffer, a frame parameter
@item minibuffer
このフレームに独自のミニバッファがあるかどうかを表す。
値@code{t}はあることを表し、@code{nil}はないことを表す。
@code{only}は、このフレームがミニバッファだけであることを表す。
(別のフレームの)値がミニバッファだけであると、
新たなフレームはそのミニバッファを使う。
This frame parameter takes effect when the frame is created, and can
not be changed afterwards.
@vindex buffer-predicate, a frame parameter
@item buffer-predicate
このフレーム向けのバッファ述語関数。
これが@code{nil}でなければ、
関数@code{other-buffer}が(選択されているフレームから)この述語を使用して、
どのバッファにするかを決定する。
当該関数は各バッファごとにバッファを引数としてこの述語関数を呼び出す。
この述語が@code{nil}以外を返すと当該バッファを選ぶ。
@vindex buffer-list, a frame parameter
@item buffer-list
このフレームで選択されたバッファを
もっとも最近に選択されたものから順に並べたリスト。
@vindex unsplittable, a frame parameter
@item unsplittable
@code{nil}以外であると、このフレームのウィンドウをけっして自動的に分割しない。
@end table
@node Management Parameters
@subsubsection Window Management Parameters
@cindex window manager interaction, and frame parameters
The following frame parameters control various aspects of the
frame's interaction with the window manager. They have no effect on
text terminals.
@table @code
@vindex visibility, a frame parameter
@item visibility
フレームの可視性。
不可視を表す@code{nil}、可視を表す@code{t}、
アイコンになっていることを表す@code{icon}の3の可能性がある。
@xref{Visibility of Frames}。
@vindex auto-raise, a frame parameter
@item auto-raise
フレームを選択したときにフレームを手前に移動するかどうかを表す
(@code{nil}以外であるとそのようにする)。
Some window managers do not allow this.
@vindex auto-lower, a frame parameter
@item auto-lower
フレームの選択を止めたときにフレームを奥へ移動するかどうかを表す
(@code{nil}以外であるとそのようにする)。
Some window managers do not allow this.
@vindex icon-type, a frame parameter
@item icon-type
このフレームをアイコンにしたときに使うアイコンの種類。
値が文字列であると、使用するビットマップを収めたファイルを指定する。
それ以外の@code{nil}以外の値はデフォルトのビットマップアイコン
を指定する。
@code{nil}はアイコンなしを指定する。
@vindex icon-name, a frame parameter
@item icon-name
このフレーム向けのアイコンを表示するときに使用するアイコンの名前。
これが@code{nil}であると、フレームのタイトルを使う。
@vindex window-id, a frame parameter
@item window-id
The ID number which the graphical display uses for this frame. Emacs
assigns this parameter when the frame is created; changing the
parameter has no effect on the actual ID number.
@vindex outer-window-id, a frame parameter
@item outer-window-id
The ID number of the outermost window-system window in which the frame
exists. As with @code{window-id}, changing this parameter has no
actual effect.
@vindex wait-for-wm, a frame parameter
@item wait-for-wm
If non-@code{nil}, tell Xt to wait for the window manager to confirm
geometry changes. Some window managers, including versions of Fvwm2
and KDE, fail to confirm, so Xt hangs. Set this to @code{nil} to
prevent hanging with those window managers.
@vindex sticky, a frame parameter
@item sticky
If non-@code{nil}, the frame is visible on all virtual desktops on systems
with virtual desktops.
@ignore
@vindex parent-id, a frame parameter
@item parent-id
@c ??? Not yet working.
The X window number of the window that should be the parent of this one.
Specifying this lets you create an Emacs window inside some other
application's window. (It is not certain this will be implemented; try
it and see if it works.)
@end ignore
@end table
@node Cursor Parameters
@subsubsection Cursor Parameters
@cindex cursor, and frame parameters
This frame parameter controls the way the cursor looks.