Commit d71546e6 authored by Yuanle Song's avatar Yuanle Song
Browse files

v1.2.4 auto update version in zero-pkg.el file;

- fix almost all checkdoc problems. the rest I don't know how to fix.
- add git pre-commit hook
parent ac77a883
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
*.zip
*.elc
*.tar
+14 −6
Original line number Diff line number Diff line
VERSION := $(shell grep 'setq zero-version' zero-framework.el | cut -d'"' -f2)

default: compile
pkg-el:
	sed "s/PKG_VERSION/$(VERSION)/g" zero-pkg.el.tpl > zero-pkg.el
compile:
	emacs -Q --batch -l zero-reload-all.el -f zero-rebuild -l zero-table.el -f ert-run-tests-batch
zip:
zip: pkg-el
	git archive -o zero-el-$(VERSION).zip --prefix=zero/ HEAD
pkg:
	echo "Creating tar for package.el distribution..."
	git archive -o zero-$(VERSION).tar --prefix=zero/$(VERSION) HEAD
	echo "Done"
.PHONY: compile zip pkg
pkg: pkg-el
# Note: install from tar is not working. install from dir does work.
	@echo "Creating tar for use with M-x package-install-file"
	git archive -o zero-$(VERSION).tar --prefix=zero-$(VERSION)/ HEAD
	@echo "Done"
install-git-hooks:
	rsync -air git-hooks/ .git/hooks/
version:
	@echo $(VERSION)
.PHONY: default pkg-el compile zip pkg install-git-hooks version

git-hooks/pre-commit

0 → 100755
+4 −0
Original line number Diff line number Diff line
#!/bin/sh
set -e
make pkg-el compile
git add zero-pkg.el
+40 −3
Original line number Diff line number Diff line
@@ -76,10 +76,14 @@ cd ~/lisp/elisp/zero/
    without converting char to string.

    (zero-table-can-start-sequence) can use this.
** 2019-10-10 documents
- Using of D-Bus
  https://www.gnu.org/software/emacs/manual/html_mono/dbus.html

* later                                                               :entry:
* current                                                             :entry:
** 
* done                                                                :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
@@ -110,8 +114,10 @@ https://github.com/melpa/melpa/blob/master/CONTRIBUTING.org#preparing-a-pull-req
    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
  - Note that there is no way to control the order in which files are
    byte-compiled.

    // seems my pkg compile just fine.
  - how to add autoload magic comments?

    https://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html
@@ -131,9 +137,40 @@ https://github.com/melpa/melpa/blob/master/CONTRIBUTING.org#preparing-a-pull-req
    function reference. E.g., (seq-filter #'evenp list).

    I don't think this is necessary in my code.
  - 
  - do I need to fix all checkdoc problems for my pkg to be accepted by melpa?
    search: melpa checkdoc one liner functions docstring

    yes. they require all checkdoc problem be fixed.
    Add recipe for a.el by dotemacs · Pull Request #4830 · melpa/melpa
    https://github.com/melpa/melpa/pull/4830

    how to specify minimum emacs version?
    ;; Package-Requires: ((emacs "24"))
  - DONE fix all checkdoc problems.
    // except for zero-mode, which I don't know how to fix. all other problems
    fixed.
    - Disambiguate zero-mode by preceding w/ function,command,variable,option
      or symbol. (C-h,f,e,n,p,q) [4 times]

      this one is really confusing.
      org-mode-map doesn't do this.
      magit-mode-map doesn't do this.
  - TODO how to add dbus as dependencies?
    some emacs build may not have dbus.
    (require 'dbus)

    also how to only allow install on linux? when I test it dbus only worked
    in linux.

    what's the correct syntax for specifying dbus as dependency?
    (dbus "1.0")
    didn't work.
  - search: package-install-file package--description-file: Wrong type argument: stringp, nil
    search: emacs package-install-file install tar package--description-file: Wrong type argument: stringp, nil

    install from dir is okay.
    install from tar is not. Not sure what's wrong.

* done                                                                :entry:
** 2019-10-08 support full-width characters and symbols.
全角 半角

+13 −7
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ If item is not in lst, return nil."

;; zero-el version
(defvar zero-version nil "Zero-el package version.")
(setq zero-version "1.2.3")
(setq zero-version "1.2.4")

;; FSM state
(defconst *zero-state-im-off* 'IM-OFF)
@@ -211,9 +211,15 @@ Otherwise, next single quote insert close quote.")

;;; concrete input method should define these functions and set them in the
;;; corresponding *-func variable.
(defun zero-build-candidates-default (_preedit-str _fetch-size) nil)
(defun zero-can-start-sequence-default (_ch) nil)
(defun zero-get-preedit-str-for-panel-default () zero-preedit-str)
(defun zero-build-candidates-default (_preedit-str _fetch-size)
  "Default implementation for `zero-build-candidates-func'."
  nil)
(defun zero-can-start-sequence-default (_ch)
  "Default implementation for `zero-can-start-sequence-func'."
  nil)
(defun zero-get-preedit-str-for-panel-default ()
  "Default implementation for `zero-get-preedit-str-for-panel-func'."
  zero-preedit-str)
(defvar zero-build-candidates-func 'zero-build-candidates-default
  "Contains a function to build candidates from preedit-str.  The function accepts param preedit-str, fetch-size, returns candidate list.")
(defvar zero-build-candidates-async-func 'zero-build-candidates-async-default
@@ -611,13 +617,13 @@ N is the argument passed to `self-insert-command'."
  (zero-hide-candidate-list))

(defun zero-focus-in ()
  "A hook function, run when focus in a `zero-mode' buffer."
  "A hook function, run when focus in a buffer."
  (when (eq zero-state *zero-state-im-preediting*)
    (zero-show-candidates zero-candidates)
    (zero-enter-preedit-state)))

(defun zero-focus-out ()
  "A hook function, run when focus out a `zero-mode' buffer."
  "A hook function, run when focus out a buffer."
  (when (eq zero-state *zero-state-im-preediting*)
    (zero-hide-candidate-list)
    (zero-leave-preedit-state)))
@@ -646,7 +652,7 @@ N is the argument passed to `self-insert-command'."
    (define-key map [remap self-insert-command]
      'zero-self-insert-command)
    map)
  "`zero-mode' keymap.")
  "Keymap for `zero-mode'.")

(defun zero-enable-preediting-map ()
  "Enable preediting keymap in `zero-mode-map'."
Loading