GNU bug report logs - #13934
Minor bug in `command-line-functions'

Previous Next

Package: emacs;

Reported by: Xue Fuqiao <xfq.free <at> gmail.com>

Date: Tue, 12 Mar 2013 14:05:02 UTC

Severity: minor

Tags: notabug

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 13934 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Xue Fuqiao <xfq.free <at> gmail.com>
Cc: 13934 <at> debbugs.gnu.org
Subject: Re: bug#13934: Minor bug in `command-line-functions'
Date: Wed, 14 Aug 2019 22:59:54 -0700
Xue Fuqiao <xfq.free <at> gmail.com> 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




This bug report was last modified 5 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.