From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: problem of marker as position Date: Tue, 18 Nov 2003 21:34:50 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200311190334.hAJ3Yo402428@raven.dms.auburn.edu> References: <200311190023.JAA14877@etlken.m17n.org> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1069213534 11794 80.91.224.253 (19 Nov 2003 03:45:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Nov 2003 03:45:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Nov 19 04:45:31 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AMJHX-0002Dm-00 for ; Wed, 19 Nov 2003 04:45:31 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AMJHW-0008TD-00 for ; Wed, 19 Nov 2003 04:45:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AMKAx-0002dX-Bv for emacs-devel@quimby.gnus.org; Tue, 18 Nov 2003 23:42:47 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AMKAq-0002c3-Eh for emacs-devel@gnu.org; Tue, 18 Nov 2003 23:42:40 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AMKAK-0002TQ-JC for emacs-devel@gnu.org; Tue, 18 Nov 2003 23:42:39 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AMKAK-0002T1-AE for emacs-devel@gnu.org; Tue, 18 Nov 2003 23:42:08 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id hAJ3eeKk015085; Tue, 18 Nov 2003 21:40:40 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id hAJ3Yo402428; Tue, 18 Nov 2003 21:34:50 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: handa@m17n.org In-reply-to: <200311190023.JAA14877@etlken.m17n.org> (message from Kenichi Handa on Wed, 19 Nov 2003 09:23:05 +0900 (JST)) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17904 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17904 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.