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: try_scrolling question Date: Sat, 04 Dec 2021 10:23:54 +0200 Message-ID: <834k7o7p7p.fsf@gnu.org> References: <87h7bovmye.fsf.ref@yahoo.com> <87h7bovmye.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10159"; 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 Sat Dec 04 09:24:55 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 1mtQLm-0002UC-Od for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Dec 2021 09:24:54 +0100 Original-Received: from localhost ([::1]:49042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtQLl-0000Uu-9U for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Dec 2021 03:24:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtQL9-0008E2-UO for emacs-devel@gnu.org; Sat, 04 Dec 2021 03:24:16 -0500 Original-Received: from [2001:470:142:3::e] (port=53110 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 1mtQL3-0006f4-VW; Sat, 04 Dec 2021 03:24:15 -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=ypZO6ddminVNvCdtR9OvWvAlR/O21K81BF2lQWVLVjs=; b=Pp3L0rUQo+i/ XBgMz8+lbX43BOryApPwlj6E4BgZw+H/Yc/83JNspFylqhCBrNk+HQDb9TgVZdhHv1JeNgcvT4TcN zGt/z+VpzpFHnnXBJXRTaESErcflhDOItfU0QW+KnFEa8Oa8vsCQJhKoJaMZY/t5U5ujdBUpLDM6d AS7xhfUyOTZ2iJ3tGG5tzFRpFYs7ubKAe+/ZkvKYd/CBQVvzcUGCGaWr0yuekPX62UxWO3OHMIiAn wLflG/YYLLVHZK+eY/bYMSFQTTeD8/TUYd7Dlk/5Q7GgboZcfC0lI60qwq95TXcV+etdOQlcgPT/o vMy5NBDlUAvGd47Il4Oq6w==; Original-Received: from [87.69.77.57] (port=1790 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 1mtQKw-00054x-3z; Sat, 04 Dec 2021 03:24:09 -0500 In-Reply-To: <87h7bovmye.fsf@yahoo.com> (message from Po Lu on Sat, 04 Dec 2021 15:38:49 +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:280901 Archived-At: > From: Po Lu > Date: Sat, 04 Dec 2021 15:38:49 +0800 > > Value is > ^^^^^ > > 1 if scrolling succeeded > > 0 if scrolling didn't find point. > > -1 if new fonts have been loaded so that we must interrupt redisplay, > adjust glyph matrices, and try again. > > Does it mean the return value of try_scrolling? Yes. "Value is ..." is our style in documenting the return value of a function. > If so, I don't understand how 0 (SCROLLING_SUCCESS) is returned if > it can't find point, and how -1 can be returned at all. Heh, a classic case of comments not matching the code. The code never looks at the literal values though, only at enumeration values, so the code works correctly. I've now fixed the enumeration to match the comment. Thanks for catching this (very old) blunder.