mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-11 09:20:51 +00:00
Changed emacsclient to open new frames by default.
lib-src/emacsclient.c (decode_options): Handle the case when $DISPLAY is an empty string. Set window_system or tty to one by default, depending on if there is a valid display. (longopts, decode_options, print_help_and_exit): Removed -w, added -c. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-85
This commit is contained in:
parent
a9298135d8
commit
e5299d8d65
@ -134,6 +134,10 @@ For the NEWS file:
|
|||||||
*** Emacsclient has been extended to support opening a new terminal
|
*** Emacsclient has been extended to support opening a new terminal
|
||||||
frame (see -t option).
|
frame (see -t option).
|
||||||
|
|
||||||
|
*** The behaviour of Emacsclient has been changed to open a new Emacs
|
||||||
|
frame by default. Use the -c option to get the old behavior of
|
||||||
|
opening files in the currently selected Emacs frame.
|
||||||
|
|
||||||
*** A make-frame-on-tty function has been added to make it easier to
|
*** A make-frame-on-tty function has been added to make it easier to
|
||||||
create frames on new terminals.
|
create frames on new terminals.
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ struct option longopts[] =
|
|||||||
{ "help", no_argument, NULL, 'H' },
|
{ "help", no_argument, NULL, 'H' },
|
||||||
{ "version", no_argument, NULL, 'V' },
|
{ "version", no_argument, NULL, 'V' },
|
||||||
{ "tty", no_argument, NULL, 't' },
|
{ "tty", no_argument, NULL, 't' },
|
||||||
{ "window-system", no_argument, NULL, 'w' },
|
{ "current-frame", no_argument, NULL, 'c' },
|
||||||
{ "alternate-editor", required_argument, NULL, 'a' },
|
{ "alternate-editor", required_argument, NULL, 'a' },
|
||||||
{ "socket-name", required_argument, NULL, 's' },
|
{ "socket-name", required_argument, NULL, 's' },
|
||||||
{ "display", required_argument, NULL, 'd' },
|
{ "display", required_argument, NULL, 'd' },
|
||||||
@ -112,11 +112,18 @@ decode_options (argc, argv)
|
|||||||
{
|
{
|
||||||
alternate_editor = getenv ("ALTERNATE_EDITOR");
|
alternate_editor = getenv ("ALTERNATE_EDITOR");
|
||||||
display = getenv ("DISPLAY");
|
display = getenv ("DISPLAY");
|
||||||
|
if (strlen (display) == 0)
|
||||||
|
display = NULL;
|
||||||
|
|
||||||
|
if (display)
|
||||||
|
window_system = 1;
|
||||||
|
else
|
||||||
|
tty = 1;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
int opt = getopt_long (argc, argv,
|
int opt = getopt_long (argc, argv,
|
||||||
"VHnea:s:d:tw", longopts, 0);
|
"VHnea:s:d:tc", longopts, 0);
|
||||||
|
|
||||||
if (opt == EOF)
|
if (opt == EOF)
|
||||||
break;
|
break;
|
||||||
@ -158,8 +165,8 @@ decode_options (argc, argv)
|
|||||||
window_system = 0;
|
window_system = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'w':
|
case 'c':
|
||||||
window_system = 1;
|
window_system = 0;
|
||||||
tty = 0;
|
tty = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -192,7 +199,7 @@ The following OPTIONS are accepted:\n\
|
|||||||
-V, --version Just print a version info and return\n\
|
-V, --version Just print a version info and return\n\
|
||||||
-H, --help Print this usage information message\n\
|
-H, --help Print this usage information message\n\
|
||||||
-t, --tty Open a new Emacs frame on the current terminal\n\
|
-t, --tty Open a new Emacs frame on the current terminal\n\
|
||||||
-w, --window-system Open a new graphical Emacs frame\n\
|
-c, --current-frame Do not create a new frame; use the current Emacs frame\n\
|
||||||
-n, --no-wait Don't wait for the server to return\n\
|
-n, --no-wait Don't wait for the server to return\n\
|
||||||
-e, --eval Evaluate the FILE arguments as ELisp expressions\n\
|
-e, --eval Evaluate the FILE arguments as ELisp expressions\n\
|
||||||
-d, --display=DISPLAY Visit the file in the given display\n\
|
-d, --display=DISPLAY Visit the file in the given display\n\
|
||||||
|
Loading…
Reference in New Issue
Block a user