diff --git a/Makefile b/Makefile
index 3d67ee1602a37032c270908f4de074cf9302071e..8a344efa9c03895096fba0097b29b93755b728f8 100644
--- a/Makefile
+++ b/Makefile
@@ -4,4 +4,8 @@ compile:
 	emacs -Q --batch -l zero-reload-all.el -f zero-rebuild -l zero-table.el -f ert-run-tests-batch
 zip:
 	git archive -o zero-el-$(VERSION).zip --prefix=zero/ HEAD
-.PHONY: zip compile
+pkg:
+	echo "Creating tar for package.el distribution..."
+	git archive -o zero-$(VERSION).tar --prefix=zero/$(VERSION) HEAD
+	echo "Done"
+.PHONY: compile zip pkg
diff --git a/operational b/operational
index 35813a9d3e8810ba150f5ab0fee2314aef42004d..080e52dcf177f7f4808483487403d9a0590144a1 100644
--- a/operational
+++ b/operational
@@ -1,6 +1,6 @@
 * COMMENT -*- mode: org -*-
 #+Date: 2019-10-08
-Time-stamp: <2019-10-08>
+Time-stamp: <2019-10-10>
 #+STARTUP: content
 * notes                                                               :entry:
 ** 2019-04-01 zero-framework.el a Chinese IM framework in emacs; FSM	:doc:
@@ -80,6 +80,59 @@ cd ~/lisp/elisp/zero/
 * later                                                               :entry:
 * current                                                             :entry:
 ** 
+** 2019-10-09 release zero-el on melpa
+melpa/CONTRIBUTING.org at master · melpa/melpa · GitHub
+https://github.com/melpa/melpa/blob/master/CONTRIBUTING.org
+
+Making your package ready for inclusion
+https://github.com/melpa/melpa/blob/master/CONTRIBUTING.org#making-your-package-ready-for-inclusion
+
+Packaging Basics - GNU Emacs Lisp Reference Manual
+https://www.gnu.org/software/emacs/manual/html_node/elisp/Packaging-Basics.html#Packaging-Basics
+
+name: zero
+version: 1.2.2
+brief: a Chinese input method framework
+long: zero is a Chinese input method framework for Emacs, implemented
+as an Emacs minor mode. A zero-pinyin input method is included with zero
+distribution.
+dependencies: s
+
+progress:
+Preparing a pull request to MELPA
+https://github.com/melpa/melpa/blob/master/CONTRIBUTING.org#preparing-a-pull-request-to-melpa
+
+- problems
+  - should I create two pkg, one for zero-framework and one for zero-pinyin?
+    does melpa require two repo for this?
+  - minimum s version?
+    I only use s-contains-p s-join.
+    checked github
+    tag 1.2.0 already include these functions.
+    https://github.com/magnars/s.el/blob/1.2.0/s.el
+  - TODO Note that there is no way to control the order in which files are
+    byte-compiled.
+  - how to add autoload magic comments?
+
+    https://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html
+
+    A magic autoload comment (often called an autoload cookie) consists of
+    ‘;;;###autoload’, on a line by itself, just before the real definition of
+    the function in its autoloadable source file.
+
+    add this for some user commands.
+    zero-set-im
+    zero-set-default-im
+    zero-on
+    zero-toggle
+  - run package-lint
+  - Prefix function names with #’ (i.e., the special form function) instead of
+    just ’ (i.e., the special form quote) to tell the compiler this is a
+    function reference. E.g., (seq-filter #'evenp list).
+
+    I don't think this is necessary in my code.
+  - 
+
 * done                                                                :entry:
 ** 2019-10-08 support full-width characters and symbols.
 全角 半角
diff --git a/zero-framework.el b/zero-framework.el
index 73d03c6dc0a63f34b7d70c47e623662e0135a1f7..141f01d5d7b28c30cedacd0fa0a2967b1d00e05d 100644
--- a/zero-framework.el
+++ b/zero-framework.el
@@ -1,5 +1,4 @@
-;;; -*- lexical-binding: t -*-
-;;; zero-framework.el --- zero Chinese input method framework
+;;; zero-framework.el --- Zero Chinese input method framework -*- lexical-binding: t -*-
 
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.
@@ -139,8 +138,8 @@ If item is not in lst, return nil."
 ;;=====================
 
 ;; zero-el version
-(defvar zero-version nil "zero-el package version.")
-(setq zero-version "1.2.2")
+(defvar zero-version nil "Zero-el package version.")
+(setq zero-version "1.2.3")
 
 ;; FSM state
 (defconst *zero-state-im-off* 'IM-OFF)
@@ -774,6 +773,7 @@ LEVEL the level to set to."
 	(zero-cycle-list zero-punctuation-levels zero-punctuation-level))
   (message "punctuation level set to %s" zero-punctuation-level))
 
