Index: sbbs.el ================================================================== --- sbbs.el +++ sbbs.el @@ -524,19 +524,20 @@ sbbs--thread-id id sbbs--board board) (switch-to-buffer (current-buffer))))) (defun sbbs-compose-format (style) - "Insert " - (if (region-active-p) - (save-excursion - (goto-char (region-beginning)) - (insert "style") - (goto-char (region-end)) - (insert "style")) - (insert style style) - (forward-char (- (length style))))) + "Insert string STYLE around region or point." + (save-mark-and-excursion + (if (region-active-p) + (progn + (goto-char (region-beginning)) + (insert style) + (goto-char (region-end)) + (insert style)) + (insert style style))) + (forward-char (length style))) (defun sbbs-compose-format-code () "Insert code syntax markers." (interactive) (sbbs-compose-format "```\n"))