[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon 134ec9413a 45/63: small adjustments to point plac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon 134ec9413a 45/63: small adjustments to point placement with (un)folding |
Date: |
Sun, 4 Aug 2024 04:00:39 -0400 (EDT) |
branch: elpa/mastodon
commit 134ec9413a86bc97320548cba3dcfda286ebd938
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>
small adjustments to point placement with (un)folding
---
lisp/mastodon-tl.el | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index b9a5535ab5..ad8cc1a5e7 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1597,24 +1597,27 @@ Folding decided by `mastodon-tl--fold-toots-at-length'."
;; `replace-region-contents' is much to slow, our hack from fedi.el is
;; much simpler and much faster
(let ((beg (car range))
- (end (cdr range)))
+ (end (cdr range))
+ (last-point (point)))
(save-excursion
(goto-char beg)
(delete-region beg end)
(delete-char 1) ;; prevent newlines accumulating
(mastodon-tl--toot toot nil nil nil
(when (not fold) :unfolded)))
- ;; move point to line where text formerly ended:
- (unless fold
- (goto-char end)
- (beginning-of-line)))))))
+ (cond ((or fold byline)
+ ;; if folding, or if point was at byline already:
+ ;; FIXME: ideally we could goto last-point if folding but
+ ;; point was not in now hidden area)
+ (mastodon-tl--goto-next-item))
+ (t
+ (goto-char last-point)
+ (beginning-of-line))))))))
(defun mastodon-tl--fold-post ()
"Fold post at point, if it is too long."
(interactive)
- (mastodon-tl--unfold-post :fold)
- ;; inserting leaves us at beg of toot, so let's leave point at byline:
- (mastodon-tl--goto-next-item))
+ (mastodon-tl--unfold-post :fold))
;; from mastodon-alt.el:
(defun mastodon-tl--toot-for-stats (&optional toot)
- [nongnu] elpa/mastodon 92e1e7b991 03/63: move/rename with-toot-item, (continued)
- [nongnu] elpa/mastodon 92e1e7b991 03/63: move/rename with-toot-item, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 8f8c461e01 20/63: wrap --thread in with-item macro, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 6e24c36e86 07/63: screenshots, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon f43ecd6bad 06/63: docstring, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 8df12b8808 15/63: update info, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon e9ddf28832 21/63: horiz-bar refactor, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 00ac9103ad 25/63: multisession var in -toot.el, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 8c4f18cca7 32/63: toot--insert-emoji: defalis -> defun., ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 3eb1c4f794 41/63: --thread: diff name for option arg to avoid macro var, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 028ab8ea22 43/63: fix newlines accumulating on (un)folding toots, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 134ec9413a 45/63: small adjustments to point placement with (un)folding,
ELPA Syncer <=
- [nongnu] elpa/mastodon cf72fb5af0 47/63: bind fold toggle, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon d0a5bae331 50/63: refactor toot--toggle-boost-or-favourite, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon c75c4b7753 60/63: Revert "readme: multisession", ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 1887a2d414 11/63: readme: multisession, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon a9c6c04ac6 09/63: comments on mastodon-tl--goto-item-pos, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 4d335d45f4 16/63: index, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon a7fec25557 17/63: Merge branch 'multisession' into develop, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon f19f3bc273 08/63: replace persist with multisession, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon c8565612b9 22/63: fold long posts, unfolding cmd. FIX #572., ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon d60d1d4c31 34/63: read CW when setting, not when sending, also display it. FIX #569., ELPA Syncer, 2024/08/04