bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24949: Command-line argument parsing: named daemons


From: Glenn Morris
Subject: bug#24949: Command-line argument parsing: named daemons
Date: Tue, 15 Nov 2016 17:25:46 -0500
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Package: emacs
Severity: minor
Version: 25.1

This starts a daemon with a server named "FOO":
   emacs -Q --daemon=FOO

(This usage is documented in the "Initial Options" appendix of the
manual, but not mentioned in --help, or the man page.)


But this very similar form does not work (it starts an un-named daemon and
visits file "FOO"):
   emacs -Q --daemon FOO

Compare with something like "--chdir /tmp", where both forms (with and
without "=") work.

This is due to the fragility of the Emacs argument parsing code,
which seems pretty home-grown. In particular, I guess it is because
struct standard_args has --daemon listed as taking no arguments.
Options with optional arguments don't seem to be handled.

There is a 20-year old comment in emacs.c:

   Too bad we can't just use getopt for all of this, but we don't have
   enough information to do it right.

Perhaps standard argument parsing libraries have improved since then...?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]