<commit_before>;;;; mto-mode - Emacs mode for typesetting MTO files
;;
;; This is a minor-mode for dealing with MTO typesetting.


;;; Surrounding functions ----------------------------------------------------
;;
;;  These functions all surround something (a line or visual selection) with
;;  some kind of tag.

(defun mto-surround-line-with-p-tags ()
  "Surround a (logical) line with <p> tags."
  (interactive)
  (save-excursion
    (evil-beginning-of-line)
    (insert "<p>")
    (evil-end-of-line)
    (forward-char)
    (insert "</p>")))

(defun mto-subhead ()
  "Surround a line with centered <p> tags."
  (interactive)
  (save-excursion
    (evil-beginning-of-line)
    (insert "<p style=\"text-align:center\"")
    (evil-end-of-line)
    (forward-char)
    (insert "</p>")))

(defun mto--surround-visual-selection (tag-name)
  "Surround a visual selection with a tag name"
  (save-excursion<commit_msg>Fix bugs in MTO mode<commit_after>;;;; mto-mode - Emacs mode for typesetting MTO files
;;
;; This is a minor-mode for dealing with MTO typesetting.


;;; Surrounding functions ----------------------------------------------------
;;
;;  These functions all surround something (a line or visual selection) with
;;  some kind of tag.

(defun mto-surround-line-with-p-tags ()
  "Surround a (logical) line with <p> tags."
  (interactive)
  (evil-save-goal-column
    (save-excursion
      (evil-beginning-of-line)
      (insert "<p>")
      (evil-end-of-line)
      (forward-char)
      (insert "</p>"))))

(defun mto-subhead ()
  "Surround a line with centered <p> tags."
  (interactive)
  (save-excursion
    (evil-beginning-of-line)
    (insert "<p style=\"text-align:center\">")
    (evil-end-of-line)
    (forward-char)
    (insert "</p>")))

(defun mto--surround-visual-selection (tag-name)
  "Surround a visual selection with a tag name"
  (save-excursion
{'fraction_non_alphanumeric': 0.2012847965738758, 'fraction_numerical': 0.0, 'mean_word_length': 2.6150870406189557, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6166692', 'n_tokens_mistral': 646, 'n_tokens_neox': 625, 'n_words': 170}