From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [elpa] externals/hyperbole c501027 2/2: Fix set-buffer byte-compiler warnings; remove outdated references Date: Mon, 10 May 2021 21:25:11 -0400 Message-ID: References: <20210510035708.29543.25002@vcs0.savannah.gnu.org> <20210510035709.E742920DFD@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4295"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: rswgnu@gmail.com, emacs-devel To: Robert Weiner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 11 03:26:15 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 1lgHA6-0000xI-0j for ged-emacs-devel@m.gmane-mx.org; Tue, 11 May 2021 03:26:14 +0200 Original-Received: from localhost ([::1]:42090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgHA5-0000jF-35 for ged-emacs-devel@m.gmane-mx.org; Mon, 10 May 2021 21:26:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgH9D-0008LO-TM for emacs-devel@gnu.org; Mon, 10 May 2021 21:25:19 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62234) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgH99-0002rX-O0; Mon, 10 May 2021 21:25:18 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C3690808CB; Mon, 10 May 2021 21:25:13 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6569B801F2; Mon, 10 May 2021 21:25:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620696312; bh=+CtdWAIYk/ilDAZtk3flu4Zf29ohtJ9OZqDhBBl7aNg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ko4n9etma5RzKCi1zxOjLf4untQ02c21//ZDdnYPQWIv7n9SH2Z5u04T/8i7ilAl0 KJxvYeuaViqSHsCPvbl/8j5TOClzIFjMsvKrH2hqiMWL5LzNsIsSCfoCvqObWOK4fC ANr/AQc3BRk3JCDvD3zvDSIos9VfTkao+q36pnfIoacC4YX1mdq2R73hdF0AgJ09gL Kym+MjzFLStLOdPuh6qG8MVQMBjRiLPut69qtLm7Zvl68T1S1v09z145GTtYLlRUAs FRh5d10Yckq9eLJVHGVQNAGLmPgMexxjUZ2n/o4nng2IxIWbxVYLc70P7tNAtt9dDy F95TwddyOq/9w== Original-Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 34838120281; Mon, 10 May 2021 21:25:12 -0400 (EDT) In-Reply-To: (Robert Weiner's message of "Mon, 10 May 2021 20:18:11 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:269139 Archived-At: > Eli and I exchanged messages about this on the emacs-devel list and settled > on the outer save-excursion as you first wrote below since it is indeed the > original buffer whose point we want to save which may be manipulated by > some subroutine deep within the with-current-buffer that changes the buffer > back to the original. Thanks as always for the pointers though. -- Bob That seems to point at a very unusual arrangement which you might want (in the longer term) to reconsider, e.g. by moving the `save-excursion` to the "deep within" place that actually moves the point in the "outer buffer". In the mean time, adding a comment explaining what's going on (e.g. giving an example scenario where point would be moved unexpectedly in the outer buffer)would go a long way. Similarly for the (save-excursion (with-current-buffer (find-file-noselect (expand-file-name hbmap:filename hbmap:dir-user)) (save-excursion in `gbut:ebut-program` because without an explanatory comment, this looks like the kind of code you get when the author just "added `save-excursion`s a bit at random until point stopped moving" ;-) Stefan