From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AAQJL5itRmCRGQAA0tVLHw (envelope-from ) for ; Mon, 08 Mar 2021 23:04:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6BHMKpitRmBNCAAAbx9fmQ (envelope-from ) for ; Mon, 08 Mar 2021 23:04:56 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2FD4B90EA for ; Tue, 9 Mar 2021 00:04:56 +0100 (CET) Received: from localhost ([::1]:46312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJOvm-0006cM-MD for larch@yhetil.org; Mon, 08 Mar 2021 18:04:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJOuy-0006cD-UW for emacs-orgmode@gnu.org; Mon, 08 Mar 2021 18:04:04 -0500 Received: from mx1.riseup.net ([198.252.153.129]:35940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJOux-0002S0-1g for emacs-orgmode@gnu.org; Mon, 08 Mar 2021 18:04:04 -0500 Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4DvYmx2PYRzDssv for ; Mon, 8 Mar 2021 15:04:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1615244641; bh=aqEqvB90wChHIVj0dgSWFkeMhbhrsk/tMHBWByPje/k=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=os4FOVi8RcMRZ/tNU7pvBoI6hqyp83cqwK/TOS1zOlM7ytOHeu+PpO+E5ccy+91ZG FEn6j8VY78MqanfnmdS2AxrYRZMw/sGt1TzKSLLIjCsnF/3gSdH97Qlcf+eHp5cVJL qG1cO8hGdwaIfs3CwFKa6Nix78MnLW8KoGNeEb2M= X-Riseup-User-ID: 39323FC1091B9F21CD9489ADCD6C72CDCBD9A1AED668AB54A3DC8FF093EF5F12 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4DvYmw1qGCz5vRr; Mon, 8 Mar 2021 15:03:59 -0800 (PST) References: <87blbtxnho.fsf@host.localdomain> From: pillule To: pillule Subject: Re: [PATCH] org-src.el Do not ask to revert unmodified buffers In-reply-to: <87blbtxnho.fsf@host.localdomain> Date: Mon, 08 Mar 2021 23:03:47 +0000 Message-ID: <87a6rdxn70.fsf@host.localdomain> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=198.252.153.129; envelope-from=pillule@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615244696; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+YisP6alMAW/grU7dnCDSAeiExZSQDnnNTuQ0LCe5d4=; b=Y5a9aBEXyV1VirHcvaWuvPF/Q5eUv5u4RSOpSKqBB5RrYcyBINxbU7mZHtdQ0kiB1YQhS4 KHUozjFjXB8NRKzqguqQVm8Vl73vCxEoMfwgpCXJHU4CI9jF6hZLbNy4gRgV33Eht5tzIO 1Jn+Mfltb31kbF6n2CFWfOo+t5kXJZh5WeYoX4HipT+cQBJY5hUQq4TcAhvJOabmKlrFiS +KYWfRpT4p+4TZ532ZLdmYcvrT61kR9oRk8fAnSA7reGbUzjT3wFz2RBC5xcTJXwUQf0HM L6JooA8uIH2Hv9J97fVLfkGlNu9UEpOxCsrssd2sDDRsPkZyeEbpYbmXssMvfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615244696; a=rsa-sha256; cv=none; b=dPvREPB6Yh7ZrvWCBM1am9Fg+56krz+Y8RC8m2KJ2nsvXlYdepiWyzM/QyKcR0CJKLB6+7 ivxPym3Ut4GwF3ViBw3riqbe2V6B8z27KacJ9/iQThwNMp6XlqjhSNSPe1Iq6BD0lzNUaD YHCyPxGlzRX/W8iQngjYlvG2AJ32810mqQmLWM2wouuijTN2hhh58JxxQeGvelsgMYFxMu osUV56fSYBjzhHBR6bvm1qrSUi67PMNSggRf5DmLmn5vx9csZxDGuFchfJ8yCw7Ax6gVAB NTtTRELGrBSIoUYig92uwAN//RUPm2DIxVkJk78qrjD+KPCIjH5UgLcwQBSREA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b=os4FOVi8; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.08 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b=os4FOVi8; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 2FD4B90EA X-Spam-Score: -3.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: wAX4Vm6NYPMR hm I hope this is better. > Hi, it is asked to the user if we want to revert changes when > re-entering in a > org-source buffer. > Even if the buffer have no modifications. > > This patch ask to revert the buffer only if there are > modifications to the > source buffer. @@ -493,8 +493,9 @@ (old-edit-buffer (org-src--edit-buffer beg end)) (contents (or contents (nth 2 area)))) (if (and old-edit-buffer - (or (not org-src-ask-before-returning-to-edit-buffer) - (y-or-n-p "Return to existing edit buffer ([n] will revert changes)? "))) + (or (not org-src-ask-before-returning-to-edit-buffer) + (or (not (buffer-modified-p old-edit-buffer)) + (y-or-n-p "Return to existing edit buffer ([n] will revert changes)? ")))) ;; Move to existing buffer. (org-src-switch-to-buffer old-edit-buffer 'return) ;; Discard old edit buffer. --