Subject: Re: bug#13934: Minor bug in `command-line-functions'

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 14 Aug 2019 22:59:54 -0700

Xue Fuqiao <[email-masked]> writes:

> In the doc string of `command-line-functions':
>   Each function should access the dynamically bound variables `argi'
>   (the current argument) and `command-line-args-left' (the remaining
>   arguments).
>
> But in startup.el:
>
>   (internal-make-var-non-special 'argi)
>
> Originally posted in:
> http://lists.gnu.org/archive/html/help-gnu-emacs/2013-03/msg00145.html

Stefan says that it's a doc bug:

---
List of functions to process unrecognized command-line arguments.
Each function should access the dynamically bound variables
‘argi’ (the current argument) and ‘command-line-args-left’ (the remaining
arguments).  The function should return non-nil only if it recognizes and
processes ‘argi’.  If it does so, it may consume successive arguments by
altering ‘command-line-args-left’ to remove them.
---

But...  if `argi' isn't dynamic, then just about everything here is
incorrect, surely.  So should `command-line-functions' just do whatever
they like and never refer to `argi'?  And consume
`command-line-args-left' however they like?

It's rather confusing, especially with the:

(with-no-warnings
  (defvar argi nil
    "Current command-line argument."))
(internal-make-var-non-special 'argi)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no