;;; howm-common.el --- Wiki-like note-taking tool
-;;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2016
-;;; HIRAOKA Kazuyuki <khi@users.sourceforge.jp>
-;;; $Id: howm-common.el,v 1.90 2012-12-29 08:57:18 hira Exp $
+;;; Copyright (C) 2002, 2003, 2004, 2005-2021
+;;; HIRAOKA Kazuyuki <khi@users.osdn.me>
;;;
;;; 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
(defun howm-time-difference-second (ti1 ti0)
(let ((h (- (car ti1) (car ti0)))
(l (- (cadr ti1) (cadr ti0)))
- (m (- (cl-caddr ti1) (cl-caddr ti0)))
+ (m (- (or (cl-caddr ti1) 0) (or (cl-caddr ti0) 0)))
)
(+ (* h 65536) l
(* m 1e-6)
(apply #'message `(,str ,@args))))
(defun howm-decode-time (&optional specified-time)
- "Decode SPECIFIED-TIME and remove DOW, DST, ZONE.
+ "Decode SPECIFIED-TIME and remove DOW, DST, ZONE, SUBSEC.
When we do something like (encode-time (decode-time)), we use this function
instead of the original `decode-time', so that we can force
current timezone rule uniformly to avoid inconsistency."
- (butlast (decode-time specified-time) 3))
+ (howm-first-n (decode-time specified-time) 6))
(defmacro howm-with-need (&rest body)
"Execute BODY where (need xxx) exits from this form if xxx is nil."
"List of arguments for last `howm-call-process'.
This variable exists only for debug. You can reproduce the last call
with the below code.
- (apply #'howm-call-process howm-call-process-last-command)")
+ (apply (function howm-call-process) howm-call-process-last-command)")
(defmacro howm-with-coding-system (coding-system &rest body)
"With CODING-SYSTEM, execute BODY.