From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IJO7E0SuRmARIAAA0tVLHw (envelope-from ) for ; Mon, 08 Mar 2021 23:07:48 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QN+AD0SuRmD9cQAAB5/wlQ (envelope-from ) for ; Mon, 08 Mar 2021 23:07:48 +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 916A791D0 for ; Tue, 9 Mar 2021 00:07:47 +0100 (CET) Received: from localhost ([::1]:50730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJOyY-00008i-PU for larch@yhetil.org; Mon, 08 Mar 2021 18:07:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJOy4-00006d-Oq for emacs-orgmode@gnu.org; Mon, 08 Mar 2021 18:07:18 -0500 Received: from mx1.riseup.net ([198.252.153.129]:37070) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJOy2-0003t2-Rh for emacs-orgmode@gnu.org; Mon, 08 Mar 2021 18:07:16 -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 4DvYrd4bNpzDsFR for ; Mon, 8 Mar 2021 15:07:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1615244833; bh=LAvQwsQ6SIuqAzAlpoLpeBW5s1i1jgqC1l84u2tylzw=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=SSz1FkwrAacdrDkak1BXyjWffBjGye7qKGr1zG2SQnY0eTvCuUJnnCBj2WSv/FRtZ 8P4iKNBE49WNvuUdxnkguzYcq9AKHDkPBZ9CvSacNB+Gz55rsPjy4sYTaUVzz7CnxP +AHJdxjKZWZflJG/4xGSXh5tefpvAvnVMwgr0zQ0= X-Riseup-User-ID: D3DD9BD9BAF6659478BCF37F2A953EA138DD35D34E584AF977FFAA14652A01DF Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4DvYrc39l9z5vRr; Mon, 8 Mar 2021 15:07:11 -0800 (PST) References: <87blbtxnho.fsf@host.localdomain> <87a6rdxn70.fsf@host.localdomain> From: pillule To: pillule Subject: Re: [PATCH] org-src.el Do not ask to revert unmodified buffers In-reply-to: <87a6rdxn70.fsf@host.localdomain> Date: Mon, 08 Mar 2021 23:06:58 +0000 Message-ID: <878s6xxn1p.fsf@host.localdomain> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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=1615244867; 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=K/znjMJv2kDgehcwiOaxrT6zkl/WoRLG0RfervsHalc=; b=r4JJsfo0YnjRee9/oJtFJnDbasE0l9oPIejWqAt8Qywz1LPjYN4a64Iq0CoIFS2RBAHSI3 bfWMOtPvr1ghFAl74uMYIb9qzb/yUolAMYAVplrz2tajzFN3LdTXjqXEZShEaprUbadIE2 8UxmfTZBOW0AcI4E0HNwNholKw3yVV5TevnVzMz2ERrnZ9jf/UbvWsVahHOx0oGMS1vXYB dqouctoEPNNwqhZlQ6g4SNqO5gi8iILutUwFIIZNU/wMfZh9GFa1f0+JGFlT8GdUwf/4Ny VxoL3TmyQ30LAec8647nuOH5bIQ+nIzHfbBLUgCOs6m3jm8bK84AcGm8eN/RTQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615244867; a=rsa-sha256; cv=none; b=P8zBnEgTsbSYecyhXpR15yqSq9Tx2XmZtO9JuYHHR1KfzCEn5SmnC3UiIGUlfp+LU9C8i7 392waNfl+bhf26zmAwhylg4ZPKv76Fjn4E74Hq+UEG2TDbh4Vw40xHmG0IHTJLR1DhUYQP w2P+RhPdSXlOO/s18b5NBxzODSEyBh4SEbcKejQX8xPj2lDYhRBc8clNIEUT3w6DaPpzM/ LTkxWet3kPEvwJ1+8ydZvE2iO6W7+cWhgNhG/H5VsZx3XwXQ9wAA0iBJzNkvLxaGCVAzNm awE1KEKBu6pCCvO/ahToRWHXKgYMVopSOpMKVyaaR67xo5jME2qOplnbhS9m0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b=SSz1Fkwr; 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=SSz1Fkwr; 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: 916A791D0 X-Spam-Score: -3.08 X-Migadu-Scanner: scn1.migadu.com X-TUID: ME439MEaadIx --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable hm I hope this is better.=C2=B2 >> Hi, it is asked to the user if we want to revert changes when=20 >> 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=20 >> modifications to the >> source buffer. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=org-src.el.patch Content-Description: don_t_ask_to_revert_unmodified_src_buffers @@ -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. --=-=-= Content-Type: text/plain; format=flowed -- --=-=-=--