+2021-04-29 HIRAOKA Kazuyuki <khi@users.osdn.me>
+
+ * howm-mode.el (howm-mode): update define-minor-mode for emacs 28.1
+ thx > U5948U5e7eU4e43
+ https://twitter.com/U5948U5e7eU4e43/status/1387373441582387209
+ http://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=2fb271ca35ff96540c0940b0ea5281bdaac953ec
+
+ * action-lock.el (action-lock-mode): ditto.
+
+ * illusion.el (illusion-mode): ditto.
+
2021-04-28 HIRAOKA Kazuyuki <khi@users.osdn.me>
* howm-view.el (howm-view-summary-mode): add TAB and M-TAB to docstring
(defvar action-lock-switch-default '("{ }" "{*}" "{-}")) ;; any number
(defvar action-lock-date-default '("{_}" "[%Y-%m-%d %H:%M]")) ;; before after
-(easy-mmode-define-minor-mode action-lock-mode
+(define-minor-mode action-lock-mode
"With no argument, this command toggles the mode.
Non-null prefix argument turns on the mode.
Null prefix argument turns off the mode.
\\[action-lock-magic-return] Envoke the action on the field
"
- nil ;; default = off
- action-lock-lighter ;; mode-line
- `(
- (,action-lock-magic-return-key . action-lock-magic-return)
- ))
-
-;; emacs20's easy-mmode-define-minor-mode can't have body. sigh...
-(add-hook 'action-lock-mode-on-hook 'action-lock-initialize-buffer)
-(add-hook 'action-lock-mode-off-hook 'action-lock-restore-buffer)
+ :init-value nil ;; default = off
+ :lighter action-lock-lighter ;; mode-line
+ :keymap `(
+ (,action-lock-magic-return-key . action-lock-magic-return)
+ )
+ (if action-lock-mode
+ (action-lock-initialize-buffer)
+ (action-lock-restore-buffer)))
(defvar action-lock-rules nil)
(defvar action-lock-original-font-lock-keywords nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Definitions
-(easy-mmode-define-minor-mode howm-mode
+(define-minor-mode howm-mode
"With no argument, this command toggles the mode.
Non-null prefix argument turns on the mode.
Null prefix argument turns off the mode.
\\[howm-create-interactively] Create new file interactively (not recommended)
\\[howm-random-walk] Browse random entries automtically
"
- nil ;; default = off
- howm-lighter ;; mode-line
- (mapcar (lambda (entry)
- (let ((k (car entry))
- (f (cadr entry)))
- (cons (concat howm-prefix k) f)))
- howm-default-key-table)
- )
-
-;; emacs20's easy-mmode-define-minor-mode can't have body. sigh...
-(add-hook 'howm-mode-on-hook 'howm-initialize-buffer)
-(add-hook 'howm-mode-off-hook 'howm-restore-buffer)
+ :init-value nil ;; default = off
+ :lighter howm-lighter ;; mode-line
+ :keymap (mapcar (lambda (entry)
+ (let ((k (car entry))
+ (f (cadr entry)))
+ (cons (concat howm-prefix k) f)))
+ howm-default-key-table)
+ (if howm-mode
+ (howm-initialize-buffer)
+ (howm-restore-buffer)))
(defun howm-set-keymap ()
(mapc (lambda (entry)
(goto-char (point-min))
(set-buffer-modified-p nil))
-(easy-mmode-define-minor-mode illusion-mode
+(define-minor-mode illusion-mode
"With no argument, this command toggles the mode.
Non-null prefix argument turns on the mode.
Null prefix argument turns off the mode.
--- -------
\\[illusion-submit] Submit changes
"
- nil ;; default = off
- illusion-lighter ;; mode-line
- `(
- (,illusion-submit-key . illusion-submit)
- )
+ :init-value nil ;; default = off
+ :lighter illusion-lighter ;; mode-line
+ :keymap `(
+ (,illusion-submit-key . illusion-submit)
+ )
+ (use-local-map illusion-mode-map)
)
-;; emacs20's easy-mmode-define-minor-mode can't have body. sigh...
-(add-hook 'illusion-mode-on-hook
- (lambda () (use-local-map illusion-mode-map)))
-
;;; Example
;; M-x yarot13-find-file to open rot13ed file.