[elpa] externals/phpinspect 62bfc7830a 2/2: Fix namespace resolution bug in phpinspect-fix-imports

2024-08-04 Thread ELPA Syncer
branch: externals/phpinspect
commit 62bfc7830a34e3320bbb0a8ae6a1829498abbc9f
Author: Hugo Thunnissen 
Commit: Hugo Thunnissen 

Fix namespace resolution bug in phpinspect-fix-imports

Incorrect use of phpinspect-namespace-name caused phpinspect-fix-imports to
incorrectly determine the current namespace. This resulted in imports being
suggested/added for types that already were available in the current
namespace. It did not make the PHP code invalid, but it did cause 
unnecessary
use statements for types in the same namespace.

This bug has now been fixed.
---
 phpinspect-imports.el | 8 ++--
 phpinspect-type.el| 5 +++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/phpinspect-imports.el b/phpinspect-imports.el
index 31efa763f2..fbb0cf44a7 100644
--- a/phpinspect-imports.el
+++ b/phpinspect-imports.el
@@ -31,6 +31,7 @@
 (require 'phpinspect-buffer)
 (require 'phpinspect-cache)
 (require 'phpinspect-util)
+(require 'phpinspect-type)
 
 (defun phpinspect-insert-at-point (point data)
   (save-excursion
@@ -115,12 +116,15 @@ buffer position to insert the use statement at."
 (dolist (type types)
   (setq namespace (phpinspect-meta-find-parent-matching-token
parent-token #'phpinspect-namespace-p)
-namespace-name (phpinspect-namespace-name namespace))
+namespace-name (if namespace
+   (phpinspect-namespace-name 
(phpinspect-meta-token namespace))
+ ""))
   ;; Add use statements for types that aren't imported or already 
referenced
   ;; with a fully qualified name.
   (unless (or (or (alist-get type imports))
   (gethash (phpinspect-intern-name
-(concat namespace-name "\\" 
(phpinspect-name-string type)))
+(phpinspect--resolve-type-name
+ nil namespace-name (phpinspect-name-string type)))
(phpinspect-autoloader-types
 (phpinspect-project-autoload project
 (phpinspect-add-use-interactive type buffer project namespace)
diff --git a/phpinspect-type.el b/phpinspect-type.el
index a7c07c08f4..1ffee8a16f 100644
--- a/phpinspect-type.el
+++ b/phpinspect-type.el
@@ -358,8 +358,9 @@ mutability of the variable")
   "Extract NAMESPACE name as a string.
 
 NAMESPACE should be a namespace token (`phpinspect-namespace-p')."
-  (or (and (phpinspect-namespace-p namespace)
-   (phpinspect-word-p (cadr namespace))
+  (cl-assert (phpinspect-namespace-p namespace))
+
+  (or (and (phpinspect-word-p (cadr namespace))
(cadadr namespace))
   ""))
 



[elpa] externals/phpinspect 3d68374fd0 1/2: Add some documentation for phpinspect-meta objects

2024-08-04 Thread ELPA Syncer
branch: externals/phpinspect
commit 3d68374fd0edbc73c038ec4e5bd2072120ff77ea
Author: Hugo Thunnissen 
Commit: Hugo Thunnissen 

Add some documentation for phpinspect-meta objects
---
 phpinspect-meta.el | 31 ++-
 phpinspect-type.el |  3 +++
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/phpinspect-meta.el b/phpinspect-meta.el
index d6590af02a..906fe7c90c 100644
--- a/phpinspect-meta.el
+++ b/phpinspect-meta.el
@@ -20,7 +20,35 @@
 ;; along with this program.  If not, see .
 
 ;;; Commentary:
-
+;;
+;; IMPLEMENTATION CONTEXT
+;;
+;; This file contains code for the storing and reading of metadata related to
+;; the tokens in a parsed syntax tree.
+;;
+;; Phpinspect's parser uses basic lists as datastructure for its parsing
+;; result.  The simplicity of the datastructure makes it performant as the 
amount
+;; of GC's triggered by simple lists is not as large as when using more complex
+;; datastructures.
+;;
+;; A drawback of this simplicity is that attaching additional metadata to the
+;; parsed tokens is nontrivial.  A list is a list: There is no way to store
+;; additional metadata in a separate slot that is not part of its overall
+;; members.  This is fine when parsing entire files and indexing their
+;; contents.  Efficiently maintaining the state of code in a buffer, however, 
is
+;; a more involved process.  It requires the storage of more metadata than just
+;; the parsed tokens.
+;;
+;; For this reason, phpinspect uses a metadata tree for live buffers.  The
+;; metadata tree can be interacted with through functions prefixed with
+;; "phpinspect-meta".  It is an n-ary tree that can be navigated and searched
+;; through using the start position of parsed tokens.  Each metadata object
+;; stores its direct children in a binary search tree (see 
phpinspect-splayt.el).
+;;
+;; The metadata tree makes it easy to dig down in a buffer's syntax tree and
+;; determine the context from which a user is interacting with the PHP code in
+;; it.
+;;
 ;;; Code:
 
 (require 'phpinspect-splayt)
@@ -104,6 +132,7 @@
   (<= (phpinspect-meta-start ,meta) ,point)
 
 (defun phpinspect-meta-find-parent-matching-token (meta predicate)
+  "Find a parent metadata node of META, the token of which matches PREDICATE."
   (if (funcall predicate (phpinspect-meta-token meta))
   meta
 (catch 'found
diff --git a/phpinspect-type.el b/phpinspect-type.el
index 2bd73fef27..a7c07c08f4 100644
--- a/phpinspect-type.el
+++ b/phpinspect-type.el
@@ -355,6 +355,9 @@ mutability of the variable")
 (list class-name extends implements used-types)))
 
 (defun phpinspect-namespace-name (namespace)
+  "Extract NAMESPACE name as a string.
+
+NAMESPACE should be a namespace token (`phpinspect-namespace-p')."
   (or (and (phpinspect-namespace-p namespace)
(phpinspect-word-p (cadr namespace))
(cadadr namespace))



[elpa] externals/phpinspect updated (dfdef3e382 -> 62bfc7830a)

2024-08-04 Thread ELPA Syncer
elpasync pushed a change to branch externals/phpinspect.

  from  dfdef3e382 Implement support for PHP8.1 property typehints
   new  3d68374fd0 Add some documentation for phpinspect-meta objects
   new  62bfc7830a Fix namespace resolution bug in phpinspect-fix-imports


Summary of changes:
 phpinspect-imports.el |  8 ++--
 phpinspect-meta.el| 31 ++-
 phpinspect-type.el|  8 ++--
 3 files changed, 42 insertions(+), 5 deletions(-)



[nongnu] elpa/mastodon aa6b7b25be 18/63: readme re tofu

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit aa6b7b25bef714fe88493d4c04327a61fba0bd53
Author: marty hiatt 
Commit: marty hiatt 

readme re tofu
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 48ee9796c3..8a5fa08bf7 100644
--- a/README.org
+++ b/README.org
@@ -65,7 +65,7 @@ it shouldn't be very hard to get it working.
 
 *** Emoji
 
-Since Emacs 28, it has builtin emoji support with =emoji.el=. If you prefer to 
use [[https://github.com/iqbalansari/emacs-emojify][Emojify]], =require= it and 
set =mastodon-use-emojify= to non-nil to display emoji in timelines and to use 
it when composing toots. =Emoji.el= is the better option, but for now only 
=emojify= supports downloading and using custom emoji from your instance.
+Since Emacs 28, it has builtin emoji support with =emoji.el=. If you prefer to 
use [[https://github.com/iqbalansari/emacs-emojify][Emojify]], =require= it and 
set =mastodon-use-emojify= to non-nil to display emoji in timelines and to use 
it when composing toots. =Emoji.el= is the better option, but for now only 
=emojify= supports downloading and using custom emoji from your instance. From 
personal experience, =emojify= also tends to result in less TOFU.
 
 *** Discover
 



[nongnu] elpa/mastodon c75c4b7753 60/63: Revert "readme: multisession"

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit c75c4b7753783e4fe393d921811f474bc8ecbaa5
Author: marty hiatt 
Commit: marty hiatt 

Revert "readme: multisession"

This reverts commit 1887a2d414029cfd7d76b5ea2edee9a15a85d0cf.
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 122ab36294..f514b33af5 100644
--- a/README.org
+++ b/README.org
@@ -421,7 +421,7 @@ to your translator function as its text argument. Here's 
what
 
 Hard dependencies (should all install with =mastodon.el=):
 - =request= (for uploading attachments), 
[[https://github.com/tkf/emacs-request][emacs-request]]
-- +=persist= for storing some settings across sessions+ (we now use 
=multisession.el= for this)
+- =persist= for storing some settings across sessions
 
 Optional dependencies (install yourself, =mastodon.el= can use them):
 - =emojify= to use custom emoji (else we use builtin =emoji.el=)



[nongnu] elpa/mastodon 9b1b08c9b3 02/63: img help echo: cmd keys and toggle sensitive binding

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 9b1b08c9b32eaec12c952437a5657e78b84c25cc
Author: marty hiatt 
Commit: marty hiatt 

img help echo: cmd keys and toggle sensitive binding
---
 lisp/mastodon-media.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el
index d14d28340f..9dc8517671 100644
--- a/lisp/mastodon-media.el
+++ b/lisp/mastodon-media.el
@@ -497,8 +497,12 @@ TYPE is the attachment's type field on the server.
 CAPTION is the image caption if provided.
 SENSITIVE is a flag from the item's JSON data."
   (let* ((help-echo-base
-  "RET/i: load full image (prefix: copy URL), +/-: zoom,\
- r: rotate, o: save preview")
+  (substitute-command-keys
+   (concat "\\`RET'/\\`i': load full image (prefix: copy URL), 
\\`+'/\\`-': zoom,\
+ \\`r': rotate, \\`o': save preview"
+   (if (not (eq sensitive :json-false))
+   ", \\`S': toggle sensitive media"
+ ""
  (help-echo (if caption
 (concat help-echo-base
 "\n\"" caption "\"")



[nongnu] elpa/mastodon e9ddf28832 21/63: horiz-bar refactor

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit e9ddf28832eb06f9731b74f3fff11c4606f05a70
Author: marty hiatt 
Commit: marty hiatt 

horiz-bar refactor
---
 lisp/mastodon-tl.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index a82d437b57..ac3000539a 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -239,9 +239,8 @@ If nil `(point-min)' is used instead.")
   "The timer that, when set will scan the buffer to update the timestamps.")
 
 (defvar mastodon-tl--horiz-bar
-  (if (char-displayable-p ?―)
-  (make-string 12 ?―)
-(make-string 12 ?-)))
+  (make-string 12
+   (if (char-displayable-p ?―) ?― ?-)))
 
 
 ;;; KEYMAPS



[nongnu] elpa/mastodon 1887a2d414 11/63: readme: multisession

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 1887a2d414029cfd7d76b5ea2edee9a15a85d0cf
Author: marty hiatt 
Commit: marty hiatt 

readme: multisession
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 53cb508cc0..b542142ca4 100644
--- a/README.org
+++ b/README.org
@@ -421,7 +421,7 @@ to your translator function as its text argument. Here's 
what
 
 Hard dependencies (should all install with =mastodon.el=):
 - =request= (for uploading attachments), 
[[https://github.com/tkf/emacs-request][emacs-request]]
-- =persist= for storing some settings across sessions
+- +=persist= for storing some settings across sessions+ (we now use 
=multisession.el= for this)
 
 Optional dependencies (install yourself, =mastodon.el= can use them):
 - =emojify= for inserting and viewing emojis



[nongnu] elpa/mastodon f16fcb15a8 27/63: use mastodon-use-emojify in toot.el

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit f16fcb15a8be0143db1f4a11f5025512feca5b44
Author: marty hiatt 
Commit: marty hiatt 

use mastodon-use-emojify in toot.el
---
 lisp/mastodon-toot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 32187090d5..51cf1c0c63 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -2029,7 +2029,7 @@ EDIT means we are editing an existing toot, not composing 
a new one."
 (setq mastodon-toot-previous-window-config previous-window-config)
 (when mastodon-toot--proportional-fonts-compose
   (facemenu-set-face 'variable-pitch))
-(when (and mastodon-toot--emojify-in-compose-buffer
+(when (and mastodon-use-emojify
;; emojify loaded but poss not enabled in our buffer:
(boundp 'emojify-mode))
   (emojify-mode))



[nongnu] elpa/mastodon a7fec25557 17/63: Merge branch 'multisession' into develop

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit a7fec255574decfe24302f260b451203d13a8b22
Merge: 7b4d77b86b 4e8d286164
Author: marty hiatt 
Commit: marty hiatt 

Merge branch 'multisession' into develop
---
 README.org   |  2 +-
 lisp/mastodon-profile.el | 19 +++
 lisp/mastodon-toot.el|  9 -
 lisp/mastodon.el | 10 --
 4 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/README.org b/README.org
index 53cb508cc0..b542142ca4 100644
--- a/README.org
+++ b/README.org
@@ -421,7 +421,7 @@ to your translator function as its text argument. Here's 
what
 
 Hard dependencies (should all install with =mastodon.el=):
 - =request= (for uploading attachments), 
[[https://github.com/tkf/emacs-request][emacs-request]]
-- =persist= for storing some settings across sessions
+- +=persist= for storing some settings across sessions+ (we now use 
=multisession.el= for this)
 
 Optional dependencies (install yourself, =mastodon.el= can use them):
 - =emojify= for inserting and viewing emojis
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index de16b7d216..cd1978fde1 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -35,7 +35,6 @@
 ;;; Code:
 (require 'seq)
 (require 'cl-lib)
-(require 'persist)
 (require 'parse-time)
 (require 'mastodon-http)
 (eval-when-compile
@@ -125,8 +124,8 @@ It contains details of the current user's account.")
 map)
   "Keymap for `mastodon-profile-update-mode'.")
 
-(persist-defvar mastodon-profile-account-settings nil
-"An alist of account settings saved from the server.
+(define-multisession-variable mastodon-profile-account-settings nil
+  "An alist of account settings saved from the server.
 Other clients can change these settings on the server at any
 time, so this list is not the canonical source for settings. It
 is updated on entering mastodon mode and on toggle any setting it
@@ -365,13 +364,16 @@ SOURCE means that the preference is in the `source' part 
of the account JSON."
 
 (defun mastodon-profile--get-pref (pref)
   "Return PREF from `mastodon-profile-account-settings'."
-  (plist-get mastodon-profile-account-settings pref))
+  (plist-get (multisession-value mastodon-profile-account-settings)
+ pref))
 
 (defun mastodon-profile--update-preference-plist (pref val)
   "Set local account preference plist preference PREF to VAL.
 This is done after changing the setting on the server."
-  (setq mastodon-profile-account-settings
-(plist-put mastodon-profile-account-settings pref val)))
+  (setf (multisession-value mastodon-profile-account-settings)
+(plist-put
+ (multisession-value mastodon-profile-account-settings)
+ pref val)))
 
 ;; used in toot.el
 (defun mastodon-profile--fetch-server-account-settings-maybe ()
@@ -384,7 +386,8 @@ Only do so if `mastodon-profile-account-settings' is nil."
 Store the values in `mastodon-profile-account-settings'.
 Run in `mastodon-mode-hook'.
 If NO-FORCE, only fetch if `mastodon-profile-account-settings' is nil."
-  (unless (and no-force mastodon-profile-account-settings)
+  (unless (and no-force
+   (multisession-value mastodon-profile-account-settings))
 (let ((keys '(locked discoverable display_name bot))
   (source-keys '(privacy sensitive language)))
   (mapc (lambda (k)
@@ -402,7 +405,7 @@ If NO-FORCE, only fetch if 
`mastodon-profile-account-settings' is nil."
   ;; TODO: remove now redundant vars, replace with fetchers from the plist
   (setq mastodon-toot--visibility (mastodon-profile--get-pref 'privacy)
 mastodon-toot--content-nsfw (mastodon-profile--get-pref 
'sensitive))
-  mastodon-profile-account-settings)))
+  (multisession-value mastodon-profile-account-settings
 
 (defun mastodon-profile--account-locked-toggle ()
   "Toggle the locked status of your account.
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index e934352690..496f334cad 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -158,10 +158,7 @@ If the original toot visibility is different we use the 
more restricted one."
   "Whether to enable your instance's custom emoji by default."
   :type 'boolean)
 
-(defcustom mastodon-toot--emojify-in-compose-buffer t
-  "Whether to enable `emojify-mode' in the compose buffer.
-We only attempt to enable it if its bound."
-  :type 'boolean)
+(defvar mastodon-use-emojify)
 
 (defcustom mastodon-toot--proportional-fonts-compose nil
   "Nonnil to enable using proportional fonts in the compose buffer.
@@ -1964,7 +1961,9 @@ EDIT means we are editing an existing toot, not composing 
a new one."
 (mastodon-toot-mode t)
 ;; set visibility:
 (setq mastodon-toot--visibility
-  (or (plist-get mastodon-profile-account-settings 'privacy)
+  (or (plist-get
+   (multisession-value mastodon-profile-account-settings)
+   'privacy)
   ;; use toot visibility setti

[nongnu] elpa/mastodon 8f8c461e01 20/63: wrap --thread in with-item macro

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 8f8c461e01a9cd85624b40bb158607f4240c80e6
Author: marty hiatt 
Commit: marty hiatt 

wrap --thread in with-item macro
---
 lisp/mastodon-tl.el | 73 +++--
 1 file changed, 37 insertions(+), 36 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index c4585b82e8..a82d437b57 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1979,42 +1979,43 @@ view all branches of a thread."
 (defun mastodon-tl--thread (&optional id)
   "Open thread buffer for toot at point or with ID."
   (interactive)
-  (let* ((id (or id (mastodon-tl--property 'base-item-id :no-move)))
- (type (mastodon-tl--field 'type (mastodon-tl--property 'item-json 
:no-move
-(if (or (string= type "follow_request")
-(string= type "follow")) ; no can thread these
-(user-error "No thread")
-  (let* ((endpoint (format "statuses/%s/context" id))
- (url (mastodon-http--api endpoint))
- (buffer (format "*mastodon-thread-%s*" id))
- (toot (mastodon-http--get-json ; refetch in case we just 
faved/boosted:
-(mastodon-http--api (concat "statuses/" id))
-nil :silent))
- (context (mastodon-http--get-json url nil :silent)))
-(if (equal (caar toot) 'error)
-(user-error "Error: %s" (cdar toot))
-  (when (member (alist-get 'type toot) '("reblog" "favourite"))
-(setq toot (alist-get 'status toot)))
-  (if (> (+ (length (alist-get 'ancestors context))
-(length (alist-get 'descendants context)))
- 0)
-  ;; if we have a thread:
-  (with-mastodon-buffer buffer #'mastodon-mode nil
-(let ((marker (make-marker)))
-  (mastodon-tl--set-buffer-spec buffer endpoint
-#'mastodon-tl--thread)
-  (mastodon-tl--timeline (alist-get 'ancestors context) 
:thread)
-  (goto-char (point-max))
-  (move-marker marker (point))
-  ;; print re-fetched toot:
-  (mastodon-tl--toot toot :detailed-p :thread)
-  (mastodon-tl--timeline (alist-get 'descendants context)
- :thread)
-  ;; put point at the toot:
-  (goto-char (marker-position marker))
-  (mastodon-tl--goto-next-item)))
-;; else just print the lone toot:
-(mastodon-tl--single-toot id)))
+  (mastodon-tl--with-toot-item
+   (let* ((id (or id (mastodon-tl--property 'base-item-id :no-move)))
+  (type (mastodon-tl--field 'type (mastodon-tl--property 'item-json 
:no-move
+ (if (or (string= type "follow_request")
+ (string= type "follow")) ; no can thread these
+ (user-error "No thread")
+   (let* ((endpoint (format "statuses/%s/context" id))
+  (url (mastodon-http--api endpoint))
+  (buffer (format "*mastodon-thread-%s*" id))
+  (toot (mastodon-http--get-json ; refetch in case we just 
faved/boosted:
+ (mastodon-http--api (concat "statuses/" id))
+ nil :silent))
+  (context (mastodon-http--get-json url nil :silent)))
+ (if (equal (caar toot) 'error)
+ (user-error "Error: %s" (cdar toot))
+   (when (member (alist-get 'type toot) '("reblog" "favourite"))
+ (setq toot (alist-get 'status toot)))
+   (if (> (+ (length (alist-get 'ancestors context))
+ (length (alist-get 'descendants context)))
+  0)
+   ;; if we have a thread:
+   (with-mastodon-buffer buffer #'mastodon-mode nil
+ (let ((marker (make-marker)))
+   (mastodon-tl--set-buffer-spec buffer endpoint
+ #'mastodon-tl--thread)
+   (mastodon-tl--timeline (alist-get 'ancestors context) 
:thread)
+   (goto-char (point-max))
+   (move-marker marker (point))
+   ;; print re-fetched toot:
+   (mastodon-tl--toot toot :detailed-p :thread)
+   (mastodon-tl--timeline (alist-get 'descendants context)
+  :thread)
+   ;; put point at the toot:
+   (goto-char (marker-position marker))
+   (mastodon-tl--goto-next-item)))
+ ;; else just print the lone toot:
+ (mastodon-tl--single-toot id
 
 (defun mastodon-tl--mute-thread ()
   "Mute the thread displayed in the current buffer.



[nongnu] elpa/mastodon 134ec9413a 45/63: small adjustments to point placement with (un)folding

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 134ec9413a86bc97320548cba3dcfda286ebd938
Author: marty hiatt 
Commit: marty hiatt 

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 6e24c36e86 07/63: screenshots

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 6e24c36e86a86978b872ddb42bb76256b22b032e
Author: marty hiatt 
Commit: marty hiatt 

screenshots
---
 README.org|  10 ++
 screenshot-notifs+compose.png | Bin 0 -> 207025 bytes
 screenshot-tl.png | Bin 0 -> 254949 bytes
 3 files changed, 10 insertions(+)

diff --git a/README.org b/README.org
index 1fbb047282..53cb508cc0 100644
--- a/README.org
+++ b/README.org
@@ -494,3 +494,13 @@ Some significant contributors are:
 - https://alexjgriffith.itch.io
 - https://github.com/hdurer
 - https://codeberg.org/Red_Starfish
+
+** screenshots
+
+Here's a (federated) timeline:
+
+[[file:screenshot-tl.png]]
+
+Here's a notifcations view plus a compose buffer:
+
+[[file:screenshot-notifs+compose.png]]
diff --git a/screenshot-notifs+compose.png b/screenshot-notifs+compose.png
new file mode 100644
index 00..98dbf5e4ee
Binary files /dev/null and b/screenshot-notifs+compose.png differ
diff --git a/screenshot-tl.png b/screenshot-tl.png
new file mode 100644
index 00..9097580615
Binary files /dev/null and b/screenshot-tl.png differ



[nongnu] elpa/mastodon 6721f40cfd 30/63: unfold toot: replace whole item on unfolding (so we have props!)

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 6721f40cfd9111ed8d511d7aa3a3a5d2a0a771cb
Author: marty hiatt 
Commit: marty hiatt 

unfold toot: replace whole item on unfolding (so we have props!)
---
 lisp/mastodon-tl.el | 31 ---
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index cb7ccf1d58..17f7ae5c62 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1506,7 +1506,7 @@ Runs `mastodon-tl--render-text' and fetches poll or 
media."
 (string= reply-to-id prev-id)))
 
 (defun mastodon-tl--insert-status (toot body author-byline action-byline
-&optional id base-toot detailed-p 
thread domain)
+&optional id base-toot detailed-p 
thread domain unfolded)
   "Display the content and byline of timeline element TOOT.
 BODY will form the section of the toot above the byline.
 AUTHOR-BYLINE is an optional function for adding the author
@@ -1540,7 +1540,7 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
"\n")
  "")
(let ((bar (mastodon-tl--symbol 'reply-bar))
- (body (mastodon-tl--fold-body-maybe body)))
+ (body (mastodon-tl--fold-body-maybe body unfolded)))
  (if (and after-reply-status-p thread)
  (propertize body
  'line-prefix bar
@@ -1565,9 +1565,10 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
 (when mastodon-tl--display-media-p
   (mastodon-media--inline-images start-pos (point)
 
-(defun mastodon-tl--fold-body-maybe (body)
+(defun mastodon-tl--fold-body-maybe (body &optional unfolded)
   "Fold toot BODY if it is very long."
-  (if (or (eq nil mastodon-tl--fold-toots-at-length)
+  (if (or unfolded
+  (eq nil mastodon-tl--fold-toots-at-length)
   (length< body mastodon-tl--fold-toots-at-length))
   body
 (let* ((heading (mastodon-search--format-heading
@@ -1585,22 +1586,22 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
   (interactive)
   ;; if at byline, must search backwards:
   (let* ((byline (mastodon-tl--property 'byline :no-move))
- (range (mastodon-tl--find-property-range
- 'read-more (point) byline)))
-(if (not range)
+ (read-more-p (mastodon-tl--find-property-range
+   'read-more (point) byline)))
+(if (not read-more-p)
 (user-error "No folded item at point?")
   (let* ((inhibit-read-only t)
- (body (save-excursion
- (goto-char (car range))
- (mastodon-tl--property 'read-more
-;; `replace-region-contents' is much to slow, our hack from fedi.el is
-;; much simpler and much faster
+ (range (mastodon-tl--find-property-range
+ 'item-json (point)))
+ (toot (mastodon-tl--property 'item-json)))
+;; `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)))
   (save-excursion
 (goto-char beg)
 (delete-region beg end)
-(insert body))
+(mastodon-tl--toot toot nil nil nil :unfolded))
   ;; move point to line where text formerly ended:
   (goto-char end)
   (beginning-of-line))
@@ -1665,7 +1666,7 @@ To disable showing the stats, customize
   (and (null (mastodon-tl--field 'in_reply_to_id toot))
(not (mastodon-tl--field 'rebloged toot
 
-(defun mastodon-tl--toot (toot &optional detailed-p thread domain)
+(defun mastodon-tl--toot (toot &optional detailed-p thread domain unfolded)
   "Format TOOT and insert it into the buffer.
 DETAILED-P means display more detailed info. For now
 this just means displaying toot client.
@@ -1677,7 +1678,7 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
(mastodon-tl--spoiler toot)
  (mastodon-tl--content toot)))
'mastodon-tl--byline-author 'mastodon-tl--byline-boosted
-   nil nil detailed-p thread domain))
+   nil nil detailed-p thread domain unfolded))
 
 (defun mastodon-tl--timeline (toots &optional thread domain)
   "Display each toot in TOOTS.



[nongnu] elpa/mastodon a9c6c04ac6 09/63: comments on mastodon-tl--goto-item-pos

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit a9c6c04ac6b4eeeae0ac8ed6344588a72af8def9
Author: marty hiatt 
Commit: marty hiatt 

comments on mastodon-tl--goto-item-pos
---
 lisp/mastodon-tl.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 2574a0f908..f84f7c031f 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -396,14 +396,18 @@ Optionally start from POS."
(current-buffer
 (if npos
 (if (not
- ;; (get-text-property npos 'item-id) ; toots, users, not tags
  (get-text-property npos 'item-type)) ; generic
+;; FIXME let's make refresh &optional and only call refresh/recur
+;; if non-nil:
 (mastodon-tl--goto-item-pos find-pos refresh npos)
   (goto-char npos)
   ;; force display of help-echo on moving to a toot byline:
   (mastodon-tl--message-help-echo))
-  ;; FIXME: this doesn't work, as the funcall doesn't return if we
-  ;; run into an endless refresh loop
+  ;; FIXME: doesn't work, the funcall doesn't return if in an endless
+  ;; refresh loop.
+  ;; either let-bind `max-lisp-eval-depth' and try to error handle when it
+  ;; errors, or else set up a counter, and error when it gets to high
+  ;; (like >2 would already be too much)
   (condition-case nil
   (funcall refresh)
 (error "No more items")



[nongnu] elpa/mastodon 92e1e7b991 03/63: move/rename with-toot-item

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 92e1e7b991d06e83aa5bf22911d18019391aa3db
Author: marty hiatt 
Commit: marty hiatt 

move/rename with-toot-item
---
 lisp/mastodon-tl.el   |  8 
 lisp/mastodon-toot.el | 21 +++--
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 41ecd8529f..2574a0f908 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -339,14 +339,6 @@ than `pop-to-buffer'."
(message "Looks like there's no item at point?")
  ,@body))
 
-(defmacro mastodon-tl--do-if-item-strict (&rest body)
-  "Execute BODY if we have a toot object at point.
-Includes boosts, and notifications that display toots."
-  (declare (debug t))
-  `(if (not (equal 'toot (mastodon-tl--property 'item-type :no-move)))
-   (message "Looks like there's no toot at point?")
- ,@body))
-
 
 ;;; NAV
 
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 23de8b7373..e934352690 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -76,7 +76,6 @@
 (autoload 'mastodon-tl--as-string "mastodon-tl")
 (autoload 'mastodon-tl--buffer-type-eq "mastodon-tl")
 (autoload 'mastodon-tl--clean-tabs-and-nl "mastodon-tl")
-(autoload 'mastodon-tl--do-if-item-strict "mastodon-tl")
 (autoload 'mastodon-tl--field "mastodon-tl")
 (autoload 'mastodon-tl--find-property-range "mastodon-tl")
 (autoload 'mastodon-tl--find-property-range "mastodon-tl")
@@ -267,6 +266,16 @@ send.")
"\\>")) ; boundary end
 
 
+;;; MACRO
+
+(defmacro mastodon-tl--with-toot-item (&rest body)
+  "Execute BODY if we have a toot object at point.
+Includes boosts, and notifications that display toots."
+  (declare (debug t))
+  `(if (not (equal 'toot (mastodon-tl--property 'item-type :no-move)))
+   (message "Looks like there's no toot at point?")
+ ,@body))
+
 ;;; MODE MAP
 
 (defvar mastodon-toot-mode-map
@@ -364,7 +373,7 @@ boosting, or bookmarking toots."
 (defun mastodon-toot--toggle-boost-or-favourite (type)
   "Toggle boost or favourite of toot at `point'.
 TYPE is a symbol, either `favourite' or `boost.'"
-  (mastodon-tl--do-if-item-strict
+  (mastodon-tl--with-toot-item
(let ((n-type (mastodon-tl--property 'notification-type :no-move)))
  (if (or (equal n-type "follow")
  (equal n-type "follow_request"))
@@ -467,7 +476,7 @@ SUBTRACT means we are un-favouriting or unboosting, so we 
decrement."
 (defun mastodon-toot--toggle-bookmark ()
   "Bookmark or unbookmark toot at point."
   (interactive)
-  (mastodon-tl--do-if-item-strict
+  (mastodon-tl--with-toot-item
(let ((n-type (mastodon-tl--property 'notification-type :no-move)))
  (if (or (equal n-type "follow")
  (equal n-type "follow_request"))
@@ -515,7 +524,7 @@ SUBTRACT means we are un-favouriting or unboosting, so we 
decrement."
 (defun mastodon-toot--list-toot-boosters-or-favers (&optional favourite)
   "List the favouriters or boosters of toot at point.
 With FAVOURITE, list favouriters, else list boosters."
-  (mastodon-tl--do-if-item-strict
+  (mastodon-tl--with-toot-item
(let* ((base-toot (mastodon-tl--property 'base-item-id))
   (endpoint (if favourite "favourited_by" "reblogged_by"))
   (url (mastodon-http--api (format "statuses/%s/%s" base-toot 
endpoint)))
@@ -948,7 +957,7 @@ instance to edit a toot."
 (defun mastodon-toot--edit-toot-at-point ()
   "Edit the user's toot at point."
   (interactive)
-  (mastodon-tl--do-if-item-strict
+  (mastodon-tl--with-toot-item
(let ((toot (or (mastodon-tl--property 'base-toot) ; fave/boost notifs
(mastodon-tl--property 'item-json
  (if (not (mastodon-toot--own-toot-p toot))
@@ -1174,7 +1183,7 @@ text of the toot being replied to in the compose buffer.
 If the region is active, inject it into the reply buffer,
 prefixed by >."
   (interactive)
-  (mastodon-tl--do-if-item-strict
+  (mastodon-tl--with-toot-item
(let* ((quote (when (region-active-p)
(buffer-substring (region-beginning)
  (region-end



[nongnu] elpa/mastodon 2d4cedbf68 01/63: readme re bookmarks

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 2d4cedbf68fff79f9fb84db6153c3c35d9c87d28
Author: marty hiatt 
Commit: marty hiatt 

readme re bookmarks
---
 README.org | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/README.org b/README.org
index db79ddea12..1fbb047282 100644
--- a/README.org
+++ b/README.org
@@ -415,9 +415,7 @@ to your translator function as its text argument. Here's 
what
 
 *** Bookmarks and =mastodon.el=
 
-=mastodon.el= doesn’t currently implement its own bookmark record and handler,
-which means that emacs bookmarks will not work as is. Until we implement them,
-you can get bookmarks going immediately by using 
[[https://github.com/emacsmirror/emacswiki.org/blob/master/bookmark%2b.el][bookmark+.el]].
+=mastodon.el= implements a basic bookmark record and handler. Currently, this 
means that you can bookmark a post item and later load it in thread view. This 
could be expanded to any item with an id, but probably not to things like 
timeline views. If you want to be able to bookmark something, open an issue and 
ask, it's trivial to expand the bookmarking code.
 
 ** Dependencies
 



[nongnu] elpa/mastodon updated (a191fb5f3f -> 45903de823)

2024-08-04 Thread ELPA Syncer
elpasync pushed a change to branch elpa/mastodon.

  from  a191fb5f3f readme re bookmarks
   new  2d4cedbf68 readme re bookmarks
   new  9b1b08c9b3 img help echo: cmd keys and toggle sensitive binding
   new  92e1e7b991 move/rename with-toot-item
   new  6e24c36e86 screenshots
   new  a9c6c04ac6 comments on mastodon-tl--goto-item-pos
   new  7b4d77b86b tl: no-refresh for next-item in --single-toot
   new  f19f3bc273 replace persist with multisession
   new  1887a2d414 readme: multisession
   new  4e8d286164 mastodon-use-emojify customize
   new  a7fec25557 Merge branch 'multisession' into develop
   new  4697c073e8 message -> user-error
   new  8f8c461e01 wrap --thread in with-item macro
   new  e9ddf28832 horiz-bar refactor
   new  c8565612b9 fold long posts, unfolding cmd. FIX #572.
   new  344da8f2f2 fold toots customize/ refactor
   new  3f9b305b5f flymake
   new  00ac9103ad multisession var in -toot.el
   new  3ba86999d3 flymake toot.el
   new  f16fcb15a8 use mastodon-use-emojify in toot.el
   new  534644d2bd toot: default to emoji.el, emojify customize
   new  82931c0869 readme, emoji
   new  8df12b8808 update info
   new  4d335d45f4 index
   new  aa6b7b25be readme re tofu
   new  43cd626f6a Merge branch 'emoji.el' into develop
   new  712a2af648 update info
   new  6721f40cfd unfold toot: replace whole item on unfolding (so we have 
props!)
   new  db227a8c25 flip an if clause
   new  8c4f18cca7 toot--insert-emoji: defalis -> defun.
   new  c95a19b2d5 index update
   new  d60d1d4c31 read CW when setting, not when sending, also display it. 
FIX #569.
   new  d7816ab59f add item-json prop to fave/boost strings, so (un)folding 
works
   new  f8ee682bb4 flip an if clause
   new  b8e8328a35 use with-toot-item and clean up functions that use it
   new  41404473ea toot.el: user-error not message when needed
   new  f43ecd6bad docstring
   new  0cd77c1880 Merge branch 'with-toot-item' into develop
   new  80ce719004 flymake our user-error mess
   new  bb1b33e2fb toot.el: use mastodon-toot--base-toot-or-item-json
   new  bc83b400b1 fix unfolding faved/bookmarked toots
   new  3eb1c4f794 --thread: diff name for option arg to avoid macro var
   new  dd1b0ab770 add mastodon-tl--fold-post
   new  028ab8ea22 fix newlines accumulating on (un)folding toots
   new  4844a1147a no newline after READ MORE heading
   new  134ec9413a small adjustments to point placement with (un)folding
   new  dad54cccbc fold-post-toggle
   new  cf72fb5af0 bind fold toggle
   new  30b02296ca fix where we leave point on (un)folding
   new  6b0a0eb1fa readme, index, info
   new  d0a5bae331 refactor toot--toggle-boost-or-favourite
   new  8d6983667d refactor toot--toggle-bookmark
   new  e66ce7b6fb folding comments / action docstring
   new  35a26600af reimplement folding via insert body only.
   new  351bd73875 fix prev-item-id
   new  0ef13ab348 fix prev-item-id
   new  5621b2df84 add underscores to user-like url regexes
   new  945de24d3e Merge branch 'develop' into insert-status-for-fold
   new  46b66e332a commentary
   new  49261b91b0 Revert "replace persist with multisession"
   new  c75c4b7753 Revert "readme: multisession"
   new  da0e348bc7 Revert "multisession var in -toot.el"
   new  4ac5b57ae6 Merge branch 'develop'
   new  45903de823 info update


Summary of changes:
 README.org|  50 +++--
 lisp/mastodon-media.el|   8 +-
 lisp/mastodon-search.el   |   4 +-
 lisp/mastodon-tl.el   | 265 ++
 lisp/mastodon-toot.el | 426 --
 lisp/mastodon.el  |  30 ++-
 mastodon-index.org|  15 +-
 mastodon.info | 115 +++-
 mastodon.texi |  30 ++-
 screenshot-notifs+compose.png | Bin 0 -> 207025 bytes
 screenshot-tl.png | Bin 0 -> 254949 bytes
 11 files changed, 551 insertions(+), 392 deletions(-)
 create mode 100644 screenshot-notifs+compose.png
 create mode 100644 screenshot-tl.png



[nongnu] elpa/mastodon 4844a1147a 44/63: no newline after READ MORE heading

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 4844a1147a7ae23c996aa21a98ae4229fe172649
Author: marty hiatt 
Commit: marty hiatt 

no newline after READ MORE heading
---
 lisp/mastodon-search.el | 4 ++--
 lisp/mastodon-tl.el | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index e69366e692..f862f3cf46 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -128,14 +128,14 @@ Optionally add string TYPE after HEADING."
   (insert
(mastodon-search--format-heading str type)))
 
-(defun mastodon-search--format-heading (str &optional type)
+(defun mastodon-search--format-heading (str &optional type no-newline)
   "Format STR as a heading.
 Optionally add string TYPE after HEADING."
   (mastodon-tl--set-face
(concat "\n " mastodon-tl--horiz-bar "\n "
(upcase str) " "
(if type (upcase type) "") "\n"
-   " " mastodon-tl--horiz-bar "\n")
+   " " mastodon-tl--horiz-bar (unless no-newline "\n"))
'success))
 
 (defvar mastodon-search-types
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 70d02236a2..b9a5535ab5 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1573,9 +1573,8 @@ Folding decided by `mastodon-tl--fold-toots-at-length'."
   (length< body mastodon-tl--fold-toots-at-length))
   body
 (let* ((heading (mastodon-search--format-heading
- (mastodon-tl--make-link
-  "READ MORE"
-  'read-more)))
+ (mastodon-tl--make-link "READ MORE" 'read-more)
+ nil :no-newline))
(display (concat (substring body 0
mastodon-tl--fold-toots-at-length)
 heading)))



[nongnu] elpa/mastodon 4d335d45f4 16/63: index

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 4d335d45f4c9f3ea90b0b5485fb0d3c80e9b
Author: marty hiatt 
Commit: marty hiatt 

index
---
 mastodon-index.org | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mastodon-index.org b/mastodon-index.org
index 4637403013..949cd6dfe9 100644
--- a/mastodon-index.org
+++ b/mastodon-index.org
@@ -110,7 +110,7 @@
 |  | mastodon-tl--do-link-action-at-point  | Do 
the action of the link at POSITION. |
 |  | mastodon-tl--enable-notify-user-posts | Query 
for USER-HANDLE and enable notifications when they post. |
 |  | mastodon-tl--filter-user-user-posts-by-language   | Query 
for USER-HANDLE and filter display of their posts by language.   |
-|  | mastodon-tl--follow-tag   | 
Prompt for a tag and follow it.|
+|  | mastodon-tl--follow-tag   | 
Prompt for a tag (from post at point) and follow it.   |
 | W| mastodon-tl--follow-user  | Query 
for USER-HANDLE from current status and follow that user.|
 |  | mastodon-tl--follow-user-disable-boosts   | 
Prompt for a USER-HANDLE, and disable display of boosts in home timeline.  |
 |  | mastodon-tl--follow-user-enable-boosts| 
Prompt for a USER-HANDLE, and enable display of boosts in home timeline.   |
@@ -121,9 +121,7 @@
 | \| mastodon-tl--get-remote-local-timeline| 
Prompt for an instance domain and try to display its local timeline.   |
 | #| mastodon-tl--get-tag-timeline | 
Prompt for tag and opens its timeline. |
 | n| mastodon-tl--goto-next-item   | Jump 
to next item. |
-| C- | mastodon-tl--goto-next-toot   |   
 |
 | p| mastodon-tl--goto-prev-item   | Jump 
to previous item. |
-| C-   | mastodon-tl--goto-prev-toot   |   
 |
 | "| mastodon-tl--list-followed-tags   | List 
followed tags. View timeline of tag user choses.  |
 | C-   | mastodon-tl--mpv-play-video-at-point  | Play 
the video or gif at point with an mpv process.|
 |  | mastodon-tl--mpv-play-video-from-byline   | Run 
`mastodon-tl--mpv-play-video-at-point' on first moving image in post.  |



[nongnu] elpa/mastodon 945de24d3e 57/63: Merge branch 'develop' into insert-status-for-fold

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 945de24d3ecb65316d1418c7e678e3c945c525b0
Merge: 351bd73875 5621b2df84
Author: marty hiatt 
Commit: marty hiatt 

Merge branch 'develop' into insert-status-for-fold
---
 lisp/mastodon.el | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index c77170500c..cd32a2dc7a 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -414,24 +414,27 @@ not, just browse the URL in the normal fashion."
   "Check if QUERY resembles a fediverse URL."
   ;; calqued off 
https://github.com/tuskyapp/Tusky/blob/c8fc2418b8f5458a817bba221d025b85e130/app/src/main/java/com/keylesspalace/tusky/BottomSheetActivity.kt
   ;; thx to Conny Duck!
+  ;; mastodon at least seems to allow only [a-z0-9_] for usernames, plus "."
+  ;; but not at beginning or end, see 
https://github.com/mastodon/mastodon/issues/6830
+  ;; objects may have - in them
   (let* ((uri-parsed (url-generic-parse-url query))
  (query (url-filename uri-parsed)))
 (save-match-data
   (or (string-match "^/@[^/]+$" query)
   (string-match "^/@[^/]+/[[:digit:]]+$" query)
-  (string-match "^/user[s]?/@?[[:alnum:]]+$" query) ; @: pleroma or 
soapbox
+  (string-match "^/user[s]?/@?[[:alnum:]_]+$" query) ; @: pleroma or 
soapbox
   (string-match "^/notice/[[:alnum:]]+$" query)
   (string-match "^/objects/[-a-f0-9]+$" query)
   (string-match "^/notes/[a-z0-9]+$" query)
   (string-match "^/display/[-a-f0-9]+$" query)
-  (string-match "^/profile/[[:alpha:]]+$" query)
-  (string-match "^/p/[[:alpha:]]+/[[:digit:]]+$" query)
-  (string-match "^/[[:alpha:]]+$" query)
-  (string-match "^/u/[[:alpha:]]+$" query)
-  (string-match "^/c/[[:alnum:]]+$" query)
+  (string-match "^/profile/[[:alpha:]_]+$" query)
+  (string-match "^/p/[[:alpha:]_]+/[[:digit:]]+$" query)
+  (string-match "^/[[:alpha:]_]+$" query)
+  (string-match "^/u/[[:alpha:]_]+$" query)
+  (string-match "^/c/[[:alnum:]_]+$" query)
   (string-match "^/post/[[:digit:]]+$" query)
   (string-match "^/comment/[[:digit:]]+$" query) ; lemmy
-  (string-match "^/user[s]?/[[:alnum:]]+/statuses/[[:digit:]]+$" 
query) ; hometown
+  (string-match "^/user[s]?/[[:alnum:]_]+/statuses/[[:digit:]]+$" 
query) ; hometown
   (string-match "^/notes/[[:alnum:]]+$" query) ; misskey post
 
 (defun mastodon-live-buffers ()



[nongnu] elpa/mastodon b8e8328a35 04/63: use with-toot-item and clean up functions that use it

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit b8e8328a35efa67b5f4b3eb2ea26821fa13120f9
Author: marty hiatt 
Commit: marty hiatt 

use with-toot-item and clean up functions that use it
---
 lisp/mastodon-toot.el | 177 +-
 1 file changed, 88 insertions(+), 89 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index e934352690..d732e3d481 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -266,15 +266,36 @@ send.")
"\\>")) ; boundary end
 
 
+;;; UTILS
+
+(defun mastodon-toot--base-toot-or-item-json ()
+  "Return the JSON data of either base-toot or item-json property.
+The former is for boost or favourite notifications, returning
+data about the item boosted or favourited."
+  (or (mastodon-tl--property 'base-toot :no-move) ; fave/boost notifs
+  (mastodon-tl--property 'item-json)))
+
+
 ;;; MACRO
 
 (defmacro mastodon-tl--with-toot-item (&rest body)
   "Execute BODY if we have a toot object at point.
-Includes boosts, and notifications that display toots."
+Includes boosts, and notifications that display toots.
+This macro makes the id local variable available."
   (declare (debug t))
   `(if (not (equal 'toot (mastodon-tl--property 'item-type :no-move)))
-   (message "Looks like there's no toot at point?")
- ,@body))
+   (user-error "Looks like there's no toot at point?")
+ (mastodon-tl--with-toot-helper
+  (lambda (id)
+,@body
+
+(defun mastodon-tl--with-toot-helper (body-fun)
+  "Helper function for `mastodon-tl--with-toot-item'.
+Extract any common variables needed, such as base-item-id
+property, and call BODY-FUN on them."
+  (let ((id (mastodon-tl--property 'base-item-id)))
+(funcall body-fun id)))
+
 
 ;;; MODE MAP
 
@@ -370,20 +391,17 @@ boosting, or bookmarking toots."
  (response (mastodon-http--post url)))
 (mastodon-http--triage response callback)))
 
-(defun mastodon-toot--toggle-boost-or-favourite (type)
+(defun mastodon-toot--toggle-boost-or-favourite (action)
   "Toggle boost or favourite of toot at `point'.
-TYPE is a symbol, either `favourite' or `boost.'"
+ACTION is a symbol, either `favourite' or `boost.'"
   (mastodon-tl--with-toot-item
(let ((n-type (mastodon-tl--property 'notification-type :no-move)))
  (if (or (equal n-type "follow")
  (equal n-type "follow_request"))
  (user-error (format "Can't do action on %s notifications." n-type))
-   (let* ((boost-p (equal type 'boost))
-  ;;   (has-id (mastodon-tl--property 'base-item-id))
-  (byline-region ;(when has-id
+   (let* ((boost-p (equal action 'boost))
+  (byline-region
(mastodon-tl--find-property-range 'byline (point)))
-  (id (when byline-region
-(mastodon-tl--as-string (mastodon-tl--property 
'base-item-id
   (boosted (when byline-region
  (get-text-property (car byline-region) 'boosted-p)))
   (faved (when byline-region
@@ -395,44 +413,35 @@ TYPE is a symbol, either `favourite' or `boost.'"
   (action-string (if boost-p "boost" "favourite"))
   (remove (if boost-p (when boosted t) (when faved t)))
   (item-json (mastodon-tl--property 'item-json))
-  (toot-type (alist-get 'type item-json))
   (visibility (mastodon-tl--field 'visibility item-json)))
- (if byline-region
- (if (and (or (equal visibility "direct")
-  (equal visibility "private"))
-  boost-p)
- (message "You cant boost posts with visibility: %s" 
visibility)
-   (cond ;; actually there's nothing wrong with faving/boosting 
own toots!
-;;((mastodon-toot--own-toot-p (mastodon-tl--property 
'item-json))
-;;(error "You can't %s your own toots" action-string))
-;; & nothing wrong with faving/boosting own toots from notifs:
-;; this boosts/faves the base toot, not the notif status
-((and (equal "reblog" toot-type)
-  (not (mastodon-tl--buffer-type-eq 'notifications)))
- (user-error "You can't %s boosts" action-string))
-((and (equal "favourite" toot-type)
-  (not (mastodon-tl--buffer-type-eq 'notifications)))
- (user-error "You can't %s favourites" action-string))
-((and (equal "private" visibility)
-  (equal type 'boost))
- (user-error "You can't boost private toots"))
-(t
- (mastodon-toot--action
-  action
-  (lambda (_)
-(let ((inhibit-read-only t))
-  (add-text-properties (car byline-region)
-   (cdr byline-region)
-   (if bo

[nongnu] elpa/mastodon 8df12b8808 15/63: update info

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 8df12b88088bb2b7072ea364fd2b0bdf74acd14a
Author: marty hiatt 
Commit: marty hiatt 

update info
---
 mastodon.info | 113 +++---
 mastodon.texi |  28 ++-
 2 files changed, 87 insertions(+), 54 deletions(-)

diff --git a/mastodon.info b/mastodon.info
index e300abeff7..1689c1d1bf 100644
--- a/mastodon.info
+++ b/mastodon.info
@@ -24,6 +24,7 @@ README
 * Contributing::
 * Supporting ‘mastodon.el’: Supporting mastodonel.
 * Contributors::
+* screenshots::
 
 Installation
 
@@ -76,6 +77,7 @@ have it installed you should be able to browse this readme 
inside emacs.
 * Contributing::
 * Supporting ‘mastodon.el’: Supporting mastodonel.
 * Contributors::
+* screenshots::
 
 
 File: mastodon.info,  Node: Installation,  Next: Usage,  Up: README
@@ -150,10 +152,12 @@ File: mastodon.info,  Node: Emoji,  Next: Discover,  
Prev: Repo,  Up: Installati
 1.1.4 Emoji
 ---
 
-‘mastodon-mode’ will enable Emojify
-(https://github.com/iqbalansari/emacs-emojify) if it is loaded in your
-Emacs environment, so there’s no need to write your own hook anymore.
-‘emojify-mode’ is not required.
+Since Emacs 28, it has builtin emoji support with ‘emoji.el’.  If you
+prefer to use Emojify (https://github.com/iqbalansari/emacs-emojify),
+‘require’ it and set ‘mastodon-use-emojify’ to non-nil to display emoji
+in timelines and to use it when composing toots.  ‘Emoji.el’ is the
+better option, but for now only ‘emojify’ supports downloading and using
+custom emoji from your instance.
 
 
 File: mastodon.info,  Node: Discover,  Prev: Emoji,  Up: Installation
@@ -361,7 +365,7 @@ is as follows:
   1. Keybindings
 
  Key  Action
- --
+ -
  ‘C-c C-c’Send toot
  ‘C-c C-k’Cancel toot
  ‘C-c C-w’Add content warning
@@ -369,7 +373,7 @@ is as follows:
  ‘C-c C-n’Add sensitive media/nsfw flag
  ‘C-c C-a’Upload attachment(s)
  ‘C-c !’  Remove all attachments
- ‘C-c C-e’Add emoji (if ‘emojify’ installed)
+ ‘C-c C-e’Insert emoji
  ‘C-c C-p’Create a poll
  ‘C-c C-l’Set toot language
  ‘-C-c C-s’   Schedule toot
@@ -381,7 +385,8 @@ is as follows:
  ‘mastodon-toot--enable-completion’ is enabled by default.
 
  To trigger completion, type a prefix followed by a few letters, ‘@’
- for mentions, ‘#’ for tags, and ‘:’ for emoji.
+ for mentions, ‘#’ for tags, and ‘:’ for emoji (for now this only
+ works when using ‘emojify.el’).
 
  If you want to enable ‘company-mode’ in the toot compose buffer,
  set ‘mastodon-toot--use-company-for-completion’ to ‘t’.
@@ -574,11 +579,12 @@ File: mastodon.info,  Node: Bookmarks and mastodonel,  
Prev: Translating toots,
 1.2.10 Bookmarks and ‘mastodon.el’
 --
 
-‘mastodon.el’ doesn’t currently implement its own bookmark record and
-handler, which means that emacs bookmarks will not work as is.  Until we
-implement them, you can get bookmarks going immediately by using
-bookmark+.el
-(https://github.com/emacsmirror/emacswiki.org/blob/master/bookmark%2b.el).
+‘mastodon.el’ implements a basic bookmark record and handler.
+Currently, this means that you can bookmark a post item and later load
+it in thread view.  This could be expanded to any item with an id, but
+probably not to things like timeline views.  If you want to be able to
+bookmark something, open an issue and ask, it’s trivial to expand the
+bookmarking code.
 
 
 File: mastodon.info,  Node: Dependencies,  Next: Network compatibility,  Prev: 
Usage,  Up: README
@@ -592,7 +598,7 @@ Hard dependencies (should all install with ‘mastodon.el’):
• ‘persist’ for storing some settings across sessions
 
Optional dependencies (install yourself, ‘mastodon.el’ can use them):
-   • ‘emojify’ for inserting and viewing emojis
+   • ‘emojify’ to use custom emoji (else we use builtin ‘emoji.el’)
• ‘mpv’ and ‘mpv.el’ for viewing videos and gifs
• ‘lingva.el’ for translating toots
 
@@ -701,7 +707,7 @@ I can provide IBAN or other bank account details.
 out.
 
 
-File: mastodon.info,  Node: Contributors,  Prev: Supporting mastodonel,  Up: 
README
+File: mastodon.info,  Node: Contributors,  Next: screenshots,  Prev: 
Supporting mastodonel,  Up: README
 
 1.7 Contributors
 
@@ -716,41 +722,58 @@ File: mastodon.info,  Node: Contributors,  Prev: 
Supporting mastodonel,  Up: REA
• 
 
+
+File: mastodon.info,  Node: screenshots,  Prev: Contributors,  Up: README
+
+1.8 screenshots
+===
+
+Here’s a (federated) timeline:
+
+��[image src="screenshot-tl.png"��]
+
+
+   Here’s a notifcations view plus a compose buffer:
+
+��[image src="screenshot-notifs+compose.png"��]
+
+
 
 
 Tag Table:
 Node: Top210
-Node: README962
-Nod

[nongnu] elpa/mastodon d60d1d4c31 34/63: read CW when setting, not when sending, also display it. FIX #569.

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit d60d1d4c316a74397b6607b4d050d71b08ac007b
Author: marty hiatt 
Commit: marty hiatt 

read CW when setting, not when sending, also display it. FIX #569.
---
 lisp/mastodon-toot.el | 34 --
 1 file changed, 12 insertions(+), 22 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index f07e461eb6..e884f97f45 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -166,10 +166,7 @@ By default fixed width fonts are used."
 width fonts"))
 
 (defvar-local mastodon-toot--content-warning nil
-  "A flag whether the toot should be marked with a content warning.")
-
-(defvar-local mastodon-toot--content-warning-from-reply-or-redraft nil
-  "The content warning of the toot being replied to.")
+  "The content warning of the current toot.")
 
 (defvar-local mastodon-toot--content-nsfw nil
   "A flag indicating whether the toot should be marked as NSFW.")
@@ -278,7 +275,7 @@ Includes boosts, and notifications that display toots."
   (let ((map (make-sparse-keymap)))
 (define-key map (kbd "C-c C-c") #'mastodon-toot--send)
 (define-key map (kbd "C-c C-k") #'mastodon-toot--cancel)
-(define-key map (kbd "C-c C-w") #'mastodon-toot--toggle-warning)
+(define-key map (kbd "C-c C-w") #'mastodon-toot--set-content-warning)
 (define-key map (kbd "C-c C-n") #'mastodon-toot--toggle-nsfw)
 (define-key map (kbd "C-c C-v") #'mastodon-toot--change-visibility)
 (define-key map (kbd "C-c C-e") #'mastodon-toot--insert-emoji)
@@ -658,8 +655,7 @@ NO-REDRAFT means delete toot only."
   "Set content warning to CW if it is non-nil."
   (unless (or (null cw) ; cw is nil for `mastodon-tl--dm-user'
   (string-empty-p cw))
-(setq mastodon-toot--content-warning t)
-(setq mastodon-toot--content-warning-from-reply-or-redraft cw)))
+(setq mastodon-toot--content-warning cw)))
 
 
 ;;; REDRAFT
@@ -863,13 +859,6 @@ to `emojify-user-emojis', and the emoji data is updated."
`(("poll[multiple]" . ,(symbol-name (plist-get mastodon-toot-poll :multi
`(("poll[hide_totals]" . ,(symbol-name (plist-get mastodon-toot-poll 
:hide))
 
-(defun mastodon-toot--read-cw-string ()
-  "Read a content warning from the minibuffer."
-  (when (and (not (mastodon-toot--empty-p))
- mastodon-toot--content-warning)
-(read-string "Warning: "
- mastodon-toot--content-warning-from-reply-or-redraft)))
-
 
 ;;; SEND TOOT FUNCTION
 
@@ -887,13 +876,12 @@ instance to edit a toot."
  (endpoint (if edit-id ; we are sending an edit:
(mastodon-http--api (format "statuses/%s" edit-id))
  (mastodon-http--api "statuses")))
- (cw (mastodon-toot--read-cw-string))
  (args-no-media (append `(("status" . ,toot)
   ("in_reply_to_id" . 
,mastodon-toot--reply-to-id)
   ("visibility" . ,mastodon-toot--visibility)
   ("sensitive" . ,(when 
mastodon-toot--content-nsfw
 (symbol-name t)))
-  ("spoiler_text" . ,cw)
+  ("spoiler_text" . 
,mastodon-toot--content-warning)
   ("language" . ,mastodon-toot--language))
 ;; Pleroma instances can't handle null-valued
 ;; scheduled_at args, so only add if non-nil
@@ -919,7 +907,8 @@ instance to edit a toot."
 (length mastodon-toot--media-attachment-ids)
(message "Something is wrong with your uploads. Wait for them to 
complete or try again."))
   ((and mastodon-toot--max-toot-chars
-(> (mastodon-toot--count-toot-chars toot cw) 
mastodon-toot--max-toot-chars))
+(> (mastodon-toot--count-toot-chars toot 
mastodon-toot--content-warning)
+   mastodon-toot--max-toot-chars))
(message "Looks like your toot (inc. CW) is longer than that 
maximum allowed length."))
   ((mastodon-toot--empty-p)
(message "Empty toot. Cowardly refusing to post this."))
@@ -1226,11 +1215,11 @@ prefixed by >."
 
 ;;; COMPOSE TOOT SETTINGS
 
-(defun mastodon-toot--toggle-warning ()
-  "Toggle `mastodon-toot--content-warning'."
+(defun mastodon-toot--set-content-warning ()
+  "Set a content warning for the current toot."
   (interactive)
   (setq mastodon-toot--content-warning
-(not mastodon-toot--content-warning))
+(read-string "Warning: " mastodon-toot--content-warning))
   (mastodon-toot--update-status-fields))
 
 (defun mastodon-toot--toggle-nsfw ()
@@ -1806,8 +1795,9 @@ REPLY-REGION is a string to be injected into the buffer."
(prin1-to-string mastodon-toot-poll))
   (mastodon-toot--apply-fields-props
cw-region
-   (if mastodon-toot--content-warning
-   "CW"
+  

[nongnu] elpa/mastodon 82931c0869 14/63: readme, emoji

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 82931c0869387c3567e4b5e2f6383c980f73748c
Author: marty hiatt 
Commit: marty hiatt 

readme, emoji
---
 README.org | 37 ++---
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/README.org b/README.org
index 53cb508cc0..48ee9796c3 100644
--- a/README.org
+++ b/README.org
@@ -65,8 +65,7 @@ it shouldn't be very hard to get it working.
 
 *** Emoji
 
-=mastodon-mode= will enable 
[[https://github.com/iqbalansari/emacs-emojify][Emojify]] if it is loaded in 
your Emacs environment, so
-there's no need to write your own hook anymore. =emojify-mode= is not required.
+Since Emacs 28, it has builtin emoji support with =emoji.el=. If you prefer to 
use [[https://github.com/iqbalansari/emacs-emojify][Emojify]], =require= it and 
set =mastodon-use-emojify= to non-nil to display emoji in timelines and to use 
it when composing toots. =Emoji.el= is the better option, but for now only 
=emojify= supports downloading and using custom emoji from your instance.
 
 *** Discover
 
@@ -242,21 +241,21 @@ value of that hook is as follows:
 
  Keybindings
 
-|--+--|
-| Key  | Action   |
-|--+--|
-| =C-c C-c=  | Send toot|
-| =C-c C-k=  | Cancel toot  |
-| =C-c C-w=  | Add content warning  |
-| =C-c C-v=  | Change toot visibility   |
-| =C-c C-n=  | Add sensitive media/nsfw flag|
-| =C-c C-a=  | Upload attachment(s) |
-| =C-c !=| Remove all attachments   |
-| =C-c C-e=  | Add emoji (if =emojify= installed) |
-| =C-c C-p=  | Create a poll|
-| =C-c C-l=  | Set toot language|
-| =-C-c C-s= | Schedule toot|
-|--+--|
+|--+---|
+| Key  | Action|
+|--+---|
+| =C-c C-c=  | Send toot |
+| =C-c C-k=  | Cancel toot   |
+| =C-c C-w=  | Add content warning   |
+| =C-c C-v=  | Change toot visibility|
+| =C-c C-n=  | Add sensitive media/nsfw flag |
+| =C-c C-a=  | Upload attachment(s)  |
+| =C-c !=| Remove all attachments|
+| =C-c C-e=  | Insert emoji  |
+| =C-c C-p=  | Create a poll |
+| =C-c C-l=  | Set toot language |
+| =-C-c C-s= | Schedule toot |
+|--+---|
 
  Autocompletion of mentions, tags and emoji
 
@@ -265,7 +264,7 @@ Autocompletion of mentions, tags, and emojis is provided by
 =mastodon-toot--enable-completion= is enabled by default.
 
 To trigger completion, type a prefix followed by a few letters, =@= for
-mentions, =#= for tags, and =:= for emoji.
+mentions, =#= for tags, and =:= for emoji (for now this only works when using 
=emojify.el=).
 
 If you want to enable =company-mode= in the toot compose buffer, set
 =mastodon-toot--use-company-for-completion= to =t=. (=mastodon.el= used to run 
its
@@ -424,7 +423,7 @@ Hard dependencies (should all install with =mastodon.el=):
 - =persist= for storing some settings across sessions
 
 Optional dependencies (install yourself, =mastodon.el= can use them):
-- =emojify= for inserting and viewing emojis
+- =emojify= to use custom emoji (else we use builtin =emoji.el=)
 - =mpv= and =mpv.el= for viewing videos and gifs
 - =lingva.el= for translating toots
 



[nongnu] elpa/mastodon da0e348bc7 61/63: Revert "multisession var in -toot.el"

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit da0e348bc7aaa48474da8cf0ee657fed3f5e485d
Author: marty hiatt 
Commit: marty hiatt 

Revert "multisession var in -toot.el"

This reverts commit 00ac9103adba722f8c2ddbd67db6b0ff6bcebc46.
---
 lisp/mastodon-toot.el | 50 +-
 1 file changed, 21 insertions(+), 29 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 6387beae17..7497429595 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -40,6 +40,7 @@
 (defvar emojify-user-emojis)
 
 (require 'cl-lib)
+(require 'persist)
 (require 'mastodon-iso)
 (require 'facemenu)
 (require 'text-property-search)
@@ -222,8 +223,8 @@ Takes its form from `window-configuration-to-register'.")
 (defvar mastodon-toot-current-toot-text nil
   "The text of the toot being composed.")
 
-(define-multisession-variable mastodon-toot-draft-toots-list nil
-  "A list of toots that have been saved as drafts.
+(persist-defvar mastodon-toot-draft-toots-list nil
+"A list of toots that have been saved as drafts.
 For the moment we just put all composed toots in here, as we want
 to also capture toots that are \"sent\" but that don't successfully
 send.")
@@ -713,10 +714,8 @@ CANCEL means the toot was not sent, so we save the toot 
text as a draft."
   (let ((prev-window-config mastodon-toot-previous-window-config))
 (unless (eq mastodon-toot-current-toot-text nil)
   (when cancel
-(setf (multisession-value mastodon-toot-draft-toots-list)
-  (cl-pushnew mastodon-toot-current-toot-text
-  (multisession-value mastodon-toot-draft-toots-list)
-  :test 'equal
+(cl-pushnew mastodon-toot-current-toot-text
+mastodon-toot-draft-toots-list :test 'equal)))
 ;; prevent some weird bug when cancelling a non-empty toot:
 (delete #'mastodon-toot--save-toot-text after-change-functions)
 (quit-window 'kill)
@@ -738,10 +737,8 @@ Pushes `mastodon-toot-current-toot-text' to
 `mastodon-toot-draft-toots-list'."
   (interactive)
   (unless (eq mastodon-toot-current-toot-text nil)
-(setf (multisession-value mastodon-toot-draft-toots-list)
-  (cl-pushnew mastodon-toot-current-toot-text
-  (multisession-value mastodon-toot-draft-toots-list)
-  :test 'equal))
+(cl-pushnew mastodon-toot-current-toot-text
+mastodon-toot-draft-toots-list :test 'equal)
 (message "Draft saved!")))
 
 (defun mastodon-toot--empty-p (&optional text-only)
@@ -1825,18 +1822,16 @@ Added to `after-change-functions' in new toot buffers."
 (defun mastodon-toot--open-draft-toot ()
   "Prompt for a draft and compose a toot with it."
   (interactive)
-  (if (multisession-value mastodon-toot-draft-toots-list)
-  (let ((text (completing-read
-   "Select draft toot: "
-   (multisession-value mastodon-toot-draft-toots-list)
-   nil t)))
+  (if mastodon-toot-draft-toots-list
+  (let ((text (completing-read "Select draft toot: "
+   mastodon-toot-draft-toots-list
+   nil t)))
 (if (not (mastodon-toot--compose-buffer-p))
 (mastodon-toot--compose-buffer nil nil nil text)
   (when (and (not (mastodon-toot--empty-p :text-only))
  (y-or-n-p "Replace current text with draft?"))
-(setf (multisession-value mastodon-toot-draft-toots-list)
-  (cl-pushnew mastodon-toot-current-toot-text
-  (multisession-value 
mastodon-toot-draft-toots-list)))
+(cl-pushnew mastodon-toot-current-toot-text
+mastodon-toot-draft-toots-list)
 (goto-char
  (cdr (mastodon-tl--find-property-range 'toot-post-header
 (point-min
@@ -1851,22 +1846,19 @@ Added to `after-change-functions' in new toot buffers."
 (defun mastodon-toot--delete-draft-toot ()
   "Prompt for a draft toot and delete it."
   (interactive)
-  (if (not (multisession-value mastodon-toot-draft-toots-list))
-  (message "No drafts to delete.")
-(let ((draft (completing-read
-  "Select draft to delete: "
-  (multisession-value mastodon-toot-draft-toots-list)
-  nil t)))
-  (setf (multisession-value mastodon-toot-draft-toots-list)
-(cl-delete draft
-   (multisession-value mastodon-toot-draft-toots-list)
-   :test #'equal))
+  (if (not mastodon-toot-draft-toots-list)
+  (user-error "No drafts to delete")
+(let ((draft (completing-read "Select draft to delete: "
+  mastodon-toot-draft-toots-list
+  nil t)))
+  (setq mastodon-toot-draft-toots-list
+(cl-delete draft mastodon-

[nongnu] elpa/mastodon c8565612b9 22/63: fold long posts, unfolding cmd. FIX #572.

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit c8565612b95ce09c1d55470943a52c25798c27a1
Author: marty hiatt 
Commit: marty hiatt 

fold long posts, unfolding cmd. FIX #572.
---
 lisp/mastodon-tl.el | 51 +++
 1 file changed, 47 insertions(+), 4 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index ac3000539a..d87a469cc2 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -979,6 +979,8 @@ the toot)."
 LINK-TYPE is the type of link to produce."
   (let ((help-text (cond ((eq link-type 'content-warning)
   "Toggle hidden text")
+ ((eq link-type 'read-more)
+  "Toggle full post")
  (t
   (error "Unknown link type %s" link-type)
 (propertize string
@@ -1020,6 +1022,8 @@ Used for hitting RET on a given link."
 "Search for account returned nothing. Perform URL 
lookup?")
(mastodon-url-lookup (get-text-property position 
'shr-url))
  (message "Unable to find account."
+  ((eq link-type 'read-more)
+   (mastodon-tl--unfold-post))
   (t
(error "Unknown link type %s" link-type)
 
@@ -1526,12 +1530,13 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
(concat (mastodon-tl--symbol 'replied)
"\n")
  "")
-   (if (and after-reply-status-p thread)
-   (let ((bar (mastodon-tl--symbol 'reply-bar)))
+   (let ((bar (mastodon-tl--symbol 'reply-bar))
+ (body (mastodon-tl--fold-body-maybe body)))
+ (if (and after-reply-status-p thread)
  (propertize body
  'line-prefix bar
- 'wrap-prefix bar))
- body)
+ 'wrap-prefix bar)
+   body))
" \n"
;; byline:
(mastodon-tl--byline toot author-byline action-byline detailed-p 
domain))
@@ -1551,6 +1556,44 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
 (when mastodon-tl--display-media-p
   (mastodon-media--inline-images start-pos (point)
 
+(defun mastodon-tl--fold-body-maybe (body)
+  "Fold toot BODY if it is very long."
+  (if (length> body 500)
+  (let* ((heading (mastodon-search--format-heading
+   (mastodon-tl--make-link
+"READ MORE"
+'read-more)))
+ (display (concat (substring body 0 500)
+  heading)))
+(propertize display
+'read-more body))
+body))
+
+(defun mastodon-tl--unfold-post ()
+  "Unfold the toot at point if it is folded (read-more)."
+  (interactive)
+  ;; if at byline, must search backwards:
+  (let* ((byline (mastodon-tl--property 'byline :no-move))
+ (range (mastodon-tl--find-property-range
+ 'read-more (point) byline)))
+(if (not range)
+(user-error "No folded item at point?")
+  (let* ((inhibit-read-only t)
+ (body (save-excursion
+ (goto-char (car range))
+ (mastodon-tl--property 'read-more
+;; `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)))
+  (save-excursion
+(goto-char beg)
+(delete-region beg end)
+(insert body))
+  ;; move point to line where text formerly ended:
+  (goto-char end)
+  (beginning-of-line))
+
 ;; from mastodon-alt.el:
 (defun mastodon-tl--toot-for-stats (&optional toot)
   "Return the TOOT on which we want to extract stats.



[nongnu] elpa/mastodon d0a5bae331 50/63: refactor toot--toggle-boost-or-favourite

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit d0a5bae33167402f6abc8707642945a738b2fe19
Author: marty hiatt 
Commit: marty hiatt 

refactor toot--toggle-boost-or-favourite
---
 lisp/mastodon-toot.el | 91 ++-
 1 file changed, 46 insertions(+), 45 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index a935c9ed5f..9b8117a884 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -386,56 +386,57 @@ boosting, or bookmarking toots."
 (mastodon-http--triage response callback)))
 
 (defun mastodon-toot--toggle-boost-or-favourite (action)
-  "Toggle boost or favourite of toot at `point'.
+  "Toggle boost or favourite of toot at point.
 ACTION is a symbol, either `favourite' or `boost.'"
   (mastodon-toot--with-toot-item
-   (let ((n-type (mastodon-tl--property 'notification-type :no-move)))
- (if (or (equal n-type "follow")
- (equal n-type "follow_request"))
- (user-error (format "Can't do action on %s notifications." n-type))
-   (let* ((boost-p (equal action 'boost))
-  (byline-region
-   (mastodon-tl--find-property-range 'byline (point)))
-  (boosted (when byline-region
+   (let* ((n-type (mastodon-tl--property 'notification-type :no-move))
+  (byline-region (mastodon-tl--find-property-range 'byline (point)))
+  (boost-p (eq action 'boost))
+  (action-str (symbol-name action))
+  (item-json (mastodon-tl--property 'item-json))
+  (vis (mastodon-tl--field 'vis item-json)))
+ (cond
+  ((not byline-region)
+   (user-error "Nothing to %s here?!?" action-str))
+  ;; there's nothing wrong with faving/boosting own toots
+  ;; & nothing wrong with faving/boosting own toots from notifs,
+  ;; it boosts/faves the base toot, not the notif status
+  ((or (equal n-type "follow")
+   (equal n-type "follow_request"))
+   (user-error "Can't %s %s notifications" action n-type))
+  ((and boost-p
+(or (equal vis "direct")
+(equal vis "private")))
+   (user-error "Can't boost posts with visibility: %s" vis))
+  (t
+   (let* ((boosted (when byline-region
  (get-text-property (car byline-region) 'boosted-p)))
   (faved (when byline-region
(get-text-property (car byline-region) 'favourited-p)))
-  (action (if boost-p
-  (if boosted "unreblog" "reblog")
-(if faved "unfavourite" "favourite")))
-  (msg (if boosted "unboosted" "boosted"))
-  (action-string (if boost-p "boost" "favourite"))
-  (remove (if boost-p (when boosted t) (when faved t)))
-  (item-json (mastodon-tl--property 'item-json))
-  (visibility (mastodon-tl--field 'visibility item-json)))
- (if (not byline-region)
- (user-error "Nothing to %s here?!?" action-string)
-   (if (and (or (equal visibility "direct")
-(equal visibility "private"))
-boost-p)
-   (user-error "You cant boost posts with visibility: %s"
-   visibility)
- ;; there's nothing wrong with faving/boosting own toots
- ;; & nothing wrong with faving/boosting own toots from notifs,
- ;; it boosts/faves the base toot, not the notif status
- (if (and (equal "private" visibility)
-  (eq action 'boost))
- (user-error "You can't boost private toots")
-   (mastodon-toot--action
-action
-(lambda (_)
-  (let ((inhibit-read-only t))
-(add-text-properties (car byline-region)
- (cdr byline-region)
- (if boost-p
- (list 'boosted-p (not boosted))
-   (list 'favourited-p (not faved
-(mastodon-toot--update-stats-on-action action remove)
-(mastodon-toot--action-success (if boost-p
-   (mastodon-tl--symbol 
'boost)
- (mastodon-tl--symbol 
'favourite))
-   byline-region remove 
item-json))
-  (message "%s #%s" (if boost-p msg action) id)))
+  (str-api (if boost-p "reblog" action-str))
+  (action-str-api (mastodon-toot--str-negify str-api faved 
boosted))
+  (action-pp (concat (mastodon-toot--str-negify action-str faved 
boosted)
+ (if boost-p "ed" "d")))
+  (remove (if boost-p (when boosted t) (when faved t
+ (mastodon-toot--action
+  action-str-api
+ 

[nongnu] elpa/mastodon 351bd73875 54/63: fix prev-item-id

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 351bd73875c5d59a02b7126a35a7883be15b5058
Author: marty hiatt 
Commit: marty hiatt 

fix prev-item-id
---
 lisp/mastodon-tl.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 99d6eac7a6..8c004183b2 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1494,11 +1494,11 @@ Runs `mastodon-tl--render-text' and fetches poll or 
media."
   "Return the id of the last toot inserted into the buffer."
   (let* ((prev-change
   (save-excursion
-(previous-single-property-change (point) 'base-toot-id)))
+(previous-single-property-change (point) 'base-item-id)))
  (prev-pos
   (when prev-change (1- prev-change
 (when prev-pos
-  (get-text-property prev-pos 'base-toot-id
+  (get-text-property prev-pos 'base-item-id
 
 (defun mastodon-tl--after-reply-status (reply-to-id)
   "T if REPLY-TO-ID is equal to that of the last toot inserted in the bufer."



[nongnu] elpa/mastodon cf72fb5af0 47/63: bind fold toggle

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit cf72fb5af09123663ef80dd373e44bc1e26233b0
Author: marty hiatt 
Commit: marty hiatt 

bind fold toggle
---
 lisp/mastodon.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index 8a0aa91790..c77170500c 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -234,6 +234,7 @@ while emojify,el has this feature and mastodon.el 
implements it.")
 (define-key map (kbd "G") #'mastodon-views--view-follow-suggestions)
 (define-key map (kbd "X") #'mastodon-views--view-lists)
 (define-key map (kbd "SPC") #'mastodon-tl--scroll-up-command)
+(define-key map (kbd "!") #'mastodon-tl--fold-post-toggle)
 (define-key map (kbd "z") #'bury-buffer)
 map)
   "Keymap for `mastodon-mode'.")



[nongnu] elpa/mastodon 8c4f18cca7 32/63: toot--insert-emoji: defalis -> defun.

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 8c4f18cca757f639aa9c19fc03a92b94c22b9d07
Author: marty hiatt 
Commit: marty hiatt 

toot--insert-emoji: defalis -> defun.

the alias is only set on loading, when mastodon-use-emojify may not be set
yet. so we defun it which means it'll check the var whenever it is run.
---
 lisp/mastodon-toot.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 4b1e22574b..f07e461eb6 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -762,11 +762,12 @@ TEXT-ONLY means don't check for attachments or polls."
 
 ;;; EMOJIS
 
-(defalias 'mastodon-toot--insert-emoji
+(defun mastodon-toot--insert-emoji ()
+  "Prompt to insert an emoji."
+  (interactive)
   (if mastodon-use-emojify
-  #'emojify-insert-emoji
-#'emoji-search)
-  "Prompt to insert an emoji.")
+  (emojify-insert-emoji)
+(emoji-search)))
 
 (defun mastodon-toot--emoji-dir ()
   "Return the file path for the mastodon custom emojis directory."



[nongnu] elpa/mastodon f8ee682bb4 36/63: flip an if clause

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit f8ee682bb403b5488294e69c464149626221f7c7
Author: marty hiatt 
Commit: marty hiatt 

flip an if clause
---
 lisp/mastodon-toot.el | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 666d1b080d..0cd66dbc17 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1863,17 +1863,17 @@ Added to `after-change-functions' in new toot buffers."
 (defun mastodon-toot--delete-draft-toot ()
   "Prompt for a draft toot and delete it."
   (interactive)
-  (if (multisession-value mastodon-toot-draft-toots-list)
-  (let ((draft (completing-read
-"Select draft to delete: "
-(multisession-value mastodon-toot-draft-toots-list)
-nil t)))
-(setf (multisession-value mastodon-toot-draft-toots-list)
-  (cl-delete draft
- (multisession-value mastodon-toot-draft-toots-list)
- :test #'equal))
-(message "Draft deleted!"))
-(message "No drafts to delete.")))
+  (if (not (multisession-value mastodon-toot-draft-toots-list))
+  (message "No drafts to delete.")
+(let ((draft (completing-read
+  "Select draft to delete: "
+  (multisession-value mastodon-toot-draft-toots-list)
+  nil t)))
+  (setf (multisession-value mastodon-toot-draft-toots-list)
+(cl-delete draft
+   (multisession-value mastodon-toot-draft-toots-list)
+   :test #'equal))
+  (message "Draft deleted!"
 
 (defun mastodon-toot--delete-all-drafts ()
   "Delete all drafts."



[nongnu] elpa/mastodon 534644d2bd 13/63: toot: default to emoji.el, emojify customize

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 534644d2bd6a0a14b89d7bdacc41d305fcf265b6
Author: marty hiatt 
Commit: marty hiatt 

toot: default to emoji.el, emojify customize

mastodon-use-emojify customize
---
 lisp/mastodon-toot.el | 16 +++-
 lisp/mastodon.el  |  8 +++-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index e934352690..ecee301828 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -31,6 +31,8 @@
 ;;; Code:
 (eval-when-compile (require 'subr-x))
 
+
+(defvar mastodon-use-emojify)
 (require 'emojify nil :noerror)
 (declare-function emojify-insert-emoji "emojify")
 (declare-function emojify-set-emoji-data "emojify")
@@ -158,11 +160,6 @@ If the original toot visibility is different we use the 
more restricted one."
   "Whether to enable your instance's custom emoji by default."
   :type 'boolean)
 
-(defcustom mastodon-toot--emojify-in-compose-buffer t
-  "Whether to enable `emojify-mode' in the compose buffer.
-We only attempt to enable it if its bound."
-  :type 'boolean)
-
 (defcustom mastodon-toot--proportional-fonts-compose nil
   "Nonnil to enable using proportional fonts in the compose buffer.
 By default fixed width fonts are used."
@@ -285,8 +282,7 @@ Includes boosts, and notifications that display toots."
 (define-key map (kbd "C-c C-w") #'mastodon-toot--toggle-warning)
 (define-key map (kbd "C-c C-n") #'mastodon-toot--toggle-nsfw)
 (define-key map (kbd "C-c C-v") #'mastodon-toot--change-visibility)
-(when (require 'emojify nil :noerror)
-  (define-key map (kbd "C-c C-e") #'mastodon-toot--insert-emoji))
+(define-key map (kbd "C-c C-e") #'mastodon-toot--insert-emoji)
 (define-key map (kbd "C-c C-a") #'mastodon-toot--attach-media)
 (define-key map (kbd "C-c !") #'mastodon-toot--clear-all-attachments)
 (define-key map (kbd "C-c C-p") #'mastodon-toot--create-poll)
@@ -764,7 +760,9 @@ TEXT-ONLY means don't check for attachments or polls."
 ;;; EMOJIS
 
 (defalias 'mastodon-toot--insert-emoji
-  #'emojify-insert-emoji
+  (if mastodon-use-emojify
+  #'emojify-insert-emoji
+#'emoji-search)
   "Prompt to insert an emoji.")
 
 (defun mastodon-toot--emoji-dir ()
@@ -2022,7 +2020,7 @@ EDIT means we are editing an existing toot, not composing 
a new one."
 (setq mastodon-toot-previous-window-config previous-window-config)
 (when mastodon-toot--proportional-fonts-compose
   (facemenu-set-face 'variable-pitch))
-(when (and mastodon-toot--emojify-in-compose-buffer
+(when (and mastodon-use-emojify
;; emojify loaded but poss not enabled in our buffer:
(boundp 'emojify-mode))
   (emojify-mode))
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index d0dddeeb6f..73a8665a90 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -144,6 +144,11 @@ The default value \"%F %T\" prints ISO8601-style 
-mm-dd HH:MM:SS.
 Use. e.g. \"%c\" for your locale's date and time format."
   :type 'string)
 
+(defcustom mastodon-use-emojify nil
+  "Whether to use emojify.el to display emojis.
+From version 28, Emacs can display emojis natively. But
+currently, it doesn't seem to have a way to handle custom emoji,
+while emojify,el has this feature and mastodon.el implements it.")
 
 (defun mastodon-kill-window ()
   "Quit window and delete helper."
@@ -464,7 +469,8 @@ Calls `mastodon-tl--get-buffer-type', which see."
 
 (defun mastodon-mode-hook-fun ()
   "Function to add to `mastodon-mode-hook'."
-  (when (require 'emojify nil :noerror)
+  (when (and mastodon-use-emojify
+ (require 'emojify nil :noerror))
 (emojify-mode t)
 (when mastodon-toot--enable-custom-instance-emoji
   (mastodon-toot--enable-custom-emoji)))



[nongnu] elpa/mastodon db227a8c25 31/63: flip an if clause

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit db227a8c2572f9985370325eca9f47d697531697
Author: marty hiatt 
Commit: marty hiatt 

flip an if clause
---
 lisp/mastodon-toot.el | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index e1d725933b..4b1e22574b 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1849,20 +1849,20 @@ Added to `after-change-functions' in new toot buffers."
"Select draft toot: "
(multisession-value mastodon-toot-draft-toots-list)
nil t)))
-(if (mastodon-toot--compose-buffer-p)
-(when (and (not (mastodon-toot--empty-p :text-only))
-   (y-or-n-p "Replace current text with draft?"))
-  (setf (multisession-value mastodon-toot-draft-toots-list)
-(cl-pushnew mastodon-toot-current-toot-text
-(multisession-value 
mastodon-toot-draft-toots-list)))
-  (goto-char
-   (cdr (mastodon-tl--find-property-range 'toot-post-header
-  (point-min
-  (kill-region (point) (point-max))
-  ;; to not save to kill-ring:
-  ;; (delete-region (point) (point-max))
-  (insert text))
-  (mastodon-toot--compose-buffer nil nil nil text)))
+(if (not (mastodon-toot--compose-buffer-p))
+(mastodon-toot--compose-buffer nil nil nil text)
+  (when (and (not (mastodon-toot--empty-p :text-only))
+ (y-or-n-p "Replace current text with draft?"))
+(setf (multisession-value mastodon-toot-draft-toots-list)
+  (cl-pushnew mastodon-toot-current-toot-text
+  (multisession-value 
mastodon-toot-draft-toots-list)))
+(goto-char
+ (cdr (mastodon-tl--find-property-range 'toot-post-header
+(point-min
+(kill-region (point) (point-max))
+;; to not save to kill-ring:
+;; (delete-region (point) (point-max))
+(insert text
 (unless (mastodon-toot--compose-buffer-p)
   (mastodon-toot--compose-buffer))
 (message "No drafts available.")))



[nongnu] elpa/mastodon 7b4d77b86b 10/63: tl: no-refresh for next-item in --single-toot

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 7b4d77b86bb88377ca75938d2f1b88b839e96a02
Author: marty hiatt 
Commit: marty hiatt 

tl: no-refresh for next-item in --single-toot
---
 lisp/mastodon-tl.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index f84f7c031f..128298d526 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1957,7 +1957,7 @@ ID is that of the toot to view."
   #'mastodon-tl--update-toot)
 (mastodon-tl--toot toot :detailed-p)
 (goto-char (point-min))
-(mastodon-tl--goto-next-item)
+(mastodon-tl--goto-next-item :no-refresh)
 
 (defun mastodon-tl--update-toot (json)
   "Call `mastodon-tl--single-toot' on id found in JSON."



[nongnu] elpa/mastodon e66ce7b6fb 52/63: folding comments / action docstring

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit e66ce7b6fb55a5f78a840ca4c00aa9773bbc9e4f
Author: marty hiatt 
Commit: marty hiatt 

folding comments / action docstring
---
 lisp/mastodon-tl.el   | 18 --
 lisp/mastodon-toot.el |  2 +-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 651427aa84..797b355efb 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1588,14 +1588,28 @@ Folding decided by `mastodon-tl--fold-toots-at-length'."
   (let* ((byline (mastodon-tl--property 'byline :no-move))
  (read-more-p (mastodon-tl--find-property-range
'read-more (point) byline)))
+;; FIXME: handle any point of the item body and byline
+;; ie if we are inbetween, try moving up or down (and check again?)
 (if (and (not fold)
  (not read-more-p))
 (user-error "No folded item at point?")
   (let* ((inhibit-read-only t)
  (range (mastodon-tl--find-property-range 'item-json (point)))
+ ;; FIXME: we need to reload toot data if we want
+ ;; fave/boost/bookmark stats to display correctly. ie if we do
+ ;; an action then (un)fold, stats/(*)/etc display incorrectly.
+
+ ;; another option may be to check favourited-p/boosted-p prop,
+ ;; and then call toot--action-success again with the relevant
+ ;; symbol (to insert it after re-display)? as per
+ ;; `mastodon-toot--toggle-boost-or-favourite' callback?
+
+ ;; or, is it simpler to just not replace the byline? to do that,
+ ;; we need to call `mastodont-tl--insert-status' without
+ ;; inserting a byline, so that props are all correct...
  (toot (mastodon-tl--property 'item-json)))
-;; `replace-region-contents' is much to slow, our hack from fedi.el is
-;; much simpler and much faster
+;; `replace-region-contents' is much too slow, our hack from fedi.el
+;; is much simpler and much faster:
 (let ((beg (car range))
   (end (cdr range))
   (last-point (point)))
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 0324c32372..12695165da 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -376,7 +376,7 @@ JSON is added to the string as its item-json."
 (mastodon-tl--goto-next-item)
 
 (defun mastodon-toot--action (action callback)
-  "Take ACTION on toot at point, then execute CALLBACK.
+  "Take ACTION, a string, on toot at point, then execute CALLBACK.
 Makes a POST request to the server. Used for favouriting,
 boosting, or bookmarking toots."
   (let* ((id (mastodon-tl--property 'base-item-id))



[nongnu] elpa/mastodon 8d6983667d 51/63: refactor toot--toggle-bookmark

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 8d6983667d51f6aec7a024bb0e2f3dd3fdddb7f4
Author: marty hiatt 
Commit: marty hiatt 

refactor toot--toggle-bookmark
---
 lisp/mastodon-toot.el | 59 +++
 1 file changed, 26 insertions(+), 33 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 9b8117a884..0324c32372 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -481,39 +481,32 @@ SUBTRACT means we are un-favouriting or unboosting, so we 
decrement."
   "Bookmark or unbookmark toot at point."
   (interactive)
   (mastodon-toot--with-toot-item
-   (let ((n-type (mastodon-tl--property 'notification-type :no-move)))
- (if (or (equal n-type "follow")
- (equal n-type "follow_request"))
- (user-error (format "Can't bookmark %s notifications." n-type))
-   (let* ((bookmarked-p (mastodon-tl--property
- 'bookmarked-p
- (if (mastodon-tl--property 'byline :no-move)
- ;; no move if not in byline, the idea being
- ;; if in body, we do move forward to byline
- ;; to toggle correctly. alternatively we
- ;; could bookmarked-p whole posts.
- :no-move)))
-  (byline-region (when id
-   (mastodon-tl--find-property-range 'byline 
(point
-  (action (if bookmarked-p "unbookmark" "bookmark"))
-  (bookmark-str (mastodon-tl--symbol 'bookmark))
-  (message (if bookmarked-p
-   "Bookmark removed!"
- "Toot bookmarked!"))
-  (remove (when bookmarked-p t))
-  (item-json (mastodon-tl--property 'item-json)))
- (if (not byline-region)
- (user-error "Nothing to %s here?!?" action)
-   (mastodon-toot--action
-action
-(lambda (_)
-  (let ((inhibit-read-only t))
-(add-text-properties (car byline-region)
- (cdr byline-region)
- (list 'bookmarked-p (not bookmarked-p
-  (mastodon-toot--action-success bookmark-str
- byline-region remove item-json)
-  (message "%s #%s" message id)
+   (let* ((n-type (mastodon-tl--property 'notification-type :no-move))
+  (byline-region (mastodon-tl--find-property-range 'byline (point)))
+  (bookmarked-p (when byline-region
+  (get-text-property (car byline-region) 
'bookmarked-p)))
+  (action (if bookmarked-p "unbookmark" "bookmark")))
+ (cond ((or (equal n-type "follow")
+(equal n-type "follow_request"))
+(user-error "Can't bookmark %s notifications" n-type))
+   ((not byline-region)
+(user-error "Nothing to %s here?!?" action))
+   (t
+(let* ((bookmark-str (mastodon-tl--symbol 'bookmark))
+   (message (if bookmarked-p
+"Bookmark removed!"
+  "Toot bookmarked!"))
+   (item-json (mastodon-tl--property 'item-json)))
+  (mastodon-toot--action
+   action
+   (lambda (_)
+ (let ((inhibit-read-only t))
+   (add-text-properties (car byline-region)
+(cdr byline-region)
+(list 'bookmarked-p (not 
bookmarked-p)))
+   (mastodon-toot--action-success bookmark-str
+  byline-region bookmarked-p 
item-json)
+   (message "%s #%s" message id))
 
 (defun mastodon-toot--list-toot-boosters ()
   "List the boosters of toot at point."



[nongnu] elpa/mastodon 46b66e332a 58/63: commentary

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 46b66e332a95096773c952598c363df5e0091d53
Author: marty hiatt 
Commit: marty hiatt 

commentary
---
 lisp/mastodon.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index cd32a2dc7a..41b6fbe450 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -32,8 +32,8 @@
 ;; mastodon.el is a client for fediverse services that implement the Mastodon
 ;; API. See .
 
-;; See the readme file at https://codeberg.org/martianh/mastodon.el for set up
-;; and usage details.
+;; For set up and usage details, see the Info documentation, or the readme
+;; file at https://codeberg.org/martianh/mastodon.el.
 
 ;;; Code:
 (require 'cl-lib) ; for `cl-some' call in mastodon



[nongnu] elpa/mastodon 00ac9103ad 25/63: multisession var in -toot.el

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 00ac9103adba722f8c2ddbd67db6b0ff6bcebc46
Author: marty hiatt 
Commit: marty hiatt 

multisession var in -toot.el
---
 lisp/mastodon-toot.el | 48 
 1 file changed, 28 insertions(+), 20 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index bb5a4c3954..902acf919f 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -38,7 +38,6 @@
 (defvar emojify-user-emojis)
 
 (require 'cl-lib)
-(require 'persist)
 (require 'mastodon-iso)
 (require 'facemenu)
 (require 'text-property-search)
@@ -226,8 +225,8 @@ Takes its form from `window-configuration-to-register'.")
 (defvar mastodon-toot-current-toot-text nil
   "The text of the toot being composed.")
 
-(persist-defvar mastodon-toot-draft-toots-list nil
-"A list of toots that have been saved as drafts.
+(define-multisession-variable mastodon-toot-draft-toots-list nil
+  "A list of toots that have been saved as drafts.
 For the moment we just put all composed toots in here, as we want
 to also capture toots that are \"sent\" but that don't successfully
 send.")
@@ -720,8 +719,10 @@ CANCEL means the toot was not sent, so we save the toot 
text as a draft."
   (let ((prev-window-config mastodon-toot-previous-window-config))
 (unless (eq mastodon-toot-current-toot-text nil)
   (when cancel
-(cl-pushnew mastodon-toot-current-toot-text
-mastodon-toot-draft-toots-list :test 'equal)))
+(setf (multisession-value mastodon-toot-draft-toots-list)
+  (cl-pushnew mastodon-toot-current-toot-text
+  (multisession-value mastodon-toot-draft-toots-list)
+  :test 'equal
 ;; prevent some weird bug when cancelling a non-empty toot:
 (delete #'mastodon-toot--save-toot-text after-change-functions)
 (quit-window 'kill)
@@ -743,8 +744,10 @@ Pushes `mastodon-toot-current-toot-text' to
 `mastodon-toot-draft-toots-list'."
   (interactive)
   (unless (eq mastodon-toot-current-toot-text nil)
-(cl-pushnew mastodon-toot-current-toot-text
-mastodon-toot-draft-toots-list :test 'equal)
+(setf (multisession-value mastodon-toot-draft-toots-list)
+  (cl-pushnew mastodon-toot-current-toot-text
+  (multisession-value mastodon-toot-draft-toots-list)
+  :test 'equal))
 (message "Draft saved!")))
 
 (defun mastodon-toot--empty-p (&optional text-only)
@@ -1840,15 +1843,17 @@ Added to `after-change-functions' in new toot buffers."
 (defun mastodon-toot--open-draft-toot ()
   "Prompt for a draft and compose a toot with it."
   (interactive)
-  (if mastodon-toot-draft-toots-list
-  (let ((text (completing-read "Select draft toot: "
-   mastodon-toot-draft-toots-list
-   nil t)))
+  (if (multisession-value mastodon-toot-draft-toots-list)
+  (let ((text (completing-read
+   "Select draft toot: "
+   (multisession-value mastodon-toot-draft-toots-list)
+   nil t)))
 (if (mastodon-toot--compose-buffer-p)
 (when (and (not (mastodon-toot--empty-p :text-only))
(y-or-n-p "Replace current text with draft?"))
-  (cl-pushnew mastodon-toot-current-toot-text
-  mastodon-toot-draft-toots-list)
+  (setf (multisession-value mastodon-toot-draft-toots-list)
+(cl-pushnew mastodon-toot-current-toot-text
+(multisession-value 
mastodon-toot-draft-toots-list)))
   (goto-char
(cdr (mastodon-tl--find-property-range 'toot-post-header
   (point-min
@@ -1864,19 +1869,22 @@ Added to `after-change-functions' in new toot buffers."
 (defun mastodon-toot--delete-draft-toot ()
   "Prompt for a draft toot and delete it."
   (interactive)
-  (if mastodon-toot-draft-toots-list
-  (let ((draft (completing-read "Select draft to delete: "
-mastodon-toot-draft-toots-list
-nil t)))
-(setq mastodon-toot-draft-toots-list
-  (cl-delete draft mastodon-toot-draft-toots-list :test #'equal))
+  (if (multisession-value mastodon-toot-draft-toots-list)
+  (let ((draft (completing-read
+"Select draft to delete: "
+(multisession-value mastodon-toot-draft-toots-list)
+nil t)))
+(setf (multisession-value mastodon-toot-draft-toots-list)
+  (cl-delete draft
+ (multisession-value mastodon-toot-draft-toots-list)
+ :test #'equal))
 (message "Draft deleted!"))
 (message "No drafts to delete.")))
 
 (defun mastodon-toot--delete-all-drafts ()
   "Delete all drafts."
   (interacti

[nongnu] elpa/mastodon 80ce719004 38/63: flymake our user-error mess

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 80ce719004cb243a7149e7bb45749cf033ae77b2
Author: marty hiatt 
Commit: marty hiatt 

flymake our user-error mess
---
 lisp/mastodon-toot.el | 54 +--
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 856c5bbd57..a422cc2304 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -611,7 +611,7 @@ Uses `lingva.el'."
  (msg (if pinned-p "unpinned" "pinned"))
  (msg-y-or-n (if pinned-p "Unpin" "Pin")))
 (if (not pinnable-p)
-(user-error "You can only pin your own toots.")
+(user-error "You can only pin your own toots")
   (when (y-or-n-p (format "%s this toot? " msg-y-or-n))
 (mastodon-toot--action action
(lambda (_)
@@ -641,7 +641,7 @@ NO-REDRAFT means delete toot only."
  (reply-id (alist-get 'in_reply_to_id toot))
  (pos (point)))
 (if (not (mastodon-toot--own-toot-p toot))
-(user-error "You can only delete (and redraft) your own toots.")
+(user-error "You can only delete (and redraft) your own toots")
   (when (y-or-n-p (if no-redraft
   (format "Delete this toot? ")
 (format "Delete and redraft this toot? ")))
@@ -787,7 +787,7 @@ To use the downloaded emoji, run 
`mastodon-toot--enable-custom-emoji'."
  (custom-emoji (mastodon-http--get-json url))
  (mastodon-custom-emoji-dir (mastodon-toot--emoji-dir)))
 (if (not (file-directory-p emojify-emojis-dir))
-(user-error "Looks like you need to set up emojify first.")
+(user-error "Looks like you need to set up emojify first")
   (unless (file-directory-p mastodon-custom-emoji-dir)
 (make-directory mastodon-custom-emoji-dir nil)) ; no add parent
   (mapc (lambda (x)
@@ -913,13 +913,13 @@ instance to edit a toot."
 (or (not args-media)
 (not (= (length mastodon-toot--media-attachments)
 (length mastodon-toot--media-attachment-ids)
-   (user-error "Something is wrong with your uploads. Wait for them to 
complete or try again."))
+   (user-error "Something is wrong with your uploads. Wait for them to 
complete or try again"))
   ((and mastodon-toot--max-toot-chars
 (> (mastodon-toot--count-toot-chars toot 
mastodon-toot--content-warning)
mastodon-toot--max-toot-chars))
-   (user-error "Looks like your toot (inc. CW) is longer than that 
maximum allowed length."))
+   (user-error "Looks like your toot (inc. CW) is longer than that 
maximum allowed length"))
   ((mastodon-toot--empty-p)
-   (user-error "Empty toot. Cowardly refusing to post this."))
+   (user-error "Empty toot. Cowardly refusing to post this"))
   (t
(let ((response (if edit-id ; we are sending an edit:
(mastodon-http--put endpoint args)
@@ -955,22 +955,22 @@ instance to edit a toot."
   "Edit the user's toot at point."
   (interactive)
   (mastodon-toot--with-toot-item
-   (mastodon-tl--with-toot-item
-(if (not (mastodon-toot--own-toot-p toot))
-(user-error "You can only edit your own toots.")
-  (let* ((source (mastodon-toot--get-toot-source id))
- (content (alist-get 'text source))
- (source-cw (alist-get 'spoiler_text source)))
-(let-alist toot
-  (when (y-or-n-p "Edit this toot? ")
-(mastodon-toot--compose-buffer nil .in_reply_to_id nil
-   content :edit)
-(goto-char (point-max))
-;; adopt reply-to-id, visibility, CW, language, and media:
-(mastodon-toot--set-toot-properties .in_reply_to_id .visibility
-source-cw .language nil nil
-.media_attachments .poll)
-(setq mastodon-toot--edit-item-id id
+   (let ((toot (mastodon-tl--property 'base-toot)))
+ (if (not (mastodon-toot--own-toot-p toot))
+ (user-error "You can only edit your own toots")
+   (let* ((source (mastodon-toot--get-toot-source id))
+  (content (alist-get 'text source))
+  (source-cw (alist-get 'spoiler_text source)))
+ (let-alist toot
+   (when (y-or-n-p "Edit this toot? ")
+ (mastodon-toot--compose-buffer nil .in_reply_to_id nil
+content :edit)
+ (goto-char (point-max))
+ ;; adopt reply-to-id, visibility, CW, language, and media:
+ (mastodon-toot--set-toot-properties .in_reply_to_id .visibility
+ source-cw .language nil nil
+ .media_attachments .poll)
+

[nongnu] elpa/mastodon 41404473ea 05/63: toot.el: user-error not message when needed

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 41404473ea8a12f4ef5cbb5b6356e6c0a6e9be9a
Author: marty hiatt 
Commit: marty hiatt 

toot.el: user-error not message when needed
---
 lisp/mastodon-toot.el | 60 +--
 1 file changed, 29 insertions(+), 31 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index d732e3d481..18bedab94d 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -363,7 +363,7 @@ Remove MARKER if REMOVE is non-nil, otherwise add it."
 (beginning-of-line) ;; The marker is not part of the byline
 (if (search-forward (format "(%s) " marker) eol t)
 (replace-match "")
-  (message "Oops: could not find marker '(%s)'" marker)))
+  (user-error "Oops: could not find marker '(%s)'" marker)))
   (unless remove
 (goto-char bol)
 (insert
@@ -506,18 +506,18 @@ SUBTRACT means we are un-favouriting or unboosting, so we 
decrement."
"Bookmark removed!"
  "Toot bookmarked!"))
   (remove (when bookmarked-p t)))
- (if byline-region
- (mastodon-toot--action
-  action
-  (lambda (_)
-(let ((inhibit-read-only t))
-  (add-text-properties (car byline-region)
-   (cdr byline-region)
-   (list 'bookmarked-p (not 
bookmarked-p
-(mastodon-toot--action-success bookmark-str
-   byline-region remove)
-(message (format "%s #%s" message id
-   (message (format "Nothing to %s here?!?" action
+ (if (not byline-region)
+ (user-error "Nothing to %s here?!?" action)
+   (mastodon-toot--action
+action
+(lambda (_)
+  (let ((inhibit-read-only t))
+(add-text-properties (car byline-region)
+ (cdr byline-region)
+ (list 'bookmarked-p (not bookmarked-p
+  (mastodon-toot--action-success bookmark-str
+ byline-region remove)
+  (message "%s #%s" message id)
 
 (defun mastodon-toot--list-toot-boosters ()
   "List the boosters of toot at point."
@@ -593,10 +593,10 @@ Uses `lingva.el'."
 (when mastodon-tl--enable-proportional-fonts
   t))
 (void-function
- (message "Looks like you need to install lingva.el. Error: %s"
-  (error-message-string x
-(message "No toot to translate?"))
-(message "No mastodon buffer?")))
+ (user-error "Looks like you need to install lingva.el. Error: %s"
+ (error-message-string x
+(user-error "No toot to translate?"))
+(user-error "No mastodon buffer?")))
 
 (defun mastodon-toot--own-toot-p (toot)
   "Check if TOOT is user's own, for deleting, editing, or pinning it."
@@ -617,7 +617,7 @@ Uses `lingva.el'."
  (msg (if pinned-p "unpinned" "pinned"))
  (msg-y-or-n (if pinned-p "Unpin" "Pin")))
 (if (not pinnable-p)
-(message "You can only pin your own toots.")
+(user-error "You can only pin your own toots.")
   (when (y-or-n-p (format "%s this toot? " msg-y-or-n))
 (mastodon-toot--action action
(lambda (_)
@@ -647,7 +647,7 @@ NO-REDRAFT means delete toot only."
  (reply-id (alist-get 'in_reply_to_id toot))
  (pos (point)))
 (if (not (mastodon-toot--own-toot-p toot))
-(message "You can only delete (and redraft) your own toots.")
+(user-error "You can only delete (and redraft) your own toots.")
   (when (y-or-n-p (if no-redraft
   (format "Delete this toot? ")
 (format "Delete and redraft this toot? ")))
@@ -787,7 +787,7 @@ To use the downloaded emoji, run 
`mastodon-toot--enable-custom-emoji'."
  (custom-emoji (mastodon-http--get-json url))
  (mastodon-custom-emoji-dir (mastodon-toot--emoji-dir)))
 (if (not (file-directory-p emojify-emojis-dir))
-(message "Looks like you need to set up emojify first.")
+(user-error "Looks like you need to set up emojify first.")
   (unless (file-directory-p mastodon-custom-emoji-dir)
 (make-directory mastodon-custom-emoji-dir nil)) ; no add parent
   (mapc (lambda (x)
@@ -921,12 +921,12 @@ instance to edit a toot."
 (or (not args-media)
 (not (= (length mastodon-toot--media-attachments)
 (length mastodon-toot--media-attachment-ids)
-   (message "Something is wrong with your uploads. Wait for them to 
complete or try again."))
+   (user-error "Someth

[nongnu] elpa/mastodon 0cd77c1880 37/63: Merge branch 'with-toot-item' into develop

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 0cd77c188045946278ead197dfe69a0e62b5abe2
Merge: f8ee682bb4 f43ecd6bad
Author: marty hiatt 
Commit: marty hiatt 

Merge branch 'with-toot-item' into develop
---
 lisp/mastodon-toot.el | 241 +-
 1 file changed, 119 insertions(+), 122 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 0cd66dbc17..856c5bbd57 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -259,15 +259,36 @@ send.")
"\\>")) ; boundary end
 
 
+;;; UTILS
+
+(defun mastodon-toot--base-toot-or-item-json ()
+  "Return the JSON data of either base-toot or item-json property.
+The former is for boost or favourite notifications, returning
+data about the item boosted or favourited."
+  (or (mastodon-tl--property 'base-toot :no-move) ; fave/boost notifs
+  (mastodon-tl--property 'item-json)))
+
+
 ;;; MACRO
 
 (defmacro mastodon-toot--with-toot-item (&rest body)
   "Execute BODY if we have a toot object at point.
-Includes boosts, and notifications that display toots."
+Includes boosts, and notifications that display toots.
+This macro makes the local variable ID available."
   (declare (debug t))
   `(if (not (equal 'toot (mastodon-tl--property 'item-type :no-move)))
-   (message "Looks like there's no toot at point?")
- ,@body))
+   (user-error "Looks like there's no toot at point?")
+ (mastodon-tl--with-toot-helper
+  (lambda (id)
+,@body
+
+(defun mastodon-tl--with-toot-helper (body-fun)
+  "Helper function for `mastodon-tl--with-toot-item'.
+Extract any common variables needed, such as base-item-id
+property, and call BODY-FUN on them."
+  (let ((id (mastodon-tl--property 'base-item-id)))
+(funcall body-fun id)))
+
 
 ;;; MODE MAP
 
@@ -335,7 +356,7 @@ JSON is added to the string as its item-json."
 (beginning-of-line) ;; The marker is not part of the byline
 (if (search-forward (format "(%s) " marker) eol t)
 (replace-match "")
-  (message "Oops: could not find marker '(%s)'" marker)))
+  (user-error "Oops: could not find marker '(%s)'" marker)))
   (unless remove
 (goto-char bol)
 (insert
@@ -364,20 +385,17 @@ boosting, or bookmarking toots."
  (response (mastodon-http--post url)))
 (mastodon-http--triage response callback)))
 
-(defun mastodon-toot--toggle-boost-or-favourite (type)
+(defun mastodon-toot--toggle-boost-or-favourite (action)
   "Toggle boost or favourite of toot at `point'.
-TYPE is a symbol, either `favourite' or `boost.'"
+ACTION is a symbol, either `favourite' or `boost.'"
   (mastodon-toot--with-toot-item
(let ((n-type (mastodon-tl--property 'notification-type :no-move)))
  (if (or (equal n-type "follow")
  (equal n-type "follow_request"))
  (user-error (format "Can't do action on %s notifications." n-type))
-   (let* ((boost-p (equal type 'boost))
-  ;;   (has-id (mastodon-tl--property 'base-item-id))
-  (byline-region ;(when has-id
+   (let* ((boost-p (equal action 'boost))
+  (byline-region
(mastodon-tl--find-property-range 'byline (point)))
-  (id (when byline-region
-(mastodon-tl--as-string (mastodon-tl--property 
'base-item-id
   (boosted (when byline-region
  (get-text-property (car byline-region) 'boosted-p)))
   (faved (when byline-region
@@ -389,44 +407,35 @@ TYPE is a symbol, either `favourite' or `boost.'"
   (action-string (if boost-p "boost" "favourite"))
   (remove (if boost-p (when boosted t) (when faved t)))
   (item-json (mastodon-tl--property 'item-json))
-  (toot-type (alist-get 'type item-json))
   (visibility (mastodon-tl--field 'visibility item-json)))
- (if byline-region
- (if (and (or (equal visibility "direct")
-  (equal visibility "private"))
-  boost-p)
- (message "You cant boost posts with visibility: %s" 
visibility)
-   (cond ;; actually there's nothing wrong with faving/boosting 
own toots!
-;;((mastodon-toot--own-toot-p (mastodon-tl--property 
'item-json))
-;;(error "You can't %s your own toots" action-string))
-;; & nothing wrong with faving/boosting own toots from notifs:
-;; this boosts/faves the base toot, not the notif status
-((and (equal "reblog" toot-type)
-  (not (mastodon-tl--buffer-type-eq 'notifications)))
- (user-error "You can't %s boosts" action-string))
-((and (equal "favourite" toot-type)
-  (not (mastodon-tl--buffer-type-eq 'notifications)))
- (user-error "You can't %s favourites" action-string))
-((and (equal "private" visibility)
-

[nongnu] elpa/mastodon 45903de823 63/63: info update

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 45903de823d3c6b46c4aa694112e9f5429e1a3f9
Author: marty hiatt 
Commit: marty hiatt 

info update
---
 mastodon.info | 19 +--
 mastodon.texi |  2 +-
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/mastodon.info b/mastodon.info
index 887dc629a9..11a3b9abba 100644
--- a/mastodon.info
+++ b/mastodon.info
@@ -597,8 +597,7 @@ File: mastodon.info,  Node: Dependencies,  Next: Network 
compatibility,  Prev: U
 Hard dependencies (should all install with ‘mastodon.el’):
• ‘request’ (for uploading attachments), emacs-request
  (https://github.com/tkf/emacs-request)
-   • ‘persist’ for storing some settings across sessions (we now use
- ‘multisession.el’ for this)
+   • ‘persist’ for storing some settings across sessions
 
Optional dependencies (install yourself, ‘mastodon.el’ can use them):
• ‘emojify’ to use custom emoji (else we use builtin ‘emoji.el’)
@@ -769,14 +768,14 @@ Node: Live-updating timelines mastodon-async-mode19677
 Node: Translating toots20529
 Node: Bookmarks and mastodonel21711
 Node: Dependencies22253
-Node: Network compatibility22936
-Node: Contributing23818
-Node: Bug reports24314
-Node: Fixes and features25225
-Node: Coding style25726
-Node: Supporting mastodonel26350
-Node: Contributors26917
-Node: screenshots27352
+Node: Network compatibility22887
+Node: Contributing23769
+Node: Bug reports24265
+Node: Fixes and features25176
+Node: Coding style25677
+Node: Supporting mastodonel26301
+Node: Contributors26868
+Node: screenshots27303
 
 End Tag Table
 
diff --git a/mastodon.texi b/mastodon.texi
index c31caf1cbf..614928fc3f 100644
--- a/mastodon.texi
+++ b/mastodon.texi
@@ -703,7 +703,7 @@ Hard dependencies (should all install with 
@samp{mastodon.el}):
 @item
 @samp{request} (for uploading attachments), 
@uref{https://github.com/tkf/emacs-request, emacs-request}
 @item
-@samp{persist} for storing some settings across sessions (we now use 
@samp{multisession.el} for this)
+@samp{persist} for storing some settings across sessions
 @end itemize
 
 Optional dependencies (install yourself, @samp{mastodon.el} can use them):



[nongnu] elpa/mastodon 344da8f2f2 23/63: fold toots customize/ refactor

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 344da8f2f2a1dff0249bb5e8d73d088d2bd824e9
Author: marty hiatt 
Commit: marty hiatt 

fold toots customize/ refactor
---
 lisp/mastodon-tl.el | 29 +++--
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index d87a469cc2..a0a0c18175 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -219,6 +219,13 @@ respects the user's `browse-url' settings."
 See `mastodon-tl--get-remote-local-timeline' for view remote local domains."
   :type '(repeat string))
 
+
+(defcustom mastodon-tl--fold-toots-at-length 1200
+  "Length, in characters, to fold a toot at.
+Longer toots will be folded and the remainder replaced by a
+\"read more\" button. If the value is nil, don't fold at all."
+  :type '(integer))
+
 
 ;;; VARIABLES
 
@@ -1558,16 +1565,18 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
 
 (defun mastodon-tl--fold-body-maybe (body)
   "Fold toot BODY if it is very long."
-  (if (length> body 500)
-  (let* ((heading (mastodon-search--format-heading
-   (mastodon-tl--make-link
-"READ MORE"
-'read-more)))
- (display (concat (substring body 0 500)
-  heading)))
-(propertize display
-'read-more body))
-body))
+  (if (or (eq nil mastodon-tl--fold-toots-at-length)
+  (length< body mastodon-tl--fold-toots-at-length))
+  body
+(let* ((heading (mastodon-search--format-heading
+ (mastodon-tl--make-link
+  "READ MORE"
+  'read-more)))
+   (display (concat (substring body 0
+   mastodon-tl--fold-toots-at-length)
+heading)))
+  (propertize display
+  'read-more body
 
 (defun mastodon-tl--unfold-post ()
   "Unfold the toot at point if it is folded (read-more)."



[nongnu] elpa/mastodon dd1b0ab770 42/63: add mastodon-tl--fold-post

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit dd1b0ab77043508623e0bb0e7861beeeb00c8e2f
Author: marty hiatt 
Commit: marty hiatt 

add mastodon-tl--fold-post
---
 lisp/mastodon-tl.el | 28 ++--
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index d3a11ed600..908a063cf2 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1566,7 +1566,8 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
   (mastodon-media--inline-images start-pos (point)
 
 (defun mastodon-tl--fold-body-maybe (body &optional unfolded)
-  "Fold toot BODY if it is very long."
+  "Fold toot BODY if it is very long.
+Folding decided by `mastodon-tl--fold-toots-at-length'."
   (if (or unfolded
   (eq nil mastodon-tl--fold-toots-at-length)
   (length< body mastodon-tl--fold-toots-at-length))
@@ -1581,30 +1582,37 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
   (propertize display
   'read-more body
 
-(defun mastodon-tl--unfold-post ()
+(defun mastodon-tl--unfold-post (&optional fold)
   "Unfold the toot at point if it is folded (read-more)."
   (interactive)
   ;; if at byline, must search backwards:
   (let* ((byline (mastodon-tl--property 'byline :no-move))
  (read-more-p (mastodon-tl--find-property-range
'read-more (point) byline)))
-(if (not read-more-p)
+(if (and (not fold)
+ (not read-more-p))
 (user-error "No folded item at point?")
   (let* ((inhibit-read-only t)
- (range (mastodon-tl--find-property-range
- 'item-json (point)))
+ (range (mastodon-tl--find-property-range 'item-json (point)))
  (toot (mastodon-tl--property 'item-json)))
-;; `replace-region-contents' is much to slow, our hack from fedi.el
-;; is much simpler and much faster
+;; `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)))
   (save-excursion
 (goto-char beg)
 (delete-region beg end)
-(mastodon-tl--toot toot nil nil nil :unfolded))
+(mastodon-tl--toot toot nil nil nil
+   (when (not fold) :unfolded)))
   ;; move point to line where text formerly ended:
-  (goto-char end)
-  (beginning-of-line))
+  (unless fold
+(goto-char end)
+(beginning-of-line)))
+
+(defun mastodon-tl--fold-post ()
+  "Fold post at point, if it is too long."
+  (interactive)
+  (mastodon-tl--unfold-post :fold))
 
 ;; from mastodon-alt.el:
 (defun mastodon-tl--toot-for-stats (&optional toot)



[nongnu] elpa/mastodon 35a26600af 53/63: reimplement folding via insert body only.

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 35a26600afca9bcf6fd033a2a7199a4df048c655
Author: marty hiatt 
Commit: marty hiatt 

reimplement folding via insert body only.

adds a toot-body prop to body only
adds toot-foldable and toot-folded props to whole toot (so can check it at 
byline)
shouldn't add any wrong newlines
adds no-byline flag to insert-status
---
 lisp/mastodon-tl.el | 188 
 1 file changed, 101 insertions(+), 87 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 797b355efb..99d6eac7a6 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1506,7 +1506,8 @@ Runs `mastodon-tl--render-text' and fetches poll or 
media."
 (string= reply-to-id prev-id)))
 
 (defun mastodon-tl--insert-status (toot body author-byline action-byline
-&optional id base-toot detailed-p 
thread domain unfolded)
+&optional id base-toot detailed-p
+thread domain unfolded no-byline)
   "Display the content and byline of timeline element TOOT.
 BODY will form the section of the toot above the byline.
 AUTHOR-BYLINE is an optional function for adding the author
@@ -1523,32 +1524,46 @@ JSON of the toot responded to.
 DETAILED-P means display more detailed info. For now
 this just means displaying toot client.
 THREAD means the status will be displayed in a thread view.
-When DOMAIN, force inclusion of user's domain in their handle."
+When DOMAIN, force inclusion of user's domain in their handle.
+UNFOLDED is a boolean meaning whether to unfold or fold item if foldable.
+NO-BYLINE means just insert toot body, used for folding."
   (let* ((start-pos (point))
  (reply-to-id (alist-get 'in_reply_to_id toot))
  (after-reply-status-p
   (when (and thread reply-to-id)
 (mastodon-tl--after-reply-status reply-to-id)))
- (type (alist-get 'type toot)))
-;; body:
+ (type (alist-get 'type toot))
+ (toot-foldable
+  (and mastodon-tl--fold-toots-at-length
+   (length> body mastodon-tl--fold-toots-at-length
 (insert
  (propertize
   (concat
-   "\n"
-   (if (and after-reply-status-p thread)
-   (concat (mastodon-tl--symbol 'replied)
-   "\n")
- "")
-   (let ((bar (mastodon-tl--symbol 'reply-bar))
- (body (mastodon-tl--fold-body-maybe body unfolded)))
+   (propertize
+(concat
+ "\n"
+ ;; relpy symbol (broken):
  (if (and after-reply-status-p thread)
- (propertize body
- 'line-prefix bar
- 'wrap-prefix bar)
-   body))
-   " \n"
+ (concat (mastodon-tl--symbol 'replied)
+ "\n")
+   "")
+ ;; actual body:
+ (let ((bar (mastodon-tl--symbol 'reply-bar))
+   (body (if (and toot-foldable (not unfolded))
+ (mastodon-tl--fold-body body)
+   body)))
+   (if (and after-reply-status-p thread)
+   (propertize body
+   'line-prefix bar
+   'wrap-prefix bar)
+ body)))
+'toot-body t) ;; includes newlines etc. for folding
;; byline:
-   (mastodon-tl--byline toot author-byline action-byline detailed-p 
domain))
+   "\n"
+   (if no-byline
+   ""
+ (mastodon-tl--byline toot author-byline action-byline
+  detailed-p domain)))
   'item-type'toot
   'item-id  (or id ; notification's own id
 (alist-get 'id toot)) ; toot id
@@ -1560,90 +1575,86 @@ When DOMAIN, force inclusion of user's domain in their 
handle."
   'item-jsontoot
   'base-tootbase-toot
   'cursor-face 'mastodon-cursor-highlight-face
-  'notification-type type)
- "\n")
+  'notification-type type
+  'toot-foldable toot-foldable
+  'toot-folded (and toot-foldable (not unfolded)))
+ (if no-byline "" "\n"))
 (when mastodon-tl--display-media-p
   (mastodon-media--inline-images start-pos (point)
 
-(defun mastodon-tl--fold-body-maybe (body &optional unfolded)
+(defun mastodon-tl--fold-body (body)
   "Fold toot BODY if it is very long.
 Folding decided by `mastodon-tl--fold-toots-at-length'."
-  (if (or unfolded
-  (eq nil mastodon-tl--fold-toots-at-length)
-  (length< body mastodon-tl--fold-toots-at-length))
-  body
-(let* ((heading (mastodon-search--format-heading
- (mastodon-tl--make-link "READ MORE" 'read-more)
- nil :no-newline))
-   (display (concat (substring body 0
-   mastodon-tl--fold-toots-at-length)
-heading)))
-  (propertize display
-   

[nongnu] elpa/mastodon dad54cccbc 46/63: fold-post-toggle

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit dad54cccbcc2385315ff8c32369bb607a937d15d
Author: marty hiatt 
Commit: marty hiatt 

fold-post-toggle
---
 lisp/mastodon-tl.el | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index ad8cc1a5e7..a357146cc4 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1619,6 +1619,17 @@ Folding decided by `mastodon-tl--fold-toots-at-length'."
   (interactive)
   (mastodon-tl--unfold-post :fold))
 
+(defun mastodon-tl--fold-post-toggle ()
+  "Toggle the folding status of the toot at point."
+  (interactive)
+  (let* ((byline-p (mastodon-tl--property 'byline))
+ (read-more-p (save-excursion
+(when byline-p
+  (previous-line)
+  (beginning-of-line))
+(mastodon-tl--property 'read-more
+(mastodon-tl--unfold-post (if (not read-more-p) :fold
+
 ;; from mastodon-alt.el:
 (defun mastodon-tl--toot-for-stats (&optional toot)
   "Return the TOOT on which we want to extract stats.



[nongnu] elpa/mastodon 4697c073e8 19/63: message -> user-error

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 4697c073e871afa2d69b64d03a7b03354e4e4dba
Author: marty hiatt 
Commit: marty hiatt 

message -> user-error
---
 lisp/mastodon-tl.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 128298d526..c4585b82e8 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1361,7 +1361,7 @@ displayed when the duration is smaller than a minute)."
  cell))
  options-alist)))
 (if (null poll)
-(message "No poll here.")
+(user-error "No poll here.")
   (list
;; var "option" = just the cdr, a cons of option number and desc
(cdr (assoc (completing-read "Poll option to vote for: "
@@ -1373,7 +1373,7 @@ displayed when the duration is smaller than a minute)."
   "If there is a poll at point, prompt user for OPTION to vote on it."
   (interactive (mastodon-tl--read-poll-option))
   (if (null (mastodon-tl--field 'poll (mastodon-tl--property 'item-json)))
-  (message "No poll here.")
+  (user-error "No poll here.")
 (let* ((toot (mastodon-tl--property 'item-json))
(poll (mastodon-tl--field 'poll toot))
(poll-id (alist-get 'id poll))



[nongnu] elpa/mastodon 4e8d286164 12/63: mastodon-use-emojify customize

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 4e8d28616431d2ddedc01eb021d20718f1eb1877
Author: marty hiatt 
Commit: marty hiatt 

mastodon-use-emojify customize
---
 lisp/mastodon-toot.el | 5 +
 lisp/mastodon.el  | 8 +++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 694d9c061f..496f334cad 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -158,10 +158,7 @@ If the original toot visibility is different we use the 
more restricted one."
   "Whether to enable your instance's custom emoji by default."
   :type 'boolean)
 
-(defcustom mastodon-toot--emojify-in-compose-buffer t
-  "Whether to enable `emojify-mode' in the compose buffer.
-We only attempt to enable it if its bound."
-  :type 'boolean)
+(defvar mastodon-use-emojify)
 
 (defcustom mastodon-toot--proportional-fonts-compose nil
   "Nonnil to enable using proportional fonts in the compose buffer.
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index 0747d530b3..8a0aa91790 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -144,6 +144,11 @@ The default value \"%F %T\" prints ISO8601-style 
-mm-dd HH:MM:SS.
 Use. e.g. \"%c\" for your locale's date and time format."
   :type 'string)
 
+(defcustom mastodon-use-emojify nil
+  "Whether to use emojify.el to display emojis.
+From version 28, Emacs can display emojis natively. But
+currently, it doesn't seem to have a way to handle custom emoji,
+while emojify,el has this feature and mastodon.el implements it.")
 
 (defun mastodon-kill-window ()
   "Quit window and delete helper."
@@ -464,7 +469,8 @@ Calls `mastodon-tl--get-buffer-type', which see."
 
 (defun mastodon-mode-hook-fun ()
   "Function to add to `mastodon-mode-hook'."
-  (when (require 'emojify nil :noerror)
+  (when (and mastodon-use-emojify
+ (require 'emojify nil :noerror))
 (emojify-mode t)
 (when mastodon-toot--enable-custom-instance-emoji
   (mastodon-toot--enable-custom-emoji)))



[nongnu] elpa/mastodon 30b02296ca 48/63: fix where we leave point on (un)folding

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 30b02296caffeb2fb95ccb26f7fed31c4961f358
Author: marty hiatt 
Commit: marty hiatt 

fix where we leave point on (un)folding
---
 lisp/mastodon-tl.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index a357146cc4..651427aa84 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1605,10 +1605,11 @@ Folding decided by `mastodon-tl--fold-toots-at-length'."
 (delete-char 1) ;; prevent newlines accumulating
 (mastodon-tl--toot toot nil nil nil
(when (not fold) :unfolded)))
-  (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)
+  (cond ((or byline
+ (and fold
+  ;; if point was in area now folded:
+  (> last-point
+ (+ beg mastodon-tl--fold-toots-at-length
  (mastodon-tl--goto-next-item))
 (t
  (goto-char last-point)



[nongnu] elpa/mastodon 5621b2df84 56/63: add underscores to user-like url regexes

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 5621b2df84802fca40ea5461308f601aeb9b361a
Author: marty hiatt 
Commit: marty hiatt 

add underscores to user-like url regexes
---
 lisp/mastodon.el | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index c77170500c..cd32a2dc7a 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -414,24 +414,27 @@ not, just browse the URL in the normal fashion."
   "Check if QUERY resembles a fediverse URL."
   ;; calqued off 
https://github.com/tuskyapp/Tusky/blob/c8fc2418b8f5458a817bba221d025b85e130/app/src/main/java/com/keylesspalace/tusky/BottomSheetActivity.kt
   ;; thx to Conny Duck!
+  ;; mastodon at least seems to allow only [a-z0-9_] for usernames, plus "."
+  ;; but not at beginning or end, see 
https://github.com/mastodon/mastodon/issues/6830
+  ;; objects may have - in them
   (let* ((uri-parsed (url-generic-parse-url query))
  (query (url-filename uri-parsed)))
 (save-match-data
   (or (string-match "^/@[^/]+$" query)
   (string-match "^/@[^/]+/[[:digit:]]+$" query)
-  (string-match "^/user[s]?/@?[[:alnum:]]+$" query) ; @: pleroma or 
soapbox
+  (string-match "^/user[s]?/@?[[:alnum:]_]+$" query) ; @: pleroma or 
soapbox
   (string-match "^/notice/[[:alnum:]]+$" query)
   (string-match "^/objects/[-a-f0-9]+$" query)
   (string-match "^/notes/[a-z0-9]+$" query)
   (string-match "^/display/[-a-f0-9]+$" query)
-  (string-match "^/profile/[[:alpha:]]+$" query)
-  (string-match "^/p/[[:alpha:]]+/[[:digit:]]+$" query)
-  (string-match "^/[[:alpha:]]+$" query)
-  (string-match "^/u/[[:alpha:]]+$" query)
-  (string-match "^/c/[[:alnum:]]+$" query)
+  (string-match "^/profile/[[:alpha:]_]+$" query)
+  (string-match "^/p/[[:alpha:]_]+/[[:digit:]]+$" query)
+  (string-match "^/[[:alpha:]_]+$" query)
+  (string-match "^/u/[[:alpha:]_]+$" query)
+  (string-match "^/c/[[:alnum:]_]+$" query)
   (string-match "^/post/[[:digit:]]+$" query)
   (string-match "^/comment/[[:digit:]]+$" query) ; lemmy
-  (string-match "^/user[s]?/[[:alnum:]]+/statuses/[[:digit:]]+$" 
query) ; hometown
+  (string-match "^/user[s]?/[[:alnum:]_]+/statuses/[[:digit:]]+$" 
query) ; hometown
   (string-match "^/notes/[[:alnum:]]+$" query) ; misskey post
 
 (defun mastodon-live-buffers ()



[nongnu] elpa/mastodon bc83b400b1 40/63: fix unfolding faved/bookmarked toots

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit bc83b400b14240820a10606279709d8e5dfcdf9f
Author: marty hiatt 
Commit: marty hiatt 

fix unfolding faved/bookmarked toots
---
 lisp/mastodon-toot.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 3a88f333d7..a935c9ed5f 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -434,7 +434,7 @@ ACTION is a symbol, either `favourite' or `boost.'"
 (mastodon-toot--action-success (if boost-p
(mastodon-tl--symbol 
'boost)
  (mastodon-tl--symbol 
'favourite))
-   byline-region remove))
+   byline-region remove 
item-json))
   (message "%s #%s" (if boost-p msg action) id)))
 
 (defun mastodon-toot--inc-or-dec (count subtract)
@@ -499,7 +499,8 @@ SUBTRACT means we are un-favouriting or unboosting, so we 
decrement."
   (message (if bookmarked-p
"Bookmark removed!"
  "Toot bookmarked!"))
-  (remove (when bookmarked-p t)))
+  (remove (when bookmarked-p t))
+  (item-json (mastodon-tl--property 'item-json)))
  (if (not byline-region)
  (user-error "Nothing to %s here?!?" action)
(mastodon-toot--action
@@ -510,7 +511,7 @@ SUBTRACT means we are un-favouriting or unboosting, so we 
decrement."
  (cdr byline-region)
  (list 'bookmarked-p (not bookmarked-p
   (mastodon-toot--action-success bookmark-str
- byline-region remove)
+ byline-region remove item-json)
   (message "%s #%s" message id)
 
 (defun mastodon-toot--list-toot-boosters ()



[nongnu] elpa/mastodon 43cd626f6a 28/63: Merge branch 'emoji.el' into develop

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 43cd626f6a3ec81cf72b4d7e522be3930e5a3846
Merge: f16fcb15a8 aa6b7b25be
Author: marty hiatt 
Commit: marty hiatt 

Merge branch 'emoji.el' into develop
---
 README.org|  37 -
 lisp/mastodon-toot.el |  11 ++---
 mastodon-index.org|   4 +-
 mastodon.info | 113 ++
 mastodon.texi |  28 +
 5 files changed, 112 insertions(+), 81 deletions(-)

diff --git a/README.org b/README.org
index b542142ca4..d8f94f954b 100644
--- a/README.org
+++ b/README.org
@@ -65,8 +65,7 @@ it shouldn't be very hard to get it working.
 
 *** Emoji
 
-=mastodon-mode= will enable 
[[https://github.com/iqbalansari/emacs-emojify][Emojify]] if it is loaded in 
your Emacs environment, so
-there's no need to write your own hook anymore. =emojify-mode= is not required.
+Since Emacs 28, it has builtin emoji support with =emoji.el=. If you prefer to 
use [[https://github.com/iqbalansari/emacs-emojify][Emojify]], =require= it and 
set =mastodon-use-emojify= to non-nil to display emoji in timelines and to use 
it when composing toots. =Emoji.el= is the better option, but for now only 
=emojify= supports downloading and using custom emoji from your instance. From 
personal experience, =emojify= also tends to result in less TOFU.
 
 *** Discover
 
@@ -242,21 +241,21 @@ value of that hook is as follows:
 
  Keybindings
 
-|--+--|
-| Key  | Action   |
-|--+--|
-| =C-c C-c=  | Send toot|
-| =C-c C-k=  | Cancel toot  |
-| =C-c C-w=  | Add content warning  |
-| =C-c C-v=  | Change toot visibility   |
-| =C-c C-n=  | Add sensitive media/nsfw flag|
-| =C-c C-a=  | Upload attachment(s) |
-| =C-c !=| Remove all attachments   |
-| =C-c C-e=  | Add emoji (if =emojify= installed) |
-| =C-c C-p=  | Create a poll|
-| =C-c C-l=  | Set toot language|
-| =-C-c C-s= | Schedule toot|
-|--+--|
+|--+---|
+| Key  | Action|
+|--+---|
+| =C-c C-c=  | Send toot |
+| =C-c C-k=  | Cancel toot   |
+| =C-c C-w=  | Add content warning   |
+| =C-c C-v=  | Change toot visibility|
+| =C-c C-n=  | Add sensitive media/nsfw flag |
+| =C-c C-a=  | Upload attachment(s)  |
+| =C-c !=| Remove all attachments|
+| =C-c C-e=  | Insert emoji  |
+| =C-c C-p=  | Create a poll |
+| =C-c C-l=  | Set toot language |
+| =-C-c C-s= | Schedule toot |
+|--+---|
 
  Autocompletion of mentions, tags and emoji
 
@@ -265,7 +264,7 @@ Autocompletion of mentions, tags, and emojis is provided by
 =mastodon-toot--enable-completion= is enabled by default.
 
 To trigger completion, type a prefix followed by a few letters, =@= for
-mentions, =#= for tags, and =:= for emoji.
+mentions, =#= for tags, and =:= for emoji (for now this only works when using 
=emojify.el=).
 
 If you want to enable =company-mode= in the toot compose buffer, set
 =mastodon-toot--use-company-for-completion= to =t=. (=mastodon.el= used to run 
its
@@ -424,7 +423,7 @@ Hard dependencies (should all install with =mastodon.el=):
 - +=persist= for storing some settings across sessions+ (we now use 
=multisession.el= for this)
 
 Optional dependencies (install yourself, =mastodon.el= can use them):
-- =emojify= for inserting and viewing emojis
+- =emojify= to use custom emoji (else we use builtin =emoji.el=)
 - =mpv= and =mpv.el= for viewing videos and gifs
 - =lingva.el= for translating toots
 
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 51cf1c0c63..e1d725933b 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -31,6 +31,8 @@
 ;;; Code:
 (eval-when-compile (require 'subr-x))
 
+
+(defvar mastodon-use-emojify)
 (require 'emojify nil :noerror)
 (declare-function emojify-insert-emoji "emojify")
 (declare-function emojify-set-emoji-data "emojify")
@@ -157,8 +159,6 @@ If the original toot visibility is different we use the 
more restricted one."
   "Whether to enable your instance's custom emoji by default."
   :type 'boolean)
 
-(defvar mastodon-use-emojify)
-
 (defcustom mastodon-toot--proportional-fonts-compose nil
   "Nonnil to enable using proportional fonts in the compose buffer.
 By default fixed width fonts are used."
@@ -281,8 +281,7 @@ Includes boosts, and notifications that display toots."
 (define-key map (kbd "C-c C-w") #'mastodon-toot--toggle-warning)
 (define-key map (kbd "C-c C-n") #'mastodon-toot--toggle-nsfw)
 (define-key map (kbd "C-c C-v") #'mastodon-toot--change-visibility)
-(when (r

[nongnu] elpa/mastodon f19f3bc273 08/63: replace persist with multisession

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit f19f3bc2735bd78bb3150b8507b6f8949108cece
Author: marty hiatt 
Commit: marty hiatt 

replace persist with multisession
---
 lisp/mastodon-profile.el | 19 +++
 lisp/mastodon-toot.el|  4 +++-
 lisp/mastodon.el |  2 +-
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index de16b7d216..cd1978fde1 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -35,7 +35,6 @@
 ;;; Code:
 (require 'seq)
 (require 'cl-lib)
-(require 'persist)
 (require 'parse-time)
 (require 'mastodon-http)
 (eval-when-compile
@@ -125,8 +124,8 @@ It contains details of the current user's account.")
 map)
   "Keymap for `mastodon-profile-update-mode'.")
 
-(persist-defvar mastodon-profile-account-settings nil
-"An alist of account settings saved from the server.
+(define-multisession-variable mastodon-profile-account-settings nil
+  "An alist of account settings saved from the server.
 Other clients can change these settings on the server at any
 time, so this list is not the canonical source for settings. It
 is updated on entering mastodon mode and on toggle any setting it
@@ -365,13 +364,16 @@ SOURCE means that the preference is in the `source' part 
of the account JSON."
 
 (defun mastodon-profile--get-pref (pref)
   "Return PREF from `mastodon-profile-account-settings'."
-  (plist-get mastodon-profile-account-settings pref))
+  (plist-get (multisession-value mastodon-profile-account-settings)
+ pref))
 
 (defun mastodon-profile--update-preference-plist (pref val)
   "Set local account preference plist preference PREF to VAL.
 This is done after changing the setting on the server."
-  (setq mastodon-profile-account-settings
-(plist-put mastodon-profile-account-settings pref val)))
+  (setf (multisession-value mastodon-profile-account-settings)
+(plist-put
+ (multisession-value mastodon-profile-account-settings)
+ pref val)))
 
 ;; used in toot.el
 (defun mastodon-profile--fetch-server-account-settings-maybe ()
@@ -384,7 +386,8 @@ Only do so if `mastodon-profile-account-settings' is nil."
 Store the values in `mastodon-profile-account-settings'.
 Run in `mastodon-mode-hook'.
 If NO-FORCE, only fetch if `mastodon-profile-account-settings' is nil."
-  (unless (and no-force mastodon-profile-account-settings)
+  (unless (and no-force
+   (multisession-value mastodon-profile-account-settings))
 (let ((keys '(locked discoverable display_name bot))
   (source-keys '(privacy sensitive language)))
   (mapc (lambda (k)
@@ -402,7 +405,7 @@ If NO-FORCE, only fetch if 
`mastodon-profile-account-settings' is nil."
   ;; TODO: remove now redundant vars, replace with fetchers from the plist
   (setq mastodon-toot--visibility (mastodon-profile--get-pref 'privacy)
 mastodon-toot--content-nsfw (mastodon-profile--get-pref 
'sensitive))
-  mastodon-profile-account-settings)))
+  (multisession-value mastodon-profile-account-settings
 
 (defun mastodon-profile--account-locked-toggle ()
   "Toggle the locked status of your account.
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index e934352690..694d9c061f 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1964,7 +1964,9 @@ EDIT means we are editing an existing toot, not composing 
a new one."
 (mastodon-toot-mode t)
 ;; set visibility:
 (setq mastodon-toot--visibility
-  (or (plist-get mastodon-profile-account-settings 'privacy)
+  (or (plist-get
+   (multisession-value mastodon-profile-account-settings)
+   'privacy)
   ;; use toot visibility setting from the server:
   (mastodon-profile--get-source-value 'privacy)
   "public")) ; fallback
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index d0dddeeb6f..0747d530b3 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -7,7 +7,7 @@
 ;; Marty Hiatt 
 ;; Maintainer: Marty Hiatt 
 ;; Version: 1.0.24
-;; Package-Requires: ((emacs "27.1") (request "0.3.0") (persist "0.4"))
+;; Package-Requires: ((emacs "27.1") (request "0.3.0"))
 ;; Homepage: https://codeberg.org/martianh/mastodon.el
 
 ;; This file is not part of GNU Emacs.



[nongnu] elpa/mastodon c95a19b2d5 33/63: index update

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit c95a19b2d5bb0de63e4cd6bd4e40080a658cdda3
Author: marty hiatt 
Commit: marty hiatt 

index update
---
 mastodon-index.org | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mastodon-index.org b/mastodon-index.org
index 949cd6dfe9..7347fe1cc4 100644
--- a/mastodon-index.org
+++ b/mastodon-index.org
@@ -140,6 +140,7 @@
 | c| mastodon-tl--toggle-spoiler-text-in-toot  | 
Toggle the visibility of the spoiler text in the current toot. |
 | C-S-b| mastodon-tl--unblock-user | Query 
for USER-HANDLE from list of blocked users and unblock that user.|
 |  | mastodon-tl--unfilter-user-languages  | 
Remove any language filters for USER-HANDLE.   |
+|  | mastodon-tl--unfold-post  | 
Unfold the toot at point if it is folded (read-more).  |
 |  | mastodon-tl--unfollow-tag | 
Prompt for a followed tag, and unfollow it.|
 | C-S-w| mastodon-tl--unfollow-user| Query 
for USER-HANDLE from current status and unfollow that user.  |
 |  | mastodon-tl--unmute-thread| Mute 
the thread displayed in the current buffer.   |
@@ -259,6 +260,7 @@
 | mastodon-tl--enable-proportional-fonts   | Nonnil to 
enable using proportional fonts when rendering HTML.|
 | mastodon-tl--enable-relative-timestamps  | Whether to 
show relative (to the current time) timestamps.|
 | mastodon-tl--expand-content-warnings | Whether to 
expand content warnings by default.|
+| mastodon-tl--fold-toots-at-length| Length, in 
characters, to fold a toot at. |
 | mastodon-tl--hide-replies| Whether to 
hide replies from the timelines.   |
 | mastodon-tl--highlight-current-toot  | Whether to 
highlight the toot at point. Uses `cursor-face' special property.  |
 | mastodon-tl--load-full-sized-images-in-emacs | Whether to 
load full-sized images inside Emacs.   |
@@ -274,7 +276,6 @@
 | mastodon-toot--completion-style-for-mentions | The company 
completion style to use for mentions. |
 | mastodon-toot--default-media-directory   | The default 
directory when prompting for a media file to upload.  |
 | mastodon-toot--default-reply-visibility  | Default 
visibility settings when replying.|
-| mastodon-toot--emojify-in-compose-buffer | Whether to 
enable `emojify-mode' in the compose buffer.   |
 | mastodon-toot--enable-completion | Whether to 
enable completion of mentions and hashtags.|
 | mastodon-toot--enable-custom-instance-emoji  | Whether to 
enable your instance's custom emoji by default.|
 | mastodon-toot--proportional-fonts-compose| Nonnil to 
enable using proportional fonts in the compose buffer.  |
@@ -283,3 +284,4 @@
 | mastodon-toot-mode-hook  | Hook run 
after entering or leaving `mastodon-toot-mode'.  |
 | mastodon-toot-orig-in-reply-length   | Length to 
crop toot replied to in the compose buffer to.  |
 | mastodon-toot-timestamp-format   | Format to use 
for timestamps. |
+| mastodon-use-emojify | Whether to 
use emojify.el to display emojis.  |



[nongnu] elpa/mastodon bb1b33e2fb 39/63: toot.el: use mastodon-toot--base-toot-or-item-json

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit bb1b33e2fb498188f57d5b26c3405802e2cc58f1
Author: marty hiatt 
Commit: marty hiatt 

toot.el: use mastodon-toot--base-toot-or-item-json
---
 lisp/mastodon-toot.el | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index a422cc2304..3a88f333d7 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -559,8 +559,7 @@ base toot."
 
 (defun mastodon-toot--toot-url ()
   "Return the URL of the base toot at point."
-  (let* ((toot (or (mastodon-tl--property 'base-toot)
-   (mastodon-tl--property 'item-json
+  (let* ((toot (mastodon-toot--base-toot-or-item-json)))
 (if (mastodon-tl--field 'reblog toot)
 (alist-get 'url (alist-get 'reblog toot))
   (alist-get 'url toot
@@ -570,8 +569,7 @@ base toot."
 If the toot is a fave/boost notification, copy the text of the
 base toot."
   (interactive)
-  (let* ((toot (or (mastodon-tl--property 'base-toot)
-   (mastodon-tl--property 'item-json
+  (let* ((toot (mastodon-toot--base-toot-or-item-json)))
 (kill-new (mastodon-tl--content toot))
 (message "Toot content copied to the clipboard.")))
 
@@ -603,8 +601,7 @@ Uses `lingva.el'."
 (defun mastodon-toot--pin-toot-toggle ()
   "Pin or unpin user's toot at point."
   (interactive)
-  (let* ((toot (or (mastodon-tl--property 'base-toot) ;fave/boost notifs
-   (mastodon-tl--property 'item-json)))
+  (let* ((toot (mastodon-toot--base-toot-or-item-json))
  (pinnable-p (mastodon-toot--own-toot-p toot))
  (pinned-p (equal (alist-get 'pinned toot) t))
  (action (if pinned-p "unpin" "pin"))
@@ -632,8 +629,7 @@ Uses `lingva.el'."
   "Delete and redraft user's toot at point synchronously.
 NO-REDRAFT means delete toot only."
   (interactive)
-  (let* ((toot (or (mastodon-tl--property 'base-toot) ;fave/boost notifs
-   (mastodon-tl--property 'item-json)))
+  (let* ((toot (mastodon-toot--base-toot-or-item-json))
  (id (mastodon-tl--as-string (mastodon-tl--item-id toot)))
  (url (mastodon-http--api (format "statuses/%s" id)))
  (toot-cw (alist-get 'spoiler_text toot))
@@ -955,7 +951,7 @@ instance to edit a toot."
   "Edit the user's toot at point."
   (interactive)
   (mastodon-toot--with-toot-item
-   (let ((toot (mastodon-tl--property 'base-toot)))
+   (let ((toot (mastodon-toot--base-toot-or-item-json)))
  (if (not (mastodon-toot--own-toot-p toot))
  (user-error "You can only edit your own toots")
(let* ((source (mastodon-toot--get-toot-source id))



[nongnu] elpa/mastodon 3ba86999d3 26/63: flymake toot.el

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 3ba86999d3369b7e44172403d9aed7d48e1c9813
Author: marty hiatt 
Commit: marty hiatt 

flymake toot.el
---
 lisp/mastodon-toot.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 902acf919f..32187090d5 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1041,7 +1041,7 @@ Remove empty string (self) from result and joins the 
sequence with whitespace."
   "Add domain to local ACCT and replace the curent user name with \"\".
 Mastodon requires the full @user@domain, even in the case of local accts.
 eg. \"user\" -> \"@user@local.social\" (when local.social is the domain of the
-mastodon-instance-url).
+`mastodon-instance-url').
 eg. \"yourusername\" -> \"\"
 eg. \"feduser@fed.social\" -> \"@feduser@fed.social\"."
   (cond ((string-match-p "@" acct) (concat "@" acct)) ; federated acct
@@ -1541,7 +1541,7 @@ With RESCHEDULE, reschedule the scheduled toot at point 
without editing."
 ;;; DISPLAY KEYBINDINGS
 
 (defun mastodon-toot--get-mode-kbinds ()
-  "Get a list of the keybindings in the mastodon-toot-mode."
+  "Get a list of the keybindings in the `mastodon-toot-mode'."
   (let* ((binds (copy-tree mastodon-toot-mode-map))
  (prefix (car (cadr binds)))
  (bindings (remove nil (mapcar (lambda (i)
@@ -1554,7 +1554,7 @@ With RESCHEDULE, reschedule the scheduled toot at point 
without editing."
 
 (defun mastodon-toot--format-kbind-command (cmd)
   "Format CMD to be more readable.
-e.g. mastodon-toot--send -> Send."
+e.g. `mastodon-toot--send' -> Send."
   (let* ((str (symbol-name cmd))
  (re "--\\(.*\\)$")
  (str2 (save-match-data
@@ -1610,7 +1610,7 @@ LONGEST is the length of the longest binding."
 ;;; DISPLAY DOCS
 
 (defun mastodon-toot--make-mode-docs ()
-  "Create formatted documentation text for the mastodon-toot-mode."
+  "Create formatted documentation text for the `mastodon-toot-mode'."
   (let* ((kbinds (mastodon-toot--get-mode-kbinds))
  (longest-kbind (mastodon-toot--formatted-kbinds-longest
  (mastodon-toot--format-kbinds kbinds



[nongnu] elpa/mastodon 0ef13ab348 55/63: fix prev-item-id

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 0ef13ab348d0b6b6fde5a8ecf3b5131917c24c34
Author: marty hiatt 
Commit: marty hiatt 

fix prev-item-id
---
 lisp/mastodon-tl.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 797b355efb..2660ef53ea 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1494,11 +1494,11 @@ Runs `mastodon-tl--render-text' and fetches poll or 
media."
   "Return the id of the last toot inserted into the buffer."
   (let* ((prev-change
   (save-excursion
-(previous-single-property-change (point) 'base-toot-id)))
+(previous-single-property-change (point) 'base-item-id)))
  (prev-pos
   (when prev-change (1- prev-change
 (when prev-pos
-  (get-text-property prev-pos 'base-toot-id
+  (get-text-property prev-pos 'base-item-id
 
 (defun mastodon-tl--after-reply-status (reply-to-id)
   "T if REPLY-TO-ID is equal to that of the last toot inserted in the bufer."



[nongnu] elpa/mastodon 028ab8ea22 43/63: fix newlines accumulating on (un)folding toots

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 028ab8ea22283fe4ae956894ef4cb6b002e2272e
Author: marty hiatt 
Commit: marty hiatt 

fix newlines accumulating on (un)folding toots
---
 lisp/mastodon-tl.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 908a063cf2..70d02236a2 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1602,6 +1602,7 @@ Folding decided by `mastodon-tl--fold-toots-at-length'."
   (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:
@@ -1612,7 +1613,9 @@ Folding decided by `mastodon-tl--fold-toots-at-length'."
 (defun mastodon-tl--fold-post ()
   "Fold post at point, if it is too long."
   (interactive)
-  (mastodon-tl--unfold-post :fold))
+  (mastodon-tl--unfold-post :fold)
+  ;; inserting leaves us at beg of toot, so let's leave point at byline:
+  (mastodon-tl--goto-next-item))
 
 ;; from mastodon-alt.el:
 (defun mastodon-tl--toot-for-stats (&optional toot)



[nongnu] elpa/mastodon 49261b91b0 59/63: Revert "replace persist with multisession"

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 49261b91b075b9ee77c96bbd04fa05043d29d28a
Author: marty hiatt 
Commit: marty hiatt 

Revert "replace persist with multisession"

This reverts commit f19f3bc2735bd78bb3150b8507b6f8949108cece.
---
 lisp/mastodon-profile.el | 19 ---
 lisp/mastodon-toot.el|  4 +---
 lisp/mastodon.el |  2 +-
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index cd1978fde1..de16b7d216 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -35,6 +35,7 @@
 ;;; Code:
 (require 'seq)
 (require 'cl-lib)
+(require 'persist)
 (require 'parse-time)
 (require 'mastodon-http)
 (eval-when-compile
@@ -124,8 +125,8 @@ It contains details of the current user's account.")
 map)
   "Keymap for `mastodon-profile-update-mode'.")
 
-(define-multisession-variable mastodon-profile-account-settings nil
-  "An alist of account settings saved from the server.
+(persist-defvar mastodon-profile-account-settings nil
+"An alist of account settings saved from the server.
 Other clients can change these settings on the server at any
 time, so this list is not the canonical source for settings. It
 is updated on entering mastodon mode and on toggle any setting it
@@ -364,16 +365,13 @@ SOURCE means that the preference is in the `source' part 
of the account JSON."
 
 (defun mastodon-profile--get-pref (pref)
   "Return PREF from `mastodon-profile-account-settings'."
-  (plist-get (multisession-value mastodon-profile-account-settings)
- pref))
+  (plist-get mastodon-profile-account-settings pref))
 
 (defun mastodon-profile--update-preference-plist (pref val)
   "Set local account preference plist preference PREF to VAL.
 This is done after changing the setting on the server."
-  (setf (multisession-value mastodon-profile-account-settings)
-(plist-put
- (multisession-value mastodon-profile-account-settings)
- pref val)))
+  (setq mastodon-profile-account-settings
+(plist-put mastodon-profile-account-settings pref val)))
 
 ;; used in toot.el
 (defun mastodon-profile--fetch-server-account-settings-maybe ()
@@ -386,8 +384,7 @@ Only do so if `mastodon-profile-account-settings' is nil."
 Store the values in `mastodon-profile-account-settings'.
 Run in `mastodon-mode-hook'.
 If NO-FORCE, only fetch if `mastodon-profile-account-settings' is nil."
-  (unless (and no-force
-   (multisession-value mastodon-profile-account-settings))
+  (unless (and no-force mastodon-profile-account-settings)
 (let ((keys '(locked discoverable display_name bot))
   (source-keys '(privacy sensitive language)))
   (mapc (lambda (k)
@@ -405,7 +402,7 @@ If NO-FORCE, only fetch if 
`mastodon-profile-account-settings' is nil."
   ;; TODO: remove now redundant vars, replace with fetchers from the plist
   (setq mastodon-toot--visibility (mastodon-profile--get-pref 'privacy)
 mastodon-toot--content-nsfw (mastodon-profile--get-pref 
'sensitive))
-  (multisession-value mastodon-profile-account-settings
+  mastodon-profile-account-settings)))
 
 (defun mastodon-profile--account-locked-toggle ()
   "Toggle the locked status of your account.
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 12695165da..6387beae17 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1951,9 +1951,7 @@ EDIT means we are editing an existing toot, not composing 
a new one."
 (mastodon-toot-mode t)
 ;; set visibility:
 (setq mastodon-toot--visibility
-  (or (plist-get
-   (multisession-value mastodon-profile-account-settings)
-   'privacy)
+  (or (plist-get mastodon-profile-account-settings 'privacy)
   ;; use toot visibility setting from the server:
   (mastodon-profile--get-source-value 'privacy)
   "public")) ; fallback
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index 41b6fbe450..82a2491424 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -7,7 +7,7 @@
 ;; Marty Hiatt 
 ;; Maintainer: Marty Hiatt 
 ;; Version: 1.0.24
-;; Package-Requires: ((emacs "27.1") (request "0.3.0"))
+;; Package-Requires: ((emacs "27.1") (request "0.3.0") (persist "0.4"))
 ;; Homepage: https://codeberg.org/martianh/mastodon.el
 
 ;; This file is not part of GNU Emacs.



[nongnu] elpa/mastodon d7816ab59f 35/63: add item-json prop to fave/boost strings, so (un)folding works

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit d7816ab59fdf64fc64adf3185052ee10931d7076
Author: marty hiatt 
Commit: marty hiatt 

add item-json prop to fave/boost strings, so (un)folding works
---
 lisp/mastodon-toot.el | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index e884f97f45..666d1b080d 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -319,11 +319,12 @@ NO-TOOT means we are not calling from a toot buffer."
   (with-current-buffer "*new toot*"
 (mastodon-toot--update-status-fields)
 
-(defun mastodon-toot--action-success (marker byline-region remove)
+(defun mastodon-toot--action-success (marker byline-region remove &optional 
json)
   "Insert/remove the text MARKER with `success' face in byline.
 BYLINE-REGION is a cons of start and end pos of the byline to be
 modified.
-Remove MARKER if REMOVE is non-nil, otherwise add it."
+Remove MARKER if REMOVE is non-nil, otherwise add it.
+JSON is added to the string as its item-json."
   (let ((inhibit-read-only t)
 (bol (car byline-region))
 (eol (cdr byline-region))
@@ -342,7 +343,8 @@ Remove MARKER if REMOVE is non-nil, otherwise add it."
   (format "(%s) "
   (propertize marker
   'face 'success))
-  'cursor-face 'mastodon-cursor-highlight-face
+  'cursor-face 'mastodon-cursor-highlight-face
+  'item-json json ;; for (un)folding items
 (when at-byline-p
   ;; leave point after the marker:
   (unless remove
@@ -422,7 +424,7 @@ TYPE is a symbol, either `favourite' or `boost.'"
   (mastodon-toot--action-success (if boost-p
  (mastodon-tl--symbol 
'boost)
(mastodon-tl--symbol 
'favourite))
- byline-region remove))
+ byline-region remove 
item-json))
 (message (format "%s #%s" (if boost-p msg action) id)))
(message (format "Nothing to %s here?!?" action-string
 



[nongnu] elpa/mastodon 3eb1c4f794 41/63: --thread: diff name for option arg to avoid macro var

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 3eb1c4f794edcf582c2eed7e2857f1ee01a5c107
Author: marty hiatt 
Commit: marty hiatt 

--thread: diff name for option arg to avoid macro var
---
 lisp/mastodon-tl.el | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 17f7ae5c62..d3a11ed600 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -2030,11 +2030,14 @@ view all branches of a thread."
 (let ((id (mastodon-tl--property 'base-item-id)))
   (mastodon-tl--thread id
 
-(defun mastodon-tl--thread (&optional id)
-  "Open thread buffer for toot at point or with ID."
+(defun mastodon-tl--thread (&optional thread-id)
+  "Open thread buffer for toot at point or with THREAD-ID."
   (interactive)
   (mastodon-toot--with-toot-item
-   (let* ((id (or id (mastodon-tl--property 'base-item-id :no-move)))
+   ;; this function's var must not be id as the above macro binds id and even
+   ;; if we provide the arg (e.g. url-lookup), the macro definition overrides
+   ;; it, making the optional arg unusable!
+   (let* ((id (or thread-id (mastodon-tl--property 'base-item-id :no-move)))
   (type (mastodon-tl--field 'type (mastodon-tl--property 'item-json 
:no-move
  (if (or (string= type "follow_request")
  (string= type "follow")) ; no can thread these



[nongnu] elpa/mastodon 712a2af648 29/63: update info

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 712a2af648b63d8760bc88ae1d3a2a6726aaecb5
Author: marty hiatt 
Commit: marty hiatt 

update info
---
 mastodon.info | 58 ++
 mastodon.texi |  4 ++--
 2 files changed, 32 insertions(+), 30 deletions(-)

diff --git a/mastodon.info b/mastodon.info
index 1689c1d1bf..8154474d59 100644
--- a/mastodon.info
+++ b/mastodon.info
@@ -157,7 +157,8 @@ prefer to use Emojify 
(https://github.com/iqbalansari/emacs-emojify),
 ‘require’ it and set ‘mastodon-use-emojify’ to non-nil to display emoji
 in timelines and to use it when composing toots.  ‘Emoji.el’ is the
 better option, but for now only ‘emojify’ supports downloading and using
-custom emoji from your instance.
+custom emoji from your instance.  From personal experience, ‘emojify’
+also tends to result in less TOFU.
 
 
 File: mastodon.info,  Node: Discover,  Prev: Emoji,  Up: Installation
@@ -595,7 +596,8 @@ File: mastodon.info,  Node: Dependencies,  Next: Network 
compatibility,  Prev: U
 Hard dependencies (should all install with ‘mastodon.el’):
• ‘request’ (for uploading attachments), emacs-request
  (https://github.com/tkf/emacs-request)
-   • ‘persist’ for storing some settings across sessions
+   • ‘persist’ for storing some settings across sessions (we now use
+ ‘multisession.el’ for this)
 
Optional dependencies (install yourself, ‘mastodon.el’ can use them):
• ‘emojify’ to use custom emoji (else we use builtin ‘emoji.el’)
@@ -748,32 +750,32 @@ Node: ELPA1917
 Node: MELPA2145
 Node: Repo2525
 Node: Emoji3018
-Node: Discover3536
-Node: Usage4088
-Node: Logging in to your instance4531
-Node: Timelines5528
-Ref: Keybindings6003
-Ref: Toot byline legend10777
-Node: Composing toots11086
-Ref: Keybindings (1)12638
-Ref: Autocompletion of mentions tags and emoji13173
-Ref: Draft toots14098
-Node: Other commands and account settings14569
-Node: Customization17736
-Node: Commands and variables index18614
-Node: Alternative timeline layout19130
-Node: Live-updating timelines mastodon-async-mode19535
-Node: Translating toots20387
-Node: Bookmarks and mastodonel21569
-Node: Dependencies22108
-Node: Network compatibility22742
-Node: Contributing23624
-Node: Bug reports24120
-Node: Fixes and features25031
-Node: Coding style25532
-Node: Supporting mastodonel26156
-Node: Contributors26723
-Node: screenshots27158
+Node: Discover3612
+Node: Usage4164
+Node: Logging in to your instance4607
+Node: Timelines5604
+Ref: Keybindings6079
+Ref: Toot byline legend10853
+Node: Composing toots11162
+Ref: Keybindings (1)12714
+Ref: Autocompletion of mentions tags and emoji13249
+Ref: Draft toots14174
+Node: Other commands and account settings14645
+Node: Customization17812
+Node: Commands and variables index18690
+Node: Alternative timeline layout19206
+Node: Live-updating timelines mastodon-async-mode19611
+Node: Translating toots20463
+Node: Bookmarks and mastodonel21645
+Node: Dependencies22184
+Node: Network compatibility22867
+Node: Contributing23749
+Node: Bug reports24245
+Node: Fixes and features25156
+Node: Coding style25657
+Node: Supporting mastodonel26281
+Node: Contributors26848
+Node: screenshots27283
 
 End Tag Table
 
diff --git a/mastodon.texi b/mastodon.texi
index 059435e78e..efececf008 100644
--- a/mastodon.texi
+++ b/mastodon.texi
@@ -152,7 +152,7 @@ it shouldn't be very hard to get it working.
 @node Emoji
 @subsection Emoji
 
-Since Emacs 28, it has builtin emoji support with @samp{emoji.el}. If you 
prefer to use @uref{https://github.com/iqbalansari/emacs-emojify, Emojify}, 
@samp{require} it and set @samp{mastodon-use-emojify} to non-nil to display 
emoji in timelines and to use it when composing toots. @samp{Emoji.el} is the 
better option, but for now only @samp{emojify} supports downloading and using 
custom emoji from your instance.
+Since Emacs 28, it has builtin emoji support with @samp{emoji.el}. If you 
prefer to use @uref{https://github.com/iqbalansari/emacs-emojify, Emojify}, 
@samp{require} it and set @samp{mastodon-use-emojify} to non-nil to display 
emoji in timelines and to use it when composing toots. @samp{Emoji.el} is the 
better option, but for now only @samp{emojify} supports downloading and using 
custom emoji from your instance. From personal experience, @samp{emojify} also 
tends to result in less TOFU@.
 
 @node Discover
 @subsection Discover
@@ -701,7 +701,7 @@ Hard dependencies (should all install with 
@samp{mastodon.el}):
 @item
 @samp{request} (for uploading attachments), 
@uref{https://github.com/tkf/emacs-request, emacs-request}
 @item
-@samp{persist} for storing some settings across sessions
+@samp{persist} for storing some settings across sessions (we now use 
@samp{multisession.el} for this)
 @end itemize
 
 Optional dependencies (install yourself, @samp{mastodon.el} can use them):



[nongnu] elpa/mastodon f43ecd6bad 06/63: docstring

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit f43ecd6bad329bd16b76d1b6962ef4b3715f362c
Author: marty hiatt 
Commit: marty hiatt 

docstring
---
 lisp/mastodon-toot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 18bedab94d..408a783f89 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -281,7 +281,7 @@ data about the item boosted or favourited."
 (defmacro mastodon-tl--with-toot-item (&rest body)
   "Execute BODY if we have a toot object at point.
 Includes boosts, and notifications that display toots.
-This macro makes the id local variable available."
+This macro makes the local variable ID available."
   (declare (debug t))
   `(if (not (equal 'toot (mastodon-tl--property 'item-type :no-move)))
(user-error "Looks like there's no toot at point?")



[nongnu] elpa/mastodon 6b0a0eb1fa 49/63: readme, index, info

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 6b0a0eb1fa7e5f4dcb353e1e3e422e560aee2c14
Author: marty hiatt 
Commit: marty hiatt 

readme, index, info
---
 README.org |  3 ++-
 mastodon-index.org |  7 +--
 mastodon.info  | 45 +++--
 mastodon.texi  |  4 +++-
 4 files changed, 33 insertions(+), 26 deletions(-)

diff --git a/README.org b/README.org
index d8f94f954b..122ab36294 100644
--- a/README.org
+++ b/README.org
@@ -185,6 +185,7 @@ For a full list of commands and variables, see 
[[file:mastodon-index.org][mastod
 | =i=  | (un)pin your toot at point
  |
 | =d=  | delete your toot at point, and reload current timeline
  |
 | =D=  | delete and redraft toot at point, preserving 
reply/CW/visibility|
+| =!=  | toggle folding of toot at point   
  |
 | (=S-C-=) =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at 
point |
 
|+-|
 || *Profile view*  
  |
@@ -414,7 +415,7 @@ to your translator function as its text argument. Here's 
what
 
 *** Bookmarks and =mastodon.el=
 
-=mastodon.el= implements a basic bookmark record and handler. Currently, this 
means that you can bookmark a post item and later load it in thread view. This 
could be expanded to any item with an id, but probably not to things like 
timeline views. If you want to be able to bookmark something, open an issue and 
ask, it's trivial to expand the bookmarking code.
+=mastodon.el= implements a basic bookmark record and handler. Currently, this 
means that you can bookmark a post item and later load it in thread view. This 
could be expanded to any item with an id, but probably not to things like 
timeline views. If you want to be able to bookmark something, open an issue and 
ask, as it's trivial to expand the bookmarking code.
 
 ** Dependencies
 
diff --git a/mastodon-index.org b/mastodon-index.org
index 7347fe1cc4..4c57478c6e 100644
--- a/mastodon-index.org
+++ b/mastodon-index.org
@@ -101,6 +101,7 @@
 |  | mastodon-search--trending-statuses| 
Display a list of statuses trending on your instance.  |
 |  | mastodon-search--trending-tags| 
Display a list of tags trending on your instance.  |
 |  | mastodon-search-mode  | 
Toggle mastodon search minor mode. |
+| /| mastodon-switch-to-buffer | 
Switch to a live mastodon buffer.  |
 | B| mastodon-tl--block-user   | Query 
for USER-HANDLE from current status and block that user. |
 | | mastodon-tl--click-image-or-video | Click 
to play video with `mpv.el'. |
 |  | mastodon-tl--copy-image-caption   | Copy 
the caption of the image at point.|
@@ -110,6 +111,8 @@
 |  | mastodon-tl--do-link-action-at-point  | Do 
the action of the link at POSITION. |
 |  | mastodon-tl--enable-notify-user-posts | Query 
for USER-HANDLE and enable notifications when they post. |
 |  | mastodon-tl--filter-user-user-posts-by-language   | Query 
for USER-HANDLE and filter display of their posts by language.   |
+|  | mastodon-tl--fold-post| Fold 
post at point, if it is too long. |
+| !| mastodon-tl--fold-post-toggle | 
Toggle the folding status of the toot at point.|
 |  | mastodon-tl--follow-tag   | 
Prompt for a tag (from post at point) and follow it.   |
 | W| mastodon-tl--follow-user  | Query 
for USER-HANDLE from current status and follow that user.|
 |  | mastodon-tl--follow-user-disable-boosts   | 
Prompt for a USER-HANDLE, and disable display of boosts in home timeline.  |
@@ -134,7 +137,7 @@
 | SPC  | mastodon-tl--scroll-up-command| Call 
`scroll-up-command', loading more toots if necessary. |
 |  | mastodon-tl--single-toot  | View 
toot at point in separate buffer.   

[nongnu] elpa/mastodon 3f9b305b5f 24/63: flymake

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 3f9b305b5f02954568ec7e7b95eb0653286ccf3a
Author: marty hiatt 
Commit: marty hiatt 

flymake
---
 lisp/mastodon-tl.el   |  8 +---
 lisp/mastodon-toot.el | 12 ++--
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index a0a0c18175..cb7ccf1d58 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -89,6 +89,8 @@
 (autoload 'mastodon-search--insert-heading "mastodon-search")
 (autoload 'mastodon-media--process-full-sized-image-response "mastodon-media")
 (autoload 'mastodon-search--trending-statuses "mastodon-search")
+(autoload 'mastodon-search--format-heading "mastodon-search")
+(autoload 'mastodon-toot--with-toot-item "mastodon-toot")
 
 (defvar mastodon-toot--visibility)
 (defvar mastodon-toot-mode)
@@ -1371,7 +1373,7 @@ displayed when the duration is smaller than a minute)."
  cell))
  options-alist)))
 (if (null poll)
-(user-error "No poll here.")
+(user-error "No poll here")
   (list
;; var "option" = just the cdr, a cons of option number and desc
(cdr (assoc (completing-read "Poll option to vote for: "
@@ -1383,7 +1385,7 @@ displayed when the duration is smaller than a minute)."
   "If there is a poll at point, prompt user for OPTION to vote on it."
   (interactive (mastodon-tl--read-poll-option))
   (if (null (mastodon-tl--field 'poll (mastodon-tl--property 'item-json)))
-  (user-error "No poll here.")
+  (user-error "No poll here")
 (let* ((toot (mastodon-tl--property 'item-json))
(poll (mastodon-tl--field 'poll toot))
(poll-id (alist-get 'id poll))
@@ -2030,7 +2032,7 @@ view all branches of a thread."
 (defun mastodon-tl--thread (&optional id)
   "Open thread buffer for toot at point or with ID."
   (interactive)
-  (mastodon-tl--with-toot-item
+  (mastodon-toot--with-toot-item
(let* ((id (or id (mastodon-tl--property 'base-item-id :no-move)))
   (type (mastodon-tl--field 'type (mastodon-tl--property 'item-json 
:no-move
  (if (or (string= type "follow_request")
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 496f334cad..bb5a4c3954 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -265,7 +265,7 @@ send.")
 
 ;;; MACRO
 
-(defmacro mastodon-tl--with-toot-item (&rest body)
+(defmacro mastodon-toot--with-toot-item (&rest body)
   "Execute BODY if we have a toot object at point.
 Includes boosts, and notifications that display toots."
   (declare (debug t))
@@ -370,7 +370,7 @@ boosting, or bookmarking toots."
 (defun mastodon-toot--toggle-boost-or-favourite (type)
   "Toggle boost or favourite of toot at `point'.
 TYPE is a symbol, either `favourite' or `boost.'"
-  (mastodon-tl--with-toot-item
+  (mastodon-toot--with-toot-item
(let ((n-type (mastodon-tl--property 'notification-type :no-move)))
  (if (or (equal n-type "follow")
  (equal n-type "follow_request"))
@@ -473,7 +473,7 @@ SUBTRACT means we are un-favouriting or unboosting, so we 
decrement."
 (defun mastodon-toot--toggle-bookmark ()
   "Bookmark or unbookmark toot at point."
   (interactive)
-  (mastodon-tl--with-toot-item
+  (mastodon-toot--with-toot-item
(let ((n-type (mastodon-tl--property 'notification-type :no-move)))
  (if (or (equal n-type "follow")
  (equal n-type "follow_request"))
@@ -521,7 +521,7 @@ SUBTRACT means we are un-favouriting or unboosting, so we 
decrement."
 (defun mastodon-toot--list-toot-boosters-or-favers (&optional favourite)
   "List the favouriters or boosters of toot at point.
 With FAVOURITE, list favouriters, else list boosters."
-  (mastodon-tl--with-toot-item
+  (mastodon-toot--with-toot-item
(let* ((base-toot (mastodon-tl--property 'base-item-id))
   (endpoint (if favourite "favourited_by" "reblogged_by"))
   (url (mastodon-http--api (format "statuses/%s/%s" base-toot 
endpoint)))
@@ -954,7 +954,7 @@ instance to edit a toot."
 (defun mastodon-toot--edit-toot-at-point ()
   "Edit the user's toot at point."
   (interactive)
-  (mastodon-tl--with-toot-item
+  (mastodon-toot--with-toot-item
(let ((toot (or (mastodon-tl--property 'base-toot) ; fave/boost notifs
(mastodon-tl--property 'item-json
  (if (not (mastodon-toot--own-toot-p toot))
@@ -1180,7 +1180,7 @@ text of the toot being replied to in the compose buffer.
 If the region is active, inject it into the reply buffer,
 prefixed by >."
   (interactive)
-  (mastodon-tl--with-toot-item
+  (mastodon-toot--with-toot-item
(let* ((quote (when (region-active-p)
(buffer-substring (region-beginning)
  (region-end



[nongnu] elpa/mastodon 4ac5b57ae6 62/63: Merge branch 'develop'

2024-08-04 Thread ELPA Syncer
branch: elpa/mastodon
commit 4ac5b57ae6c4e94439a44820d81df00785d420c4
Merge: a191fb5f3f da0e348bc7
Author: marty hiatt 
Commit: marty hiatt 

Merge branch 'develop'
---
 README.org|  50 +++--
 lisp/mastodon-media.el|   8 +-
 lisp/mastodon-search.el   |   4 +-
 lisp/mastodon-tl.el   | 265 ++
 lisp/mastodon-toot.el | 426 --
 lisp/mastodon.el  |  30 ++-
 mastodon-index.org|  15 +-
 mastodon.info | 118 +++-
 mastodon.texi |  32 +++-
 screenshot-notifs+compose.png | Bin 0 -> 207025 bytes
 screenshot-tl.png | Bin 0 -> 254949 bytes
 11 files changed, 554 insertions(+), 394 deletions(-)

diff --git a/README.org b/README.org
index 1fbb047282..f514b33af5 100644
--- a/README.org
+++ b/README.org
@@ -65,8 +65,7 @@ it shouldn't be very hard to get it working.
 
 *** Emoji
 
-=mastodon-mode= will enable 
[[https://github.com/iqbalansari/emacs-emojify][Emojify]] if it is loaded in 
your Emacs environment, so
-there's no need to write your own hook anymore. =emojify-mode= is not required.
+Since Emacs 28, it has builtin emoji support with =emoji.el=. If you prefer to 
use [[https://github.com/iqbalansari/emacs-emojify][Emojify]], =require= it and 
set =mastodon-use-emojify= to non-nil to display emoji in timelines and to use 
it when composing toots. =Emoji.el= is the better option, but for now only 
=emojify= supports downloading and using custom emoji from your instance. From 
personal experience, =emojify= also tends to result in less TOFU.
 
 *** Discover
 
@@ -186,6 +185,7 @@ For a full list of commands and variables, see 
[[file:mastodon-index.org][mastod
 | =i=  | (un)pin your toot at point
  |
 | =d=  | delete your toot at point, and reload current timeline
  |
 | =D=  | delete and redraft toot at point, preserving 
reply/CW/visibility|
+| =!=  | toggle folding of toot at point   
  |
 | (=S-C-=) =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at 
point |
 
|+-|
 || *Profile view*  
  |
@@ -242,21 +242,21 @@ value of that hook is as follows:
 
  Keybindings
 
-|--+--|
-| Key  | Action   |
-|--+--|
-| =C-c C-c=  | Send toot|
-| =C-c C-k=  | Cancel toot  |
-| =C-c C-w=  | Add content warning  |
-| =C-c C-v=  | Change toot visibility   |
-| =C-c C-n=  | Add sensitive media/nsfw flag|
-| =C-c C-a=  | Upload attachment(s) |
-| =C-c !=| Remove all attachments   |
-| =C-c C-e=  | Add emoji (if =emojify= installed) |
-| =C-c C-p=  | Create a poll|
-| =C-c C-l=  | Set toot language|
-| =-C-c C-s= | Schedule toot|
-|--+--|
+|--+---|
+| Key  | Action|
+|--+---|
+| =C-c C-c=  | Send toot |
+| =C-c C-k=  | Cancel toot   |
+| =C-c C-w=  | Add content warning   |
+| =C-c C-v=  | Change toot visibility|
+| =C-c C-n=  | Add sensitive media/nsfw flag |
+| =C-c C-a=  | Upload attachment(s)  |
+| =C-c !=| Remove all attachments|
+| =C-c C-e=  | Insert emoji  |
+| =C-c C-p=  | Create a poll |
+| =C-c C-l=  | Set toot language |
+| =-C-c C-s= | Schedule toot |
+|--+---|
 
  Autocompletion of mentions, tags and emoji
 
@@ -265,7 +265,7 @@ Autocompletion of mentions, tags, and emojis is provided by
 =mastodon-toot--enable-completion= is enabled by default.
 
 To trigger completion, type a prefix followed by a few letters, =@= for
-mentions, =#= for tags, and =:= for emoji.
+mentions, =#= for tags, and =:= for emoji (for now this only works when using 
=emojify.el=).
 
 If you want to enable =company-mode= in the toot compose buffer, set
 =mastodon-toot--use-company-for-completion= to =t=. (=mastodon.el= used to run 
its
@@ -415,7 +415,7 @@ to your translator function as its text argument. Here's 
what
 
 *** Bookmarks and =mastodon.el=
 
-=mastodon.el= implements a basic bookmark record and handler. Currently, this 
means that you can bookmark a post item and later load it in thread view. This 
could be expanded to any item with an id, but probably not to things like 
timeline views. If you want t

[elpa] externals/denote eec60330fb: Make org-capture not create CUSTOM_ID for heading if no link is specified

2024-08-04 Thread ELPA Syncer
branch: externals/denote
commit eec60330fb0971db7693ee21d4c8324f4c467656
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Make org-capture not create CUSTOM_ID for heading if no link is specified

Before, we were creating this unconditionally. Thanks to Jonas
Großekathöfer for bringing this matter to my attention in issue 404:
.
---
 README.org | 19 ++-
 denote.el  |  9 -
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/README.org b/README.org
index 9734989bed..8b1783ef80 100644
--- a/README.org
+++ b/README.org
@@ -6172,15 +6172,16 @@ Denote is meant to be a collective effort.  Every bit 
of help matters.
   Elias Storms, Federico Stilman, Florian, Frédéric Willem Frank
   Ehmsen, Glenna D., Guo Yong, Hanspeter Gisler Harold Ollivier, Jack
   Baty, Jay Rajput, Jean-Charles Bagneris, Jens Östlund, Jeremy
-  Friesen, Jonathan Sahar, Johan Bolmsjö, Jousimies, Juanjo Presa,
-  Julian Hoch, Kai von Fintel, Kaushal Modi, Kolmas, M. Hadi Timachi,
-  Maikol Solis, Mark Olson, Mirko Hernandez, Niall Dooley, Nick Bell,
-  Paul van Gelder, Peter Prevos, Peter Smith, Samuel W. Flint, Suhail
-  Singh, Shreyas Ragavan, Stefan Thesing, Summer Emacs, Sven Seebeck,
-  Taoufik, TJ Stankus, Vick (VicZz), Viktor Haag, Wade Mealing, Yi
-  Liu, Ypot, atanasj, azegas, babusri, doolio, duli, drcxd, elge70,
-  fingerknight, hpgisler, mentalisttraceur, pRot0ta1p, rbenit68,
-  relict007, sienic, skissue, sundar bp, yetanotherfossman, zadca123
+  Friesen, Jonathan Sahar, Johan Bolmsjö, Jonas Großekathöfer,
+  Jousimies, Juanjo Presa, Julian Hoch, Kai von Fintel, Kaushal Modi,
+  Kolmas, M. Hadi Timachi, Maikol Solis, Mark Olson, Mirko Hernandez,
+  Niall Dooley, Nick Bell, Paul van Gelder, Peter Prevos, Peter Smith,
+  Samuel W. Flint, Suhail Singh, Shreyas Ragavan, Stefan Thesing,
+  Summer Emacs, Sven Seebeck, Taoufik, TJ Stankus, Vick (VicZz),
+  Viktor Haag, Wade Mealing, Yi Liu, Ypot, atanasj, azegas, babusri,
+  doolio, duli, drcxd, elge70, fingerknight, hpgisler,
+  mentalisttraceur, pRot0ta1p, rbenit68, relict007, sienic, skissue,
+  sundar bp, yetanotherfossman, zadca123
 
 Special thanks to Peter Povinec who helped refine the file-naming
 scheme, which is the cornerstone of this project.
diff --git a/denote.el b/denote.el
index 73d91fea46..5bebea7245 100644
--- a/denote.el
+++ b/denote.el
@@ -4755,7 +4755,9 @@ Also see the user option 
`denote-org-store-link-to-heading'."
  ((denote-file-is-note-p file))
  (file-id (denote-retrieve-filename-identifier file))
  (description (denote--link-get-description file)))
-(let ((heading-links (and denote-org-store-link-to-heading (derived-mode-p 
'org-mode
+(let ((heading-links (and denote-org-store-link-to-heading
+  (derived-mode-p 'org-mode)
+  (denote--org-capture-link-specifiers-p
   (org-link-store-props
:type "denote"
:description (if heading-links
@@ -4829,6 +4831,11 @@ the standard front matter we define."
   :package-version '(denote . "0.1.0")
   :group 'denote-org-capture)
 
+(defun denote--org-capture-link-specifiers-p ()
+  "Return non-nil if `denote-org-capture-specifiers' uses link specifiers."
+  (when (stringp denote-org-capture-specifiers)
+(string-match-p "%^?[aAlL]" denote-org-capture-specifiers)))
+
 (defvar denote-last-path nil "Store last path.")
 
 ;;;###autoload



[elpa] externals/lin ede49730af 2/2: Add user option lin-remap-cureent-line-number

2024-08-04 Thread ELPA Syncer
branch: externals/lin
commit ede49730af5f23cee2b784c860dfb3dc90ce67d0
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add user option lin-remap-cureent-line-number
---
 README.org |  7 +++
 lin.el | 24 ++--
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index eda5c00068..2906bbc0ae 100644
--- a/README.org
+++ b/README.org
@@ -114,6 +114,13 @@ background attribute.  The Lin faces with the 
=-override-fg= suffix set
 a foreground value which replaces that of the underlying text.  Whereas
 the others only specify a background attribute.
 
+[ The ~lin-remap-cureent-line-number~ is part of {{{development-version}}}. ]
+
+#+vindex: lin-remap-cureent-line-number
+The user option ~lin-remap-cureent-line-number~ controls whether to
+apply the Lin style also to the currently highlighted line number.
+Line numbers come from the built-in ~display-line-numbers-mode~.
+
 * Installation
 :PROPERTIES:
 :CUSTOM_ID: h:7b68abd3-a854-4b72-b704-05ca013dfa7f
diff --git a/lin.el b/lin.el
index d2f7a04369..30ae528738 100644
--- a/lin.el
+++ b/lin.el
@@ -145,6 +145,13 @@ updates the face.  Users who prefer to use `setq' must run
   :package-version '(lin . "0.3.0")
   :group 'lin)
 
+(defcustom lin-remap-cureent-line-number t
+  "When non-nil, apply `lin-face' also to the current line number.
+Line numbers come from the `display-line-numbers-mode'."
+  :type 'boolean
+  :package-version '(lin . "1.1.0")
+  :group 'lin)
+
  Faces
 
 (defgroup lin-faces ()
@@ -299,10 +306,13 @@ updates the face.  Users who prefer to use `setq' must run
 
  Lin setup
 
-(defvar-local lin--cookie nil
-  "Cookie returned by `face-remap-add-relative'.")
+(defvar-local lin--hl-line-cookie nil
+  "Cookie returned by `face-remap-add-relative' for `hl-line' face.")
+
+(defvar-local lin--line-number-current-line-cookie nil
+  "Cookie of `face-remap-add-relative' for `line-number-current-line' face.")
 
-(defun lin--source-face ()
+(defun lin--hl-line-source-face ()
   "Determine the source face: what to remap."
   (cond
((derived-mode-p 'mu4e-headers-mode)
@@ -323,10 +333,12 @@ updates the face.  Users who prefer to use `setq' must run
   :init-value nil
   (if lin-mode
   (progn
-(setq lin--cookie
-  (face-remap-add-relative (lin--source-face) lin-face))
+(setq lin--hl-line-cookie (face-remap-add-relative 
(lin--hl-line-source-face) lin-face))
+(when lin-remap-cureent-line-number
+  (setq lin--line-number-current-line-cookie (face-remap-add-relative 
'line-number-current-line lin-face)))
 (hl-line-mode 1))
-(face-remap-remove-relative lin--cookie)
+(face-remap-remove-relative lin--hl-line-cookie)
+(face-remap-remove-relative lin--line-number-current-line-cookie)
 (hl-line-mode -1)))
 
 ;;;###autoload



[elpa] externals/lin updated (7a043603d1 -> ede49730af)

2024-08-04 Thread ELPA Syncer
elpasync pushed a change to branch externals/lin.

  from  7a043603d1 Update development links
   new  32e84f853e Remove needless word from the Overview heading
   new  ede49730af Add user option lin-remap-cureent-line-number


Summary of changes:
 README.org |  9 -
 lin.el | 24 ++--
 2 files changed, 26 insertions(+), 7 deletions(-)



[elpa] externals/lin 32e84f853e 1/2: Remove needless word from the Overview heading

2024-08-04 Thread ELPA Syncer
branch: externals/lin
commit 32e84f853edfed8397217710252140a036424729
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Remove needless word from the Overview heading
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 5d08c40c80..eda5c00068 100644
--- a/README.org
+++ b/README.org
@@ -59,7 +59,7 @@ included in the section entitled “GNU Free Documentation 
License.”
 modify this GNU manual.”
 #+end_quote
 
-* Overview LIN
+* Overview
 :PROPERTIES:
 :CUSTOM_ID: h:aa71c6b7-4801-4aba-9bcb-f3309f9e4d87
 :END:



[nongnu] elpa/web-mode 0c83581d1e: add pandoc as synonym of marko

2024-08-04 Thread ELPA Syncer
branch: elpa/web-mode
commit 0c83581d1e93d1d802c730a1d5e90cd1c740e1b2
Author: fxbois 
Commit: fxbois 

add pandoc as synonym of marko

#1305
---
 issues/1308.jsx | 15 +++
 web-mode.el |  6 +++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/issues/1308.jsx b/issues/1308.jsx
new file mode 100644
index 00..1edaf34747
--- /dev/null
+++ b/issues/1308.jsx
@@ -0,0 +1,15 @@
+function App() {
+return (
+  
+
+  
+);
+}
+
+function App() {
+  return (
+
+
+
+  );
+}
diff --git a/web-mode.el b/web-mode.el
index 870cd549c9..645e33ad2e 100644
--- a/web-mode.el
+++ b/web-mode.el
@@ -2,7 +2,7 @@
 
 ;; Copyright 2011-2024 François-Xavier Bois
 
-;; Version: 17.3.19
+;; Version: 17.3.20
 ;; Author: François-Xavier Bois
 ;; Maintainer: François-Xavier Bois 
 ;; Package-Requires: ((emacs "23.1"))
@@ -23,7 +23,7 @@
 
 ;; CONSTS 
--
 
-(defconst web-mode-version "17.3.19"
+(defconst web-mode-version "17.3.20"
   "Web Mode version.")
 
 ;; GROUPS 
--
@@ -1006,7 +1006,7 @@ Must be used in conjunction with 
web-mode-enable-block-face."
 ("json-t"   . ())
 ("jsp"  . ("grails"))
 ("mako" . ())
-("marko". ())
+("marko". ("pandoc"))
 ("mason". ("poet"))
 ("lsp"  . ("lisp"))
 ("mojolicious"  . ())



[elpa] externals/cursor-undo c544a74e5e: Fix for upgrading package by allowing redefining of advised functions.

2024-08-04 Thread Luke Lee
branch: externals/cursor-undo
commit c544a74e5e4e46bc1211fdad25248200c330ec7b
Author: Luke Lee 
Commit: Luke Lee 

Fix for upgrading package by allowing redefining of advised functions.

* cursor-undo.el: change redefining errors to warnings.
(def-cursor-undo, disable-cursor-tracking): prevent redefining errors
that prevent users from upgrading package, also attempt to cease
warning on upgrading.
---
 cursor-undo.el | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/cursor-undo.el b/cursor-undo.el
index b16175d81b..cd10f20c46 100644
--- a/cursor-undo.el
+++ b/cursor-undo.el
@@ -5,7 +5,7 @@
 ;; Author:   Luke Lee 
 ;; Maintainer:   Luke Lee 
 ;; Keywords: undo, cursor
-;; Version:  1.1.3
+;; Version:  1.1.4
 
 ;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -183,10 +183,11 @@ relative screen position (screen-pos=NIL) nor `point' 
position (no-move=t)."))
  (def-advice-sym (intern-soft
   (concat func-sym-str "@" advice-sym-str
 ;; prevent duplicate definition
-(if def-advice-sym
-(error (message
-(format "Error: Redefining cursor undo advice for `%S'"
-func-sym
+(when def-advice-sym
+  (unless (member #'package-menu--post-refresh post-command-hook)
+;; do not warn when upgrading this package
+(warn "Redefining cursor undo advice for `%S'" func-sym))
+  (advice-remove func-sym def-advice-sym))
 `(define-advice ,func-sym (:around (orig-func &rest args) ,advice-sym)
(let* ((cursor-tracking cundo-enable-cursor-tracking)
   ;; prevent nested calls for complicated compound commands
@@ -257,10 +258,11 @@ relative screen position (screen-pos=NIL) nor `point' 
position (no-move=t)."))
  (def-advice-sym (intern-soft
   (concat func-sym-str "@" advice-sym-str
 ;; prevent duplicate definition
-(if def-advice-sym
-(error (message (format
-"Error: Redefining cursor tracking disabling advice for `%S'"
- func-sym
+(when def-advice-sym
+  (unless (member #'package-menu--post-refresh post-command-hook)
+;; do not warn when upgrading this package
+(warn "Redefining cursor tracking disabling advice for `%S'" func-sym))
+  (advice-remove func-sym def-advice-sym))
 `(define-advice ,func-sym (:around (orig-func &rest args) ,advice-sym)
(let ((cundo-enable-cursor-tracking nil))
  (apply orig-func args)



[elpa] externals/csv-mode 388bcb9a77: Fix 'csv-guess-separator' being confused by comments

2024-08-04 Thread Philip Kaludercic
branch: externals/csv-mode
commit 388bcb9a77118d7b7d9c42aa8b3f9fa2c892b930
Author: Peder O. Klingenberg 
Commit: Philip Kaludercic 

Fix 'csv-guess-separator' being confused by comments

* csv-mode.el (csv--separator-candidates): Ignore
csv-comment-start when looking for potential separators.
* csv-mode-tests.el (csv-tests-guess-separator-avoid-comment):
Previously failing test case guessing the comment start as
separator char.  (Bug#71042)
---
 csv-mode-tests.el | 10 ++
 csv-mode.el   |  7 ++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/csv-mode-tests.el b/csv-mode-tests.el
index 12e009ecf9..213fd033b2 100644
--- a/csv-mode-tests.el
+++ b/csv-mode-tests.el
@@ -170,5 +170,15 @@
   (should (equal (csv--unquote-value "|Hello, World|")
  "|Hello, World|")))
 
+(ert-deftest csv-tests-guess-separator-avoid-comment ()
+  ;; bug#71042
+  (let ((testdata "###
+###
+Foo;Bar;Quux
+123;456;blah, blah
+"))
+(message "Guessed separator: %c" (csv-guess-separator testdata))
+(should-not (equal (csv-guess-separator testdata) ?#
+
 (provide 'csv-mode-tests)
 ;;; csv-mode-tests.el ends here
diff --git a/csv-mode.el b/csv-mode.el
index 1e0f99ef92..6bdfcafbbb 100644
--- a/csv-mode.el
+++ b/csv-mode.el
@@ -4,7 +4,7 @@
 
 ;; Author: "Francis J. Wright" 
 ;; Maintainer: emacs-de...@gnu.org
-;; Version: 1.25
+;; Version: 1.26
 ;; Package-Requires: ((emacs "27.1") (cl-lib "0.5"))
 ;; Keywords: convenience
 
@@ -107,6 +107,10 @@
 
 ;;; News:
 
+;; Since 1.26:
+;; - `csv-guess-separator' will no longer guess the comment-start
+;;character as a potential separator character.
+
 ;; Since 1.25:
 ;; - The ASCII control character 31 Unit Separator can now be
 ;;   recognized as a CSV separator by `csv-guess-separator'.
@@ -1902,6 +1906,7 @@ When CUTOFF is passed, look only at the first CUTOFF 
number of characters."
  (or (= c ?\t)
  (= c ?\C-_)
  (and (not (member c '(?. ?/ ?\" ?')))
+  (not (= c (string-to-char csv-comment-start)))
   (not (member (get-char-code-property c 
'general-category)
'(Lu Ll Lt Lm Lo Nd Nl No Ps Pe Cc 
Co))
 (puthash c t chars)))



[elpa] main e6bf68bac0: * elpa-packages (wrap-search): Remove outdated comment

2024-08-04 Thread Philip Kaludercic
branch: main
commit e6bf68bac0302e09d6685dd7d2695d3068124e84
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

* elpa-packages (wrap-search): Remove outdated comment

Author:
---
 elpa-packages | 2 --
 1 file changed, 2 deletions(-)

diff --git a/elpa-packages b/elpa-packages
index 7eca03e786..f320d79dd7 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -845,8 +845,6 @@
  (wisitoken-grammar-mode :url nil)
  (wpuzzle  :url nil)
  (wrap-search  :url "https://dataswamp.org/~incal/wrap-search.git";)
- ;; FIXME: Waiting for copyright paperwork from Emanuel Berg.
- ;;(wrap-search:url 
"https://dataswamp.org/~incal/wrap-search.git";)
  (xclip:url nil)
  (xeft  :url "https://git.sr.ht/~casouri/xeft";
   :ignored-files ("*.gif"))



[elpa] externals/wrap-search 4e913585af: Sun Aug 4 06:30:21 PM CEST 2024

2024-08-04 Thread ELPA Syncer
branch: externals/wrap-search
commit 4e913585afc59dffa56d39c4511e31552be4e80e
Author: Emanuel Berg 
Commit: Emanuel Berg 

Sun Aug  4 06:30:21 PM CEST 2024
---
 wrap-search.el | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/wrap-search.el b/wrap-search.el
index d04472d7f2..fb4fd84028 100644
--- a/wrap-search.el
+++ b/wrap-search.el
@@ -8,7 +8,7 @@
 ;; Keywords: matching
 ;; License: GPL3+
 ;; URL: https://dataswamp.org/~incal/elpa/wrap-search.el
-;; Version: 4.16.15
+;; Version: 4.16.17
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -79,7 +79,7 @@
   (prev-case)
   (prev-rev)
   (prev-beg)
-  (prev-end) )
+  (prev-end))
   (defun wrap-search-again (&optional rev-case rev-rev)
 "Repeat the search previously done with `wrap-search'.
 
@@ -88,17 +88,17 @@ Interactively, use a preceding
   \\[universal-argument] \\[universal-argument] to set REV-REV (ditto search 
direction)
   \\[universal-argument] \\[universal-argument] \\[universal-argument] to set 
both"
 (interactive
- (list (member current-prefix-arg '( (4) (64)))
-   (member current-prefix-arg '((16) (64))) ))
+  (list (member current-prefix-arg '( (4) (64)))
+(member current-prefix-arg '((16) (64)
 (when rev-case
-  (setq prev-case (not prev-case)) )
+  (setq prev-case (not prev-case)))
 (when rev-rev
-  (setq prev-rev (not prev-rev)) )
-(wrap-search prev-str prev-case prev-rev prev-beg prev-end) )
+  (setq prev-rev (not prev-rev)))
+(wrap-search prev-str prev-case prev-rev prev-beg prev-end))
   (declare-function wrap-search-again nil)
 
   (defun wrap-search-show-default ()
-(truncate-string-to-width prev-str 10 nil nil t) )
+(truncate-string-to-width prev-str 10 nil nil t))
   (declare-function wrap-search-show-default nil)
 
   (defun wrap-search (str &optional case rev beg end)
@@ -119,14 +119,14 @@ Do \\[wrap-search-again] to repeat, with 
`wrap-search-again'."
,(member current-prefix-arg '( (4) (64)))
,(member current-prefix-arg '((16) (64)))
,@(when (use-region-p)
-   (list (region-beginning) (region-end)) )))
+   (list (region-beginning) (region-end)
 (let ((pos (point)))
   (when (or (not beg)
-(and rev (< pos beg)) )
-(setq beg (point-min)) )
+(and rev (< pos beg)))
+(setq beg (point-min)))
   (when (or (not end)
-(and (not rev) (> pos end)) )
-(setq end (point-max)) )
+(and (not rev) (> pos end)))
+(setq end (point-max)))
   (if (string= "" str)
   (wrap-search-again)
 (setq prev-str  str)
@@ -138,20 +138,20 @@ Do \\[wrap-search-again] to repeat, with 
`wrap-search-again'."
 (`(,search-f ,search-beg ,search-end)
  (if rev
  (list #'search-backward end beg)
-   (list #'search-forward beg end) )))
+   (list #'search-forward beg end
   (if (funcall search-f str search-end t)
   (when wrap-search-echo-point
-(message "hit: %s" (point)) )
+(message "hit: %s" (point)))
 (goto-char search-beg)
 (if (funcall search-f str (+ pos (if rev 0 (length str))) t)
 (if (= pos (point))
 (message "this is the only occurrence")
   (message "wrap%s" (if wrap-search-echo-point
 (format ": %s" (point))
-  "") ))
+  "")))
   (goto-char pos)
-  (message "no hit") ))) )))
-  (declare-function wrap-search nil) )
+  (message "no hit")))
+  (declare-function wrap-search nil))
 
 (provide 'wrap-search)
 ;;; wrap-search.el ends here



[nongnu] elpa/git-commit 87fe66662a: magit-diff-working-tree: Change diff type to committed

2024-08-04 Thread ELPA Syncer
branch: elpa/git-commit
commit 87fe2a1068239e7eafdf26fc0d3ef310a4e7
Author: Kyle Meyer 
Commit: Kyle Meyer 

magit-diff-working-tree: Change diff type to committed

magit-diff-range with a single revision and magit-diff-working-tree
both show a diff between the revision and the working tree.  Whether
magit-reverse aborted in these buffers used to be determined by
whether the specified revision resolved to HEAD.  If so, magit-reverse
aborted with "Cannot reverse unstaged changes".

magit-reverse aborting here wasn't entirely right because a diff of
HEAD versus the working tree may contain staged changes too.

e94b6ebf (Record diff-type in magit-diff-mode buffers, 2023-03-18)
moved magit-diff-range and magit-diff-working-tree in different
directions.  With that change, magit-diff-range with any revision,
including HEAD, allows reversing.  On the other hand,
magit-diff-working-tree with any revision forbids reversing.

Update magit-diff-working-tree to pass `committed' instead of
`unstaged' for the diff type.  As a description, `committed' is a bit
off (the diff can include a mix of unstaged, staged, and committed
changes), but it allows reversing and matches what magit-diff-range
does.

For a diff of any revision against the working tree, magit-apply is
bound to fail.  Before e94b6ebf, magit-apply used to abort when the
diff was between _HEAD_ and the working tree.  After e94b6ebf and this
change, magit-apply leaves the failure to git-apply.  To abort early,
we could mark working tree diffs with a distinct diff type, but
leaving the failure to apply time is good enough, at least for now.

Closes #5090.
---
 docs/RelNotes/4.0.0.org | 3 +++
 lisp/magit-diff.el  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/RelNotes/4.0.0.org b/docs/RelNotes/4.0.0.org
index 30e8c8caae..682e81e994 100644
--- a/docs/RelNotes/4.0.0.org
+++ b/docs/RelNotes/4.0.0.org
@@ -171,6 +171,9 @@
 
 - Improve the diff shown while committing.  #3246
 
+- ~magit-reverse~ is now permitted in diff buffers between HEAD and
+  the working tree.  e94b6ebfdb #5090
+
 - Register a ~bookmark-handler-type~ for our handler.  adf5848ea7
 
 - Added new option ~magit-log-merged-commit-count~. #4711
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 5ad87868f7..5aeba13c87 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -1235,7 +1235,7 @@ a commit read from the minibuffer."
(cons (and current-prefix-arg
   (magit-read-branch-or-commit "Diff working tree and commit"))
  (magit-diff-arguments)))
-  (magit-diff-setup-buffer (or rev "HEAD") nil args files 'unstaged))
+  (magit-diff-setup-buffer (or rev "HEAD") nil args files 'committed))
 
 ;;;###autoload
 (defun magit-diff-staged (&optional rev args files)



[nongnu] elpa/magit updated (5c364eaad7 -> 87fe66662a)

2024-08-04 Thread ELPA Syncer
elpasync pushed a change to branch elpa/magit.

  from  5c364eaad7 magit-reverse-in-index: Fix option reference in docs
  adds  87fe2a magit-diff-working-tree: Change diff type to committed

No new revisions were added by this update.

Summary of changes:
 docs/RelNotes/4.0.0.org | 3 +++
 lisp/magit-diff.el  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)



[nongnu] elpa/magit-section updated (5c364eaad7 -> 87fe66662a)

2024-08-04 Thread ELPA Syncer
elpasync pushed a change to branch elpa/magit-section.

  from  5c364eaad7 magit-reverse-in-index: Fix option reference in docs
  adds  87fe2a magit-diff-working-tree: Change diff type to committed

No new revisions were added by this update.

Summary of changes:
 docs/RelNotes/4.0.0.org | 3 +++
 lisp/magit-diff.el  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)