From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Allowing point to be outside the window? Date: Thu, 09 Dec 2021 12:02:10 +0200 Message-ID: <83bl1qume5.fsf@gnu.org> References: <87ilwd7zaq.fsf.ref@yahoo.com> <83o864wg2a.fsf@gnu.org> <87ilwb68ck.fsf@yahoo.com> <83zgpnunfo.fsf@gnu.org> <87fsrf3xmd.fsf@yahoo.com> <83y257ulfp.fsf@gnu.org> <8735ne4e0e.fsf@yahoo.com> <87czmcvcs1.fsf@yahoo.com> <83sfv85y36.fsf@gnu.org> <87v904tsvv.fsf@yahoo.com> <83h7bo5m1x.fsf@gnu.org> <87ilw3ubfp.fsf@yahoo.com> <83h7bn4e55.fsf@gnu.org> <877dcipjmk.fsf@yahoo.com> <83mtld254e.fsf@gnu.org> <87lf0xjgxu.fsf@yahoo.com> <83ilw0zg38.fsf@gnu.org> <87mtlbgajq.fsf@yahoo.com> <83czm7vx0s.fsf@gnu.org> <87mtlad3sv.fsf@yahoo.com> <83mtlaurxj.fsf@gnu.org> <87lf0ub09f.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34186"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 09 11:03:08 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvGGZ-0008dp-Tc for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 11:03:08 +0100 Original-Received: from localhost ([::1]:52572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvGGY-0006E9-G0 for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 05:03:06 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvGFw-0005Su-7e for emacs-devel@gnu.org; Thu, 09 Dec 2021 05:02:28 -0500 Original-Received: from [2001:470:142:3::e] (port=36770 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvGFv-0002D5-SL; Thu, 09 Dec 2021 05:02:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IK51hfuWmlpdZ1Fqd8IpbS3PlYb3XPBMxfth/cMbOdg=; b=jjH05emuiTNe WL7uNyo/mUYHjduuB0kIZNFuSY/mKzuvC9H+u5f+4lQYcxGggsmt63YVWNG5RN5SbWRnv32ZCuMqr sxjzyPWgVQPhA07JhpsxFEyN5wPiZstRaWInocUFLzcWlPaB9Bp4LRYU/MlWNqNcu7OW+JPRKRNpc +H4nFGr3Bq6gfBL0o+eLfRRZR/hD0bSiLQDk3IyyEUOR0qktKVldqTzphCPs/AsdhRya63ohg2k2N oFhssRprYu9wWF8VVzIAcbMOrD1araZp/bNpRbDkcjLT27aiBS5h4kPNv2qJWhbZVDeus0xj31SN0 GE0cQOCRYcgiCerWaOeWzg==; Original-Received: from [87.69.77.57] (port=2877 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvGFv-0007mW-LT; Thu, 09 Dec 2021 05:02:27 -0500 In-Reply-To: <87lf0ub09f.fsf@yahoo.com> (message from Po Lu on Thu, 09 Dec 2021 17:22:52 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281475 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Thu, 09 Dec 2021 17:22:52 +0800 > > BTW, how would you recommend to determine inside redisplay whether the > text before the start of the window has changed? We already do that when needed: /* The position of the first and last character that has been changed. */ first_changed_charpos = BEG + BEG_UNCHANGED; last_changed_charpos = Z - END_UNCHANGED; /* If window starts after a line end, and the last change is in front of that newline, then changes don't affect the display. This case happens with stealth-fontification. Note that although the display is unchanged, glyph positions in the matrix have to be adjusted, of course. */ row = MATRIX_ROW (w->current_matrix, w->window_end_vpos); if (MATRIX_ROW_DISPLAYS_TEXT_P (row) && ((last_changed_charpos < CHARPOS (start) && CHARPOS (start) == BEGV) || (last_changed_charpos < CHARPOS (start) - 1 && FETCH_BYTE (BYTEPOS (start) - 1) == '\n'))) The BEG_UNCHANGED and END_UNCHANGED positions are tracked by all the functions that modify the buffer.