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.
- Ruby 2.1 or newer
- Emacs 24 or newer
- 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.
- 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
- Clone MHC from github
$ git clone [email protected]:yoshinari-nomura/mhc.git ~/src/mhc
- 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...
- Install requied gem packages in sandbox ~/src/mhc/vendor/bundle
$ cd ~/src/mhc $ bundle install --path vendor/bundle
- 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
- Byte-compile Emacs client
$ cd emacs $ make
- 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
- Check if TODAY is good.
$ mhc scan today
You may add ~/src/mhc/bin directory to your $PATH for dogfooding
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.
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 intospool
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.
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