Merge branch 'maint'

This commit is contained in:
Kyle Meyer 2021-01-24 22:17:01 -05:00
commit 72e368a2e9
6 changed files with 52 additions and 15 deletions

View File

@ -6053,15 +6053,17 @@ various inputs are interpreted, the items filled in by Org mode are in
| =2012-w04-5= | \rArr{} Same as above |
Furthermore you can specify a relative date by giving, as the /first/
thing in the input: a plus/minus sign, a number and a letter---=d=,
=w=, =m= or =y=---to indicate change in days, weeks, months, or
years. With a single plus or minus, the date is always relative to
today. With a double plus or minus, it is relative to the default
date. If instead of a single letter, you use the abbreviation of day
name, the date is the Nth such day, e.g.:
thing in the input: a plus/minus sign, a number and a letter---=h=,
=d=, =w=, =m= or =y=---to indicate a change in hours, days, weeks,
months, or years. With =h= the date is relative to the current time,
with the other letters and a single plus or minus, the date is
relative to today at 00:00. With a double plus or minus, it is
relative to the default date. If instead of a single letter, you use
the abbreviation of day name, the date is the Nth such day, e.g.:
| =+0= | \rArr{} today |
| =.= | \rArr{} today |
| =+2h= | \rArr{} two hours from now |
| =+4d= | \rArr{} four days from today |
| =+4= | \rArr{} same as +4d |
| =+2w= | \rArr{} two weeks from today |

View File

@ -426,7 +426,12 @@ of the same value."
into a column number."
(pcase org-babel-c-variant
((or `c `cpp)
"int get_column_num (int nbcols, const char** header, const char* column)
(concat
(if (eq org-babel-c-variant 'c)
"extern "
"extern \"C\" ")
"int strcmp (const char *, const char *);
int get_column_num (int nbcols, const char** header, const char* column)
{
int c;
for (c=0; c<nbcols; c++)
@ -434,7 +439,7 @@ into a column number."
return c;
return -1;
}
")
"))
(`d
"int get_column_num (string[] header, string column)
{

View File

@ -1228,10 +1228,11 @@ Return 0. if S is not recognized as a valid value."
((string= s "<tomorrow>") (+ 86400.0 today))
((string= s "<yesterday>") (- today 86400.0))
((string-match "\\`<\\([-+][0-9]+\\)\\([hdwmy]\\)>\\'" s)
(+ today
(+ (if (string= (match-string 2 s) "h") (float-time) today)
(* (string-to-number (match-string 1 s))
(cdr (assoc (match-string 2 s)
'(("d" . 86400.0) ("w" . 604800.0)
'(("h" . 3600.0)
("d" . 86400.0) ("w" . 604800.0)
("m" . 2678400.0) ("y" . 31557600.0)))))))
((string-match org-ts-regexp0 s) (org-2ft s))
(t 0.)))))

View File

@ -3666,12 +3666,12 @@ produced."
(match-string 0)))
"pdflatex"))
(process (if (functionp org-latex-pdf-process) org-latex-pdf-process
;; Replace "%latex" and "%bibtex" with,
;; respectively, "%L" and "%B" so as to adhere to
;; `format-spec' specifications.
;; Replace "%latex" with "%L" and "%bib" and
;; "%bibtex" with "%B" to adhere to `format-spec'
;; specifications.
(mapcar (lambda (command)
(replace-regexp-in-string
"%\\(?:bib\\|la\\)tex\\>"
"%\\(?:\\(?:bib\\|la\\)tex\\|bib\\)\\>"
(lambda (m) (upcase (substring m 0 2)))
command))
org-latex-pdf-process)))

View File

@ -159,6 +159,6 @@ void main()
writef ("%s ", tinomogen[i][j]);
writeln();
}
writefln ("Friday %s\n", tinomogen_h(4,"day"));
writefln ("Friday %s", tinomogen_h(4,"day"));
}
#+end_src

View File

@ -103,5 +103,34 @@
(org-test-with-temp-text "xx abc<point> xx"
(org-in-regexp "abc" nil t))))
;;; Time
(ert-deftest test-org-matcher-time ()
"Test `org-matcher-time'."
(let ((system-time-locale "en_US"))
(org-test-at-time "<2021-01-11 Mon 13:00>"
(should (equal (list 0 0 13 11 1 2021)
(butlast (org-decode-time (org-matcher-time "<now>"))
3)))
(should (equal (list 0 0 0 14 1 2021)
(butlast (org-decode-time (org-matcher-time "<+3d>"))
3)))
(should (equal (list 0 0 0 9 1 2021)
(butlast (org-decode-time (org-matcher-time "<-2d>"))
3)))
(should (equal (list 0 0 0 18 1 2021)
(butlast (org-decode-time (org-matcher-time "<+1w>"))
3)))
(should (equal (list 0 0 17 11 1 2021)
(butlast (org-decode-time (org-matcher-time "<+4h>"))
3)))
(should (equal (list 0 0 11 11 1 2021)
(butlast (org-decode-time (org-matcher-time "<-2h>"))
3)))
(should (equal (list 0 0 3 12 1 2021)
(butlast (org-decode-time (org-matcher-time "<+14h>"))
3))))))
(provide 'test-org-macs)
;;; test-org-macs.el ends here