[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[COMMITTED] rec-mode.el, ob-rec.el and rec-mode.texi are now maintained
From: |
Jose E. Marchesi |
Subject: |
[COMMITTED] rec-mode.el, ob-rec.el and rec-mode.texi are now maintained elsewhere |
Date: |
Wed, 11 Nov 2020 11:54:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
2020-11-11 Jose E. Marchesi <jemarch@gnu.org>
* etc/rec-mode.el: Delete.
* etc/ob-rec.el: Likewise.
* etc/Makefile.am (dist_lisp_DATA): Remove.
* doc/rec-mode.texi: Delete.
* doc/Makefile.am (info_TEXINFOS): Remove rec-mode.texi.
* m4/pkg.m4: New file.
---
ChangeLog | 9 +
doc/Makefile.am | 2 +-
doc/rec-mode.texi | 466 ----------
etc/Makefile.am | 5 +-
etc/ob-rec.el | 79 --
etc/rec-mode.el | 2211 ---------------------------------------------
po/ChangeLog | 4 +
po/POTFILES.in | 56 +-
po/recutils.pot | 578 ++++++------
9 files changed, 374 insertions(+), 3036 deletions(-)
delete mode 100644 doc/rec-mode.texi
delete mode 100644 etc/ob-rec.el
delete mode 100644 etc/rec-mode.el
diff --git a/ChangeLog b/ChangeLog
index 71c7598..a92a3d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-11-11 Jose E. Marchesi <jemarch@gnu.org>
+
+ * etc/rec-mode.el: Delete.
+ * etc/ob-rec.el: Likewise.
+ * etc/Makefile.am (dist_lisp_DATA): Remove.
+ * doc/rec-mode.texi: Delete.
+ * doc/Makefile.am (info_TEXINFOS): Remove rec-mode.texi.
+ * m4/pkg.m4: New file.
+
2020-11-09 Antoine Kalmbach <ane@iki.fi>
* utils/recutl.c (recutl_read_file): Update to latest signature
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f03821a..d1db7bb 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-info_TEXINFOS = recutils.texi rec-mode.texi
+info_TEXINFOS = recutils.texi
recutils_TEXINFOS = parse-datetime.texi fdl.texi
# End of Makefile.am
diff --git a/doc/rec-mode.texi b/doc/rec-mode.texi
deleted file mode 100644
index b49d865..0000000
--- a/doc/rec-mode.texi
+++ /dev/null
@@ -1,466 +0,0 @@
-\input texinfo
-@comment %**start of header
-@setfilename rec-mode.info
-@include version-rec-mode.texi
-@settitle rec-mode for Emacs
-@afourpaper
-@comment %**end of header
-
-@c Macros used in this file.
-
-@macro ie
-@i{i.e.@:}
-@end macro
-
-@macro reccmd{key,command}
-@item @kbd{\key\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end macro
-
-@copying
-This manual is for rec-mode for Emacs, which is part of the GNU
-recutils suite (version @value{VERSION}, @value{UPDATED}).
-
-Copyright @copyright{} 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
-2020 Jose E. Marchesi
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
-copy of the license is included in the section entitled ``GNU Free
-Documentation License''.
-@end quotation
-@end copying
-
-@dircategory Database
-@direntry
-* rec-mode: (rec-mode). Emacs mode for editing recfiles.
-@end direntry
-
-@titlepage
-@title rec-mode: an Emacs mode for editing recfiles
-@subtitle for version @value{VERSION}, @value{UPDATED}
-@author by Jose E. Marchesi
-@page
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-@contents
-
-@ifnottex
-@node Top
-@top rec-mode: an Emacs mode for editing recfiles
-
-This manual documents version @value{VERSION} of rec-mode.
-
-@insertcopying
-@end ifnottex
-
-@menu
-* Introduction:: Getting started
-* Navigation mode:: User-friendly interface for browing recfiles
-* Edition modes:: Edit recfiles in rec-format
-* Configuration:: Adapting rec-mode to your needs
-* GNU Free Documentation License:: Distribution terms for this document
-
-@detailmenu
- --- The Detailed Node Listing ---
-
-Introduction
-
-* Installation:: How to install rec-mode
-* Activation:: How to activate rec-mode for certain buffers
-* Feedback:: Bug reports, ideas, patches etc.
-
-Navigation mode
-
-* Record navigation:: Moving through records.
-* Field navigation:: Moving through fields in a record.
-* Field folding:: Hiding and showing the values of fields.
-* Field edition:: Changing the values of fields.
-* Searches:: Finding records fufilling some criteria.
-* Statistics:: Counting records.
-* Data integrity:: Verifying the integrity of the recfile.
-
-Edition modes
-
-* Edition modes:: Edit recfiles in rec-format
-
-Configuration
-
-* Finding the recutils:: Specifying the location of the recutils.
-* Records appearance:: Setting the way records are displayed.
-@end detailmenu
-@end menu
-
-@node Introduction
-@chapter Introduction
-
-rec-mode is a mode for browsing and editing recfiles, which are text
-files containing data structured in fields and records. It is part of
-the GNU recutils@footnote{@url{http://www.gnu.org/software/recutils}}
-suite.
-
-
-Recfiles are text-based databases which are easy to read and write
-manually using a text editor. At the same time they feature enough
-structure so they can be read, edited and processed automatically by
-programs.
-
-@menu
-* Installation:: How to install rec-mode
-* Activation:: How to activate rec-mode for certain buffers
-* Feedback:: Bug reports, ideas, patches etc.
-@end menu
-
-@node Installation
-@section Installation
-
-rec-mode is implemented in a self-contained elisp file called
-@file{rec-mode.el}. It can be obtained in several ways:
-
-@itemize @minus
-@item As part of a released tarball of recutils. @file{rec-mode.el}
-can be found in the @file{etc/} directory in the tarball contents.
-@item As part of the source tree cloned from the development git
-repo. @file{rec-mode.el} can be found in the @file{etc/} directory in
-the recutils sources tree.
-@item As a single file downloaded form some other location in
-internet.
-@item It may be already installed as part of a binary package in some
-distribution.
-@end itemize
-
-@noindent In the first three cases you need to tell Emacs where to locate the
-@file{rec-mode.el} file and to load it. Add the following to your
-@file{.emacs} file.
-@lisp
-(add-to-list 'load-path "~/path/to/recmode/")
-(require 'rec-mode)
-@end lisp
-
-@noindent If @file{rec-mode.el} was installed as part of a binary
-package in a distribution then you usually don't have to touch the
-@code{load-path} variable. Depending on the specific case you may
-have to @code{require} the package.
-
-@node Activation
-@section Activation
-@cindex activation
-
-To make sure files with extension @file{.rec} use rec-mode, add the
-following line to your @file{.emacs} file.
-@lisp
-(add-to-list 'auto-mode-alist '("\\.rec\\'" . rec-mode))
-@end lisp
-@noindent rec-mode buffers need font-lock to be turned on - this is
-the default in Emacs@footnote{If you don't use font-lock globally,
-turn it on in the rec buffer with @code{(add-hook 'rec-mode-hook
-'turn-on-font-lock)}}.
-
-With this setup, all files with extension @samp{.rec} will be put into
-rec mode. As an alternative, make the first line of a recfile look
-like this:
-
-@example
-# -*- mode: rec -*-
-@end example
-
-@noindent which will select rec-mode for this buffer no matter what
-the file's name is.
-
-@node Feedback
-@section Feedback
-@cindex feedback
-@cindex bug reports
-@cindex maintainer
-@cindex author
-
-If you find problems with rec-mode, or if you have questions, remarks,
-or ideas about it, please mail to the recutils mailing list
-@email{bug-recutils@@gnu.org}. If you are not a member of the mailing
-list, your mail will be passed to the list after a moderator has
-approved it@footnote{Please consider subscribing to the mailing list,
-in order to minimize the work the mailing list moderators have to do.
-The subscription can be done online at
-@url{http://lists.gnu.org/mailman/listinfo/bug-recutils}.}.
-
-@node Navigation mode
-@chapter Navigation mode
-
-When a recfile is visited in Emacs and rec-mode is activated, the
-contents of the file are examined and parsed in order to determine if
-it is a valid recfile and, in that case, to extract information like
-the kind of records stored in the file.
-
-If the file does not contain valid rec data then the buffer is put in
-@code{fundamental-mode} and a description of the syntax error, along
-its location, is notified in the echo area.
-
-If the file contains valid rec data, the mode sets itself in what is
-known as ``navigation mode''. In this mode the buffer is made
-read-only and it is narrowed to the first record present in the file.
-Also, the presentation of the record contents is slightly changed in
-order to improve the visualization of the data: continuation line
-marks are replaced by indentation, big fields are folded, etc. The
-modeline is changed in order to reflect the type of the records being
-navigated.
-
-At this point the user can navigate through the records and fields
-contained in the file, and edit the contents of the fields and the
-structure of the records, by using the commands described in the
-following subsections.
-
-@menu
-* Record navigation:: Moving through records
-* Field navigation:: Moving through fields in a record
-* Field folding:: Hiding and showing the values of fields
-* Field edition:: Changing the values of fields
-* Searches:: Finding records fulfilling some criteria
-* Statistics:: Counting records
-* Data integrity:: Verifying the integrity of the recfile
-@end menu
-
-@node Record navigation
-@section Record navigation
-@cindex motion, between records
-@cindex jumping, to records
-@cindex record navigation
-
-The following commands jump to other records in the buffer.
-
-@table @asis
-@reccmd{n,rec-cmd-goto-next-rec}
-Display the next record of the same type in the buffer.
-@*`C-u N n' will move next N times.
-@reccmd{p,rec-cmd-goto-previous-rec}
-Display the previous record of the same type in the buffer.
-@*`C-u N p' will move backwards N times.
-@reccmd{d, rec-cmd-show-descriptor}
-Display the record descriptor applicable to the current record. If
-the current record is anonymous, @ie{} there is not record
-descriptor. then this command does nothing.
-@reccmd{b, rec-cmd-jump-back}
-Display the record previously displayed in the buffer.
-@reccmd{C-c t, rec-find-type}
-Prompt the user for one of the record types present in the recfile and
-display the first record of the selected type.
-@end table
-
-@node Field navigation
-@section Field navigation
-
-The following commands iterate through the fields in a record, and to
-get information about some of the properties of the fields.
-
-@table @asis
-@reccmd{TAB, rec-cmd-goto-next-field}
-Move the cursor to the beginning of the name of the next field in the
-current record. If the cursor is currently located at the last field
-of the record then move it to the beginning of the first field.
-@reccmd{t, rec-cmd-show-type}
-Show information about the type of the field under the cursor, if it
-is defined.
-@end table
-
-@node Field folding
-@section Field folding
-
-Fields in recfiles can contain data of any size, and sometimes it is
-difficult to have an overview of the contents of the record. The
-following commands fold and unfold the value of the field under the
-cursor.
-
-@table @asis
-@reccmd{SPC, rec-cmd-toggle-field-visibility}
-Toggle the visibility of the field under the cursor. When a field is
-folded then three dots are displayed in the buffer instead of the
-value of the field.
-
-It is possible to automatically fold any field whose value exceeds a
-certain limit which can be configured by the user. @xref{Records
-appearance}.
-@end table
-
-@node Field edition
-@section Field edition
-
-The following commands change the value of the field under the cursor.
-
-@table @asis
-@reccmd{e, rec-cmd-edit-field}
-Edit the value of the field under the cursor. The specific action
-depends on the type of the field in the corresponding record
-descriptor:
-@itemize @minus
-@item For @b{date} fields a calendar buffer is opened in another window
-and the focus is moved there. The user can then select a date by
-moving the cursor there and press @kbd{RET} in order to set that date
-as the value for the field. Alternatively the user can press @kbd{t}
-in order to set the field to ``now'', or @kbd{q} to cancel the
-operation. In the later case the value of the field is left
-untouched.
-@item For @b{enumerated} and @b{bool} fields a fast-select buffer is opened in
-another window, showing a list of labeled options. The labels are
-single digits and letters. The user can then select ony of the
-options by pressing the corresponding label, or cancel the operation
-by pressing @kbd{RET}. In the later case the value of the field is
-left untouched.
-@item For any other kind of fields an edition buffer is opened in
-another window, showing the current contents of the field. The user
-can then edit the buffer as desired. When she is done, the user can
-then press @kbd{C-c C-c} in order to set the new value of the field,
-or just kill the buffer to cancel the operation.
-@end itemize
-@reccmd{m, rec-cmd-trim-field-value}
-Trim the value of the field under the cursor, removing any sequence of
-leading and trailing blank characters.
-@end table
-
-@node Searches
-@section Searches
-
-The following commands jump to the first record in the buffer
-satisfying some criteria.
-
-@table @asis
-@reccmd{s q, rec-cmd-select-fast}
-Display the first record having a field whose value matches a given
-fixed pattern. This is equivalent of using the command line option
-@option{-q} of @command{recsel}. If a prefix argument is specified
-then the search is case-insensitive.
-@reccmd{s s, rec-cmd-select-sex}
-Display the first record in the buffer satisfying a given selection
-expression. This is equivalent of using the command line option
-@option{-e} of @command{recsel}. If a prefix argument is specified
-then the search is case-insensitive.
-@end table
-
-@node Statistics
-@section Statistics
-
-The following commands allow to count records in the current buffer
-based on some provided criteria.
-
-@table @asis
-@reccmd{I, rec-cmd-show-info}
-Show the number of records in the buffer categorized by type.
-@reccmd{#, rec-cmd-count}
-Count the number of records in the buffer having the same type as the
-current record. With a numeric prefix N, ask for a selection
-expression and count the number of records in the buffer satisfying
-the expression.
-
-Note that rec-mode tries to guess a reasonable default for the
-selection expression, depending on the type of the field and its
-value. If the user press @kbd{RET} then the provided default
-selection expression is used.
-@reccmd{%, rec-cmd-statistics}
-If the field under the cursor contains an enumerated value, show the
-percentages of records in the current record set having fields with
-each of the possible values of the enumerated type.
-@end table
-
-@node Data integrity
-@section Data integrity
-
-The integrity of the rec data stored in the file can be checked using
-the following commands.
-
-@table @asis
-@reccmd{c, rec-cmd-compile}
-Compile the buffer with @command{recfix} and open a compilation window
-showing the result of the command. In case some error or warning is
-reported, the user can jump to the location triggering the error by
-pressing @kbd{RET} in the compilation window.
-@end table
-
-@node Edition modes
-@chapter Edition modes
-
-The navigation mode described in a previous chapter is mainly intended
-for browsing recdata and doing changes at the record level: editing
-the contents of a field, adding or removing fields, etc. In order to
-perform broader changes, such as adding/deleting record descriptors,
-records or comment blocks, the user must enter into one of the
-``edition modes''.
-
-There are three edition modes, covering different areas of the
-recfile: record, record type and buffer. When an edition mode is
-entered the buffer is set in read/write mode, it is narrowed to the
-desired area and any embellishment used in navigation mode is
-removed@footnote{Exceptuating font-lock}. As a general rule, the
-commands available in navigation mode are also available in the
-edition mode prefixed with @kbd{C-c}. Thus, @kbd{C-c n} would make
-the cursor to jump to the beginning of the next record.
-
-The following commands are used to enter into one of the available
-edition modes from the navigation mode.
-
-@table @asis
-@reccmd{R, rec-edit-record}
-Edit the record being navigated.
-@reccmd{T, rec-edit-type}
-Edit the record set being navigated.
-@reccmd{B, rec-edit-buffer}
-Edit the buffer.
-@end table
-
-@noindent After doing modifications in the buffer, the user can go
-back to navigation mode by using the following command.
-
-@table @asis
-@reccmd{C-c C-c, rec-finish-editing}
-Finish the current edition and return to navigation mode. If a
-syntactic error was introduced in the edition activity then the error
-is reported in the echo area and navigation mode is not entered.
-@end table
-
-@node Configuration
-@chapter Configuration
-
-TBC
-
-@menu
-* Finding the recutils:: Specifying the location of the recutils.
-* Records appearance:: Setting the way records are displayed
-@end menu
-
-@node Finding the recutils
-@section Finding the recutils
-
-@code{rec-mode} makes use of the several utilities which are part of
-the recutils. The following variables tell the mode where to find the
-utilities. The default values of these variables must work if the
-recutils are installed system-wide in the system.
-
-@table @code
-@item rec-recsel
-Name of the @command{recsel} utility from the GNU recutils.
-@item rec-recinf
-Name of the @command{recinf} utility from the GNU recutils.
-@item rec-recfix
-Name of the @command{recfix} utility from the GNU recutils.
-@end table
-
-@node Records appearance
-@section Records appearance
-
-The appearance of the records in navigation mode can be customised by
-tweaking the value of the following variables.
-
-@table @code
-@item rec-max-lines-in-fields
-Values in fiels having more than the specified number of lines will be
-hidden by default in navigation mode. When hidden, an ellipsis is
-shown instead of the value of the field. Default is @code{15}.
-@end table
-
-@node GNU Free Documentation License
-@appendix GNU Free Documentation License
-
-@include fdl.texi
-
-@bye
diff --git a/etc/Makefile.am b/etc/Makefile.am
index d94314d..50aede5 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -1,7 +1,6 @@
# Makefile.am for etc/
-# Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018,
-# 2019, 2020 Jose E. Marchesi
+# Copyright (C) 2010-2020 Jose E. Marchesi
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,8 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-dist_lisp_DATA = rec-mode.el ob-rec.el
-
etcdir=$(pkgdatadir)/etc
dist_etc_DATA = FSD.rec
diff --git a/etc/ob-rec.el b/etc/ob-rec.el
deleted file mode 100644
index c4e1fc8..0000000
--- a/etc/ob-rec.el
+++ /dev/null
@@ -1,79 +0,0 @@
-;;; ob-rec.el --- org-babel functions for recutils evaluation
-
-;; Copyright (C) 2011-2019 Free Software Foundation
-
-;; Author: Jose E. Marchesi
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.7
-
-;; This file is NOT part of GNU Emacs.
-
-;; This program is free software: you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation, either version 3 of the
-;; License, or (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating recsel queries and substituing the
-;; contained template. See http://www.gnu.org/software/recutils/
-
-;;; Code:
-(require 'ob)
-
-(defvar org-babel-default-header-args:rec
- '((:exports . "results")))
-
-(defun org-babel-execute:rec (body params)
- "Execute a block containing a recsel query.
-This function is called by `org-babel-execute-src-block'."
- (let* ((in-file ((lambda (el)
- (or el
- (error
- "rec code block requires :data header argument")))
- (cdr (assoc :data params))))
- (result-params (cdr (assq :result-params params)))
- (cmdline (cdr (assoc :cmdline params)))
- (rec-type (cdr (assoc :type params)))
- (fields (cdr (assoc :fields params)))
- (join (cdr (assoc :join params)))
- (sort (cdr (assoc :sort params)))
- (groupby (cdr (assoc :groupby params)))
- (cmd (concat "recsel"
- (when rec-type (concat " -t " rec-type " "))
- " " (expand-file-name in-file)
- (when (> (length (org-babel-trim body)) 0)
- (concat " -e " "\""
- (replace-regexp-in-string "\"" "\\\\\"" body)
- "\""))
- (when join (concat " -j " join " "))
- (when sort (concat " -S " sort " "))
- (when groupby (concat " -G " groupby " "))
- (when fields (concat " -p " fields " "))))
- (do-raw (or (member "scalar" result-params)
- (member "html" result-params)
- (member "code" result-params)
- (member "verbatim" result-params)
- (equal (point-min) (point-max)))))
- (unless do-raw
- ;; Get the csv representation, that will be used by
- ;; org-table-convert-region below.
- (setq cmd (concat cmd " | rec2csv")))
- (with-temp-buffer
- (shell-command cmd (current-buffer))
- (if do-raw
- (buffer-string)
- (org-table-convert-region (point-min) (point-max) '(4))
- (let ((table (org-table-to-lisp)))
- ;; The first row always contains the table header.
- (cons (car table) (cons 'hline (cdr table))))))))
-
-(provide 'ob-rec)
-
-;; ob-rec.el ends here
diff --git a/etc/rec-mode.el b/etc/rec-mode.el
deleted file mode 100644
index b91c91f..0000000
--- a/etc/rec-mode.el
+++ /dev/null
@@ -1,2211 +0,0 @@
-;;; rec-mode.el --- Major mode for viewing/editing rec files
-
-;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
-;; 2018, 2019, 2020 Jose E. Marchesi
-
-;; Maintainer: Jose E. Marchesi
-
-;; This file is NOT part of GNU Emacs.
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; A major mode for editing rec files.
-;;
-;; To see the structure of this file activate the outline minor mode
-;; and execute M-xhide-body
-
-;;; Code:
-
-(require 'compile)
-(eval-when-compile (require 'cl))
-(require 'calendar)
-(require 'hl-line)
-(require 'tabulated-list)
-
-;;;; Customization
-
-(defgroup rec-mode nil
- "rec-mode subsystem"
- :group 'applications
- :link '(url-link "http://www.gnu.org/software/recutils"))
-
-(defcustom rec-open-mode 'navigation
- "Default mode to use when switching a buffer to rec-mode.
-Valid values are `edit' and `navigation'. The default is `navigation'"
- :type 'symbol
- :group 'rec-mode)
-
-(defcustom rec-popup-calendar t
- "Whether to use a popup calendar to select dates when editing field
-values. The default is `t'."
- :type 'boolean
- :group 'rec-mode)
-
-(defcustom rec-mode-hook nil
- "Hook run when entering rec mode."
- :type 'hook
- :group 'rec-mode)
-
-(defvar rec-max-lines-in-fields 15
- "Values of fields having more than the specified lines will be
-hidden by default in navigation mode.")
-
-(defvar rec-recsel "recsel"
- "Name of the 'recsel' utility from the GNU recutils.")
-
-(defvar rec-recinf "recinf"
- "Name of the 'recinf' utility from the GNU recutils.")
-
-(defvar rec-recfix "recfix"
- "Name of the 'recfix' utility from the GNU recutils.")
-
-(defface rec-field-name-face '((t :weight bold)) "" :group 'rec-mode)
-(defface rec-keyword-face '((t :weight bold)) "" :group 'rec-mode)
-(defface rec-continuation-line-face '((t :weight bold)) "" :group 'rec-mode)
-
-;;;; Variables and constants that the user does not want to touch (really!)
-
-(defconst rec-mode-version "1.5"
- "Version of rec-mode.el")
-
-(defconst rec-keyword-prefix "%"
- "Prefix used to distinguish special fields.")
-
-(defconst rec-keyword-rec (concat rec-keyword-prefix "rec")
- ;; Remember to update `rec-font-lock-keywords' if you change this
- ;; value!!
- "Rec keyword.")
-
-(defconst rec-keyword-key (concat rec-keyword-prefix "key")
- "Key keyword.")
-
-(defconst rec-keyword-mandatory (concat rec-keyword-prefix "mandatory")
- "Mandatory keyword.")
-
-(defconst rec-keyword-summary (concat rec-keyword-prefix "summary")
- "Summary keyword.")
-
-(defconst rec-time-stamp-format "%Y-%m-%d %a %H:%M"
- "Format for `format-time-string' which is used for time stamps.")
-
-(defvar rec-comment-re "^#.*"
- "regexp denoting a comment line")
-
-(defvar rec-comment-field-re "^\\(#.*\n\\)*\\([a-zA-Z0-1_%-]+:\\)+"
- "regexp denoting the beginning of a record")
-
-(defvar rec-field-name-re
- "^[a-zA-Z%][a-zA-Z0-9_]*:"
- "Regexp matching a field name")
-
-(defvar rec-field-value-re
- (let ((ret-re "\n\\+ ?")
- (esc-ret-re "\\\\\n"))
- (concat
- "\\("
- "\\(" ret-re "\\)*"
- "\\(" esc-ret-re "\\)*"
- "\\(" "\\\\[^\n]" "\\)*"
- "[^\\\n]*"
- "\\)*"))
- "Regexp matching a field value")
-
-(defvar rec-field-re
- (concat rec-field-name-re
- rec-field-value-re
- "\n")
- "Regexp matching a field")
-
-(defvar rec-record-re
- (concat rec-field-re "\\(" rec-field-re "\\|" rec-comment-re "\\)*")
- "Regexp matching a record")
-
-(defvar rec-mode-syntax-table
- (let ((st (make-syntax-table)))
- (modify-syntax-entry ?# "<" st) ; Comment start
- (modify-syntax-entry ?\n ">" st) ; Comment end
- (modify-syntax-entry ?\" "w" st)
- (modify-syntax-entry ?\' "w" st)
- st)
- "Syntax table used in rec-mode")
-
-(defvar rec-font-lock-keywords
-`((,(concat "^" rec-keyword-prefix "[a-zA-Z0-9_]+:") . rec-field-name-face)
- (,rec-field-name-re . rec-keyword-face)
- ("^\\+" . rec-continuation-line-face))
-"Font lock keywords used in rec-mode")
-
-(defvar rec-mode-edit-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-cn" 'rec-cmd-goto-next-rec)
- (define-key map "\C-cp" 'rec-cmd-goto-previous-rec)
- (define-key map "\C-ce" 'rec-cmd-edit-field)
- (define-key map "\C-cd" 'rec-cmd-show-descriptor)
- (define-key map "\C-ct" 'rec-cmd-show-type)
- (define-key map "\C-c#" 'rec-cmd-count)
- (define-key map "\C-cm" 'rec-cmd-trim-field-value)
- (define-key map "\C-cc" 'rec-cmd-compile)
- (define-key map "\C-csq" 'rec-cmd-select-fast)
- (define-key map "\C-css" 'rec-cmd-select-sex)
- (define-key map "\C-ch" 'rec-cmd-show-summary)
- (define-key map "\C-cI" 'rec-cmd-show-info)
- (define-key map "\C-cf\C-w" 'rec-cmd-kill-field)
- (define-key map "\C-cf\M-w" 'rec-cmd-copy-field)
- (define-key map "\C-cr\C-w" 'rec-cmd-kill-record)
- (define-key map "\C-cr\M-w" 'rec-cmd-copy-record)
- (define-key map (kbd "TAB") 'rec-cmd-goto-next-field)
- (define-key map "\C-cb" 'rec-cmd-jump-back)
- (define-key map "\C-c\C-c" 'rec-finish-editing)
- map)
- "Keymap for rec-mode")
-
-(defvar rec-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "n" 'rec-cmd-goto-next-rec)
- (define-key map "p" 'rec-cmd-goto-previous-rec)
- (define-key map "e" 'rec-cmd-edit-field)
- (define-key map "R" 'rec-edit-record)
- (define-key map "T" 'rec-edit-type)
- (define-key map "B" 'rec-edit-buffer)
- (define-key map "A" 'rec-cmd-append-field)
- (define-key map "I" 'rec-cmd-show-info)
- (define-key map "d" 'rec-cmd-show-descriptor)
- (define-key map "t" 'rec-cmd-show-type)
- (define-key map "m" 'rec-cmd-trim-field-value)
- (define-key map "c" 'rec-cmd-compile)
- (define-key map "f\C-w" 'rec-cmd-kill-field)
- (define-key map "f\M-w" 'rec-cmd-copy-field)
- (define-key map "r\C-w" 'rec-cmd-kill-record)
- (define-key map "r\M-w" 'rec-cmd-copy-record)
- (define-key map "f\C-w" 'rec-cmd-kill-field)
- (define-key map "f\M-w" 'rec-cmd-copy-field)
- (define-key map "sq" 'rec-cmd-select-fast)
- (define-key map "ss" 'rec-cmd-select-sex)
- (define-key map "h" 'rec-cmd-show-summary)
- (define-key map "\C-ct" 'rec-find-type)
-;; (define-key map [remap move-beginning-of-line]
'rec-cmd-beginning-of-line)
- (define-key map [remap undo] 'rec-cmd-undo)
- (define-key map "#" 'rec-cmd-count)
- (define-key map "%" 'rec-cmd-statistic)
- (define-key map (kbd "RET") 'rec-cmd-jump)
- (define-key map (kbd "TAB") 'rec-cmd-goto-next-field)
- (define-key map (kbd "SPC") 'rec-cmd-toggle-field-visibility)
- (define-key map "b" 'rec-cmd-jump-back)
- map)
- "Keymap for rec-mode")
-
-;;;; Parsing functions (rec-parse-*)
-;;
-;; Those functions read the contents of the buffer (starting at the
-;; current position of the pointer) and try to parse field, comment
-;; and records structures.
-
-(defun rec-parse-comment ()
- "Parse and return a comment starting at point.
-
-Return a list whose first element is the symbol 'comment and the
-second element is the string with the contents of the comment,
-including the leading #:
-
- (comment POSITION \"# foo\")
-
-If the point is not at the beginning of a comment then return nil"
- (let ((there (point))
- comment)
- (when (and (equal (current-column) 0)
- (looking-at rec-comment-re))
- (setq comment (list 'comment
- there
- (buffer-substring-no-properties (match-beginning 0)
- (match-end 0))))
- (goto-char (match-end 0))
- ;; Skip a newline if needed
- (when (looking-at "\n") (goto-char (match-end 0))))
- comment))
-
-(defun rec-parse-field-name ()
- "Parse and return a field name starting at point.
-If the point is not at the beginning of a field name return nil"
- (when (and (equal (current-column) 0)
- (looking-at rec-field-name-re))
- (goto-char (match-end 0))
- (buffer-substring-no-properties (match-beginning 0)
- (- (match-end 0) 1))))
-
-(defun rec-parse-field-value ()
- "Return the field value under the pointer.
-
-Return a string containing the value of the field.
-
-If the pointer is not at the beginning of a field value, return
-nil"
- (when (looking-at rec-field-value-re)
- (goto-char (match-end 0))
- (let ((val (buffer-substring-no-properties (match-beginning 0)
- (match-end 0))))
- ;; Replace escaped newlines
- (setq val (replace-regexp-in-string "\\\\\n" "" val))
- ;; Replace continuation lines
- (setq val (replace-regexp-in-string "\n\\+ ?" "\n" val))
- ;; Remove the initial blank
- (with-temp-buffer
- (insert val)
- (goto-char (point-min))
- (if (equal (char-after (point)) ? )
- (progn
- (delete-char 1)))
- (setq val (buffer-substring-no-properties (point-min)
- (point-max))))
- val)))
-
-(defun rec-parse-field ()
- "Return a structure describing the field starting from the
-pointer.
-
-The returned structure is a list whose first element is the
-symbol 'field', the second element is the name of the field and
-the second element is the value of the field:
-
- (field POSITION FIELD-NAME FIELD-VALUE)
-
-If the pointer is not at the beginning of a field
-descriptor then return nil"
- (let ((there (point))
- field-name field-value)
- (and (setq field-name (rec-parse-field-name))
- (setq field-value (rec-parse-field-value)))
- (when (and field-name field-value)
- ;; Skip a newline if needed
- (when (looking-at "\n") (goto-char (match-end 0)))
- (list 'field there field-name field-value))))
-
-(defun rec-parse-record ()
- "Return a structure describing the record starting from the pointer.
-
-The returned structure is a list of fields preceded by the symbol
-'record':
-
- (record POSITION (FIELD-1 FIELD-2 ... FIELD-N))
-
-If the pointer is not at the beginning of a record, then return
-nil"
- (let ((there (point))
- record field-or-comment)
- (while (setq field-or-comment (or (rec-parse-field)
- (rec-parse-comment)))
- (setq record (cons field-or-comment record)))
- (setq record (list 'record there (reverse record)))))
-
-;;;; Writer functions (rec-insert-*)
-;;
-;; Those functions dump the written representation of the parser
-;; structures (field, comment, record, etc) into the current buffer
-;; starting at the current position.
-
-(defun rec-insert-comment (comment)
- "Insert the written form of COMMENT in the current buffer"
- (when (rec-comment-p comment)
- (insert (rec-comment-string comment))))
-
-(defun rec-insert-field-name (field-name)
- "Insert the written form of FIELD-NAME in the current buffer"
- (when (stringp field-name)
- (insert (concat field-name ":"))
- t))
-
-(defun rec-insert-field-value (field-value)
- "Insert the written form of FIELD-VALUE in the current buffer"
- (when (stringp field-value)
- (let ((val field-value))
- ;; FIXME: Maximum line size
- (insert (replace-regexp-in-string "\n" "\n+ " val)))
- (insert "\n")))
-
-(defun rec-insert-field (field)
- "Insert the written form of FIELD in the current buffer"
- (when (rec-field-p field)
- (when (rec-insert-field-name (rec-field-name field))
- (insert " ")
- (rec-insert-field-value (rec-field-value field)))))
-
-(defun rec-insert-record (record)
- "Insert the written form of RECORD in the current buffer."
- (when (rec-record-p record)
- (mapcar (lambda (elem)
- (cond
- ((rec-comment-p elem) (rec-insert-comment elem))
- ((rec-field-p elem) (rec-insert-field elem))))
- (rec-record-elems record))))
-
-;;;; Operations on record structures
-;;
-;; Those functions retrieve or set properties of field structures.
-
-(defun rec-record-p (record)
- "Determine if the provided structure is a record."
- (and (listp record)
- (= (length record) 3)
- (equal (car record) 'record)))
-
-(defun rec-record-position (record)
- "Return the start position of the given record."
- (when (rec-record-p record)
- (nth 1 record)))
-
-(defun rec-record-elems (record)
- "Return a list with the elements of the given record."
- (when (rec-record-p record)
- (nth 2 record)))
-
-(defun rec-record-descriptor-p (record)
- "Determine if the given record is a descriptor."
- (not (null (rec-record-assoc rec-keyword-rec record))))
-
-(defun rec-record-assoc (name record)
- "Get a list with the values of the fields in RECORD named NAME.
-
-NAME shall be a field name.
-If no such field exists in RECORD then nil is returned."
- (when (rec-record-p record)
- (let (result)
- (mapc (lambda (field)
- (when (and (rec-field-p field)
- (equal name (rec-field-name field)))
- (setq result (cons (rec-field-value field) result))))
- (rec-record-elems record))
- (reverse result))))
-
-(defun rec-record-names (record)
- "Get a list of the field names in the record"
- (when (rec-record-p record)
- (let (result)
- (mapc (lambda (field)
- (when (rec-field-p field)
- (setq result (cons (rec-field-name field) result))))
- (rec-record-elems record))
- (reverse result))))
-
-(defun rec-record-values (record fields)
- "Given a list of field names, return a list of the values."
- (when fields
- (append (rec-record-assoc (car fields) record)
- (rec-record-values record (cdr fields)))))
-
-;;;; Operations on comment structures
-;;
-;; Those functions retrieve or set properties of comment structures.
-
-(defun rec-comment-p (comment)
- "Determine if the provided structure is a comment"
- (and (listp comment)
- (= (length comment) 3)
- (equal (car comment) 'comment)))
-
-(defun rec-comment-position (comment)
- "Return the start position of the given comment."
- (when (rec-comment-p comment)
- (nth 1 comment)))
-
-(defun rec-comment-string (comment)
- "Return the string composig the comment, including the initial '#'
character."
- (when (rec-comment-p comment)
- (nth 2 comment)))
-
-;;;; Operations on field structures
-;;
-;; Those functions retrieve or set properties of field structures.
-
-(defun rec-field-p (field)
- "Determine if the provided structure is a field"
- (and (listp field)
- (= (length field) 4)
- (equal (car field) 'field)))
-
-(defun rec-field-position (field)
- "Return the start position of the given field."
- (when (rec-field-p field)
- (nth 1 field)))
-
-(defun rec-field-name (field)
- "Return the name of the provided field"
- (when (rec-field-p field)
- (nth 2 field)))
-
-(defun rec-field-value (field)
- "Return the value of the provided field"
- (when (rec-field-p field)
- (nth 3 field)))
-
-(defun rec-field-set-value (field value)
- "Return FIELD with its value replaced by VALUE."
- (list 'field
- (rec-field-position field)
- (rec-field-name field)
- value))
-
-(defun rec-field-trim-value (field)
- "Return FIELD with its value trimmed."
- (when (rec-field-p field)
- (let ((value (rec-field-value field))
- c)
- (with-temp-buffer
- (insert value)
- (goto-char (point-min))
- (when (looking-at "[ \t\n][ \t\n]+")
- (delete-region (match-beginning 0)
- (match-end 0)))
- (goto-char (point-max))
- (setq c (char-before))
- (while (and c
- (or (equal c ?\n)
- (equal c ?\t)
- (equal c ? )))
- (backward-char)
- (setq c (char-before)))
- (delete-region (point) (point-max))
- (setq value (buffer-substring-no-properties (point-min)
- (point-max))))
- (rec-field-set-value field value))))
-
-;;;; Get entities under pointer
-;;
-;; Those functions retrieve structures of the entities under pointer
-;; like comments, fields and records. If the especified entity is not
-;; under the pointer then nil is returned.
-
-(defun rec-beginning-of-field-pos ()
- "Return the position of the beginning of the current field, or
-nil if the pointer is not on a field."
- (save-excursion
- (beginning-of-line)
- (let (res exit)
- (while (not exit)
- (cond
- ((and (not (= (line-beginning-position) 1))
- (or (looking-at "+")
- (looking-back "\\\\\n" 2)))
- (forward-line -1))
- ((looking-at rec-field-name-re)
- (setq res (point))
- (setq exit t))
- (t
- (setq exit t))))
- res)))
-
-(defun rec-end-of-field-pos ()
- "Return the position of the end of the current field, or nil if
-the pointer is not on a field."
- (let ((begin-pos (rec-beginning-of-field-pos)))
- (when begin-pos
- (save-excursion
- (goto-char begin-pos)
- ;; The following hack is due to the fact that
- ;; the regular expressions search engine is
- ;; hanging on rec-field-re
- (when (looking-at rec-field-name-re)
- (goto-char (match-end 0)))
- (when (looking-at rec-field-value-re)
- (match-end 0))))))
-
-(defun rec-beginning-of-comment-pos ()
- "Return the position of the beginning of the current comment,
-or nil if the pointer is not on a comment."
- (save-excursion
- (beginning-of-line)
- (when (looking-at rec-comment-re)
- (point))))
-
-(defun rec-end-of-comment-pos ()
- "Return the position of the end of the current comment,
-or nil if the pointer is not on a comment."
- (let ((begin-pos (rec-beginning-of-comment-pos)))
- (when begin-pos
- (save-excursion
- (goto-char begin-pos)
- (when (looking-at rec-comment-re)
- (match-end 0))))))
-
-(defun rec-beginning-of-record-pos ()
- "Return the position of the beginning of the current record, or nil if
-the pointer is not on a record."
- (save-excursion
- (let (field-pos prev-pos)
- (setq prev-pos (point))
- (while (and (not (equal (point) (point-min)))
- (or (setq field-pos (rec-beginning-of-field-pos))
- (setq field-pos (rec-beginning-of-comment-pos))))
- (goto-char field-pos)
- (if (not (equal (point) (point-min)))
- (backward-char)))
- (unless (or (eobp)
- (looking-at rec-comment-field-re))
- (forward-char))
- (when (looking-at rec-comment-field-re)
- (point)))))
-
-(defun rec-end-of-record-pos ()
- "Return the position of the end of the current record,
-or nil if the pointer is not on a record."
- (let ((begin-pos (rec-beginning-of-record-pos)))
- (when begin-pos
- (save-excursion
- (goto-char begin-pos)
- (while (or (looking-at rec-field-name-re)
- (looking-at rec-comment-re))
- (goto-char (match-end 0))
- (when (or (looking-at rec-field-value-re)
- (looking-at rec-comment-re))
- (goto-char (+ (match-end 0) 1))))
- (point)))))
-
-(defun rec-current-field ()
- "Return a structure with the contents of the current field.
-The current field is the field where the pointer is."
- (save-excursion
- (let ((begin-pos (rec-beginning-of-field-pos)))
- (when begin-pos
- (goto-char begin-pos)
- (rec-parse-field)))))
-
-(defun rec-current-field-type ()
- "Return the field type of the field under point, if any."
- (let ((current-field (rec-current-field)))
- (when current-field
- (rec-field-type (rec-field-name current-field)))))
-
-(defun rec-current-record ()
- "Return a structure with the contents of the current record.
-The current record is the record where the pointer is"
- (save-excursion
- (let ((begin-pos (rec-beginning-of-record-pos)))
- (when begin-pos
- (goto-char begin-pos)
- (rec-parse-record)))))
-
-;;;; Visibility
-;;
-;; These functions manage the visibility in the rec buffer.
-
-(defun rec-narrow-to-record ()
- "Narrow to the current record, if any"
- (let ((begin-pos (rec-beginning-of-record-pos))
- (end-pos (rec-end-of-record-pos)))
- (if (and begin-pos end-pos)
- (narrow-to-region begin-pos end-pos))))
-
-(defun rec-narrow-to-type (type)
- "Narrow to the specified type, if any"
- (let ((begin-pos (or (rec-type-pos type) (point-min)))
- (end-pos (or (rec-type-pos (rec-type-next type)) (point-max))))
- (narrow-to-region begin-pos end-pos)))
-
-;;;; Record collection management
-;;
-;; 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-buffer-valid-p)
- (progn
- (rec-update-buffer-descriptors)
- t)
- (unless dont-go-fundamental
- (fundamental-mode))
- (let* ((cur-buf (current-buffer))
- (errmsg (with-temp-buffer
- (let ((err-buf (current-buffer)))
- (with-current-buffer cur-buf
- (call-process-region (point-min) (point-max)
- rec-recfix
- nil ; delete
- (list err-buf t)
- nil ; display
- "--check")))
- (goto-char (point-min))
- (when (looking-at "stdin: ")
- (delete-region (point-min) (match-end 0)))
- (goto-char (point-max))
- (when (equal (char-after) ?\n)
- (delete-char 1))
- (buffer-substring (point-min) (- (point-max) 1)))))
- (message (concat (buffer-name) ": " errmsg))
- nil)))
-
-(defun rec-update-buffer-descriptors ()
- "Get a list of the record descriptors in the current buffer.
-
-If the contents of the current buffer are not valid rec data then
-this function returns `nil'."
- (setq rec-buffer-descriptors
- (let ((buffer (generate-new-buffer "Rec Inf "))
- descriptors records status)
- ;; Call 'recinf' to get the list of record descriptors in
- ;; sexp format.
- (setq status (call-process-region (point-min) (point-max)
- rec-recinf
- nil ; delete
- buffer
- nil ; display
- "-S" "-d"))
- (if (equal status 0)
- (progn (with-current-buffer buffer
- (goto-char (point-min))
- (insert "(")
- (goto-char (point-max))
- (insert ")")
- (unwind-protect
- (setq descriptors (read (point-min-marker)))
- (kill-buffer buffer)))
- (when descriptors
- (mapc (lambda (descriptor)
- (let ((marker (make-marker)))
- (set-marker marker (rec-record-position
descriptor))
- (setq records (cons (list 'descriptor
descriptor marker)
- records))))
- descriptors)
- (reverse records)))
- (kill-buffer buffer)
- nil))))
-
-(defun rec-buffer-types ()
- "Return a list with the names of the record types in the
-existing buffer."
- ;; If a descriptor has more than a %rec field, then the first one is
- ;; used. The rest are ignored.
- (mapcar
- (lambda (elem)
- (car (rec-record-assoc rec-keyword-rec (cadr elem))))
- rec-buffer-descriptors))
-
-(defun rec-type-p (type)
- "Determine if there are records of type TYPE in the current
-file."
- (member type (rec-buffer-types)))
-
-(defun rec-goto-type (type)
- "Goto the beginning of the descriptor with type TYPE.
-
-If there are records of type TYPE in the record set then goto the
-first record. Otherwise goto to the record descriptor.
-
-If the type do not exist in the current buffer then
-this function returns nil."
- (if (or (not type)
- (equal type ""))
- ;; If there is a regular record in the
- ;; beginning of the file, go there.
- (if (save-excursion
- (goto-char (point-min))
- (unless (looking-at rec-comment-field-re)
- (rec-goto-next-rec))
- (rec-regular-p))
- (progn
- (goto-char (point-min))
- (unless (looking-at rec-comment-field-re)
- (rec-goto-next-rec))
- t)
- nil)
- (let (found
- (descriptors rec-buffer-descriptors))
- (mapc
- (lambda (elem)
- (when (equal (car (rec-record-assoc rec-keyword-rec
- (cadr elem)))
- type)
- (setq found t)
- (goto-char (nth 2 elem))))
- descriptors)
- found)))
-
-(defun rec-type-pos (type)
- "Return the position where the records of type TYPE start in
-the current file. If no records of type TYPE are defined in the
-current file then return nil."
- (when (rec-type-p type)
- (save-excursion
- (rec-goto-type type)
- (point))))
-
-(defun rec-type-next (type)
- "Return the name of the type following TYPE in the file, if
-any. If the specified type is the last appearing in the file,
-or the specified type does not exist, then return nil."
- (let ((types (member type (rec-buffer-types))))
- (nth 1 types)))
-
-(defun rec-type-previous (type)
- "Return the name of the type preceding TYPE in the file, if
-any. If the specified type is the first appearing in the file,
-or the specified type does not exist, then return nil."
- (let ((types (member type (reverse (rec-buffer-types)))))
- (nth 1 types)))
-
-(defun rec-goto-next-field ()
- "Move the pointer to the beginning of the next field in the
-file."
- (let ((pos (save-excursion
- (rec-end-of-field)
- (when (re-search-forward rec-field-name-re nil t)
- (match-beginning 0)))))
- (when pos
- (goto-char pos)
- t)))
-
-(defun rec-goto-next-rec ()
- "Move the pointer to the beginning of the next record in the
-file."
- (let ((pos (save-excursion
- (rec-end-of-record)
- (when (re-search-forward rec-comment-field-re nil t)
- (match-beginning 0)))))
- (when pos
- (goto-char pos)
- t)))
-
-(defun rec-goto-previous-rec ()
- "Move the pointer to the end of the previous record in the
-file."
- (let ((pos (save-excursion
- (rec-beginning-of-record)
- (if (not (= (point) (point-min)))
- (backward-char))
- (when (and (re-search-backward rec-record-re nil t)
- (rec-beginning-of-record))
- (point)))))
- (when pos
- (goto-char pos)
- t)))
-
-(defun rec-type-first-rec-pos (type)
- "Return the position of the first record of the specified TYPE.
-
-If TYPE is nil then return the position of the first regular record in the
file.
-If there are no regular records in the file, return nil."
- (save-excursion
- (when (or (not type) (rec-type-p type))
- (if type
- (rec-goto-type type)
- (goto-char (point-min)))
- ;; Find the next regular record
- (when (and (rec-goto-next-rec)
- (rec-regular-p))
- (point)))))
-
-(defun rec-goto-type-first-rec (type)
- "Goto to the first record of type TYPE present in the file.
-If TYPE is nil then goto to the first Unknown record on the file.
-
-If the record is found, return its position.
-If no such record exist then don't move and return nil."
- (let ((pos (rec-type-first-rec-pos type)))
- (when pos
- (goto-char pos))))
-
-(defun rec-count (&optional type sex)
- "If TYPE is a string, return the number of records of the
-specified type in the current file."
- (let (num
- (rec-file-name (if buffer-file-name
- buffer-file-name
- "")))
- (with-temp-buffer
- (if (stringp type)
- (if (stringp sex)
- (call-process rec-recsel
- nil ; infile
- t ; output to current buffer.
- nil ; display
- "-t" type "-e" sex "-c" rec-file-name)
- (call-process rec-recsel
- nil ; infile
- t ; output to current buffer.
- nil ; display
- "-t" type "-c" rec-file-name))
- (if (stringp sex)
- (call-process rec-recsel
- nil ; infile
- t ; output to current buffer.
- nil ; display
- "-e" sex "-c" rec-file-name)
- (call-process rec-recsel
- nil ; infile
- t ; output to current buffer.
- nil ; display
- "-c" rec-file-name)))
- (setq num (buffer-substring-no-properties (point-min) (point-max))))
- (string-to-number num)))
-
-(defun rec-regular-p ()
- "Return t if the record under point is a regular record.
-Return nil otherwise."
- (let ((rec (rec-current-record)))
- (when rec
- (= (length (rec-record-assoc rec-keyword-rec rec))
- 0))))
-
-(defun rec-record-type ()
- "Return the type of the record under point.
-
-If the record is of no known type, return nil."
- (let ((descriptor (rec-record-descriptor)))
- (cond
- ((listp descriptor)
- (car (rec-record-assoc rec-keyword-rec
- (cadr descriptor))))
- ((equal descriptor "")
- "")
- (t
- nil))))
-
-(defun rec-record-descriptor ()
- "Return the record descriptor of the record under point.
-
-Return \"\" if no proper record descriptor is found in the file.
-Return nil if the point is not on a record."
- (when (rec-current-record)
- (let ((descriptors rec-buffer-descriptors)
- descriptor type position found
- (i 0))
- (while (and (not found)
- (< i (length descriptors)))
- (setq descriptor (nth i rec-buffer-descriptors))
- (setq position (marker-position (nth 2 descriptor)))
- (if (and (>= (point) position)
- (or (= i (- (length rec-buffer-descriptors) 1))
- (< (point) (marker-position (nth 2 (nth (+ i 1)
rec-buffer-descriptors))))))
- (setq found t)
- (setq i (+ i 1))))
- (if found
- descriptor
- nil))))
-
-(defun rec-summary-fields ()
- "Return a list with the names of the summary fields in the
-current record set."
- (let ((descriptor (cadr (rec-record-descriptor))))
- (when descriptor
- (let ((fields-str (rec-record-assoc rec-keyword-summary descriptor)))
- (when fields-str
- (split-string (car fields-str) "[ ,]"))))))
-
-(defun rec-mandatory-fields ()
- "Return a list with the names of the mandatory fields in the
-current record set."
- (let ((descriptor (cadr (rec-record-descriptor))))
- (when descriptor
- (let ((fields-str (rec-record-assoc rec-keyword-mandatory descriptor)))
- (when fields-str
- (split-string (car fields-str)))))))
-
-(defun rec-key ()
- "Return the name of the field declared as the key of the
-current record set, if any. Otherwise return `nil'."
- (let ((descriptor (cadr (rec-record-descriptor))))
- (when descriptor
- (let ((key (rec-record-assoc rec-keyword-key descriptor)))
- (when key
- (car key))))))
-
-;;;; Navigation
-
-(defun rec-show-type (type &optional show-descriptor)
- "Show the records of the given type. If TYPE is nil then the records
-of the default type are shown."
- (widen)
- (unless (rec-goto-type type)
- (message "No records of the requested type were found."))
- ;; Show the first data record of this type, if it exists.
- (if (and (not show-descriptor)
- (save-excursion
- (let ((record-type (rec-record-type)))
- (and (rec-goto-next-rec)
- (equal (rec-record-type) record-type)))))
- (rec-goto-next-rec))
- (rec-show-record))
-
-(defun rec-show-record ()
- "Show the record under the point"
- (setq buffer-read-only t)
- (rec-narrow-to-record)
- (use-local-map rec-mode-map)
- (rec-set-head-line nil)
- (rec-set-mode-line (rec-record-type))
- ;; Hide the contents of big fields.
- (rec-hide-record-fields)
- ;; Change the appearance of continuation line markers to look like
- ;; indentation.
- (rec-hide-continuation-line-markers))
-
-(defvar rec-continuation-line-markers-width 4
- "Width (in number of characters) used to represent continuation
- line markers in navigation mode.")
-
-(defvar rec-continuation-line-markers-overlays nil
- "Continuation line markers overlays.")
-
-(defun rec-hide-continuation-line-markers ()
- "Change the appearance of continuation line markers in the
-current buffer to look like indentation."
- (let ((record (rec-current-record)))
- (when (rec-record-p record)
- (mapcar
- (lambda (field)
- (when (rec-field-p field)
- (let* ((pos (rec-field-position field))
- (value-begin (+ pos (length (rec-field-name field)) 1))
- (value-end (+ value-begin
- (length (with-temp-buffer
- (rec-insert-field-value
(rec-field-value field))
- (buffer-substring (point-min)
(point-max)))))))
- (save-excursion
- (goto-char value-begin)
- (while (re-search-forward "^\\+ ?" (+ value-end 1) t)
- (let ((ov (make-overlay (match-beginning 0) (match-end 0))))
- (overlay-put ov 'display '(space . (:width
rec-continuation-line-markers-width)))
- (push ov rec-continuation-line-markers-overlays)))))))
- (rec-record-elems record)))))
-
-(defun rec-remove-continuation-line-marker-overlays ()
- "Delete all the continuation line markers overlays."
- (mapc 'delete-overlay rec-continuation-line-markers-overlays)
- (setq rec-continuation-line-markers-overlays nil))
-
-;;;; Field folding
-
-(defvar rec-hide-field-overlays nil
- "Overlays hiding fields.")
-
-(defun rec-hide-record-fields ()
- "Hide the contents of fields whose value exceeds
-`rec-max-lines-in-fields' lines. TAB can then be used to toggle
-the visibility."
- (let ((record (rec-current-record)))
- (when (rec-record-p record)
- (mapcar
- (lambda (field)
- (when (rec-field-p field)
- (let ((lines-in-value (with-temp-buffer
- (insert (rec-field-value field))
- (count-lines (point-min) (point-max))))
- ov)
- (when (> lines-in-value rec-max-lines-in-fields)
- (save-excursion
- (goto-char (rec-field-position field))
- (rec-fold-field))
- t))))
- (rec-record-elems record)))))
-
-(defun rec-field-folded-p ()
- "Return whether the current field is folded."
- (let ((field (rec-current-field)))
- (when (rec-field-p field)
- (let ((value-start (+ (point) (length (rec-field-name field)) 1)))
- (memq t (mapcar (lambda (overlay)
- (eq (overlay-get overlay 'invisible)
- 'rec-hide-field))
- (overlays-at value-start)))))))
-
-(defun rec-fold-field ()
- "Fold the current field."
- (let ((field (rec-current-field)))
- (when (rec-field-p field)
- (save-excursion
- (goto-char (rec-field-position field))
- (when (looking-at rec-field-re)
- (let ((value-start (+ (point) (length (rec-field-name field)) 1))
- (value-end (- (match-end 0) 1))
- ov)
- (setq ov (make-overlay value-start value-end))
- (overlay-put ov 'invisible 'rec-hide-field)
- (push ov rec-hide-field-overlays)))))))
-
-(defun rec-unfold-field ()
- "Unfold the current field."
- (let ((field (rec-current-field)))
- (when (rec-field-p field)
- (let ((value-start (+ (point) (length (rec-field-name field)) 1)))
- (mapcar (lambda (overlay)
- (when (eq (overlay-get overlay 'invisible) 'rec-hide-field)
- (delete-overlay overlay)))
- (overlays-at value-start))))))
-
-(defun rec-unfold-all-fields ()
- "Unfold all folded fields in the buffer."
- (mapc 'delete-overlay rec-hide-field-overlays)
- (setq rec-hide-field-overlays nil))
-
-(defun rec-unfold-record-fields ()
- "Unfold any folded field in the current record."
- (let ((record (rec-current-record)))
- (when (rec-record-p record)
- (mapcar
- (lambda (field)
- (when (rec-field-p field)
- (save-excursion
- (goto-char (rec-field-position field))
- (rec-unfold-field))))
- (rec-record-elems record)))))
-
-(defun rec-toggle-field-visibility ()
- "Toggle the visibility of the current field."
- (let ((field (rec-current-field)))
- (when (rec-field-p field)
- (save-excursion
- (goto-char (rec-field-position field))
- (when (looking-at rec-field-re)
- (let* ((value-start (+ (point) (length (rec-field-name field)) 1))
- (value-end (- (match-end 0) 1))
- ov)
- (if (memq t (mapcar (lambda (overlay)
- (eq (overlay-get overlay 'invisible)
- 'rec-hide-field))
- (overlays-at value-start)))
- (mapcar
- (lambda (overlay)
- (delete-overlay overlay))
- (overlays-at value-start))
- (setq ov (make-overlay value-start value-end))
- (overlay-put ov 'invisible 'rec-hide-field))))))))
-
-;;;; Field types
-;;
-;; This section contains functions and variable implementing field
-;; types as described in the recutils manual.
-;;
-;; Each type is stored in a structure like:
-;;
-;; (type KIND EXPR DATA)
-;;
-;; Where EXPR is the type descriptor used to create the type, and NAME
-;; is the name of the type.
-;;
-;; KIND is the class of the type, and is one of:
-;;
-;; int, bool, range, real, size, line, regexp, date,
-;; enum, field, email, uuid, rec
-;;
-;; DESCR is the data describing the type, and its value depends on the
-;; kind:
-;;
-;; - For sized strings, it is the maximum size of the string.
-;;
-;; - For ranges, it is a list (MIN MAX) defining the range
-;; [MIN,MAX]. Open ranges can be specified by using nil. For
-;; example: (0,nil).
-;;
-;; - For regexps, it is a string containing the regexp.
-;;
-;; - For record types, it is a string containing the type of
-;; the referred records.
-;;
-;; - For any other type, it is nil.
-
-(defvar rec-types
- '("int" "bool" "range" "real" "size" "line" "regexp" "date" "enum" "field"
"email" "uuid" "rec")
- "Kind of supported types")
-
-(defun rec-type-kind-p (kind)
- "Determine whether the given symbol or string is a type kind."
- (let (kind-symbol)
- (cond
- ((symbolp kind)
- (member (symbol-name kind) rec-types))
- ((stringp kind)
- (member kind rec-types))
- (t
- nil))))
-
-(defun rec-parse-type (str)
- "Parse STR into a new type structure and return it.
-
-STR must contain a type description as defined in the recutils
-manual."
- (let (type)
- (with-temp-buffer
- (insert str)
- (goto-char (point-min))
- (when (looking-at "[a-z]+")
- (let ((kind (match-string 0)))
- (goto-char (match-end 0))
- (when (rec-type-kind-p kind)
- (cond
- ((member kind '("int" "bool" "real" "line" "date" "field" "email"
"uuid"))
- (when (looking-at "[ \n\t]*$")
- (list 'type (intern kind) str nil)))
- ((equal kind "size")
- (when (looking-at "[ \n\t]*\\([0-9]+\\)[ \n\t]*$")
- (list (intern kind) str (string-to-number (match-string 1)))))
- ((equal kind "range")
- (when (or
- (looking-at "[ \n\t]*\\(-?[0-9]+\\)[ \n\t]*$")
- (looking-at "[ \n\t]*\\(-?[0-9]+\\)[ \n\t]+\\([0-9]+\\)[
\n\t]*$"))
- (let ((min (string-to-number (match-string 1)))
- (max (when (stringp (match-string 2))
- (string-to-number (match-string 2)))))
- (list 'type (intern kind) str (list min max)))))
- ((equal kind "enum")
- (let ((str-copy str)
- (here (point)))
- ;; Remove comments from the enum description.
- (delete-region (point-min) (point-max))
- (insert (replace-regexp-in-string "([^)]*)" "" str-copy))
- (goto-char here)
- (when (looking-at "\\([ \n\t]*[a-zA-Z0-9][a-zA-Z0-9_-]*\\)+[
\n\t]*$")
- (let (names)
- ;; Scan the enum literals.
- (while (looking-at "[
\n\t]+\\([a-zA-Z0-9][a-zA-Z0-9_-]*\\)")
- (setq names (cons (match-string 1) names))
- (goto-char (match-end 0)))
- (list 'type (intern kind) str-copy (reverse names))))))
- ((equal kind "rec")
- (when (looking-at "[ \n\t]*\\([a-zA-Z%][a-zA-Z0-9_]*\\)[
\n\t]*$") ; Field name without a colon.
- (let ((referred-record (match-string 1)))
- (list 'type (intern kind) str referred-record))))
- ((equal kind "regexp")
- (when (looking-at "[ \n\t]*\\(.*?\\)[ \n\t]*$")
- (let ((expr (match-string 1)))
- (when (and (>= (length expr) 2)
- (equal (elt expr 0) (elt expr (- (length expr)
1))))
- (list 'type (intern kind) str (substring expr 1 -1))))))
- (t
- nil))))))))
-
-(defun rec-type-kind (type)
- "Return the kind of a given type."
- (cadr type))
-
-(defun rec-type-data (type)
- "Return the data associated with a given type."
- (cadddr type))
-
-(defun rec-type-text (type)
- "Return the textual description of a given type."
- (caddr type))
-
-(defun rec-check-type (type str)
- "Check whether STR contains a value conforming to TYPE, which
-is a field type structure."
- (let* ((kind (cadr type))
- (expr (caddr type))
- (data (cadddr type))
- (value (if (equal kind 'line)
- str
- str)))
- (cond
- ((equal kind 'int)
- (string-match-p "^-?[0-9]+$" value))
- ((equal kind 'bool)
- (string-match-p "^\\(yes\\|no\\|0\\|1\\|true\\|false\\)$" value))
- ((equal kind 'range)
- (let ((min (car data))
- (max (cadr data)))
- (when (looking-at "-?[0-9]+$")
- (let ((number (string-to-number (match-string 0))))
- (and (>= number min) (<= number max))))))
- ((equal kind 'real)
- (string-match-p "^-?\\([0-9]*\\.\\)?[0-9]+$" value))
- ((equal kind 'size)
- (<= (length str) data))
- ((equal kind 'line)
- (string-match-p "^[^\n]*$" value))
- ((equal kind 'regexp)
- (string-match-p data value))
- ((equal kind 'date)
- ;; TODO.
- t)
- ((equal kind 'enum)
- (member value data))
- ((equal kind 'field)
- (string-match-p "^[a-zA-Z%][a-zA-Z0-9_]*$" value))
- ((equal kind 'email)
- (string-match-p "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]+$" value))
- ((equal kind 'uuid)
- ;; TODO.
- t)
- ((equal kind 'rec)
- ;; TODO.
- t)
- (t
- nil))))
-
-(defun rec-field-type (field-name)
- "Return the type of the given field, if any, as determined in
-the current record set. If the field has no type, i.e. it is an
-unrestricted field which can contain any text, then `nil' is
-returned."
- (let* ((descriptor (rec-record-descriptor))
- (types (rec-record-assoc "%type" (cadr 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))
- name)
- (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
-
-(defun rec-set-mode-line (str)
- "Set the modeline in rec buffers."
- (when str
- (setq mode-line-buffer-identification
- (list 20
- "%b " str))))
-
-(defun rec-set-head-line (str)
- "Set the headline in rec buffers."
- (setq header-line-format str))
-
-;;;; Fast selection
-
-(defun rec-fast-selection (names prompt)
- "Fast group tag selection with single keys.
-
-NAMES is an association list of the form:
-
- ((\"NAME1\" char1) ...)
-
-Each character should identify only one name."
- ;; Adapted from `org-fast-tag-selection' in org.el by Carsten Dominic
- ;; Thanks Carsten! :D
- (let* ((maxlen (apply 'max (mapcar (lambda (name)
- (string-width (car name))) names)))
- (buf (current-buffer))
- (fwidth (+ maxlen 3 1 3))
- (ncol (/ (- (window-width) 4) fwidth))
- name count result char i key-list)
- (save-window-excursion
- (set-buffer (get-buffer-create " *Rec Fast Selection*"))
- (delete-other-windows)
-;; (split-window-vertically)
- (switch-to-buffer-other-window (get-buffer-create " *Rec Fast
Selection*"))
- (erase-buffer)
- (insert prompt ":")
- (insert "\n\n")
- (setq count 0)
- (while (setq name (pop names))
- (setq key-list (cons (cadr name) key-list))
- (insert "[" (cadr name) "] "
- (car name)
- (make-string (- fwidth 4 (length (car name))) ?\ ))
- (when (= (setq count (+ count 1)) ncol)
- (insert "\n")
- (setq count 0)))
- (goto-char (point-min))
- (if (fboundp 'fit-window-to-buffer)
- (fit-window-to-buffer))
- (catch 'exit
- (while t
- (message "[a-z0-9...]: Select entry [RET]: Exit")
- (setq char (let ((inhibit-quit t)) (read-char-exclusive)))
- (cond
- ((= char ?\r)
- (setq result nil)
- (throw 'exit t))
- ((member char key-list)
- (setq result char)
- (throw 'exit t)))))
- result)))
-
-;;;; Summary mode
-
-(defvar rec-summary-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map tabulated-list-mode-map)
- (define-key map "\C-m" 'rec-summary-cmd-jump-to-record)
- map)
- "Local keymap for `rec-summary-mode' buffers.")
-
-(defvar rec-summary-rec-buffer nil
- "rec-mode buffer paired with this summary buffer.")
-(make-variable-buffer-local 'rec-summary-rec-buffer)
-
-(define-derived-mode rec-summary-mode tabulated-list-mode "Rec Summary"
- "Major mode for summarizing the contents of a recfile.
-\\<rec-summary-mode-map>
-\\{rec-summary-mode-map}"
- (setq tabulated-list-format nil)
- (setq tabulated-list-padding 2)
- (setq tabulated-list-sort-key nil)
- (tabulated-list-init-header))
-
-(defun rec-summary-populate (headers entries)
- "Populate a rec-mode summary buffer with the data in ENTRIES.
-
-The data has the same structure than `tabulated-list-entries'."
- (setq tabulated-list-format headers)
- (setq tabulated-list-padding 2)
-;; (setq tabulated-list-sort-key (cons (car (elt headers 0)) nil))
- (tabulated-list-init-header)
- (setq tabulated-list-entries entries)
- (tabulated-list-print nil))
-
-(defun rec-summary-cmd-jump-to-record ()
- "Jump to the selected record in the rec-mode buffer."
- (interactive)
-;; (if (buffer-live-p rec-summary-rec-buffer)
- (save-excursion
- (let ((rec-marker (tabulated-list-get-id)))
- (set-buffer (marker-buffer rec-marker))
- (widen)
- (goto-char (marker-position rec-marker))
- (rec-show-record))))
-;; (message "The rec buffer paired with this summary is not alive.")))
-
-;;;; Database access functions
-;;
-;; The following functions map the high-level API rec_db_* provided by
-;; librec, using the command line utilities instead. Note that we are
-;; using the support for keyword arguments provided by the cl package
-;; in order to ease the usage of the functions.
-;;
-;; Note that the functions are not checking for the integrity of the
-;; arguments: it is the invoked recutil which is in charge of that.
-
-(defun* rec-query (&rest args
- &key (type nil) (join nil) (index nil) (sex nil)
- (fast-string nil) (random nil) (fex nil) (password nil)
- (group-by nil) (sort-by nil) (icase nil) (uniq nil))
- "Perform a query in the current buffer using recsel.
-
-ARGS contains the arguments to pass to the program."
- (let ((buffer (generate-new-buffer "Rec Sel "))
- args records status)
- (save-restriction
- (widen)
- (unwind-protect
- (progn
- ;; Prepare the arguments to recsel based on the arguments
- ;; passed to this function.
-
- (when (stringp type)
- (setq args (cons "-t" (cons type args))))
- (when (stringp join)
- (setq args (cons "-j" (cons join args))))
- (when (integerp index)
- (setq args (cons "-n" (cons (number-to-string index) args))))
- (when (stringp sex)
- (setq args (cons "-e" (cons sex args))))
- (when (stringp fast-string)
- (setq args (cons "-q" (cons fast-string args))))
- (when (integerp random)
- (setq args (cons "-m" (cons (number-to-string random) args))))
- (when (stringp fex)
- (setq args (cons "-p" (cons fex args))))
- (when (stringp password)
- (setq args (cons "-s" (cons password args))))
- (when (stringp group-by)
- (setq args (cons "-G" (cons group-by args))))
- (when (stringp sort-by)
- (setq args (cons "-S" (cons sort-by args))))
- (when icase
- (setq args (cons "-i" args)))
- (when uniq
- (setq args (cons "-U" args)))
- (when (and (not group-by) (not sort-by))
- (setq args (cons "--print-sexps" args)))
- ;; Call 'recsel' to perform the query.
- (setq status (apply #'call-process-region
- (point-min) (point-max)
- rec-recsel
- nil ; delete
- buffer
- nil ; display
- args))
- (if (/= status 0)
- (error "recsel returned error: %d" status))
- (with-current-buffer buffer
- (goto-char (point-min))
- (insert "(")
- (goto-char (point-max))
- (insert ")")
- (setq records (read (point-min-marker)))))
- (kill-buffer buffer)))
- records))
-
-;;;; Selection of records
-;;
-;; The following functions implement selection of records, which
-;; maintains a subset of the records in the current buffer.
-
-(defvar rec-current-selection nil
- "List of records corresponding to the last executed selection,
-or `nil' if no selection is active.")
-(make-variable-buffer-local 'rec-current-selection)
-
-(defun rec-navigate-selection ()
- "Goto the first record of the current selection, if any."
- (if (not rec-current-selection)
- (message "No current selection")
- (widen)
- (let* ((first-record (car rec-current-selection))
- (pos (rec-record-position first-record)))
- (goto-char pos)
- (rec-show-record))))
-
-(defun rec-cmd-select ()
- "Perform a selection on the current buffer using some criteria.
-
-The result of the selection is stored in `rec-current-selection'."
- (interactive)
- (setq rec-current-selection (rec-query)))
-
-(defun rec-cmd-select-fast (prefix str)
- "Perform a selection on the current record set using a fast string search.
-
-A prefix argument means to use a case-insensitive search."
- (interactive "P\nsFast string query: ")
- (when (not (equal str ""))
- (setq rec-current-selection (rec-query :fast-string str
- :icase prefix
- :type (rec-record-type)))
- (rec-navigate-selection)))
-
-(defun rec-cmd-select-sex (prefix sex)
- "Perform a selection on the current record set using a selection expression.
-
-A prefix argument means to use a case-insensitive search."
- (interactive "P\nsSelection expression: ")
- (when (not (equal sex ""))
- (setq rec-current-selection (rec-query :sex sex
- :icase prefix
- :type (rec-record-type)))
- (rec-navigate-selection)))
-
-;;;; Commands
-;;
-;; The following functions implement interactive commands available in
-;; the several modes defined in this file.
-
-(defvar rec-field-name)
-(make-variable-buffer-local 'rec-field-name)
-(defvar rec-marker)
-(make-variable-buffer-local 'rec-marker)
-(defvar rec-buffer)
-(make-variable-buffer-local 'rec-buffer)
-
-(defun rec-cmd-edit-field (n)
- "Edit the contents of the field under point in a separate
-buffer.
-
-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))
- (field-name (rec-field-name field))
- (field-type (rec-field-type field-name))
- (field-type-kind (when field-type (rec-type-kind field-type)))
- (pointer (rec-beginning-of-field-pos))
- (prev-buffer (current-buffer)))
- (if field-value
- (cond
- ((and (or (equal field-type-kind 'enum)
- (equal field-type-kind 'bool))
- (null n))
- (let* ((data (rec-type-data field-type))
- (fast-selection-data
- (cond
- ((equal field-type-kind 'enum)
- (let (used-letters)
- (mapcar
- (lambda (elem)
- ;; Assign a letter to this enumerated entry.
- ;; The letters are chosen using the following
- ;; criteria: if the first letter of the entry
- ;; is free then use it. Otherwise, if the
- ;; second letter of the entry is free then
- ;; use it. Otherwise use the first available
- ;; symbol in the alphabet. Note that ELEM
- ;; cannot be the empty string.
- (let ((letter (if (not (member (elt elem 0)
used-letters))
- (elt elem 0)
- (if (and (> (length elem) 1)
- (not (member (elt elem 1)
used-letters)))
- (elt elem 1)
- (let* ((c ?a) (i 0))
- (while (member c used-letters)
- (setq c (+ ?a i))
- (setq i (+ i 1)))
- c)))))
- (setq used-letters (cons letter used-letters))
- (list elem letter)))
- data)))
- ((equal field-type-kind 'bool)
- '(("yes" ?y) ("no" ?n) ("1" ?o) ("0" ?z) ("true" ?t)
("false" ?f)))
- (t
- (error "Invalid kind of type"))))
- (letter (rec-fast-selection fast-selection-data "New value")))
- (when letter
- (let ((buffer-read-only nil)
- new-value)
- (mapc
- (lambda (elem)
- (when (equal letter (cadr elem))
- (setq new-value (car elem))))
- fast-selection-data)
- (rec-delete-field)
- (save-excursion
- (rec-insert-field (list 'field
- 0
- field-name
- new-value)))))))
- ((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)
- (calendar)
- (let ((old-map (current-local-map))
- (map (copy-keymap calendar-mode-map)))
- (define-key map "q"
- `(lambda () (interactive)
- (use-local-map (quote ,old-map))
- (calendar-exit)))
- (define-key map "t"
- `(lambda () (interactive)
- (use-local-map (quote ,old-map))
- (calendar-exit)
- (set-buffer rec-prev-buffer)
- (let ((buffer-read-only nil))
- (rec-delete-field)
- (save-excursion
- (rec-insert-field (list 'field
- 0
- rec-field-name
- (format-time-string
rec-time-stamp-format)))))))
- (define-key map (kbd "RET")
- `(lambda () (interactive)
- (let* ((date (calendar-cursor-to-date))
- (time (encode-time 0 0 0 (nth 1 date) (nth 0 date)
(nth 2 date))))
- (use-local-map (quote ,old-map))
- (calendar-exit)
- (set-buffer rec-prev-buffer)
- (let ((buffer-read-only nil))
- (rec-delete-field)
- (save-excursion
- (rec-insert-field (list 'field
- 0
- rec-field-name
- (format-time-string "%Y-%m-%d"
time))))))))
- (use-local-map map)
- (message "[RET]: Select date [t]: Time-stamp [q]: Exit")))
- (t
- (setq edit-buf (get-buffer-create "Rec Edit"))
- (set-buffer edit-buf)
- (delete-region (point-min) (point-max))
- (rec-edit-field-mode)
- (setq rec-field-name field-name)
- (setq rec-marker (make-marker))
- (set-marker rec-marker pointer prev-buffer)
- (setq rec-prev-buffer prev-buffer)
- (setq rec-pointer pointer)
- (insert field-value)
- (switch-to-buffer-other-window edit-buf)
- (goto-char (point-min))
- (message "Edit the value of the field and use C-c C-c to exit")))
- (message "Not in a field"))))
-
-(defun rec-finish-editing-field ()
- "Stop editing the value of a field."
- (interactive)
- (let ((marker rec-marker)
- (prev-pointer rec-pointer)
- (edit-buffer (current-buffer))
- (name rec-field-name)
- (value (buffer-substring-no-properties (point-min) (point-max))))
- (if (equal (length (window-list)) 1)
- (set-window-buffer (selected-window) rec-prev-buffer)
- (delete-window))
- (switch-to-buffer rec-prev-buffer)
- (let ((buffer-read-only nil))
- (kill-buffer edit-buffer)
- (goto-char marker)
- (rec-delete-field)
- (rec-insert-field (list 'field
- 0
- name
- value))
- (goto-char prev-pointer)
- (unless rec-editing
- (rec-hide-continuation-line-markers)))))
-
-(defun rec-beginning-of-field ()
- "Goto to the beginning of the current field"
- (interactive)
- (let ((pos (rec-beginning-of-field-pos)))
- (when pos
- (goto-char pos))))
-
-(defun rec-end-of-field ()
- "Goto to the end of the current field"
- (interactive)
- (let ((pos (rec-end-of-field-pos)))
- (when pos
- (goto-char pos))))
-
-(defun rec-beginning-of-record ()
- "Goto to the beginning of the current record"
- (interactive)
- (let ((pos (rec-beginning-of-record-pos)))
- (when pos
- (goto-char pos))))
-
-(defun rec-end-of-record ()
- "Goto to the end of the current record"
- (interactive)
- (let ((pos (rec-end-of-record-pos)))
- (when pos
- (goto-char pos))))
-
-(defun rec-delete-field ()
- "Delete the current field"
- (interactive)
- (let ((begin-pos (rec-beginning-of-field-pos))
- (end-pos (rec-end-of-field-pos)))
- (when (and begin-pos end-pos)
- (delete-region begin-pos end-pos)
- (when (equal (char-after) ?\n)
- (delete-char 1)))))
-
-(defun rec-copy-record ()
- "Copy the current record"
- (interactive))
-
-(defun rec-find-type ()
- "Goto the beginning of the descriptor with a given type."
- (interactive)
- (let ((type (completing-read "Record type: "
- (save-restriction
- (widen)
- (rec-buffer-types)))))
- (if (equal type "") (setq type nil))
- (rec-show-type type)))
-
-(defun rec-cmd-goto-next-field ()
- "Move the pointer to the beginning of the next field in the
-record. Interactive version."
- (interactive)
- (if (save-excursion
- (not (rec-goto-next-field)))
- (if rec-editing
- (progn
- (goto-char (point-min))
- (unless (looking-at rec-field-name-re)
- (rec-goto-next-field)))
- (rec-beginning-of-record))
- (rec-goto-next-field)))
-
-(defun rec-cmd-goto-next-rec (&optional n)
- "Move the pointer to the beginning of the next record in the
-file. Interactive version."
- (interactive "P")
- (when (null n) (setq n 1))
- (widen)
- (let ((record-type (rec-record-type)))
- (dotimes (i n)
- (if (save-excursion
- (and (rec-goto-next-rec)
- (equal (rec-record-type) record-type)
- (not (rec-record-descriptor-p (rec-current-record)))))
- (progn
- (rec-unfold-all-fields)
- (rec-remove-continuation-line-marker-overlays)
- (rec-goto-next-rec))
- (if (not (rec-record-type))
- (message "No more records")
- (message "%s" (concat "No more records of type "
- (rec-record-type)))))))
- (unless rec-editing
- (rec-show-record)))
-
-(defun rec-cmd-goto-previous-rec (&optional n)
- "Move the pointer to the beginning of the previous record in
-the file. Interactive version."
- (interactive "P")
- (when (null n) (setq n 1))
- (widen)
- (let ((record-type (rec-record-type)))
- (dotimes (i n)
- (if (save-excursion
- (and (rec-goto-previous-rec)
- (equal (rec-record-type) record-type)
- (not (rec-record-descriptor-p (rec-current-record)))))
- (progn
- (rec-unfold-all-fields)
- (rec-remove-continuation-line-marker-overlays)
- (rec-goto-previous-rec))
- (if (not (rec-record-type))
- (message "No more records")
- (message "%s" (concat "No more records of type "
- (rec-record-type)))))))
- (unless rec-editing
- (rec-show-record)))
-
-(defun rec-cmd-undo ()
- "Undo a change in the buffer when in navigation mode."
- (interactive)
- (let ((buffer-read-only nil))
- (undo)))
-
-(defun rec-cmd-jump-back ()
- "Undo the previous jump"
- (interactive)
- (if rec-jump-back
- (progn
- (widen)
- (goto-char (marker-position rec-jump-back))
- (unless rec-editing
- (rec-show-record))
- (setq rec-jump-back nil))
- (message "No previous position to jump")))
-
-(defun rec-edit-record ()
- "Go to the record edition mode"
- (interactive)
- (setq rec-editing t)
- (rec-unfold-all-fields)
- (rec-remove-continuation-line-marker-overlays)
- (setq buffer-read-only nil)
- (use-local-map rec-mode-edit-map)
- (rec-set-head-line "Editing record - use C-cC-c to return to navigation
mode")
- (rec-set-mode-line "Edit record")
- (setq rec-update-p nil)
- (setq rec-preserve-last-newline t))
-
-(defun rec-edit-type ()
- "Go to the type edition mode"
- (interactive)
- (setq rec-editing t)
- (rec-unfold-all-fields)
- (rec-remove-continuation-line-marker-overlays)
- (setq buffer-read-only nil)
- (use-local-map rec-mode-edit-map)
- (widen)
- (rec-narrow-to-type (rec-record-type))
- (setq rec-update-p t)
- (rec-set-head-line (concat "Editing type "
- "'" (rec-record-type) "'"
- " - use C-cC-c to return to navigation mode"))
- (rec-set-mode-line "Edit type"))
-
-(defun rec-edit-buffer ()
- "Go to the buffer edition mode"
- (interactive)
- (setq rec-editing t)
- (rec-unfold-all-fields)
- (rec-remove-continuation-line-marker-overlays)
- (setq buffer-read-only nil)
- (use-local-map rec-mode-edit-map)
- (widen)
- (setq rec-update-p t)
- (rec-set-head-line "Editing buffer - use C-cC-c to return to navigation
mode")
- (rec-set-mode-line "Edit buffer"))
-
-(defun rec-finish-editing ()
- "Go back from the record edition mode"
- (interactive)
- (when (or (not rec-update-p)
- (and rec-update-p
- (save-restriction (widen)
(rec-update-buffer-descriptors-and-check t))))
- (or (rec-current-record)
- (rec-goto-next-rec)
- (rec-goto-previous-rec))
- (when rec-preserve-last-newline
- (save-excursion
- (goto-char (point-max))
- (unless (equal (char-before) ?\n)
- (insert ?\n))))
- (setq rec-update-p nil)
- (rec-show-record)
- (rec-set-head-line nil)
- (rec-set-mode-line (rec-record-type))
- (setq rec-editing nil)
- (message "End of edition")))
-
-(defun rec-cmd-show-descriptor ()
- "Show the descriptor record of the current record.
-
-This jump sets jump-back."
- (interactive)
- (let ((type (rec-record-type)))
- (when type
- (setq rec-jump-back (point-marker))
- (if rec-editing
- (rec-goto-type type)
- (rec-show-type type t)))))
-
-(defun rec-cmd-show-type ()
- "Show the descriptor corresponding to the field under point, in
-the modeline."
- (interactive)
- (let ((type (rec-current-field-type)))
- (if type
- (display-message-or-buffer (rec-type-text type))
- (message "Unrestricted text"))))
-
-(defun rec-cmd-count (n)
- "Display a message in the minibuffer showing the number of
-records of the current type.
-
-If a numeric argument is used then prompt for a selection
-expression."
- (interactive "P")
- (let* ((default-sex (let ((current-field (rec-current-field)))
- (when (and current-field
- (not (string-match "\n" (rec-field-value
current-field)))
- (< (length (rec-field-value current-field))
20))
- (concat (rec-field-name current-field) " = '"
(rec-field-value current-field) "'"))))
- (sex (and (not (null n)) (read-from-minibuffer (concat "Selection
expression"
- (if default-sex
- (concat "
(default " default-sex ")")
- "")
- ": ")))))
- (when (equal sex "")
- (setq sex default-sex))
- (message "Counting records...")
- (let ((type (rec-record-type)))
- (message "%s" (concat (number-to-string (rec-count type sex))
- (if (or (not type)
- (equal type ""))
- " records"
- (concat " records of type " type))
- (when (and sex (not (equal sex "")))
- (concat " with sex " sex)))))))
-
-(defun rec-cmd-statistic ()
- "Display a statistic on the occurrence of the value contained
- in the field under point in the minibuffer, if any.
-
-This command is especially useful with enumerated types."
- (interactive)
- (let* ((field (rec-current-field))
- (field-name (rec-field-name field))
- (type (rec-field-type field-name))
- (type-kind (when type (rec-type-kind type))))
- (cond ((equal type-kind 'enum)
- (let* ((keys (rec-type-data type))
- (total (rec-count (rec-record-type)))
- (percentages (mapcar (lambda (key)
- (let ((key-count (rec-count
(rec-record-type)
- (concat
field-name " = '" key "'"))))
- (list key key-count (/ (* key-count
100) total))))
- keys))
- str)
- (mapc (lambda (occurrence)
- (setq str (concat str
- (number-to-string (nth 1 occurrence))
- " "
- (nth 0 occurrence)
- " ("
- (number-to-string (nth 2 occurrence))
- "%) ")))
- percentages)
- (message "%s" str))))))
-
-(defun rec-cmd-append-field ()
- "Goto the end of the record and switch to edit record mode."
- (interactive)
- (unless rec-editing
- (rec-edit-record)
- (goto-char (point-max))
- (insert "\n")
- (backward-char)))
-
-(defun rec-cmd-trim-field-value ()
- "Trim the value of the field under point, if any."
- (interactive)
- (save-excursion
- (let ((buffer-read-only nil)
- (field (rec-current-field)))
- (setq field (rec-field-trim-value field))
- (rec-delete-field)
- (rec-insert-field field))))
-
-(defun rec-cmd-compile ()
- "Compile the current file with recfix."
- (interactive)
- (let ((cur-buf (current-buffer))
- (cmd (concat rec-recfix " "))
- (tmpfile (make-temp-file "rec-mode-")))
- (if buffer-file-name
- (setq cmd (concat cmd (shell-quote-argument buffer-file-name)))
- (with-temp-file tmpfile
- (insert-buffer-substring cur-buf))
- (setq cmd (concat cmd (shell-quote-argument tmpfile))))
- (compilation-start cmd)))
-
-(defun rec-cmd-show-info ()
- "Show information about the recfile in the modeline."
- (interactive)
- (let ((cur-buf (current-buffer))
- (filename (if buffer-file-name
- buffer-file-name
- (make-temp-file "rec-mode-")))
- (msg ""))
- (if (not buffer-file-name)
- (with-temp-file filename
- (insert-buffer-substring cur-buf)))
- (with-temp-buffer
- (call-process rec-recinf
- nil ; infile
- t ; output to current buffer
- nil ; display
- filename)
- (setq msg (buffer-substring-no-properties (point-min)
- (point-max))))
- ;; Delete temporary file.
- (if (not buffer-file-name)
- (delete-file filename))
- ;; Show the message.
- (setq msg (replace-regexp-in-string "\n$" "" msg))
- (setq msg (replace-regexp-in-string "\n" ", " msg))
- (message "%s" msg)))
-
-(defun rec-cmd-toggle-field-visibility ()
- "Toggle the visibility of the field under point."
- (interactive)
- (when (rec-field-p (rec-current-field))
- (if (rec-field-folded-p)
- (rec-unfold-field)
- (rec-fold-field))))
-
-(defun rec-cmd-kill-field ()
- "Kill the current field"
- (interactive)
- (let ((begin-pos (rec-beginning-of-field-pos))
- (end-pos (rec-end-of-field-pos)))
- (if (and begin-pos end-pos)
- (kill-region begin-pos end-pos)
- (message "Not in a field"))))
-
-(defun rec-cmd-copy-field ()
- "Copy the current field"
- (interactive)
- (let ((begin-pos (rec-beginning-of-field-pos))
- (end-pos (rec-end-of-field-pos)))
- (if (and begin-pos end-pos)
- (progn
- (copy-region-as-kill begin-pos end-pos)
- (message "Field copied to kill ring"))
- (message "Not in a field"))))
-
-(defun rec-cmd-kill-record ()
- "Kill the current record"
- (interactive)
- (let ((begin-pos (rec-beginning-of-record-pos))
- (end-pos (rec-end-of-record-pos)))
- (if (and begin-pos end-pos)
- (progn
- (when (looking-back "^[ \t]*")
- ;; Delete the newline before the record as well, but do
- ;; not include it in the kill ring.
- (delete-region (match-beginning 0) (+ (match-end 0) 1)))
- (kill-region begin-pos end-pos))
- (message "Not in a record"))))
-
-(defun rec-cmd-copy-record ()
- "Copy the current record"
- (interactive)
- (let ((begin-pos (rec-beginning-of-record-pos))
- (end-pos (rec-end-of-record-pos)))
- (if (and begin-pos end-pos)
- (progn
- (copy-region-as-kill begin-pos end-pos)
- (message "record copied to kill ring"))
- (message "Not in a record"))))
-
-(defun rec-cmd-show-summary ()
- "Show a window with a summary of the contents of the current
-record set.
-
-The fields used to build the summary are determined in the
-following way: if there is a %summary field in the record
-descriptor of the current record set then it must contain a comma
-separated list of fields. Otherwise the %key is used. Otherwise
-the user is prompted."
- (interactive)
- (let ((summary-buffer-name (concat (buffer-name (current-buffer)) "
Summary")))
- (if (buffer-live-p (get-buffer summary-buffer-name))
- (progn
- (delete-other-windows)
- (split-window-vertically 10)
- (switch-to-buffer summary-buffer-name))
- (let ((summary-fields (rec-summary-fields)))
- (unless summary-fields
- (setq summary-fields (list (rec-key)))
- (unless (car summary-fields)
- (setq summary-fields (split-string (read-from-minibuffer "Fields
to use in the summary: ") "[ ,]"))))
- (if (car summary-fields)
- (let* ((query (rec-query :fex (rec-join-string summary-fields
",")))
- (summary-list (mapcar (lambda (rec)
- (let ((entry-marker (make-marker)))
- (set-marker entry-marker
(rec-record-position rec))
- (list entry-marker (vconcat
(rec-record-values rec summary-fields)))))
- query)))
- ;; Create the summary window if it does not exist and populate
- ;; it.
- (let ((rec-buf (current-buffer))
- (buf (get-buffer-create (concat (buffer-name
(current-buffer)) " Summary"))))
- (delete-other-windows)
- (split-window-vertically 10)
- (switch-to-buffer buf)
- (let ((buffer-read-only nil))
- (delete-region (point-min) (point-max))
- (setq rec-summary-rec-buffer rec-buf)
- (rec-summary-mode)
- (rec-summary-populate (vconcat (mapcar (lambda (field) (list
field 15 nil)) summary-fields)) summary-list)
- (hl-line-mode 1))))
- (message "No fields to build the summary."))))))
-
-;;;; Interacting with other modes
-
-(defun rec-log-current-defun ()
- "Return the value of the key in the current record, if any. If
-no key is defined then return the value of the first field in the
-record. In case the pointer is not in a record then this
-function returns `nil'."
- (let ((record (rec-current-record))
- (key (rec-key)))
- (when record
- (if key
- (let ((values (rec-record-assoc key record)))
- (if values
- (car values)
- (rec-field-value (car (rec-record-elems record)))))
- (rec-field-value (car (rec-record-elems record)))))))
-
-;;;; Definition of modes
-
-(defvar font-lock-defaults)
-(make-variable-buffer-local 'font-lock-defaults)
-(defvar rec-type)
-(make-variable-buffer-local 'rec-type)
-(defvar rec-buffer-descriptors)
-(make-variable-buffer-local 'rec-buffer-descriptors)
-(defvar rec-jump-back)
-(make-variable-buffer-local 'rec-jump-back)
-(defvar rec-update-p)
-(make-variable-buffer-local 'rec-update-p)
-(defvar rec-preserve-last-newline)
-(make-variable-buffer-local 'rec-preserve-last-newline)
-(defvar rec-editing)
-(make-variable-buffer-local 'rec-editing)
-(defvar add-log-current-defun-section)
-(make-variable-buffer-local 'add-log-current-defun-section)
-
-(defun rec-mode ()
- "A major mode for editing rec files.
-
-Commands:
-\\{rec-mode-map}
-
-Turning on rec-mode calls the members of the variable
-`rec-mode-hook' with no args, if that value is non-nil."
- (interactive)
- (kill-all-local-variables)
- (widen)
- ;; Local variables
- (setq add-log-current-defun-section #'rec-log-current-defun)
- (setq rec-editing nil)
- (setq rec-jump-back nil)
- (setq rec-update-p nil)
- (setq rec-preserve-last-newline nil)
- (setq font-lock-defaults '(rec-font-lock-keywords))
- (add-to-invisibility-spec '(rec-hide-field . "..."))
- (use-local-map rec-mode-map)
- (set-syntax-table rec-mode-syntax-table)
- (setq mode-name "Rec")
- (setq major-mode 'rec-mode)
- (run-hooks 'rec-mode-hook)
- ;; Goto the first record of the first type (including the Unknown).
- ;; If there is a problem (i.e. syntax error) then go to fundamental
- ;; mode and show the output of recfix in a separated buffer.
- (when (rec-update-buffer-descriptors-and-check)
- ;; If the configured open-mode is navigation, set up the buffer
- ;; accordingly. But don't go into navigation mode if the file is
- ;; empty.
- (if (and (equal rec-open-mode 'navigation)
- (> (buffer-size (current-buffer)) 0))
- (progn
- (setq buffer-read-only t)
- (setq rec-type (car (rec-buffer-types)))
- (rec-show-type rec-type))
- ;; Edit mode
- (use-local-map rec-mode-edit-map)
- (setq rec-editing t)
- (rec-set-mode-line "Edit buffer"))))
-
-(defvar rec-edit-field-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-c" 'rec-finish-editing-field)
- map)
- "Keymap for rec-edit-field-mode")
-
-(defun rec-edit-field-mode ()
- "A major mode for editing rec field values.
-
-Commands:
-\\{rec-edit-field-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (use-local-map rec-edit-field-mode-map)
- (setq mode-name "Rec Edit")
- (setq major-mode 'rec-edit-field-mode))
-
-;;;; Miscellaneous utilities
-
-(defun rec-join-string (l c)
- (if (> (length l) 1)
- (concat (car l) c (rec-join-string (cdr l) c))
- (car l)))
-
-(provide 'rec-mode)
-
-;; Local variables:
-;; outline-regexp: ";;;;"
-;; End:
-
-;;; rec-mode.el ends here
diff --git a/po/ChangeLog b/po/ChangeLog
index 9f67c78..f89d011 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,7 @@
+2020-11-11 Jose E. Marchesi <jemarch@gnu.org>
+
+ * POTFILES.in: Updated.
+
2018-03-18 Jose E. Marchesi <jemarch@gnu.org>
* POTFILES.in: Updated.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index d4246b0..bd85542 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -13,14 +13,19 @@ lib/alloca.in.h
lib/arg-nonnull.h
lib/asnprintf.c
lib/asprintf.c
+lib/attribute.h
lib/base64.c
lib/base64.h
lib/basename-lgpl.c
+lib/basename-lgpl.h
+lib/binary-io.c
+lib/binary-io.h
lib/btowc.c
lib/canonicalize-lgpl.c
lib/c-ctype.c
lib/c-ctype.h
lib/c++defs.h
+lib/cdefs.h
lib/cloexec.c
lib/cloexec.h
lib/close.c
@@ -29,6 +34,9 @@ lib/closeout.h
lib/close-stream.c
lib/close-stream.h
lib/copy-acl.c
+lib/copy-file.c
+lib/copy-file.h
+lib/copy-file-range.c
lib/crc.c
lib/crc.h
lib/c-strcasecmp.c
@@ -37,7 +45,6 @@ lib/c-strcase.h
lib/c-strncasecmp.c
lib/dirname.h
lib/dirname-lgpl.c
-lib/dosname.h
lib/dup2.c
lib/errno.in.h
lib/error.c
@@ -47,6 +54,7 @@ lib/execute.c
lib/execute.h
lib/exitfail.c
lib/exitfail.h
+lib/explicit_bzero.c
lib/fatal-signal.c
lib/fatal-signal.h
lib/fcntl.c
@@ -60,6 +68,7 @@ lib/float+.h
lib/float.in.h
lib/flock.c
lib/floor.c
+lib/fopen.c
lib/fpending.c
lib/fpending.h
lib/fprintf.c
@@ -73,6 +82,8 @@ lib/fseterr.h
lib/fstat.c
lib/ftell.c
lib/ftello.c
+lib/full-write.c
+lib/full-write.h
lib/fwriting.c
lib/fwriting.h
lib/getdelim.c
@@ -94,6 +105,7 @@ lib/getpass.h
lib/get-permissions.c
lib/getprogname.c
lib/getprogname.h
+lib/getrandom.c
lib/gettext.h
lib/gettime.c
lib/gettimeofday.c
@@ -104,6 +116,7 @@ lib/gl_list.h
lib/group-member.c
lib/hard-locale.c
lib/hard-locale.h
+lib/ignore-value.h
lib/intprops.h
lib/inttypes.in.h
lib/isnan.c
@@ -115,13 +128,14 @@ lib/isnanl.c
lib/isnanl-nolibm.h
lib/itold.c
lib/langinfo.in.h
+lib/lc-charset-dispatch.c
+lib/lc-charset-dispatch.h
+lib/libc-config.h
lib/limits.in.h
lib/localcharset.c
lib/localcharset.h
lib/localeconv.c
lib/locale.in.h
-lib/localtime-buffer.c
-lib/localtime-buffer.h
lib/lseek.c
lib/lstat.c
lib/malloca.c
@@ -131,11 +145,16 @@ lib/math.c
lib/math.in.h
lib/mbrlen.c
lib/mbrtowc.c
+lib/mbrtowc-impl.h
+lib/mbrtowc-impl-utf8.h
lib/mbsinit.c
lib/mbtowc.c
lib/mbtowc-impl.h
+lib/mbtowc-lock.c
+lib/mbtowc-lock.h
lib/memchr.c
lib/minmax.h
+lib/mkdir.c
lib/mkostemp.c
lib/mkstemp.c
lib/mktime.c
@@ -145,12 +164,14 @@ lib/msvc-inval.h
lib/msvc-nothrow.c
lib/msvc-nothrow.h
lib/nl_langinfo.c
+lib/nl_langinfo-lock.c
lib/_Noreturn.h
lib/nstrftime.c
lib/obstack.c
lib/obstack.h
lib/open.c
lib/parse-datetime.c
+lib/parse-datetime-gen.h
lib/parse-datetime.h
lib/pathmax.h
lib/printf-args.c
@@ -172,6 +193,7 @@ lib/quote.h
lib/raise.c
lib/random_r.c
lib/rawmemchr.c
+lib/read.c
lib/read-file.c
lib/read-file.h
lib/readline.c
@@ -184,9 +206,14 @@ lib/regexec.c
lib/regex.h
lib/regex_internal.c
lib/regex_internal.h
+lib/remove.c
lib/rename.c
lib/rmdir.c
lib/root-uid.h
+lib/safe-read.c
+lib/safe-read.h
+lib/safe-write.c
+lib/safe-write.h
lib/same-inode.h
lib/sched.in.h
lib/se-context.c
@@ -196,6 +223,9 @@ lib/se-selinux.c
lib/se-selinux.in.h
lib/set-acl.c
lib/setenv.c
+lib/setlocale-lock.c
+lib/setlocale_null.c
+lib/setlocale_null.h
lib/set-permissions.c
lib/sigaction.c
lib/sig-handler.c
@@ -223,6 +253,7 @@ lib/stat-time.c
lib/stat-time.h
lib/stat-w32.c
lib/stat-w32.h
+lib/stdalign.in.h
lib/stdarg.in.h
lib/stdbool.in.h
lib/stddef.in.h
@@ -233,6 +264,7 @@ lib/stdlib.in.h
lib/strcasecmp.c
lib/strcasestr.c
lib/strchrnul.c
+lib/strdup.c
lib/streq.h
lib/strerror.c
lib/strerror-override.c
@@ -246,12 +278,15 @@ lib/strsep.c
lib/str-two-way.h
lib/strverscmp.c
lib/sys_file.in.h
+lib/sys-limits.h
+lib/sys_random.in.h
lib/sys_stat.in.h
lib/sys_time.in.h
lib/sys_types.in.h
lib/sys_wait.in.h
lib/tempname.c
lib/tempname.h
+lib/thread-optim.h
lib/timegm.c
lib/time.in.h
lib/time-internal.h
@@ -264,9 +299,14 @@ lib/tmpdir.h
lib/tzset.c
lib/unistd.c
lib/unistd.in.h
+lib/unlink.c
lib/unlocked-io.h
lib/unsetenv.c
lib/unused-parameter.h
+lib/utime.c
+lib/utime.in.h
+lib/utimens.c
+lib/utimens.h
lib/vasnprintf.c
lib/vasnprintf.h
lib/vasprintf.c
@@ -287,6 +327,16 @@ lib/wctomb.c
lib/wctomb-impl.h
lib/wctype-h.c
lib/wctype.in.h
+lib/windows-initguard.h
+lib/windows-mutex.c
+lib/windows-mutex.h
+lib/windows-once.c
+lib/windows-once.h
+lib/windows-recmutex.c
+lib/windows-recmutex.h
+lib/windows-rwlock.c
+lib/windows-rwlock.h
+lib/write.c
lib/xalloc-die.c
lib/xalloc.h
lib/xalloc-oversized.h
diff --git a/po/recutils.pot b/po/recutils.pot
index 33316da..eefe1cd 100644
--- a/po/recutils.pot
+++ b/po/recutils.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GNU recutils 1.8.90\n"
"Report-Msgid-Bugs-To: bug-gnu-utils@gnu.org\n"
-"POT-Creation-Date: 2020-01-28 12:19+0100\n"
+"POT-Creation-Date: 2020-11-11 11:50+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -21,11 +21,36 @@ msgstr ""
msgid "write error"
msgstr ""
-#: lib/copy-acl.c:54
+#: lib/copy-acl.c:54 lib/copy-file.c:215
#, c-format
msgid "preserving permissions for %s"
msgstr ""
+#: lib/copy-file.c:192
+#, c-format
+msgid "error while opening %s for reading"
+msgstr ""
+
+#: lib/copy-file.c:196
+#, c-format
+msgid "cannot open backup file %s for writing"
+msgstr ""
+
+#: lib/copy-file.c:200
+#, c-format
+msgid "error reading %s"
+msgstr ""
+
+#: lib/copy-file.c:204
+#, c-format
+msgid "error writing %s"
+msgstr ""
+
+#: lib/copy-file.c:208
+#, c-format
+msgid "error after reading %s"
+msgstr ""
+
#: lib/error.c:195
msgid "Unknown system error"
msgstr ""
@@ -75,341 +100,341 @@ msgstr ""
msgid "memory exhausted"
msgstr ""
-#: parse-datetime.y:440 parse-datetime.y:540
+#: parse-datetime.y:428 parse-datetime.y:528
#, c-format
msgid "parsed %s part: "
msgstr ""
-#: parse-datetime.y:455
+#: parse-datetime.y:443
#, c-format
msgid "year: %04<PRIdMAX>"
msgstr ""
-#: parse-datetime.y:483
+#: parse-datetime.y:471
#, c-format
msgid "%s (day ordinal=%<PRIdMAX> number=%d)"
msgstr ""
-#: parse-datetime.y:514
+#: parse-datetime.y:502
#, c-format
msgid "number of seconds: %<PRIdMAX>"
msgstr ""
-#: parse-datetime.y:547
+#: parse-datetime.y:535
msgid "today/this/now\n"
msgstr ""
-#: parse-datetime.y:612
+#: parse-datetime.y:600
msgid "number of seconds"
msgstr ""
-#: parse-datetime.y:625
+#: parse-datetime.y:613
msgid "datetime"
msgstr ""
-#: parse-datetime.y:630
+#: parse-datetime.y:618
msgid "time"
msgstr ""
-#: parse-datetime.y:635
+#: parse-datetime.y:623
msgid "local_zone"
msgstr ""
-#: parse-datetime.y:640
+#: parse-datetime.y:628
msgid "zone"
msgstr ""
-#: parse-datetime.y:645
+#: parse-datetime.y:633
msgid "date"
msgstr ""
-#: parse-datetime.y:650
+#: parse-datetime.y:638
msgid "day"
msgstr ""
-#: parse-datetime.y:654 parse-datetime.y:761 parse-datetime.y:766
+#: parse-datetime.y:642 parse-datetime.y:749 parse-datetime.y:754
msgid "relative"
msgstr ""
-#: parse-datetime.y:658
+#: parse-datetime.y:646
msgid "number"
msgstr ""
-#: parse-datetime.y:662
+#: parse-datetime.y:650
msgid "hybrid"
msgstr ""
-#: parse-datetime.y:820
+#: parse-datetime.y:808
#, c-format
msgid "warning: value %<PRIdMAX> has %<PRIdMAX> digits. Assuming YYYY/MM/DD\n"
msgstr ""
-#: parse-datetime.y:832
+#: parse-datetime.y:820
#, c-format
msgid ""
"warning: value %<PRIdMAX> has less than 4 digits. Assuming MM/DD/YY[YY]\n"
msgstr ""
-#: parse-datetime.y:1279
+#: parse-datetime.y:1267
#, c-format
msgid "warning: adjusting year value %<PRIdMAX> to %<PRIdMAX>\n"
msgstr ""
-#: parse-datetime.y:1289
+#: parse-datetime.y:1277
#, c-format
msgid "error: out-of-range year %<PRIdMAX>\n"
msgstr ""
-#: parse-datetime.y:1527
+#: parse-datetime.y:1515
#, c-format
msgid "error: unknown word '%s'\n"
msgstr ""
-#: parse-datetime.y:1676
+#: parse-datetime.y:1664
msgid "error: invalid date/time value:\n"
msgstr ""
-#: parse-datetime.y:1677
+#: parse-datetime.y:1665
#, c-format
msgid " user provided time: '%s'\n"
msgstr ""
-#: parse-datetime.y:1679
+#: parse-datetime.y:1667
#, c-format
msgid " normalized time: '%s'\n"
msgstr ""
-#: parse-datetime.y:1702
+#: parse-datetime.y:1690
msgid " possible reasons:\n"
msgstr ""
-#: parse-datetime.y:1704
+#: parse-datetime.y:1692
msgid " non-existing due to daylight-saving time;\n"
msgstr ""
-#: parse-datetime.y:1706
+#: parse-datetime.y:1694
msgid " invalid day/month combination;\n"
msgstr ""
-#: parse-datetime.y:1707
+#: parse-datetime.y:1695
msgid " numeric values overflow;\n"
msgstr ""
-#: parse-datetime.y:1708
+#: parse-datetime.y:1696
msgid "incorrect timezone"
msgstr ""
-#: parse-datetime.y:1709
+#: parse-datetime.y:1697
msgid "missing timezone"
msgstr ""
-#: parse-datetime.y:1829
+#: parse-datetime.y:1817
msgid "error: initial year out of range\n"
msgstr ""
-#: parse-datetime.y:1926
+#: parse-datetime.y:1914
msgid "error: parsing failed\n"
msgstr ""
-#: parse-datetime.y:1927
+#: parse-datetime.y:1915
#, c-format
msgid "error: parsing failed, stopped at '%s'\n"
msgstr ""
-#: parse-datetime.y:1937
+#: parse-datetime.y:1925
msgid "input timezone: "
msgstr ""
-#: parse-datetime.y:1940
+#: parse-datetime.y:1928
#, c-format
msgid "'@timespec' - always UTC"
msgstr ""
-#: parse-datetime.y:1942
+#: parse-datetime.y:1930
#, c-format
msgid "parsed date/time string"
msgstr ""
-#: parse-datetime.y:1946
+#: parse-datetime.y:1934
#, c-format
msgid "TZ=\"%s\" in date string"
msgstr ""
-#: parse-datetime.y:1950
+#: parse-datetime.y:1938
#, c-format
msgid "TZ=\"UTC0\" environment value or -u"
msgstr ""
-#: parse-datetime.y:1953
+#: parse-datetime.y:1941
#, c-format
msgid "TZ=\"%s\" environment value"
msgstr ""
-#: parse-datetime.y:1956
+#: parse-datetime.y:1944
#, c-format
msgid "system default"
msgstr ""
-#: parse-datetime.y:1998
+#: parse-datetime.y:1986
msgid "error: year, month, or day overflow\n"
msgstr ""
-#: parse-datetime.y:2009
+#: parse-datetime.y:1997
#, c-format
msgid "error: invalid hour %<PRIdMAX>%s\n"
msgstr ""
-#: parse-datetime.y:2017
+#: parse-datetime.y:2005
#, c-format
msgid "using specified time as starting value: '%s'\n"
msgstr ""
-#: parse-datetime.y:2018
+#: parse-datetime.y:2006
#, c-format
msgid "using current time as starting value: '%s'\n"
msgstr ""
-#: parse-datetime.y:2072
+#: parse-datetime.y:2060
#, c-format
msgid "error: tzalloc (\"%s\") failed\n"
msgstr ""
-#: parse-datetime.y:2117
+#: parse-datetime.y:2105
#, c-format
msgid ""
"error: day '%s' (day ordinal=%<PRIdMAX> number=%d) resulted in an invalid "
"date: '%s'\n"
msgstr ""
-#: parse-datetime.y:2128
+#: parse-datetime.y:2116
#, c-format
msgid "new start date: '%s' is '%s'\n"
msgstr ""
-#: parse-datetime.y:2137
+#: parse-datetime.y:2125
#, c-format
msgid "using current date as starting value: '%s'\n"
msgstr ""
-#: parse-datetime.y:2141
+#: parse-datetime.y:2129
#, c-format
msgid "warning: day (%s) ignored when explicit dates are given\n"
msgstr ""
-#: parse-datetime.y:2145
+#: parse-datetime.y:2133
#, c-format
msgid "starting date/time: '%s'\n"
msgstr ""
-#: parse-datetime.y:2155
+#: parse-datetime.y:2143
msgid ""
"warning: when adding relative months/years, it is recommended to specify the "
"15th of the months\n"
msgstr ""
-#: parse-datetime.y:2160
+#: parse-datetime.y:2148
msgid "warning: when adding relative days, it is recommended to specify noon\n"
msgstr ""
-#: parse-datetime.y:2170
+#: parse-datetime.y:2158
#, c-format
msgid "error: %s:%d\n"
msgstr ""
-#: parse-datetime.y:2184
+#: parse-datetime.y:2172
#, c-format
msgid "error: adding relative date resulted in an invalid date: '%s'\n"
msgstr ""
-#: parse-datetime.y:2193
+#: parse-datetime.y:2181
#, c-format
msgid ""
"after date adjustment (%+<PRIdMAX> years, %+<PRIdMAX> months, %+<PRIdMAX> "
"days),\n"
msgstr ""
-#: parse-datetime.y:2197
+#: parse-datetime.y:2185
#, c-format
msgid " new date/time = '%s'\n"
msgstr ""
-#: parse-datetime.y:2216
+#: parse-datetime.y:2204
msgid "warning: daylight saving time changed after date adjustment\n"
msgstr ""
-#: parse-datetime.y:2235
+#: parse-datetime.y:2223
msgid "warning: month/year adjustment resulted in shifted dates:\n"
msgstr ""
-#: parse-datetime.y:2238
+#: parse-datetime.y:2226
#, c-format
msgid " adjusted Y M D: %s %02d %02d\n"
msgstr ""
-#: parse-datetime.y:2240
+#: parse-datetime.y:2228
#, c-format
msgid " normalized Y M D: %s %02d %02d\n"
msgstr ""
-#: parse-datetime.y:2268
+#: parse-datetime.y:2256
#, c-format
msgid "error: timezone %d caused time_t overflow\n"
msgstr ""
-#: parse-datetime.y:2278
+#: parse-datetime.y:2266
#, c-format
msgid "'%s' = %<PRIdMAX> epoch-seconds\n"
msgstr ""
-#: parse-datetime.y:2306
+#: parse-datetime.y:2294
msgid "error: adding relative time caused an overflow\n"
msgstr ""
-#: parse-datetime.y:2317
+#: parse-datetime.y:2305
#, c-format
msgid ""
"after time adjustment (%+<PRIdMAX> hours, %+<PRIdMAX> minutes, %+<PRIdMAX> "
"seconds, %+d ns),\n"
msgstr ""
-#: parse-datetime.y:2322
+#: parse-datetime.y:2310
#, c-format
msgid " new time = %<PRIdMAX> epoch-seconds\n"
msgstr ""
-#: parse-datetime.y:2338
+#: parse-datetime.y:2326
msgid "warning: daylight saving time changed after time adjustment\n"
msgstr ""
-#: parse-datetime.y:2348
+#: parse-datetime.y:2336
msgid "timezone: system default\n"
msgstr ""
-#: parse-datetime.y:2350
+#: parse-datetime.y:2338
msgid "timezone: Universal Time\n"
msgstr ""
-#: parse-datetime.y:2352
+#: parse-datetime.y:2340
#, c-format
msgid "timezone: TZ=\"%s\" environment value\n"
msgstr ""
-#: parse-datetime.y:2356
+#: parse-datetime.y:2344
#, c-format
msgid "final: %<PRIdMAX>.%09d (epoch-seconds)\n"
msgstr ""
-#: parse-datetime.y:2362
+#: parse-datetime.y:2350
#, c-format
msgid "final: %s (UTC)\n"
msgstr ""
-#: parse-datetime.y:2377
+#: parse-datetime.y:2365
#, c-format
msgid "final: %s (UTC%s)\n"
msgstr ""
-#: parse-datetime.y:2381
+#: parse-datetime.y:2369
#, c-format
msgid "final: %s (unknown time zone offset)\n"
msgstr ""
@@ -435,11 +460,11 @@ msgstr ""
#. If you don't know what to put here, please see
#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
#. and use glyphs suitable for your language.
-#: lib/quotearg.c:362
+#: lib/quotearg.c:355
msgid "`"
msgstr ""
-#: lib/quotearg.c:363
+#: lib/quotearg.c:356
msgid "'"
msgstr ""
@@ -646,17 +671,17 @@ msgstr ""
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: lib/version-etc.c:249 utils/recutl.c:124
+#: lib/version-etc.c:249 utils/recutl.c:114
#, c-format
msgid "Report bugs to: %s\n"
msgstr ""
-#: lib/version-etc.c:251 utils/recutl.c:127
+#: lib/version-etc.c:251 utils/recutl.c:117
#, c-format
msgid "Report %s bugs to: %s\n"
msgstr ""
-#: lib/version-etc.c:255 lib/version-etc.c:257 utils/recutl.c:131
+#: lib/version-etc.c:255 lib/version-etc.c:257 utils/recutl.c:121
#, c-format
msgid "%s home page: <%s>\n"
msgstr ""
@@ -686,281 +711,281 @@ msgstr ""
msgid "%s subprocess got fatal signal %d"
msgstr ""
-#: src/rec-fex.c:452
+#: src/rec-fex.c:725
#, c-format
msgid "internal error: REC_FEX_MAX_ELEMS exceeded. Please report this.\n"
msgstr ""
-#: src/rec-int.c:177
-#, c-format
-msgid "%s: error: the number of records of type %s should be %zd.\n"
-msgstr ""
-
-#: src/rec-int.c:187
-#, c-format
-msgid "%s: error: too many records of type %s. Maximum allowed are %zd.\n"
-msgstr ""
-
-#: src/rec-int.c:194
-#, c-format
-msgid "%s: error: too few records of type %s. Minimum allowed are %zd.\n"
-msgstr ""
-
-#: src/rec-int.c:410 src/rec-int.c:464 src/rec-int.c:521 src/rec-int.c:565
-#: utils/recutl.c:209
+#: src/rec-int.c:131 src/rec-int.c:185 src/rec-int.c:242 src/rec-int.c:286
+#: utils/recutl.c:199
msgid "out of memory\n"
msgstr ""
-#: src/rec-int.c:425
+#: src/rec-int.c:146
#, c-format
msgid "%s:%s: error: mandatory field '%s' not found in record\n"
msgstr ""
-#: src/rec-int.c:488
+#: src/rec-int.c:209
#, c-format
msgid "%s:%s: error: field '%s' not allowed in this record set\n"
msgstr ""
-#: src/rec-int.c:535
+#: src/rec-int.c:256
#, c-format
msgid "%s:%s: error: field '%s' should be unique in this record\n"
msgstr ""
-#: src/rec-int.c:579
+#: src/rec-int.c:300
#, c-format
msgid "%s:%s: error: prohibited field '%s' found in record\n"
msgstr ""
-#: src/rec-int.c:611
+#: src/rec-int.c:332
#, c-format
msgid "%s:%s: error: %%constraint[%d] violated in record\n"
msgstr ""
-#: src/rec-int.c:648
+#: src/rec-int.c:369
#, c-format
msgid "%s:%s: error: confidential field is not encrypted\n"
msgstr ""
-#: src/rec-int.c:700
+#: src/rec-int.c:421
#, c-format
msgid "%s:%s: error: key field '%s' not found in record\n"
msgstr ""
-#: src/rec-int.c:709
+#: src/rec-int.c:430
#, c-format
msgid "%s:%s: error: multiple key fields '%s' in record\n"
msgstr ""
-#: src/rec-int.c:752
+#: src/rec-int.c:473
#, c-format
msgid "%s:%s: error: duplicated key value in field '%s' in record\n"
msgstr ""
-#: src/rec-int.c:800
+#: src/rec-int.c:536
#, c-format
msgid "%s:%s: error: missing %%rec field in record descriptor\n"
msgstr ""
-#: src/rec-int.c:808
+#: src/rec-int.c:544
#, c-format
msgid "%s:%s: error: too many %%rec fields in record descriptor\n"
msgstr ""
-#: src/rec-int.c:818
+#: src/rec-int.c:554
#, c-format
msgid "%s:%s: error: invalid record type %s\n"
msgstr ""
-#: src/rec-int.c:829
+#: src/rec-int.c:565
#, c-format
msgid "%s:%s: error: only one %%key field is allowed in a record descriptor\n"
msgstr ""
-#: src/rec-int.c:839
+#: src/rec-int.c:575
#, c-format
msgid "%s:%s: error: only one %%size field is allowed in a record descriptor\n"
msgstr ""
-#: src/rec-int.c:849
+#: src/rec-int.c:585
#, c-format
msgid "%s:%s: error: only one %%sort field is allowed in a record descriptor\n"
msgstr ""
-#: src/rec-int.c:872
+#: src/rec-int.c:608
#, c-format
msgid ""
"%s:%s: error: expected a comma-separated list of fields before the type "
"specification\n"
msgstr ""
-#: src/rec-int.c:898 src/rec-int.c:951
+#: src/rec-int.c:634 src/rec-int.c:687
#, c-format
msgid "%s:%s: error: the referred type %s does not exist\n"
msgstr ""
-#: src/rec-int.c:910
+#: src/rec-int.c:646
#, c-format
msgid "%s:%s: error: invalid type specification\n"
msgstr ""
-#: src/rec-int.c:925
+#: src/rec-int.c:661
#, c-format
msgid "%s:%s: error: expected a type name before the type specification\n"
msgstr ""
-#: src/rec-int.c:963
+#: src/rec-int.c:699
#, c-format
msgid "%s:%s: error: invalid typedef specification\n"
msgstr ""
-#: src/rec-int.c:985
+#: src/rec-int.c:721
#, c-format
msgid "%s:%s: error: value for %s[%zd] is not a valid selection expression\n"
msgstr ""
-#: src/rec-int.c:1016
+#: src/rec-int.c:752
#, c-format
msgid "%s:%s: error: value for %s[%zd] is not a list of field names\n"
msgstr ""
-#: src/rec-int.c:1029
+#: src/rec-int.c:765
#, c-format
msgid ""
"%s:%s: error: value for %s should be a number optionally preceded by >, <, "
">= or <=.\n"
msgstr ""
-#: src/rec-int.c:1045
+#: src/rec-int.c:781
#, c-format
msgid "%s:%s: error: value for %s should be a list of field names.\n"
msgstr ""
-#: src/rec-int.c:1073
+#: src/rec-int.c:809
#, c-format
msgid ""
"%s:%s: error: auto-incremented field %s should be of type int, range, uuid "
"or date\n"
msgstr ""
-#: src/rec-int.c:1075
+#: src/rec-int.c:811
#, c-format
msgid ""
"%s:%s: error: auto-incremented field %s should be of type int, range or "
"date\n"
msgstr ""
-#: src/rec-int.c:1158
+#: src/rec-int.c:894
#, c-format
msgid "%s:%s: error: could not fetch remote descriptor from url %s.\n"
msgstr ""
-#: src/rec-int.c:1177
+#: src/rec-int.c:913
#, c-format
msgid "%s:%s: error: could not read external descriptor from file %s.\n"
msgstr ""
-#: src/rec-int.c:1192
+#: src/rec-int.c:928
#, c-format
msgid "%s:%s: error: %s does not contain valid rec data.\n"
msgstr ""
-#: src/rec-int.c:1206
+#: src/rec-int.c:942
#, c-format
msgid "%s:%s: error: %s does not contain information for type %s.\n"
msgstr ""
-#: src/rec-types.c:449
+#: src/rec-int.c:1066
#, c-format
-msgid ""
-"internal error: rec-types: got REC_TYPE_NONE from rec_type_parse_type_kind() "
-"in rec_type_new().\n"
+msgid "%s: error: the number of records of type %s should be %zd.\n"
+msgstr ""
+
+#: src/rec-int.c:1076
+#, c-format
+msgid "%s: error: too many records of type %s. Maximum allowed are %zd.\n"
msgstr ""
-#: src/rec-types.c:1179
+#: src/rec-int.c:1083
+#, c-format
+msgid "%s: error: too few records of type %s. Minimum allowed are %zd.\n"
+msgstr ""
+
+#: src/rec-types.c:303
msgid "invalid integer."
msgstr ""
-#: src/rec-types.c:1209
+#: src/rec-types.c:331
msgid "invalid 'field' value."
msgstr ""
-#: src/rec-types.c:1232
+#: src/rec-types.c:352
msgid "invalid 'uuid' value."
msgstr ""
-#: src/rec-types.c:1250
+#: src/rec-types.c:368
msgid "invalid 'bool' value."
msgstr ""
-#: src/rec-types.c:1273
+#: src/rec-types.c:389
msgid "invalid 'range' value."
msgstr ""
-#: src/rec-types.c:1282
+#: src/rec-types.c:398
#, c-format
msgid "expected an integer between %d and %d."
msgstr ""
-#: src/rec-types.c:1303
+#: src/rec-types.c:418
msgid "invalid 'real' value."
msgstr ""
-#: src/rec-types.c:1321
+#: src/rec-types.c:435
#, c-format
msgid "value too large. Expected a size <= %zu."
msgstr ""
-#: src/rec-types.c:1342
+#: src/rec-types.c:455
msgid "invalid 'line' value."
msgstr ""
-#: src/rec-types.c:1361
+#: src/rec-types.c:472
msgid "value does not match the regexp."
msgstr ""
-#: src/rec-types.c:1384
+#: src/rec-types.c:491
msgid "invalid date."
msgstr ""
-#: src/rec-types.c:1400
+#: src/rec-types.c:505
msgid "invalid email."
msgstr ""
-#: src/rec-types.c:1445
+#: src/rec-types.c:546
msgid "invalid enum value."
msgstr ""
-#: src/rec-utils.c:94
+#: src/rec-types.c:897
+#, c-format
+msgid ""
+"internal error: rec-types: got REC_TYPE_NONE from rec_type_parse_type_kind() "
+"in rec_type_new().\n"
+msgstr ""
+
+#: src/rec-utils.c:85
#, c-format
msgid "internal error: rec_int_rec_extract_file: error compiling regexp.\n"
msgstr ""
-#: src/rec-utils.c:122 src/rec-utils.c:151
+#: src/rec-utils.c:115 src/rec-utils.c:146
#, c-format
msgid "internal error: rec_int_rec_extract_url: error compiling regexp.\n"
msgstr ""
-#: src/rec-utils.c:305
+#: src/rec-utils.c:289
#, c-format
msgid "internal error: rec_match: error compiling regexp.\n"
msgstr ""
#. TRANSLATORS: --help output, csv2rec synopsis.
#. no-wrap
-#: utils/csv2rec.c:106
+#: utils/csv2rec.c:98
#, c-format
msgid "Usage: csv2rec [OPTIONS]... [CSV_FILE]\n"
msgstr ""
#. TRANSLATORS: --help output, csv2rec short description.
#. no-wrap
-#: utils/csv2rec.c:111
+#: utils/csv2rec.c:103
msgid "Convert csv data into rec data.\n"
msgstr ""
#. TRANSLATORS: --help output, csv2rec options.
#. no-wrap
-#: utils/csv2rec.c:117
+#: utils/csv2rec.c:109
msgid ""
" -t, --type=TYPE type name for the converted records; "
"if this\n"
@@ -970,47 +995,51 @@ msgid ""
" -e, --omit-empty omit empty fields.\n"
msgstr ""
-#: utils/csv2rec.c:231
+#: utils/csv2rec.c:212
#, c-format
msgid "invalid field name '%s' in header\n"
msgstr ""
-#: utils/csv2rec.c:260
+#: utils/csv2rec.c:221
+msgid "error while parsing CSV file: too many columns in row\n"
+msgstr ""
+
+#: utils/csv2rec.c:241
#, c-format
msgid ""
"%s: %lu: this line contains %lu fields, but %lu header fields were read\n"
msgstr ""
-#: utils/csv2rec.c:348 utils/recdel.c:267 utils/recset.c:359 utils/recutl.c:330
+#: utils/csv2rec.c:331 utils/recdel.c:233 utils/recset.c:306 utils/recutl.c:317
#, c-format
msgid "cannot read file %s\n"
msgstr ""
-#: utils/csv2rec.c:359
+#: utils/csv2rec.c:338
msgid "failed to initialize csv parser\n"
msgstr ""
-#: utils/csv2rec.c:377
+#: utils/csv2rec.c:355
#, c-format
msgid "error while parsing CSV file: %s\n"
msgstr ""
#. TRANSLATORS: --help output, mdb2rec synopsis.
#. no-wrap
-#: utils/mdb2rec.c:104
+#: utils/mdb2rec.c:97
#, c-format
msgid "Usage: mdb2rec [OPTIONS]... MDB_FILE [TABLE]\n"
msgstr ""
#. TRANSLATORS: --help output, mdb2rec short description.
#. no-wrap
-#: utils/mdb2rec.c:109
+#: utils/mdb2rec.c:102
msgid "Convert an mdb file into a rec file.\n"
msgstr ""
#. TRANSLATORS: --help output, mdb2rec options.
#. no-wrap
-#: utils/mdb2rec.c:115
+#: utils/mdb2rec.c:108
msgid ""
" -s, --system-tables include system tables.\n"
" -e, --keep-empty-fields don't prune empty fields in the rec\n"
@@ -1020,51 +1049,51 @@ msgid ""
" in the mdb file.\n"
msgstr ""
-#: utils/mdb2rec.c:252 utils/mdb2rec.c:316
+#: utils/mdb2rec.c:230 utils/mdb2rec.c:288
#, c-format
msgid "failed to normalise record type name %s\n"
msgstr ""
-#: utils/mdb2rec.c:260 utils/mdb2rec.c:271
+#: utils/mdb2rec.c:236 utils/mdb2rec.c:245
#, c-format
msgid "failed to normalise field name %s\n"
msgstr ""
-#: utils/mdb2rec.c:337
+#: utils/mdb2rec.c:307
#, c-format
msgid "failed to normalise the field name %s\n"
msgstr ""
-#: utils/mdb2rec.c:444 utils/recins.c:209 utils/recset.c:254
+#: utils/mdb2rec.c:396 utils/recins.c:191 utils/recset.c:223
#, c-format
msgid "invalid field name %s.\n"
msgstr ""
-#: utils/mdb2rec.c:483
+#: utils/mdb2rec.c:436
#, c-format
msgid "could not open file %s\n"
msgstr ""
-#: utils/mdb2rec.c:490
+#: utils/mdb2rec.c:441
msgid "file does not appear to be an Access database\n"
msgstr ""
#. TRANSLATORS: --help output, rec2csv synopsis.
#. no-wrap
-#: utils/rec2csv.c:89
+#: utils/rec2csv.c:70
#, c-format
msgid "Usage: rec2csv [OPTIONS]... [REC_FILE]\n"
msgstr ""
#. TRANSLATORS: --help output, rec2csv short description.
#. no-wrap
-#: utils/rec2csv.c:94
+#: utils/rec2csv.c:75
msgid "Convert rec data into csv data.\n"
msgstr ""
#. TRANSLATORS: --help output, rec2csv options.
#. no-wrap
-#: utils/rec2csv.c:100
+#: utils/rec2csv.c:81
msgid ""
" -d, --delim=char sets the deliminator (default ',')\n"
" -t, --type=TYPE record set to convert to csv; if this "
@@ -1075,21 +1104,21 @@ msgid ""
"fields.\n"
msgstr ""
-#: utils/rec2csv.c:146
+#: utils/rec2csv.c:121
msgid "only one list of fields can be specified as a sorting criteria.\n"
msgstr ""
-#: utils/rec2csv.c:153
+#: utils/rec2csv.c:126
msgid "invalid field name list in -S.\n"
msgstr ""
-#: utils/rec2csv.c:159 utils/recsel.c:249 utils/recsel.c:287
+#: utils/rec2csv.c:130 utils/recsel.c:221 utils/recsel.c:245
msgid "internal error creating fex.\n"
msgstr ""
#. TRANSLATORS: --help output, recdel synopsis.
#. no-wrap
-#: utils/recdel.c:90
+#: utils/recdel.c:78
#, c-format
msgid ""
"Usage: recdel [OPTIONS]... [-t TYPE] [-n NUM | -e RECORD_EXPR | -q STR | -m "
@@ -1098,13 +1127,13 @@ msgstr ""
#. TRANSLATORS: --help output, recdel short description.
#. no-wrap
-#: utils/recdel.c:95
+#: utils/recdel.c:83
msgid "Remove (or comment out) records from a rec file.\n"
msgstr ""
#. TRANSLATORS: --help output, recdel arguments.
#. no-wrap
-#: utils/recdel.c:102
+#: utils/recdel.c:90
msgid ""
" -c, --comment comment out the matching records "
"instead of\n"
@@ -1125,51 +1154,51 @@ msgstr ""
#. no-wrap
#. TRANSLATORS: --help output, notes on recins.
#. no-wrap
-#: utils/recdel.c:120 utils/recfix.c:168 utils/recins.c:150
+#: utils/recdel.c:108 utils/recfix.c:149 utils/recins.c:138
msgid ""
"If no FILE is specified then the command acts like a filter, getting\n"
"the data from standard input and writing the result to standard output.\n"
msgstr ""
-#: utils/recdel.c:137
+#: utils/recdel.c:123
#, c-format
msgid "no records of type %s found.\n"
msgstr ""
-#: utils/recdel.c:228
+#: utils/recdel.c:196
#, c-format
msgid "ignoring a request to delete all records of type %s.\n"
msgstr ""
-#: utils/recdel.c:230
+#: utils/recdel.c:198
msgid "use --force if you really want to proceed, or use either -n or -e.\n"
msgstr ""
-#: utils/recdel.c:238
+#: utils/recdel.c:206
msgid "invalid selection expression.\n"
msgstr ""
-#: utils/recdel.c:277 utils/recfix.c:408 utils/recins.c:411 utils/recset.c:366
+#: utils/recdel.c:241 utils/recfix.c:344 utils/recins.c:361 utils/recset.c:312
#, c-format
msgid "file %s is not writable.\n"
msgstr ""
#. TRANSLATORS: --help output, recfix synopsis.
#. no-wrap
-#: utils/recfix.c:118
+#: utils/recfix.c:99
#, c-format
msgid "Usage: recfix [OPTION]... [OPERATION] [OP_OPTION]... [FILE]\n"
msgstr ""
#. TRANSLATORS: --help output, recfix short description.
#. no-wrap
-#: utils/recfix.c:123
+#: utils/recfix.c:104
msgid "Check and fix rec files.\n"
msgstr ""
#. TRANSLATORS: --help output, recfix global arguments.
#. no-wrap
-#: utils/recfix.c:130
+#: utils/recfix.c:111
msgid ""
" --no-external don't use external descriptors.\n"
" --force force the requested operation.\n"
@@ -1177,7 +1206,7 @@ msgstr ""
#. TRANSLATORS: --help output, recfix operations.
#. no-wrap
-#: utils/recfix.c:140
+#: utils/recfix.c:121
msgid ""
"Operations:\n"
" --check check integrity of the specified "
@@ -1190,7 +1219,7 @@ msgstr ""
#. TRANSLATORS: --help output, recfix operations related with encryption.
#. no-wrap
-#: utils/recfix.c:150
+#: utils/recfix.c:131
msgid ""
" --encrypt encrypt confidential fields in the "
"specified file.\n"
@@ -1201,99 +1230,104 @@ msgstr ""
#. TRANSLATORS: --help output, recfix encryption and decryption
#. options.
#. no-wrap
-#: utils/recfix.c:159
+#: utils/recfix.c:140
msgid ""
"De/Encryption options:\n"
" -s, --password=PASSWORD encrypt/decrypt with this password.\n"
msgstr ""
-#: utils/recfix.c:209
+#: utils/recfix.c:184
msgid "--password|-s must be used as an operation argument.\n"
msgstr ""
-#: utils/recfix.c:215
+#: utils/recfix.c:188
msgid "the specified operation does not require a password.\n"
msgstr ""
-#: utils/recfix.c:220
+#: utils/recfix.c:191
msgid "please specify just one password.\n"
msgstr ""
-#: utils/recfix.c:231 utils/recfix.c:241 utils/recfix.c:251 utils/recfix.c:262
-#: utils/recfix.c:272
+#: utils/recfix.c:198 utils/recfix.c:204 utils/recfix.c:210 utils/recfix.c:217
+#: utils/recfix.c:223
msgid "please specify just one operation.\n"
msgstr ""
-#: utils/recfix.c:464
+#: utils/recfix.c:304 utils/recfix.c:326 utils/recfix.c:365 utils/recfix.c:435
+#, c-format
+msgid "recfix: error: cannot read file %s\n"
+msgstr ""
+
+#: utils/recfix.c:399
msgid "the database contains already encrypted fields\n"
msgstr ""
-#: utils/recfix.c:465
+#: utils/recfix.c:400
msgid "please use --force or --decrypt\n"
msgstr ""
-#: utils/recfix.c:575
+#: utils/recfix.c:499
msgid "unknown operation in recfix: please report this as a bug.\n"
msgstr ""
#. TRANSLATORS: --help output, recfmt synopsis.
#. no-wrap
-#: utils/recfmt.c:79
+#: utils/recfmt.c:64
#, c-format
msgid "Usage: recfmt [OPTION]... [TEMPLATE]\n"
msgstr ""
#. TRANSLATORS: --help output, recfmt arguments.
#. no-wrap
-#: utils/recfmt.c:84
+#: utils/recfmt.c:69
msgid "Apply a template to records read from standard input.\n"
msgstr ""
#. TRANSLATORS: --help output, recfmt arguments.
#. no-wrap
-#: utils/recfmt.c:90
+#: utils/recfmt.c:75
msgid ""
" -f, --file=FILENAME read the template to apply from a "
"file.\n"
msgstr ""
-#: utils/recfmt.c:124
+#: utils/recfmt.c:107
#, c-format
msgid "can't open file %s for reading.\n"
msgstr ""
-#: utils/recfmt.c:142
+#: utils/recfmt.c:120
msgid "don't specify a template in the command line and -f at the same time.\n"
msgstr ""
-#: utils/recfmt.c:165
+#: utils/recfmt.c:142
msgid "invalid expression in a template slot.\n"
msgstr ""
-#: utils/recfmt.c:171
+#: utils/recfmt.c:146
msgid "error evaluating expression in a template slot.\n"
msgstr ""
-#: utils/recfmt.c:205
+#: utils/recfmt.c:178
msgid "recfmt_apply_template: error compiling regexp. Please report this.\n"
msgstr ""
#. TRANSLATORS: --help output, recinf synopsis.
#. no-wrap
-#: utils/recinf.c:85
+#: utils/recinf.c:77
#, c-format
msgid "Usage: recinf [OPTION]... [FILE]...\n"
msgstr ""
#. TRANSLATORS: --help output, recinf short description.
#. no-wrap
-#: utils/recinf.c:90
+#: utils/recinf.c:82
msgid "Print information about the types of records stored in the input.\n"
msgstr ""
#. TRANSLATORS: --help output, recinf arguments.
#. no-wrap
-#: utils/recinf.c:97
+#: utils/recinf.c:89
msgid ""
" -t, --type=RECORD_TYPE print information on the records having "
"the\n"
@@ -1305,21 +1339,21 @@ msgstr ""
#. TRANSLATORS: --help output, recinf special options.
#. no-wrap
-#: utils/recinf.c:110
+#: utils/recinf.c:102
msgid ""
"Special options:\n"
" -S, --print-sexps print the data in sexps instead of rec "
"format.\n"
msgstr ""
-#: utils/recinf.c:264
+#: utils/recinf.c:234
#, c-format
msgid "error: cannot read file %s\n"
msgstr ""
#. TRANSLATORS: --help output, recins synopsis.
#. no-wrap
-#: utils/recins.c:112
+#: utils/recins.c:100
#, c-format
msgid ""
"Usage: recins [OPTION]... [-t TYPE] [-n NUM | -e RECORD_EXPR | -q STR | -m "
@@ -1328,13 +1362,13 @@ msgstr ""
#. TRANSLATORS: --help output, recins short description.
#. no-wrap
-#: utils/recins.c:117
+#: utils/recins.c:105
msgid "Insert new records in a rec database.\n"
msgstr ""
#. TRANSLATORS: --help output, recins arguments.
#. no-wrap
-#: utils/recins.c:123
+#: utils/recins.c:111
msgid ""
" -f, --field=STR field name; should be followed by a -"
"v.\n"
@@ -1354,36 +1388,36 @@ msgstr ""
#. TRANSLATORS: --help output, encryption related options.
#. no-wrap
-#: utils/recins.c:137
+#: utils/recins.c:125
msgid ""
" -s, --password=STR encrypt confidential fields with the "
"given password.\n"
msgstr ""
-#: utils/recins.c:196
+#: utils/recins.c:179
msgid "a -f should be followed by a -v\n"
msgstr ""
-#: utils/recins.c:220
+#: utils/recins.c:198
msgid "a -v should be preceded by a -f\n"
msgstr ""
-#: utils/recins.c:245 utils/recsel.c:224
+#: utils/recins.c:214 utils/recsel.c:204
msgid "more than one password was specified\n"
msgstr ""
-#: utils/recins.c:259
+#: utils/recins.c:224
msgid "error while parsing the record provided by -r\n"
msgstr ""
-#: utils/recins.c:294
+#: utils/recins.c:256
#, c-format
msgid "please provide a value for the field %s\n"
msgstr ""
#. TRANSLATORS: --help output, recsel synopsis.
#. no-wrap
-#: utils/recsel.c:119
+#: utils/recsel.c:107
#, c-format
msgid ""
"Usage: recsel [OPTION]... [-t TYPE] [-j FIELD] [-n INDEXES | -e RECORD_EXPR "
@@ -1392,13 +1426,13 @@ msgstr ""
#. TRANSLATORS: --help output, recsel arguments.
#. no-wrap
-#: utils/recsel.c:124
+#: utils/recsel.c:112
msgid "Select and print rec data.\n"
msgstr ""
#. TRANSLATORS: --help output, recsel arguments.
#. no-wrap
-#: utils/recsel.c:130
+#: utils/recsel.c:118
msgid ""
" -d, --include-descriptors print record descriptors along with "
"the matched\n"
@@ -1415,13 +1449,13 @@ msgstr ""
#. TRANSLATORS: --help output, encryption related options.
#. no-wrap
-#: utils/recsel.c:142
+#: utils/recsel.c:130
msgid ""
" -s, --password=STR decrypt confidential fields with the "
"given password.\n"
msgstr ""
-#: utils/recsel.c:151
+#: utils/recsel.c:139
msgid ""
" -j, --join=FIELD perform an inner join using the "
"specified field.\n"
@@ -1429,7 +1463,7 @@ msgstr ""
#. TRANSLATORS: --help output, recsel output options.
#. no-wrap
-#: utils/recsel.c:158
+#: utils/recsel.c:146
msgid ""
"Output options:\n"
" -p, --print=FIELDS comma-separated list of fields to "
@@ -1448,83 +1482,83 @@ msgstr ""
#. TRANSLATORS: --help output, recsel special options.
#. no-wrap
-#: utils/recsel.c:172
+#: utils/recsel.c:160
msgid ""
"Special options:\n"
" --print-sexps print the data in sexps instead of rec "
"format.\n"
msgstr ""
-#: utils/recsel.c:236
+#: utils/recsel.c:212
msgid "only one field list can be specified as a sorting criteria.\n"
msgstr ""
-#: utils/recsel.c:243
+#: utils/recsel.c:217
msgid "invalid field names in -S.\n"
msgstr ""
-#: utils/recsel.c:259
+#: utils/recsel.c:226
msgid "only one field can be specified as join criteria.\n"
msgstr ""
-#: utils/recsel.c:264
+#: utils/recsel.c:229
msgid "please specify a correct field name to -j|--join.\n"
msgstr ""
-#: utils/recsel.c:275
+#: utils/recsel.c:236
msgid "only one field list can be specified as a grouping criteria.\n"
msgstr ""
-#: utils/recsel.c:281
+#: utils/recsel.c:241
msgid "invalid field names in -G.\n"
msgstr ""
-#: utils/recsel.c:301
+#: utils/recsel.c:255
msgid "cannot specify -[pPR] and also -c.\n"
msgstr ""
-#: utils/recsel.c:318
+#: utils/recsel.c:266
#, c-format
msgid "invalid list of fields in -%c\n"
msgstr ""
-#: utils/recsel.c:326
+#: utils/recsel.c:272
msgid "internal error creating the field expression.\n"
msgstr ""
-#: utils/recsel.c:341
+#: utils/recsel.c:284
#, c-format
msgid "invalid aggregate function '%s'\n"
msgstr ""
-#: utils/recsel.c:359
+#: utils/recsel.c:296
msgid "cannot specify -c and also -p.\n"
msgstr ""
-#: utils/recsel.c:378
+#: utils/recsel.c:309
msgid "joins can only be used when a named record set is selected.\n"
msgstr ""
-#: utils/recsel.c:440
+#: utils/recsel.c:363
msgid "several record types found. Please use -t to specify one.\n"
msgstr ""
#. TRANSLATORS: --help output, recset synopsis.
#. no-wrap
-#: utils/recset.c:114
+#: utils/recset.c:99
#, c-format
msgid "Usage: recset [OPTION]... [FILE]...\n"
msgstr ""
#. TRANSLATORS: --help output, recset short description.
#. no-wrap
-#: utils/recset.c:119
+#: utils/recset.c:104
msgid "Alter or delete fields in records.\n"
msgstr ""
#. TRANSLATORS: --help output, recset options.
#. no-wrap
-#: utils/recset.c:125
+#: utils/recset.c:110
msgid ""
" --no-external don't use external descriptors.\n"
" --force alter the records even if violating "
@@ -1534,7 +1568,7 @@ msgstr ""
#. TRANSLATORS: --help output, recset field selection options.
#. no-wrap
-#: utils/recset.c:138
+#: utils/recset.c:123
msgid ""
"Field selection options:\n"
" -f, --fields=FIELDS comma-separated list of field names "
@@ -1544,7 +1578,7 @@ msgstr ""
#. TRANSLATORS: --help output, recset actions.
#. no-wrap
-#: utils/recset.c:146
+#: utils/recset.c:131
msgid ""
"Actions:\n"
" -s, --set=VALUE change the value of the selected "
@@ -1564,39 +1598,39 @@ msgid ""
" -c, --comment comment out the selected fields.\n"
msgstr ""
-#: utils/recset.c:169
+#: utils/recset.c:154
msgid "please specify some field with -f.\n"
msgstr ""
-#: utils/recset.c:174
+#: utils/recset.c:159
msgid "please specify just one action.\n"
msgstr ""
-#: utils/recset.c:214
+#: utils/recset.c:193
msgid "invalid field expression in -f.\n"
msgstr ""
-#: utils/recset.c:222
+#: utils/recset.c:199
msgid "creating the field expression.\n"
msgstr ""
-#: utils/recset.c:244
+#: utils/recset.c:214
msgid ""
"the rename operation requires just one field with an optional subscript.\n"
msgstr ""
-#: utils/recutl.c:133
+#: utils/recutl.c:123
#, c-format
msgid "%s home page: <http://www.gnu.org/software/recutils/>\n"
msgstr ""
-#: utils/recutl.c:136
+#: utils/recutl.c:126
msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
msgstr ""
#. TRANSLATORS: --help output, common arguments.
#. no-wrap
-#: utils/recutl.c:145
+#: utils/recutl.c:135
msgid ""
" --help print a help message and exit.\n"
" --version show version and exit.\n"
@@ -1604,7 +1638,7 @@ msgstr ""
#. TRANSLATORS: --help output, record selection arguments
#. no-wrap
-#: utils/recutl.c:156
+#: utils/recutl.c:146
msgid ""
"Record selection options:\n"
" -i, --case-insensitive make strings case-insensitive in "
@@ -1621,7 +1655,7 @@ msgid ""
"records.\n"
msgstr ""
-#: utils/recutl.c:181
+#: utils/recutl.c:171
#, c-format
msgid ""
"Copyright (C) %s Jose E. Marchesi.\n"
@@ -1631,94 +1665,94 @@ msgid ""
"There is NO WARRANTY, to the extent permitted by law.\n"
msgstr ""
-#: utils/recutl.c:187
+#: utils/recutl.c:177
msgid ""
"\n"
"Written by Jose E. Marchesi."
msgstr ""
-#: utils/recutl.c:199 utils/recutl.c:219
+#: utils/recutl.c:189 utils/recutl.c:209
msgid ": error: "
msgstr ""
-#: utils/recutl.c:231
+#: utils/recutl.c:221
msgid ": warning: "
msgstr ""
-#: utils/recutl.c:256
+#: utils/recutl.c:246
#, c-format
msgid "duplicated record set '%s' from %s.\n"
msgstr ""
-#: utils/recutl.c:419
+#: utils/recutl.c:401
msgid "cannot create a unique name.\n"
msgstr ""
-#: utils/recutl.c:441
+#: utils/recutl.c:421
#, c-format
msgid "renaming file %s to %s\n"
msgstr ""
-#: utils/recutl.c:485
+#: utils/recutl.c:463
msgid "operation aborted due to integrity failures.\n"
msgstr ""
-#: utils/recutl.c:486
+#: utils/recutl.c:464
msgid "use --verbose to get a detailed report.\n"
msgstr ""
-#: utils/recutl.c:493
+#: utils/recutl.c:471
msgid "use --force to skip the integrity check.\n"
msgstr ""
-#: utils/recutl.c:554
+#: utils/recutl.c:529
msgid "internal error: recutl_index_list_parse: error compiling regexp.\n"
msgstr ""
-#: utils/recutl.c:629
+#: utils/recutl.c:596
msgid "Password: "
msgstr ""
-#: utils/recutl.c:635
+#: utils/recutl.c:602
msgid "Password again: "
msgstr ""
-#: utils/recutl.c:640
+#: utils/recutl.c:607
msgid "the provided passwords don't match.\n"
msgstr ""
-#: utils/recutl.h:98 utils/recutl.h:187 utils/recutl.h:191
+#: utils/recutl.h:84 utils/recutl.h:131 utils/recutl.h:133
msgid "cannot specify -e and also -n\n"
msgstr ""
-#: utils/recutl.h:103
+#: utils/recutl.h:86
msgid "cannot specify -e and also -q\n"
msgstr ""
-#: utils/recutl.h:114
+#: utils/recutl.h:94
msgid "invalid selection expression\n"
msgstr ""
-#: utils/recutl.h:126
+#: utils/recutl.h:100
msgid "cannot specify -n and also -e\n"
msgstr ""
-#: utils/recutl.h:131
+#: utils/recutl.h:102
msgid "cannot specify -n and also -q\n"
msgstr ""
-#: utils/recutl.h:141
+#: utils/recutl.h:106
msgid "invalid list of indexes in -n\n"
msgstr ""
-#: utils/recutl.h:151
+#: utils/recutl.h:111
msgid "cannot specify -m and also -e\n"
msgstr ""
-#: utils/recutl.h:156
+#: utils/recutl.h:113
msgid "cannot specify -m and also -q\n"
msgstr ""
-#: utils/recutl.h:161
+#: utils/recutl.h:115
msgid "cannot specify -m and also -n\n"
msgstr ""
--
2.25.0.2.g232378479e
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [COMMITTED] rec-mode.el, ob-rec.el and rec-mode.texi are now maintained elsewhere,
Jose E. Marchesi <=