all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* minibuffer-prompt-end badly named
@ 2002-08-13  1:37 Thomas A. Horsley
  2002-08-13 22:47 ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A. Horsley @ 2002-08-13  1:37 UTC (permalink / raw)


This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.2.1 (i386-msvc-nt5.1.2600)
 of 2002-03-19 on buffy
configured using `configure --with-msvc (12.00)'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: nil

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

While attempting to port all my custom lisp code that navigates around
buffers so it works correctly in the minibuffer, I started using things
like (minibuffer-prompt-end) instead of (point-min). This worked
until I tried using some of these functions in shell buffers.

The function minibuffer-prompt-end (and all the other related functions
added for emacs21) are very badly documented. Just looking at prompt-end:

(defun minibuffer-prompt-end ()
  "Return the buffer position of the end of the minibuffer prompt.
Return (point-min) if current buffer is not a mini-buffer."
  (field-beginning (point-max)))

It *claims* to work one way in the minibuffer and another way in all other
buffers, but in reality, all it does is work one way for buffers with
text fields and another way for buffers without text fields. Since
lots of buffers use text fields (comint, to pick a popular one), this
will have strange and wondrous behavior if you write code while
believing the documentation.

In fact, it would really be useful to have functions that work the
way minibuffer-prompt-end and friends are documented to work, but
unfortunately, they don't work that way :-(.

Speaking of which, how the devil do you tell if the current buffer
is a minibuffer?

Recent input:
<help-echo> <help-echo> c y SPC c y SPC c y SPC c y 
SPC c y SPC c y SPC c y SPC c y SPC c y SPC c y SPC 
<down> SPC <down> <down> <down> <down> SPC <down> SPC 
c y SPC c y C-u 9 9 c y q y <f1> r e p o r t - b u 
g <tab> <f1> a p r o p o s <return> r e p o r t . * 
b u g <return> <f1> r e p o r t - e m a c <tab> <r
eturn>

Recent messages:
No more newsgroups [76 times]

No more unread newsgroups

Wrote f:/users/tom/.newsrc
Saving f:/users/tom/.newsrc.eld...
Wrote f:/users/tom/.newsrc.eld
Saving f:/users/tom/.newsrc.eld...done
call-interactively: Quit
Loading emacsbug...done

--
>>==>> The *Best* political site <URL:http://www.vote-smart.org/> >>==+
      email: Tom.Horsley@worldnet.att.net icbm: Delray Beach, FL      |
<URL:http://home.att.net/~Tom.Horsley> Free Software and Politics <<==+

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

* Re: minibuffer-prompt-end badly named
  2002-08-13  1:37 minibuffer-prompt-end badly named Thomas A. Horsley
@ 2002-08-13 22:47 ` Richard Stallman
  2002-08-13 23:17   ` Thomas A. Horsley
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2002-08-13 22:47 UTC (permalink / raw)
  Cc: emacs-devel

I will improve this area.

    The function minibuffer-prompt-end (and all the other related functions
    added for emacs21) are very badly documented.

Could you give me a precise list of the functions that you think
are badly documented?  I could afford to look at specific functions
to try to improve their doc strings, but I'd rather not take the extra
time to hunt for the right functions.

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

* Re: minibuffer-prompt-end badly named
  2002-08-13 22:47 ` Richard Stallman
@ 2002-08-13 23:17   ` Thomas A. Horsley
  2002-08-14 23:13     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A. Horsley @ 2002-08-13 23:17 UTC (permalink / raw)
  Cc: emacs-devel

>I will improve this area.
>
>    The function minibuffer-prompt-end (and all the other related functions
>    added for emacs21) are very badly documented.
>
>Could you give me a precise list of the functions that you think
>are badly documented?  I could afford to look at specific functions
>to try to improve their doc strings, but I'd rather not take the extra
>time to hunt for the right functions.

Upon further review, it may only be minibuffer-prompt-end that has the
really screwy doc string. The other functions right next to it all say they
must be used in the minibuffer, and in those cases, the rest of the doc
string is correct. I'd still like a function that actually does what the
current doc string for minibuffer-prompt-end claims to do :-).

The best I've come up with so far is:

(defun writable-point-min ()
"Return first writable position in current buffer."
   (let
      ( (rval (point-min)) )
      (if (get-text-property rval 'read-only)
         (setq rval (next-single-property-change rval 'read-only)) )
      rval ) )

--
>>==>> The *Best* political site <URL:http://www.vote-smart.org/> >>==+
      email: Tom.Horsley@worldnet.att.net icbm: Delray Beach, FL      |
<URL:http://home.att.net/~Tom.Horsley> Free Software and Politics <<==+

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

* Re: minibuffer-prompt-end badly named
  2002-08-13 23:17   ` Thomas A. Horsley
@ 2002-08-14 23:13     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2002-08-14 23:13 UTC (permalink / raw)
  Cc: emacs-devel

I changed minibuffer-prompt-end so that outside the minibuffer
it always returns (point-beg).  Thanks for pointing out the problem.

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

end of thread, other threads:[~2002-08-14 23:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-13  1:37 minibuffer-prompt-end badly named Thomas A. Horsley
2002-08-13 22:47 ` Richard Stallman
2002-08-13 23:17   ` Thomas A. Horsley
2002-08-14 23:13     ` Richard Stallman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.