+;;;###autoload
 (defun zero-set-im (im-name)
   "Select zero input method for current buffer.
 
@@ -835,12 +835,14 @@ if IM-NAME is nil, use default empty input method"
     (setq zero-preedit-start-func nil)
     (setq zero-preedit-end-func nil)))
 
+;;;###autoload
 (defun zero-set-default-im (im-name)
   "Set given IM-NAME as default zero input method."
   (unless (symbolp im-name)
     (signal 'wrong-type-argument (list 'symbolp im-name)))
   (setq-default zero-im im-name))
 
+;;;###autoload
 (defun zero-on ()
   "Turn on `zero-mode'."
   (interactive)
@@ -857,6 +859,7 @@ if IM-NAME is nil, use default empty input method"
   (zero-reset)
   (zero-set-state *zero-state-im-off*))
 
+;;;###autoload
 (defun zero-toggle ()
   "Toggle `zero-mode'."
   (interactive)
diff --git a/zero-panel.el b/zero-panel.el
index f4b399103ac400eecbdc867448bf77b314f118dd..a0bb6bc2e20dcb958babe1432a192916fe386ea2 100644
--- a/zero-panel.el
+++ b/zero-panel.el
@@ -1,5 +1,4 @@
-;;; -*- lexical-binding: t -*-
-;;; zero-panel --- provide emacs interface for zero-panel dbus service.
+;;; zero-panel --- Provide emacs interface for zero-panel dbus service. -*- lexical-binding: t -*-
 
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.
@@ -31,7 +30,7 @@ EVENT and ERROR are error-handler arguments."
   (when (or (string-equal "com.emacsos.zero.Panel"
 			  (dbus-event-interface-name event))
 	    (s-contains-p "com.emacsos.zero.Panel" (cadr error)))
-    (error "zero-panel dbus failed: %S" (cadr error))))
+    (error "Zero-panel dbus failed: %S" (cadr error))))
 
 (add-hook 'dbus-event-error-functions 'zero-panel-error-handler)
 
diff --git a/zero-pinyin-service.el b/zero-pinyin-service.el
index 8b1189ea8ed6ed3657753926a83396e0218c5e11..caeba8bfd12ef9d44f2250eb16a591dd3b6fbe07 100644
--- a/zero-pinyin-service.el
+++ b/zero-pinyin-service.el
@@ -1,5 +1,4 @@
-;;; -*- lexical-binding: t -*-
-;;; zero-pinyin-service.el --- provide emacs interface for zero-pinyin-service dbus service.
+;;; zero-pinyin-service.el --- Provide emacs interface for zero-pinyin-service dbus service. -*- lexical-binding: t -*-
 
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.
@@ -22,13 +21,14 @@
 ;;================
 
 (require 'dbus)
+(require 's)
 
 (defun zero-pinyin-service-error-handler (event error)
   "Handle dbus errors."
   (when (or (string-equal "com.emacsos.zero.ZeroPinyinService1"
 			  (dbus-event-interface-name event))
 	    (s-contains-p "com.emacsos.zero.ZeroPinyinService1" (cadr error)))
-    (error "zero-pinyin-service dbus failed: %S" (cadr error))))
+    (error "`zero-pinyin-service' dbus failed: %S" (cadr error))))
 
 (add-hook 'dbus-event-error-functions 'zero-pinyin-service-error-handler)
 
