Skip to content

ikazuhiro/mhc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MHC – Message Harmonized Calendaring system.

DESCRIPTION

MHC is designed to help those who receive most appointments via email. Using MHC, you can easily import schedule articles from emails.

You can get the latest version from:

MHC has following features:

  • Easy import your schedule from existing buffers. For example, using with Mew/Gnus/Wanderlust (MUAs on Emacs), you can easily compose your schedule items from appoint-emails. MHC will guess the title, date, time and description by scanning the email.
  • Simple data structure allows you to manipulate stored data in many ways.
  • Appointments can be made to repeat in flexible ways.
  • powerful but simple expression of appointments.

MHC stores schedule articles in the same form of MH; you can manipulate these messages not only by above tools but also by many other MUAs, editors, UNIX commandline tools or your own scripts.

SYSTEM REQUIREMENTS

  • Ruby 2.1 or newer
  • Emacs 24 or newer

Information for Developers

INSTALL for developers:

  1. Install rbenv + ruby-build (see https://github.com/sstephenson/rbenv#basic-github-checkout for details)
    $ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
    $ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
    # Edit your shell dot files to add some path and environment variables.
        
  2. Install Latest Ruby and bundler
    # Install ruby 2.1.2
    $ rbenv install 2.1.2
    
    # Installation check
    $ rbenv global 2.1.2
    $ ruby -v # -> You will see: ruby 2.1.2...
    
    # Install bundler for your new Ruby
    $ gem install bundler
    
    # If you want to use Ruby in your sytem, say /usr/bin/ruby
    $ rbenv global system
    $ ruby -v
        
  3. Clone MHC from github
    $ git clone [email protected]:yoshinari-nomura/mhc.git ~/src/mhc
        
  4. Set default ruby version in MHC project
    $ cd ~/src/mhc
    $ echo '2.1.2' > .ruby-version
    $ ruby -v # -> You will see: ruby 2.1.2...
        
  5. Install requied gem packages in sandbox ~/src/mhc/vendor/bundle
    $ cd ~/src/mhc
    $ bundle install --path vendor/bundle
        
  6. Initialize config file and spool directory
    $ bin/mhc init ~/mhc
    
    Guessing current local timezone ...
              ok  guess timezone ... Asia/Tokyo
    Making directries under ~/mhc ...
          create  ~/mhc/draft
          create  ~/mhc/inbox
          create  ~/mhc/presets
          create  ~/mhc/spool
          create  ~/mhc/trash
          create  ~/mhc/status/cache
          create  ~/mhc/status/log
          create  ~/mhc/status/sync_channels
    Copying config file(s) into ~/.config/mhc/config.yml ...
              ok  copy ~/.config/mhc/config.yml
    Done.
    
    # Read comments in config.yml carefully
    $ vi ~/.config/mhc/config.yml
    
    # Add Japanese Holidays if needed.
    $ cp samples/japanese-holidays.mhcc ~/mhc/presets/
    
    # Add ~/src/mhc/bin directory to your $PATH for dogfooding
    $ export PATH=$HOME/src/mhc/bin:$PATH
        
  7. Byte-compile Emacs client
    $ cd emacs
    $ make
        
  8. Add setup in your .emacs.d/init.el
    (setq load-path
          (cons "~/src/mhc/emacs" load-path))
    (autoload 'mhc "mhc" "Message Harmonized Calendar system." t)
    
    ;; M-x mhc
        
  9. Check if TODAY is good.
    $ mhc scan today
        

You may add ~/src/mhc/bin directory to your $PATH for dogfooding

DIRECTORY STRUCTURE

Configuration Directory

Default configuration directory is ~/.config/mhc. If environment variable MHC_CONFIG_HOME or XDG_CONFIG_HOME is set, it is taken as $MHC_CONFIG_HOME/mhc or $XDG_CONFIG_HOME/mhc.

Configuration directory ~/.config/mhc has these stuffs:

config.yml
Configuration file (mandatory).
plugins
Your home-made Ruby functions.

See samples for details.

Spool Directory

Location of the spool directory should be set by TOPDIR: element in config.yml.

For example, if you have TOPDIR: ~/MHC entry in your config.yml, you will have these directory structure under ~/MHC:

spool/*.mhc
MHC event database. All events are flatly located in this directory in the form of {x-sc-message-id}.mhc
draft/*.mhc
Draft files of events. Opening a file in directory by Emacs, and Typing C-cC-c will move the file into spool directory. (Not implemented yet. Should be empty for now.)
inbox/*.mhc
Mainly same as spool. You will have a chance to review these events in this directory afterwards. (Not implemented yet. Should be empty for now.)
presets/*.mhcc
Database for fixed anniversary events such as birthdays or national holidays.
trash/*.mhc
Removed events from spool directory.
status/
cache/*
Cache files for speed-up. You can remove these files without any damage to MHC Database.
log/*
log files for debug. You can remove these files without any damage to MHC DB.
sync_channels/*
Sync records of MHC DB. If you remove any files under this directory, MHC Sync will be DAMAGED.

How to convert from the old MHC spool

update-uuid.sh would help you.

New format is:

  • X-SC-Record-Id is now in UUID style.
  • Each filename is in the form of {UUID}.mhc, not [0-9]+.
  • UUID in X-SC-Record-Id is same as its file’s base name.
  • All articles are flatly placed in TOP/spool/ directory.
$ ./update-uuid.sh ~/Mail/schedule ~/mhc

Converting... logfile will be in /Users/nom/mhc/update-uuid.sh34485.log

For Japanese people, character-code conversion might be needed.

$ cd ~/mhc/spool
$ find . -name '*.mhc' | xargs -n 10 nkf --overwrite

About

MHC -- Message Harmonized Calendaring system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 66.5%
  • Ruby 32.4%
  • Other 1.1%