[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/rec-mode d505c30 61/98: rec-mode: visiting an empty fil
From: |
Stefan Monnier |
Subject: |
[elpa] externals/rec-mode d505c30 61/98: rec-mode: visiting an empty file works again. |
Date: |
Thu, 12 Nov 2020 13:18:41 -0500 (EST) |
branch: externals/rec-mode
commit d505c30efedb5e7265367bc84812314d89842ba2
Author: Jose E. Marchesi <jemarch@gnu.org>
Commit: Antoine Kalmbach <ane@iki.fi>
rec-mode: visiting an empty file works again.
---
etc/rec-mode.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/etc/rec-mode.el b/etc/rec-mode.el
index 08003bc..1104a31 100644
--- a/etc/rec-mode.el
+++ b/etc/rec-mode.el
@@ -598,11 +598,22 @@ The current record is the record where the pointer is"
;; These functions perform the management of the collection of records
;; in the buffer.
+(defun rec-buffer-valid-p ()
+ "Determine whether the current buffer contains valid rec data."
+ (equal (call-process-region (point-min) (point-max)
+ rec-recinf
+ nil ; delete
+ nil ; discard output
+ nil ; display
+ ) 0))
+
(defun rec-update-buffer-descriptors-and-check (&optional dont-go-fundamental)
"Update buffer descriptors and switch to fundamental mode if
there is a parse error."
- (if (rec-update-buffer-descriptors)
- t
+ (if (rec-buffer-valid-p)
+ (progn
+ (rec-update-buffer-descriptors)
+ t)
(unless dont-go-fundamental
(fundamental-mode))
(let* ((cur-buf (current-buffer))
- [elpa] externals/rec-mode 6c82c97 13/98: ob-rec.el is not part of Emacs., (continued)
- [elpa] externals/rec-mode 6c82c97 13/98: ob-rec.el is not part of Emacs., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 884d53e 20/98: Initial implementation of encrypted fields., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode f111394 29/98: rec-mode: more work in the field types., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 37fa271 21/98: rec-mode: fix error when saving a newly created file, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 19d0cef 35/98: rec-mode: support for selection expressions in rec-count., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 2204ecc 40/98: rec-mode: support for editing date fields using the calendar., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 88bab07 45/98: rec-mode: time-stamps are now triggered with n'., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 9c6d63d 50/98: rec-mode: copy/kill fields and records commands., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 5eabbdb 52/98: syntax-check fixes., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 241e824 55/98: rec-mode: don't move the pointer after switching to edit buffer or edit type mode., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode d505c30 61/98: rec-mode: visiting an empty file works again.,
Stefan Monnier <=
- [elpa] externals/rec-mode 903c1dc 59/98: rec-mode: check for the validity of the contents of the buffers before going to navigation mode., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 979fcef 69/98: ob-rec.el: support for :groupby and :join added., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 34714d3 85/98: rec-mode: fix typo and run the actual hooks., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode e1ad9fe 84/98: rec-mode: fix setq typo, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode e4419ae 87/98: Copyright years updated to 2019., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 105ff13 88/98: Updated copyright years, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 053f28a 90/98: Lexical binding, style and compatibility fixes, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode cd42c9f 93/98: Docstring improvements (via checkdoc), Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode c0ae8da 96/98: Loop fix and autoload cookie, docstring clarifications, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode eea5220 03/98: rec-mode: initial version of rec-cmd-compile, Stefan Monnier, 2020/11/12