From b0a40846039703ee8101b10c670f4b5faaf2e100 Mon Sep 17 00:00:00 2001 From: Heikki Junes Date: Thu, 5 Dec 2002 21:20:02 +0000 Subject: [PATCH] revert before a command if needed. --- ChangeLog | 5 +++++ lilypond-mode.el | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f31dfee58..6634db59aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-12-05 Heikki Junes + + * lilypond-mode.el: Propose reverting buffer before a command if + it was edited with an another editor. + 2002-12-05 Han-Wen Nienhuys * python/GNUmakefile (INSTALLATION_DIR1): install Python module diff --git a/lilypond-mode.el b/lilypond-mode.el index e56a32acdd..819f255e1c 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -22,7 +22,7 @@ (require 'easymenu) (require 'compile) -(defconst LilyPond-version "1.7.8" +(defconst LilyPond-version "1.7.9" "`LilyPond-mode' version number.") (defconst LilyPond-help-address "bug-lilypond@gnu.org" @@ -326,9 +326,12 @@ Must be the car of an entry in `LilyPond-command-alist'." (LilyPond-check-files (concat name ".tex") (list name) LilyPond-file-extensions) - (if (buffer-modified-p) - (if (y-or-n-p "Save buffer before next command? ") - (LilyPond-save-buffer))) + (if (verify-visited-file-modtime (current-buffer)) + (if (buffer-modified-p) + (if (y-or-n-p "Save buffer before next command? ") + (LilyPond-save-buffer))) + (if (y-or-n-p "The command will be invoked to an already saved buffer. Revert it? ") + (revert-buffer t t))) ;;"LilyPond" LilyPond-command-default)) (t LilyPond-command-default))) -- 2.39.5