Memoranda Personalia

No memo on Monday, 8th of May 2000

Tuesday, 8th of May 2001

No memo on Wednesday, 8th of May 2002

Thursday, 8th of May 2003

Saturday, 8th of May 2004

Sunday, 8th of May 2005

Monday, 8th of May 2006

Tuesday, 8th of May 2007

Thursday, 8th of May 2008

Friday, 8th of May 2009

Saturday, 8th of May 2010

Sunday, 8th of May 2011

Tuesday, 8th of May 2012

No memo on Wednesday, 8th of May 2013

Thursday, 8th of May 2014

Friday, 8th of May 2015

Sunday, 8th of May 2016

Monday, 8th of May 2017

Tuesday, 8th of May 2018

Wednesday, 8th of May 2019

Friday, 8th of May 2020

Saturday, 8th of May 2021

Sunday, 8th of May 2022

Monday, 8th of May 2023

ソースコードもきれいに書ける。

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; make_my_memo_org_file
;;
(bind-key* "C-c C-," 'make_my_memo_org_file)
(defun make_my_memo_org_file (arg)
  "mode for memoranda personalia"
  (interactive "P")
  (setq delay_hours 3)                  ; count as the same day until 'delay_hours' hours past midnight
  (if (not arg) (setq arg 0))
  (setq filename
        (format "~/Dropbox/memo-local/memo%s.org"
                (format-time-string "%Y%m%d"
                                    (time-add (current-time)
                                              (- (* arg 60 60 24) (* 60 60 delay_hours))
                                              )
                                    )
                )
        )
  (find-file filename)
  (when (file-exists-p filename)
    (end-of-buffer)
    (insert (format-time-string "# OPENED: %Y-%m-%d %H:%M:%S\n"))
    )
  (unless (file-exists-p filename)
    (insert "# THIS FILE IS " filename "\n")
    (insert (format-time-string "# MADE at %Y-%m-%d %H:%M:%S\n"))    
    (insert "\n- ")
    )
  )
(defun my_close_org_memo()
  "insert time-stamp, export only body to html, and upload html file."
  (interactive)
  (setq html_file_name (concat (file-name-sans-extension (buffer-file-name)) ".html"))
  (end-of-buffer)
  (insert (format-time-string "# EXPORTED at %Y-%m-%d %H:%M:%S\n"))
  (org-html-export-to-html nil nil t t)
  (shell-command-to-string
   (mapconcat #'shell-quote-argument
              (list "rsync" "-auv" html_file_name "myusername@mydomain.ne.jp:www/")
              " ")
   )
  )

Wednesday, 8th of May 2024