如何获取日历提示并插入日期

时间:2016-11-15 15:30:13

标签: emacs elisp

我正在编写一个函数,它将两个日期作为参数。 (类似于2016-8-1)

我想从美丽的emacs日历视图中获取日期。

CORE_PEER_ADDRESS=172.17.0.2:7051 peer chaincode deploy -n mytcc -c '{"Args": ["init", "a","100", "b", "200"]}' 
-p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02

我知道在Org模式中有

(defun my-fun (date1 date2)
   (setq date1 (get-date-from-calendar))
)

但是当在elisp代码中使用时,此函数需要参数。

有什么想法吗?

2 个答案:

答案 0 :(得分:1)

如果要避免提示用户,则参数用于传递前缀选项。你可以传递nil,它应该有效(org-time-stamp nil)

答案 1 :(得分:0)

  
(defun org-read-date-example ()
  "Doc-string."
  (require 'org)
  (let ((date-in-string-format (org-read-date nil nil nil "Date #1:  "))
        (date-in-time-format (org-read-date nil 'to-time nil "Date #2:  ")))
    (message "Date #1: %s | Date #2: %s" date-in-string-format date-in-time-format)))
相关问题