From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Keeping replace-buffer-contents runtime in bounds Date: Sun, 17 Feb 2019 19:26:04 +0100 Message-ID: <87k1hyxoeb.fsf@gnu.org> References: <87r2c7ze9n.fsf@gnu.org> <83imxil8h6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="85585"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 17 19:26:51 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvR9N-000M7v-VD for ged-emacs-devel@m.gmane.org; Sun, 17 Feb 2019 19:26:50 +0100 Original-Received: from localhost ([127.0.0.1]:45076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvR9M-0000c7-RJ for ged-emacs-devel@m.gmane.org; Sun, 17 Feb 2019 13:26:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvR8m-0000bx-G8 for emacs-devel@gnu.org; Sun, 17 Feb 2019 13:26:13 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvR8m-0005Wv-Di for emacs-devel@gnu.org; Sun, 17 Feb 2019 13:26:12 -0500 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:52579) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1gvR8m-00007A-8W; Sun, 17 Feb 2019 13:26:12 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id BBA4C218CA; Sun, 17 Feb 2019 13:26:11 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 17 Feb 2019 13:26:11 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrudduuddguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecu fedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhfff gjkfgfgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoeht shguhhesghhnuhdrohhrgheqnecukfhppeelfedrvdefiedruddvledrhedvnecurfgrrh grmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgr lhhithihqdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgse hfrghsthhmrghilhdrfhhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Original-Received: from thinkpad-t440p (p5dec8134.dip0.t-ipconnect.de [93.236.129.52]) by mail.messagingengine.com (Postfix) with ESMTPA id 86015E41F3; Sun, 17 Feb 2019 13:26:10 -0500 (EST) In-Reply-To: <83imxil8h6.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 17 Feb 2019 17:50:45 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233429 Archived-At: Eli Zaretskii writes: >> If that number of seconds is over, compareseq returns early and >> replace-buffer-contents falls back to plain delete and insert. > > The gotcha about aborting after more than the time-out value should be > mentioned in the doc string. Right, I will do that including a NEWS entry and an update of the Info docs. > Thanks for working on this. My only other comment is that maybe we > should allow passing the time-out value via the function's arguments, > not via a global variable. It seems to me the time-out will be used > in more use cases than MAX-COSTS, and in any case treating these two > differently API-wise sounds strangely inconsistent. I'll do that. So two optional args and MAX-SECS as the first one, right? >> This is my first C encounter in emacs, so please feel free to >> nit-pick. > > Nitpicking: > >> + DEFVAR_LISP ("replace-buffer-contents-max-secs", >> + Vreplace_buffer_contents_max_secs, >> + doc: /* If differencing the two buffers takes longer than this, >> +`replace-buffer-contents' falls back to a plain delete and insert. */); > > The first sentence of a doc string should not be longer than 79 > characters. (But if you agree with me, this variable will go away, so > it's a moot point.) Yup. Bye, Tassilo