diffstat for ddskk-16.2 ddskk-16.2 changelog | 7 ++++ patches/020_reiwa.patch | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ patches/series | 1 3 files changed, 89 insertions(+) diff -Nru ddskk-16.2/debian/changelog ddskk-16.2/debian/changelog --- ddskk-16.2/debian/changelog 2019-01-10 00:38:19.000000000 +0900 +++ ddskk-16.2/debian/changelog 2019-04-12 21:18:06.000000000 +0900 @@ -1,3 +1,10 @@ +ddskk (16.2-7) unstable; urgency=medium + + * New patch 020_reiwa.patch to not fail when 令和元年 (2019/5-) + (closes: #926861) + + -- Tatsuya Kinoshita Fri, 12 Apr 2019 21:18:06 +0900 + ddskk (16.2-6) unstable; urgency=medium * New patch 010_unibyte.patch to enable M-SPC and M-Q for Emacs 26 diff -Nru ddskk-16.2/debian/patches/020_reiwa.patch ddskk-16.2/debian/patches/020_reiwa.patch --- ddskk-16.2/debian/patches/020_reiwa.patch 1970-01-01 09:00:00.000000000 +0900 +++ ddskk-16.2/debian/patches/020_reiwa.patch 2019-04-12 07:19:41.000000000 +0900 @@ -0,0 +1,81 @@ +Subject: Don't fail when 令和元年 (2019/5-) +Author: Tatsuya Kinoshita +Bug: https://github.com/skk-dev/ddskk/pull/70 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926861 + + Add Japan's new era 令和 (Reiwa), and prevent an error when 元年 + for skk-default-current-date. + +diff --git a/skk-gadget.el b/skk-gadget.el +index 9bd407ee..7584f979 100644 +--- a/skk-gadget.el ++++ b/skk-gadget.el +@@ -169,13 +169,17 @@ AND-TIME $B$O;~9o$bI=<($9$k$+$I$&$+(B \(boolean\)$B!#(B" + (multiple-value-bind (year month day day-of-week hour minute second v) + date-information + (when gengo +- (setq v (skk-ad-to-gengo-1 (string-to-number year)))) ++ (setq v (skk-ad-to-gengo-1 ++ (string-to-number year) nil ++ (string-to-number (nth 0 (cdr (assoc month skk-month-alist))))))) + (setq year (if gengo + (concat (if gengo-index + (nth gengo-index (car v)) + (caar v)) +- (skk-num-exp (number-to-string (cdr v)) +- num-type)) ++ (if (numberp (cdr v)) ++ (skk-num-exp (number-to-string (cdr v)) ++ num-type) ++ (cdr v))) + (skk-num-exp year num-type))) + (when month-alist-index + (setq month (skk-num-exp (nth month-alist-index +@@ -351,7 +355,7 @@ interactive $B$K5/F0$9$kB>!"(B\"clock /(skk-clock)/\" $B$J$I$N%(%s%H%j$r(B S + tail))) + + ;;;###autoload +-(defun skk-ad-to-gengo-1 (ad &optional not-gannen) ++(defun skk-ad-to-gengo-1 (ad &optional not-gannen month) + ;; AD is a number and NOT-GANNEN is a boolean optional + ;; arg. + ;; return a cons cell of which car is a Gengo list +@@ -370,9 +374,12 @@ interactive $B$K5/F0$9$kB>!"(B\"clock /(skk-clock)/\" $B$J$I$N%(%s%H%j$r(B S + ((>= 1988 ad) + (setq ad (- ad 1925)) + (cdr (assq 'showa skk-gengo-alist))) +- (t ++ ((or (< ad 2019) (and (= ad 2019) month (< month 5))) + (setq ad (- ad 1988)) +- (cdr (assq 'heisei skk-gengo-alist)))) ++ (cdr (assq 'heisei skk-gengo-alist))) ++ (t ++ (setq ad (- ad 2018)) ++ (cdr (assq 'reiwa skk-gengo-alist)))) + (cond (not-gannen ad) + ((= ad 1) "$B85(B") + (t ad)))) +@@ -404,6 +411,8 @@ interactive $B$K5/F0$9$kB>!"(B\"clock /(skk-clock)/\" $B$J$I$N%(%s%H%j$r(B S + ((eq number 0) + (skk-error "0 $BG/$O$"$jF@$J$$(B" + "Cannot convert 0 year")) ++ ((member gengo '("$B$l$$$o(B" "$BNaOB(B")) ++ 2018) + ((member gengo '("$B$X$$$;$$(B" "$BJ?@.(B")) + 1988) + ((member gengo '("$B$7$g$&$o(B" "$B>