From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: problem of marker as position
Date: Tue, 18 Nov 2003 21:34:50 -0600 (CST) [thread overview]
Message-ID: <200311190334.hAJ3Yo402428@raven.dms.auburn.edu> (raw)
In-Reply-To: <200311190023.JAA14877@etlken.m17n.org> (message from Kenichi Handa on Wed, 19 Nov 2003 09:23:05 +0900 (JST))
Ken'ichi Handa wrote:
I've just noticed that (char-after MARKER) returns a
character in the current buffer even if the buffer of MARKER
is the different one. I think all such functions that
accept a marker as a position ignores the buffer infomation
of the marker.
To me that is exactly what is _meant_ by using a marker "as a
position". A function could also accept a marker "as a buffer", by
ignoring the position, or "truly as a marker", by using both. It
would seem to me that any function is free to allow both an integer
and a marker as an argument and nevertheless use the marker as a
marker, that is, buffer and all. In that case however, it would not
be using the marker as a "substitute" for a position, but as a
genuinely different alternative to a position. I believe that it is
up to the documentation of the individual function to make that clear.
The documentation string of `char-after' clearly says that it uses the
current buffer no matter what.
That being said, _if_ something needs to be clarified, then I believe
that the best place to do that is (elisp)Positions:
===File ~/pos-diff==========================================
cd ~/emacscvsdir/emacs/lispref/
diff -c /home/teirllm/positions.old.texi /home/teirllm/emacscvsdir/emacs/lispref/positions.texi
*** /home/teirllm/positions.old.texi Sat Nov 8 22:41:19 2003
--- /home/teirllm/emacscvsdir/emacs/lispref/positions.texi Tue Nov 18 21:14:12 2003
***************
*** 18,24 ****
Positions are usually represented as integers starting from 1, but can
also be represented as @dfn{markers}---special objects that relocate
automatically when text is inserted or deleted so they stay with the
! surrounding characters. @xref{Markers}.
See also the ``field'' feature (@pxref{Fields}), which provides
functions that are used by many cursor-motion commands.
--- 18,28 ----
Positions are usually represented as integers starting from 1, but can
also be represented as @dfn{markers}---special objects that relocate
automatically when text is inserted or deleted so they stay with the
! surrounding characters. Functions that expect an argument to be a
! position (an integer), but accept a marker as a substitute, normally
! ignore the marker buffer. Of course, markers used this way usually
! point to a position in the buffer that the function operates on, but
! that is entirely the programmer's responsibility. @xref{Markers}.
See also the ``field'' feature (@pxref{Fields}), which provides
functions that are used by many cursor-motion commands.
Diff finished at Tue Nov 18 21:20:02
============================================================
Sincerely,
Luc.
next prev parent reply other threads:[~2003-11-19 3:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-19 0:23 problem of marker as position Kenichi Handa
2003-11-19 3:34 ` Luc Teirlinck [this message]
2003-11-20 11:47 ` Kenichi Handa
2003-11-20 13:22 ` Robert J. Chassell
2003-11-20 19:41 ` Kevin Rodgers
2003-11-21 5:03 ` Luc Teirlinck
2003-11-19 16:00 ` Luc Teirlinck
2003-11-21 4:09 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200311190334.hAJ3Yo402428@raven.dms.auburn.edu \
--to=teirllm@dms.auburn.edu \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).