[Top][All Lists]

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

[elpa] externals/rec-mode ceb00b5 41/98: rec-mode: rec-cmd-edit-field su

From: Stefan Monnier
Subject: [elpa] externals/rec-mode ceb00b5 41/98: rec-mode: rec-cmd-edit-field supports a numeric argument.
Date: Thu, 12 Nov 2020 13:18:37 -0500 (EST)

branch: externals/rec-mode
commit ceb00b52f52cf0609a53d01e6e44f05de531f2e5
Author: Jose E. Marchesi <jemarch@gnu.org>
Commit: Antoine Kalmbach <ane@iki.fi>

    rec-mode: rec-cmd-edit-field supports a numeric argument.
 etc/rec-mode.el | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/etc/rec-mode.el b/etc/rec-mode.el
index ae1cfda..610ca38 100644
--- a/etc/rec-mode.el
+++ b/etc/rec-mode.el
@@ -1506,10 +1506,15 @@ A prefix argument means to use a case-insensitive 
 ;; The following functions implement interactive commands available in
 ;; the several modes defined in this file.
-(defun rec-cmd-edit-field ()
+(defun rec-cmd-edit-field (n)
   "Edit the contents of the field under point in a separate
-  (interactive)
+The input method used for getting the field value depends on its
+type, unless a prefix argument is used.  Then the more general
+method, i.e. asking for the new value in an unrestricted buffer,
+will be used for fields of any type."
+  (interactive "P")
   (let* (edit-buf
          (field (rec-current-field))
          (field-value (rec-field-value field))
@@ -1520,8 +1525,9 @@ buffer"
          (prev-buffer (current-buffer)))
     (if field-value
-         ((or (equal field-type-kind 'enum)
-              (equal field-type-kind 'bool))
+         ((and (or (equal field-type-kind 'enum)
+                   (equal field-type-kind 'bool))
+               (null n))
           (let* ((data (rec-type-data field-type))
                  (i -1)
@@ -1551,7 +1557,8 @@ buffer"
-         ((and (equal field-type-kind 'date) rec-popup-calendar)
+         ((and (equal field-type-kind 'date) rec-popup-calendar
+               (null n))
           (setq rec-field-name field-name)
           (setq rec-prev-buffer prev-buffer)
           (setq rec-pointer pointer)

reply via email to

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