From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.bugs Subject: bug#35645: Fix icalendar--add-diary-entry/diary-make-entry interaction Date: Thu, 23 May 2019 22:49:46 -0400 Message-ID: References: <874l5xhp0e.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="169466"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35645@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 24 04:50:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1hU0Ha-000hwZ-C9 for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 May 2019 04:50:10 +0200 Original-Received: from localhost ([127.0.0.1]:46485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU0HZ-0000ET-E5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 May 2019 22:50:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU0HT-0000DG-Fw for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 22:50:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hU0HS-0003xc-Hd for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 22:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hU0HS-0003xO-4g for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 22:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hU0HS-0006Tg-0q for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 22:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Fitzsimmons Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 May 2019 02:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35645 X-GNU-PR-Package: emacs Original-Received: via spool by 35645-submit@debbugs.gnu.org id=B35645.155866619724885 (code B ref 35645); Fri, 24 May 2019 02:50:01 +0000 Original-Received: (at 35645) by debbugs.gnu.org; 24 May 2019 02:49:57 +0000 Original-Received: from localhost ([127.0.0.1]:45788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hU0HM-0006TJ-KR for submit@debbugs.gnu.org; Thu, 23 May 2019 22:49:56 -0400 Original-Received: from mail-it1-f169.google.com ([209.85.166.169]:54969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hU0HK-0006T5-J5 for 35645@debbugs.gnu.org; Thu, 23 May 2019 22:49:55 -0400 Original-Received: by mail-it1-f169.google.com with SMTP id h20so13374423itk.4 for <35645@debbugs.gnu.org>; Thu, 23 May 2019 19:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fitzsim-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+ZTeKA0r50j9gNoSX+Y26aYRDq5pFFgGvM2fxnsbg3o=; b=f8Pi248PVV1wR7lq0C7KiT4JFhjwS5JSZbpPEIo0g2Q7ei05tce/Zix2j1eEtahBgM t+t1AZtkAnI7tj25C8iTmEy5lCD7wrrJP9Fs9g3YYe0Uhh3rDuWP0ATXYecCl3oCHfq8 uBhY+ve3ppJo4sk1nsN/essClY4taCBWwc8Y0Ebl59Dhj4n8XjlEBYFYxylwpzPp5fjA 0VmvauUlPK0hwA34ghHGjcvdafjnISMCn6fgdBtSUSZCmpToS3dPIkUU5sGtdTBoJ+ic QQwK7vZkxSUD8yJNJpoeyXstF6GIXcAukCruDolV4mjH6Oo2y5mOmSM0Uh6B/Z3jxDNW oonQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+ZTeKA0r50j9gNoSX+Y26aYRDq5pFFgGvM2fxnsbg3o=; b=KpKzKZ6BX3rJSAK5iUyHKG0zMV7an2SCzfZAKKyPrJSvoV/vOmc7U/5zKBbGnKSM9s gJSzab6dATYfoGeYcuwNJDKG43u3D5oYZj9079F88ja0uCLWXT7r92t6M/48+MGVdiyp aBuScK6P/0whWC25BWQQBxuBZHC49LPRKxGdNWkLcQ5hUid41jPlfyvhuGjUspqjgCVF 6Rs1QAXmgeDYO/3gZts+XsP9L91FpvQfdEI1wkjYpvgvrjOIJyV5h+vB7rZr4AqzIkKN g9xueCNF+36QzgNYef6ThRKRqtULk1RNDFJVT22Tz9lUNL49ztDP2vvIBRNCIkl3K+u7 QSGw== X-Gm-Message-State: APjAAAVkRK4y81Bf/UtLQi7zOvDp1S+m2wP2SVo78T1TooDkZMjdKFg6 LiR2x9sgDweAMCGtGurjWmQz7Q== X-Google-Smtp-Source: APXvYqyrCzXszwK6AmWZKVc0y53HU17pAjApxKeAdWXSx5hw5TWqGZAKsGmsQ3Sr52JZ3PE+UUFnPg== X-Received: by 2002:a05:660c:352:: with SMTP id b18mr6151308itl.20.1558666188885; Thu, 23 May 2019 19:49:48 -0700 (PDT) Original-Received: from localhost.localdomain (69-165-165-189.dsl.teksavvy.com. [69.165.165.189]) by smtp.gmail.com with ESMTPSA id d22sm525842ioc.51.2019.05.23.19.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 19:49:48 -0700 (PDT) In-Reply-To: <874l5xhp0e.fsf@gmail.com> (Noam Postavsky's message of "Mon, 13 May 2019 20:13:21 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159699 Archived-At: Noam Postavsky writes: > Thomas Fitzsimmons writes: > >> To keep the code mostly the same (so that I don't need to factor out >> another function), I've changed the original logic by adding a >> with-current-buffer wrapper, as shown in simplified form in >> diary-make-entry-with-current-buffer.patch. I'm hoping this keeps the >> default diary-make-entry logic exactly the same, but I'd like >> confirmation from someone more familiar with the subtleties of window >> and buffer manipulation. > >> - (let ((pop-up-frames (or pop-up-frames (window-dedicated-p)))) >> - (find-file-other-window (or file diary-file))) >> + (with-current-buffer >> + (let ((pop-up-frames (or pop-up-frames (window-dedicated-p)))) >> + (find-file-other-window (or file diary-file))) > > If you're asking whether > > (progn (find-file-other-window (or file diary-file)) > BODY) > > is the same as > > (with-current-buffer (find-file-other-window (or file diary-file)) > BODY) > > Then yes, I'd say you're fine (assuming BODY doesn't change buffers, > which I believe is the case here). Yes, that's what I was asking, thanks. Ulf, the only other feedback I have for icalendar is that icalendar--add-diary-entry is useful to/used by other packages (e.g., Excorporate) despite it being a private function. What if we added a public alias, icalendar-add-diary-entry, within this same patch? Then I could check for that alias's existence and only enable the workaround advice for older Emacs versions. Thomas