emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/rec-mode 24adb19f70: fix res-type initialization order


From: ELPA Syncer
Subject: [elpa] externals/rec-mode 24adb19f70: fix res-type initialization order
Date: Tue, 5 Apr 2022 06:58:05 -0400 (EDT)

branch: externals/rec-mode
commit 24adb19f70f682f28d6edac03598b1fee971d599
Author: Antoine Kalmbach <ane@iki.fi>
Commit: Antoine Kalmbach <ane@iki.fi>

    fix res-type initialization order
    
    * rec-mode.el (rec-field-type): initialize res-type in correct order.
---
 rec-mode.el | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/rec-mode.el b/rec-mode.el
index 95d608b0a4..a1baf4baa5 100644
--- a/rec-mode.el
+++ b/rec-mode.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Antoine Kalmbach <ane@iki.fi>
 ;; URL: https://www.gnu.org/software/recutils/
 ;; Package-Requires: ((emacs "25"))
-;; Version: 1.8.2
+;; Version: 1.8.3
 
 ;; This file is NOT part of GNU Emacs.
 
@@ -1289,26 +1289,26 @@ manual."
 
 If the field has no type, i.e. it is an unrestricted field which
 can contain any text, then nil is returned."
-  (if-let ((descriptor (rec-current-record-descriptor))
-           (types (rec-record-assoc "%type" descriptor))
-           res-type)
-      ;; Note that invalid %type entries are simply ignored.
-      (mapc
-       (lambda (type-descr)
-         (with-temp-buffer
-           (insert type-descr)
-           (goto-char (point-min))
-           (when (looking-at "[ 
\n\t]*\\([a-zA-Z%][a-zA-Z0-9_-]*\\(,[a-zA-Z%][a-zA-Z0-9_-]*\\)?\\)[ \n\t]*")
-             (let (;; (names (match-string 1))
-                   (begin-description (match-end 0)))
-               (goto-char (match-beginning 1))
-               (while (looking-at "\\([a-zA-Z%][a-zA-Z0-9_]*\\),?")
-                 (if (equal (match-string 1) field-name)
-                     (progn
-                       (goto-char begin-description)
-                       (setq res-type (rec-parse-type (buffer-substring 
(point) (point-max)))))
-                   (goto-char (match-end 0))))))))
-       types)
+  (let (res-type)
+    (when-let ((descriptor (rec-current-record-descriptor))
+               (types      (rec-record-assoc "%type" descriptor)))
+        ;; Note that invalid %type entries are simply ignored.
+        (mapc
+         (lambda (type-descr)
+           (with-temp-buffer
+             (insert type-descr)
+             (goto-char (point-min))
+             (when (looking-at "[ 
\n\t]*\\([a-zA-Z%][a-zA-Z0-9_-]*\\(,[a-zA-Z%][a-zA-Z0-9_-]*\\)?\\)[ \n\t]*")
+               (let (;; (names (match-string 1))
+                     (begin-description (match-end 0)))
+                 (goto-char (match-beginning 1))
+                 (while (looking-at "\\([a-zA-Z%][a-zA-Z0-9_]*\\),?")
+                   (if (equal (match-string 1) field-name)
+                       (progn
+                         (goto-char begin-description)
+                         (setq res-type (rec-parse-type (buffer-substring 
(point) (point-max)))))
+                     (goto-char (match-end 0))))))))
+         types))
     res-type))
 
 ;;;; Mode line and Head line



reply via email to

[Prev in Thread] Current Thread [Next in Thread]