--- a/obsolete/dict-c5-mode.el Sun Mar 01 13:25:07 2015 +0200
+++ b/obsolete/dict-c5-mode.el Thu Mar 26 01:37:32 2015 +0200
@@ -16,9 +16,6 @@
;;; Code:
-(defvar dict-c5-mode-map (make-sparse-keymap))
-;; (define-key dict-c5-mode-map (kbd "RET") 'my-xxx)
-
(defvar dict-c5-font-lock-keywords
'(
("^\\(_\\{5,\\}\\)\n\n\\(\\w.*\\)$"
@@ -49,6 +46,22 @@
(t nil)
))
+(defun dict-c5-new-entry ()
+ "Insert new entry template."
+ (interactive)
+ (if (re-search-forward "^_____" nil t)
+ (beginning-of-line)
+ (goto-char (point-max)))
+ (while (eq (char-before) ?\n)
+ (delete-backward-char 1))
+ (insert-char ?\n)
+ (insert-char ?_ 5)
+ (insert-char ?\n 3)
+ (backward-char))
+
+(defvar dict-c5-mode-map (make-sparse-keymap))
+(define-key dict-c5-mode-map [C-return] 'dict-c5-new-entry)
+
;;;###autoload
(define-derived-mode dict-c5-mode fundamental-mode "Dict-c5"
"Derived mode for editing C5 dictd source file."