unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13926: 24.3.50; doc string of `visual-line-mode'
@ 2013-03-11 20:19 Drew Adams
  2014-02-08 12:58 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2013-03-11 20:19 UTC (permalink / raw)
  To: 13926

The doc string is misleading wrt the argument when called from Lisp.
 
 With a prefix argument ARG, enable Visual Line mode if ARG is
 positive, and disable it otherwise.  If called from Lisp, enable
 the mode if ARG is omitted or nil.
 
This makes no connection between the interactive prefix arg and the arg
when called from Lisp.  In particular, it can also give the incorrect
impression that the mode is enabled ONLY if ARG is omitted or nil.
There is nothing that suggests the behavior of a non-positive or
positive ARG when called from Lisp.
 
By way of contrast, the doc string of `define-minor-mode' correctly says
what the argument values do when called from Lisp:
 
 When called from Lisp, the mode command toggles the mode if the
 argument is `toggle', disables the mode if the argument is a
 non-positive integer, and enables the mode otherwise (including
 if the argument is omitted or nil or a positive integer).
 
This kind of careful description should probably be added automatically
to functions defined by `define-minor-mode', to prevent misleading doc
wrt the argument.

In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2013-03-04 on ODIEONE
Bzr revision: 111935 yamaoka@jpl.org-20130304102733-4qy111z41qwoh2as
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib'
 






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#13926: 24.3.50; doc string of `visual-line-mode'
  2013-03-11 20:19 bug#13926: 24.3.50; doc string of `visual-line-mode' Drew Adams
@ 2014-02-08 12:58 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-08 12:58 UTC (permalink / raw)
  To: Drew Adams; +Cc: 13926

"Drew Adams" <drew.adams@oracle.com> writes:

> The doc string is misleading wrt the argument when called from Lisp.
>
>  With a prefix argument ARG, enable Visual Line mode if ARG is
>  positive, and disable it otherwise.  If called from Lisp, enable
>  the mode if ARG is omitted or nil.
>
> This makes no connection between the interactive prefix arg and the arg
> when called from Lisp.  In particular, it can also give the incorrect
> impression that the mode is enabled ONLY if ARG is omitted or nil.
> There is nothing that suggests the behavior of a non-positive or
> positive ARG when called from Lisp.
>
> By way of contrast, the doc string of `define-minor-mode' correctly says
> what the argument values do when called from Lisp:
>
>  When called from Lisp, the mode command toggles the mode if the
>  argument is `toggle', disables the mode if the argument is a
>  non-positive integer, and enables the mode otherwise (including
>  if the argument is omitted or nil or a positive integer).
>
> This kind of careful description should probably be added automatically
> to functions defined by `define-minor-mode', to prevent misleading doc
> wrt the argument.

Everything defined by `define-minor-mode' follows this model, I think?
Should `define-minor-mode' just append that to the function doc strings
automatically, and then we can remove the half-assed ARG explanations
from all the callers?

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-08 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 20:19 bug#13926: 24.3.50; doc string of `visual-line-mode' Drew Adams
2014-02-08 12:58 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).