[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed 31556c6 372/389: Add functions for bold and italic a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed 31556c6 372/389: Add functions for bold and italic and change keybindings |
Date: |
Fri, 3 Dec 2021 11:01:01 -0500 (EST) |
branch: elpa/subed
commit 31556c63a758f59f21b50f5240aec9af01dae832
Author: Marcin Borkowski <mbork@mbork.pl>
Commit: Marcin Borkowski <mbork@mbork.pl>
Add functions for bold and italic and change keybindings
---
subed/subed-common.el | 15 +++++++++++----
subed/subed-config.el | 5 -----
subed/subed.el | 7 +++++--
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/subed/subed-common.el b/subed/subed-common.el
index bc74217..91a9cdd 100644
--- a/subed/subed-common.el
+++ b/subed/subed-common.el
@@ -1056,14 +1056,21 @@ attribute(s)."
(when attributes (insert-before-markers " " attributes))
(insert-before-markers ">")))
-(defun subed-insert-default-html-tag (begin end)
- "Insert a pair of default tags at point or around the region.
-See `subed-insert-html-tag' and `subed-default-html-tag'."
+(defun subed-insert-html-tag-italic (begin end)
+ "Insert a pair of <i> tags at point or around the region."
(interactive (let* ((region-p (use-region-p))
(begin (if region-p (region-beginning) (point)))
(end (if region-p (region-end) (point))))
(list begin end)))
- (subed-insert-html-tag begin end subed-default-html-tag))
+ (subed-insert-html-tag begin end "i"))
+
+(defun subed-insert-html-tag-bold (begin end)
+ "Insert a pair of <b> tags at point or around the region."
+ (interactive (let* ((region-p (use-region-p))
+ (begin (if region-p (region-beginning) (point)))
+ (end (if region-p (region-end) (point))))
+ (list begin end)))
+ (subed-insert-html-tag begin end "b"))
;;; Characters per second computation
diff --git a/subed/subed-config.el b/subed/subed-config.el
index 3416ee6..f2f62d8 100644
--- a/subed/subed-config.el
+++ b/subed/subed-config.el
@@ -199,11 +199,6 @@ remembers whether it was originally enabled by the user.")
:type 'file
:group 'subed)
-(defcustom subed-default-html-tag "i"
- "Default HTML-like tag."
- :type 'string
- :group 'subed)
-
(defcustom subed-mpv-arguments '("--osd-level=2" "--osd-fractions")
"Additional arguments for \"mpv\".
The options --input-ipc-server=SRTEDIT-MPV-SOCKET and --idle are
diff --git a/subed/subed.el b/subed/subed.el
index f68b54b..93fc2d2 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -71,8 +71,11 @@
(define-key subed-mode-map (kbd "C-c ]")
#'subed-copy-player-pos-to-stop-time)
(define-key subed-mode-map (kbd "C-c .")
#'subed-toggle-sync-point-to-player)
(define-key subed-mode-map (kbd "C-c ,")
#'subed-toggle-sync-player-to-point)
- (define-key subed-mode-map (kbd "C-c C-t") #'subed-insert-html-tag)
- (define-key subed-mode-map (kbd "C-c C-e") #'subed-insert-default-html-tag)
+ (define-key subed-mode-map (kbd "C-c C-t") (let ((html-tag-keymap
(make-sparse-keymap)))
+ (define-key html-tag-keymap
(kbd "C-t") #'subed-insert-html-tag)
+ (define-key html-tag-keymap
(kbd "C-i") #'subed-insert-html-tag-italic)
+ (define-key html-tag-keymap
(kbd "C-b") #'subed-insert-html-tag-bold)
+ html-tag-keymap))
subed-mode-map))
;;;###autoload
- [nongnu] elpa/subed 8263b33 360/389: subed-split-subtitle: Use offset or text fraction, (continued)
- [nongnu] elpa/subed 8263b33 360/389: subed-split-subtitle: Use offset or text fraction, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 1c52f1b 361/389: Add tests for splitting subtitles and handle more cases, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e065632 362/389: Fix previous commit for subed-set-subtitle-text, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed ec7b222 368/389: Enable CPS showing by default and improve CPS toggling functions, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f28ad22 379/389: Make subed-mpv-jump-to-current-subtitle interactive, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed c76ba50 387/389: Prompt for playback speed factor, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 9d0aa0f 388/389: Make make-subtitle a generic function, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed d0dfa1a 389/389: Preliminary support for .ass files (Advanced SubStation Alpha), ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f30780e 249/389: Default keybinding: C-M-i -> subed-insert-subtitle-adjacent, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f8793fb 330/389: Move motion hooks from subed-config.el to subed-common.el, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 31556c6 372/389: Add functions for bold and italic and change keybindings,
ELPA Syncer <=
- [nongnu] elpa/subed ba22919 289/389: Add subed-mpv-jump-to-current-subtitle, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 14ebbbb 293/389: subed-srt--subtitle-id-at-msecs: Return nil if no matching subtitle, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 2e18727 294/389: Pause video initially, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3d5902b 295/389: Reword comment, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3baf5c1 296/389: subed-mpv--client-filter: Store process mark in variable, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 08d5033 301/389: Remove unused variable subed-mode--enabled-p, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 070384b 302/389: subed--set-subtitle-loop: Don't croak on empty file, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 89df304 304/389: subed-srt--sanitize: Don't insert newline in empty buffer, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed b0a4ff0 307/389: Fix parentheses, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 8007c12 308/389: Make debugging window a bit smaller, ELPA Syncer, 2021/12/03