@@ -92,7 +92,7 @@ GET-CANDIDATES-COMPLETE the async handler function."
 			  (:struct :int32 7 :int32 55)))))
 
 (defun zero-pinyin-service-commit-candidate-async (candidate candidate_pinyin_indices)
-  "Commit CANDIDATE asynchronously."
+  "Commit candidate asynchronously."
   ;; don't care about the result, so no callback.
   (zero-pinyin-service-async-call
    "CommitCandidate" nil
diff --git a/zero-pinyin.el b/zero-pinyin.el
index bbea2e305a6ca39ee1487768d018516ce4655a17..f633c1493bc43425e63d76003c3d168f5b710bc7 100644
--- a/zero-pinyin.el
+++ b/zero-pinyin.el
@@ -1,5 +1,4 @@
-;;; -*- lexical-binding: t -*-
-;;; zero-pinyin.el --- a pinyin input method for zero-framework
+;;; zero-pinyin.el --- A pinyin input method for zero-framework -*- lexical-binding: t -*-
 
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.
@@ -27,7 +26,6 @@
 ;; dependencies
 ;;==============
 
-(require 's)
 (require 'zero-framework)
 (require 'zero-pinyin-service)
 
@@ -35,7 +33,7 @@
 ;; basic data and emacs facility
 ;;===============================
 
-(defvar zero-pinyin-state nil "zero-pinyin internal state. could be nil or `*zero-pinyin-state-im-partial-commit*'.")
+(defvar zero-pinyin-state nil "Zero-pinyin internal state.  could be nil or `*zero-pinyin-state-im-partial-commit*'.")
 (defconst *zero-pinyin-state-im-partial-commit* 'IM-PARTIAL-COMMIT)
 
 (defvar zero-pinyin-used-preedit-str-lengths nil
@@ -283,7 +281,7 @@ DIGIT 0 means delete 10th candidate."
   "Allow C-<digit> to DeleteCandidate in `*zero-state-im-preediting*' state."
   (interactive)
   (unless (eq zero-state *zero-state-im-preediting*)
-    (error "zero-digit-argument called in non preediting state"))
+    (error "`zero-digit-argument' called in non preediting state"))
   (if (memq 'control (event-modifiers last-command-event))
       (let* ((char (if (integerp last-command-event)
 		       last-command-event
diff --git a/zero-pkg.el b/zero-pkg.el
new file mode 100644
index 0000000000000000000000000000000000000000..dda4c6a6b7b6714a05a25ce54f3fa2a1687c566a
--- /dev/null
+++ b/zero-pkg.el
@@ -0,0 +1,31 @@
+;;; zero-pkg.el --- Zero package file -*- lexical-binding: t -*-
+
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;;     http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
+;; Version: 1.2.3
+;; Package-Version: 1.2.3
+;; URL: https://gitlab.emacsos.com/sylecn/zero-el
+
+;;; Commentary:
+
+;; defines zero package.
+
+;;; Code:
+
+(define-package "zero" "1.2.3"
+  "a Chinese input method framework"
+  '((s "1.2.0")))
+
+(provide 'zero-pkg)
+
+;;; zero-pkg.el ends here
diff --git a/zero-quickdial.el b/zero-quickdial.el
index 9bacc893863b18dc119d5b74643aec33900ba2d2..52e7669f1151611f4af88e959ecfbcf5b55655ed 100644
--- a/zero-quickdial.el
+++ b/zero-quickdial.el
@@ -1,5 +1,4 @@
-;;; -*- lexical-binding: t -*-
-;;; zero-quickdial --- quickdial input method written as an emacs minor mode.
+;;; zero-quickdial --- quickdial input method written as an emacs minor mode. -*- lexical-binding: t -*-
 
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.
diff --git a/zero-reload-all.el b/zero-reload-all.el
index 8e1465a5390adc3a8c74ffc684a9251634d32aad..50f2988e78571b5cf1bb7d099f44b4baa4b913ab 100644
--- a/zero-reload-all.el
+++ b/zero-reload-all.el
@@ -1,5 +1,4 @@
-;;; -*- no-byte-compile: t; -*-
-;;; zero-reload-all.el --- reload zero-el in correct order
+;;; zero-reload-all.el --- reload zero-el in correct order -*- no-byte-compile: t; -*-
 
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.
diff --git a/zero-table.el b/zero-table.el
index 50ad31b3b4c89720b674e91b2ccfead4ffc40a72..da94009d9dc6890ef52641aa2661b2a92be0f7b7 100644
--- a/zero-table.el
+++ b/zero-table.el
@@ -1,5 +1,4 @@
-;;; -*- no-byte-compile: t; -*-
-;;; zero-table.el --- a demo table based input method based on zero-framework.el
+;;; zero-table.el --- a demo table based input method based on zero-framework.el -*- no-byte-compile: t; lexical-binding: t -*-
 
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.
@@ -30,7 +29,6 @@
 ;; dependencies
 ;;==============
 
-(require 's)
 (require 'zero-framework)
 
 ;;===============================