unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9452: 24.0.50; doc string of `constrain-to-field'
@ 2011-09-06 18:51 Drew Adams
  2012-03-11 16:28 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2011-09-06 18:51 UTC (permalink / raw)
  To: 9452

1. The doc for this, and for all things concerning fields, is quite
complex - not simple to read.  Dunno whether it could be made simpler
and still be complete and correct.  It seems clear, but you must read it
carefully, and probably more than once.
 
2. The elisp manual's description of `constrain-to-field' is better than
the doc string's.  In particular, the fact that a nil NEW-POS has the
side effect of (possibly) moving point is clearer.  The manual says:
 
 "If NEW-POS is `nil', then `constrain-to-field'...moves point to the
  resulting position as well as returning it."
 
(The English is not really correct, however: It should say "moves"..."
and returns", not "moves"...and "returning".)
 
The doc string is not as clear about point moving.  It says:
 
 "If NEW-POS is nil, then the current point is used instead, and set to
  the constrained position if that is different."
 
We do not "set" point, for one thing.  And the passive voice ("is used",
"is set to") waters meaning down here.
 
But the real problem is that users reading this might not catch the fact
that _point is moved_.  Use language similar to the manual's: "moves" is
an active verb and makes clear that there is a side effect of (possibly)
moving point.
 
Even in the manual this important difference in behavior when NEW-POS is
nil is not so noticeable.  We should emphasize to users that null
NEW-POS means point might move.  This is an important use case for
`constrain-to-field', and it almost gets lost in the verbiage about the
args.
 

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-09-05 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt'
 






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

* bug#9452: 24.0.50; doc string of `constrain-to-field'
  2011-09-06 18:51 bug#9452: 24.0.50; doc string of `constrain-to-field' Drew Adams
@ 2012-03-11 16:28 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-03-11 16:28 UTC (permalink / raw)
  To: Drew Adams; +Cc: 9452

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

> But the real problem is that users reading this might not catch the fact
> that _point is moved_.  Use language similar to the manual's: "moves" is
> an active verb and makes clear that there is a side effect of (possibly)
> moving point.

Fair enough.  Fixed.





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

end of thread, other threads:[~2012-03-11 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-06 18:51 bug#9452: 24.0.50; doc string of `constrain-to-field' Drew Adams
2012-03-11 16:28 ` Chong Yidong

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).