summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2023-11-05 08:49:03 -0500
committerSacha Chua <sacha@sachachua.com>2023-11-05 08:49:03 -0500
commite2c70a999ecebdcbfddd7b531ccfb9c6a7213158 (patch)
treea396aac642f07d9cf60f78a71a7bf9bc0582d9ee
parent40fc91c9a20284bafa0b53659571f8f85a367fb1 (diff)
downloademacsconf-el-e2c70a999ecebdcbfddd7b531ccfb9c6a7213158.tar.xz
emacsconf-el-e2c70a999ecebdcbfddd7b531ccfb9c6a7213158.zip
subed: add autoload cookie, make split keymap modifiable
-rw-r--r--emacsconf-subed.el38
1 files 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 "<down>") #'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 "<down>") #'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."