diff options
-rw-r--r-- | lisp/mastodon-inspect.el | 6 | ||||
-rw-r--r-- | lisp/mastodon-tl.el | 4 | ||||
-rw-r--r-- | lisp/mastodon-toot.el | 5 |
3 files changed, 11 insertions, 4 deletions
diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index f5fcd81..0457e74 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -71,8 +71,10 @@ (with-current-buffer buffer (let ((toot (mastodon-inspect--download-single-toot toot-id ))) (mastodon-tl--toot toot) - (replace-regexp "\n\n\n | " "\n | " nil (point-min) (point-max)) - (mastodon-media--inline-images))) + (goto-char (point-min)) + (while (search-forward "\n\n\n | " nil t) + (replace-match "\n | ")) + (mastodon-media--inline-images))) (switch-to-buffer-other-window buffer) (mastodon-mode))) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index edefae9..72883fc 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -234,7 +234,9 @@ also render the html" (defun mastodon-tl--timeline (toots) "Display each toot in TOOTS." (mapc 'mastodon-tl--toot toots) - (replace-regexp "\n\n\n | " "\n | " nil (point-min) (point-max)) + (goto-char (point-min)) + (while (search-forward "\n\n\n | " nil t) + (replace-match "\n | ")) (mastodon-media--inline-images)) (defun mastodon-tl--get-update-function (&optional buffer) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index ffe6454..296f95f 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -56,7 +56,10 @@ Remove MARKER if RM is non-nil." (let ((inhibit-read-only t) (bol (progn (move-beginning-of-line nil) (point))) (eol (progn (move-end-of-line nil) (point)))) - (when rm (replace-regexp (format "(%s) " marker) "" nil bol eol)) + (when rm + (goto-char bol) + (if (search-forward (format "(%s) " marker) eol t) + (replace-match ""))) (move-beginning-of-line nil) (mastodon-tl--goto-next-toot) (unless rm |