mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 10:31:37 -08:00
(main): Fix conversion of --display to -d.
(main): Implement --version.
This commit is contained in:
parent
dcc98b56bc
commit
1702afef39
1 changed files with 19 additions and 1 deletions
20
src/emacs.c
20
src/emacs.c
|
|
@ -420,6 +420,22 @@ main (argc, argv, envp)
|
|||
|
||||
sort_args (argc, argv);
|
||||
|
||||
if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args))
|
||||
{
|
||||
Lisp_Object tem;
|
||||
tem = Fsymbol_value (intern ("emacs-version"));
|
||||
if (!STRINGP (tem))
|
||||
{
|
||||
fprintf (stderr, "Invalid value of `emacs-version'\n");
|
||||
exit (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("%s\n", XSTRING (tem)->data);
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Map in shared memory, if we are using that. */
|
||||
#ifdef HAVE_SHM
|
||||
if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args))
|
||||
|
|
@ -604,7 +620,9 @@ Usage: %s [-t term] [--terminal term] [-nw] [--no-windows] [--batch]\n\
|
|||
argv = new;
|
||||
argc++;
|
||||
}
|
||||
else if (displayname != 0 && argv[count_before + 1][1] == '-')
|
||||
/* Change --display to -d, when its arg is separate. */
|
||||
else if (displayname != 0 && skip_args > count_before
|
||||
&& argv[count_before + 1][1] == '-')
|
||||
argv[count_before] = "-d";
|
||||
|
||||
/* Don't actually discard this arg. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue