From e2c70a999ecebdcbfddd7b531ccfb9c6a7213158 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sun, 5 Nov 2023 08:49:03 -0500 Subject: subed: add autoload cookie, make split keymap modifiable --- emacsconf-subed.el | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/emacsconf-subed.el b/emacsconf-subed.el index 70e6afc..f49b2f2 100644 --- a/emacsconf-subed.el +++ b/emacsconf-subed.el @@ -140,6 +140,7 @@ TYPE can be 'end if you want the match end instead of the beginning." (set-fill-column subtitle-text-limit) (display-fill-column-indicator-mode 1))) +;;;###autoload (defun emacsconf-subed-make-chapter-file-based-on-comments () "Create a chapter file based on NOTE comments." (interactive) @@ -307,25 +308,28 @@ Create it if necessary." (subed-merge-with-next) (fill-paragraph)) +(defvar emacsconf-subed-split-map + (let ((map (make-sparse-keymap))) + (define-key map [down-mouse-1] #'emacsconf-subed-split-at-mouse) + (define-key map [mouse-1] #'ignore) + (define-key map [up-1] #'ignore) + (define-key map [drag-mouse-1] #'ignore) + (define-key map [mouse-movement] #'ignore) + (define-key map (kbd "") #'scroll-up) + (define-key map (kbd "M-q") #'fill-paragraph) + (define-key map (kbd "M-.") #'emacsconf-subed-merge-and-fill) + (define-key map "q" #'fill-paragraph) + (define-key map "." #'emacsconf-subed-merge-and-fill) + (define-key map "u" #'undo) + (define-key map (kbd "SPC") #'scroll-up) + map) + "Map for splitting.") + (defun emacsconf-subed-split () - "Transient map for splitting subtitles." + "Use transient map for splitting subtitles." (interactive) - (set-transient-map - (let ((map (make-sparse-keymap))) - (define-key map [down-mouse-1] #'emacsconf-subed-split-at-mouse) - (define-key map [mouse-1] #'ignore) - (define-key map [up-1] #'ignore) - (define-key map [drag-mouse-1] #'ignore) - (define-key map [mouse-movement] #'ignore) - (define-key map (kbd "") #'scroll-up) - (define-key map (kbd "M-q") #'fill-paragraph) - (define-key map (kbd "M-.") #'emacsconf-subed-merge-and-fill) - (define-key map "q" #'fill-paragraph) - (define-key map "." #'emacsconf-subed-merge-and-fill) - (define-key map "u" #'undo) - (define-key map (kbd "SPC") #'scroll-up) - map) - t)) + (set-fill-column 60) + (set-transient-map emacsconf-subed-split-map t)) (defun emacsconf-subed-intro-subtitles () "Create the introduction as subtitles." -- cgit v1.2.3