diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-01-09 16:06:20 +1100 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-01-09 16:06:38 +1100 |
commit | 5d1e5edd0709a70c81a9fc846ff3292a9a270544 (patch) | |
tree | 8661ff9f8f8779a7c5eefe750e1905ffa8bda026 /lisp | |
parent | 77bc927b3dbb7c97463815b5e03084cf47c57adf (diff) |
remove first empty line in docstrings
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-async.el | 6 | ||||
-rw-r--r-- | lisp/mastodon-http.el | 3 | ||||
-rw-r--r-- | lisp/mastodon-media.el | 8 | ||||
-rw-r--r-- | lisp/mastodon-notifications.el | 1 | ||||
-rw-r--r-- | lisp/mastodon-search.el | 2 | ||||
-rw-r--r-- | lisp/mastodon-tl.el | 31 | ||||
-rw-r--r-- | lisp/mastodon-toot.el | 6 | ||||
-rw-r--r-- | lisp/mastodon.el | 4 |
8 files changed, 5 insertions, 56 deletions
diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index 58e7b93..a352ffc 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -131,7 +131,6 @@ (defun mastodon-async--mastodon (endpoint timeline name filter) "Make sure that the previous async process has been closed. - Then start an async stream at ENDPOINT filtering toots using FILTER. TIMELINE is a specific target, such as federated or home. @@ -157,7 +156,6 @@ NAME is the center portion of the buffer name for (defun mastodon-async--set-http-buffer (buffer http-buffer) "Initialize for BUFFER a local variable `mastodon-async--http-buffer'. - HTTP-BUFFER is the initializing value. Use this funcion if HTTP-BUFFER is not known when `mastodon-async--setup-buffer' is called." (with-current-buffer (get-buffer-create buffer) @@ -178,7 +176,6 @@ is not known when `mastodon-async--setup-buffer' is called." (defun mastodon-async--setup-http (http-buffer name) "Add local variables to HTTP-BUFFER. - NAME is used to generate the display buffer and the queue." (let ((queue-name (concat " *mastodon-async-queue-" name "-" mastodon-instance-url "*")) @@ -200,7 +197,6 @@ NAME is used to generate the display buffer and the queue." (defun mastodon-async--setup-buffer (http-buffer name endpoint) "Set up the buffer timeline like `mastodon-tl--init'. - HTTP-BUFFER the name of the http-buffer, if unknown, set to... NAME is the name of the stream for the buffer name. ENDPOINT is the endpoint for the stream and timeline." @@ -334,7 +330,6 @@ NAME is used for the queue and display buffer." (defun mastodon-async--cycle-queue (string) "Append the most recent STRING from http buffer to queue buffer. - Then determine if a full message has been recived. If so return it. Full messages are seperated by two newlines" (with-current-buffer mastodon-async--queue @@ -350,7 +345,6 @@ Full messages are seperated by two newlines" (defun mastodon-async--http-layer (proc data) "Passes PROC and DATA to ‘url-http-generic-filter’. - It then processes its output." (with-current-buffer (process-buffer proc) (let ((start (max 1 (- (point-max) 2)))) diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 9ef7aec..3cc5511 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -73,7 +73,6 @@ (defun mastodon-http--url-retrieve-synchronously (url &optional silent) "Retrieve URL asynchronously. - This is a thin abstraction over the system `url-retrieve-synchronously'. Depending on which version of this is available we will call it with or without a timeout. @@ -84,7 +83,6 @@ SILENT means don't message." (defun mastodon-http--triage (response success) "Determine if RESPONSE was successful. Call SUCCESS if successful. - Message status and JSON error from RESPONSE if unsuccessful." (let ((status (with-current-buffer response (mastodon-http--status)))) @@ -136,7 +134,6 @@ Used for API form data parameters that take an array." (defun mastodon-http--post (url &optional params headers unauthenticated-p) "POST synchronously to URL, optionally with PARAMS and HEADERS. - Authorization header is included by default unless UNAUTHENTICATED-P is non-nil." (mastodon-http--authorized-request "POST" diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 4e50dbc..3fb10b0 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -144,7 +144,6 @@ fKRJkmVZjAQwh78A6vCRWJE8K+8AAAAASUVORK5CYII=") (defun mastodon-media--process-image-response (status-plist marker image-options region-length url) "Callback function processing the url retrieve response for URL. - STATUS-PLIST is the usual plist of status events as per `url-retrieve'. IMAGE-OPTIONS are the precomputed options to apply to the image. MARKER is the marker to where the response should be visible. @@ -186,7 +185,6 @@ with the image." (defun mastodon-media--load-image-from-url (url media-type start region-length) "Take a URL and MEDIA-TYPE and load the image asynchronously. - MEDIA-TYPE is a symbol and either 'avatar or 'media-link. START is the position where we start loading the image. REGION-LENGTH is the range from start to propertize." @@ -199,8 +197,8 @@ REGION-LENGTH is the range from start to propertize." `(:max-height ,mastodon-media--preview-max-height)))))) (let ((buffer (current-buffer)) (marker (copy-marker start)) - ;; Keep url.el from spamming us with messages about connecting to hosts: - (url-show-status nil)) + ;; Keep url.el from spamming us with messages about connecting to hosts: + (url-show-status nil)) (condition-case nil ;; catch any errors in url-retrieve so as to not abort ;; whatever called us @@ -226,7 +224,6 @@ REGION-LENGTH is the range from start to propertize." (defun mastodon-media--select-next-media-line (end-pos) "Find coordinates of the next media to load before END-POS. - Returns the list of (`start' . `end', `media-symbol') points of that line and string found or nil no more media links were found." @@ -249,7 +246,6 @@ found." (defun mastodon-media--valid-link-p (link) "Check if LINK is valid. - Checks to make sure the missing string has not been returned." (and link (> (length link) 8) diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index b7fe038..a36b99e 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -244,7 +244,6 @@ Status notifications are given when author-byline action-byline id &optional base-toot) "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 diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 1aed676..24ddfb3 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -230,13 +230,11 @@ user's profile note. This is also called by (defun mastodon-search--get-id-from-status (status) "Fetch the id from a STATUS returned by a search call to the server. - We use this to fetch the complete status from the server." (alist-get 'id status)) (defun mastodon-search--fetch-full-status-from-id (id) "Fetch the full status with id ID from the server. - This allows us to access the full account etc. details and to render them properly." (let* ((url (concat mastodon-instance-url "/api/v1/statuses/" (mastodon-tl--as-string id))) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 9f21bf9..0d93b8d 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -103,7 +103,6 @@ (defcustom mastodon-tl--enable-relative-timestamps t "Whether to show relative (to the current time) timestamps. - This will require periodic updates of a timeline buffer to keep the timestamps current as time progresses." :group 'mastodon-tl @@ -111,7 +110,6 @@ keep the timestamps current as time progresses." (defcustom mastodon-tl--enable-proportional-fonts nil "Nonnil to enable using proportional fonts when rendering HTML. - By default fixed width fonts are used." :group 'mastodon-tl :type '(boolean :tag "Enable using proportional rather than fixed \ @@ -161,7 +159,6 @@ Valid values are: (defvar-local mastodon-tl--update-point nil "When updating a mastodon buffer this is where new toots will be inserted. - If nil `(point-min)' is used instead.") (defvar-local mastodon-tl--after-update-marker nil @@ -185,7 +182,6 @@ If nil `(point-min)' is used instead.") (define-key map [follow-link] 'mouse-face) (keymap-canonicalize map)) "The keymap for link-like things in buffer (except for shr.el generate links). - This will make the region of text act like like a link with mouse highlighting, mouse click action tabbing to next/previous link etc.") @@ -201,7 +197,6 @@ etc.") (define-key map [remap shr-browse-url] 'mastodon-url-lookup) (keymap-canonicalize map)) "The keymap to be set for shr.el generated links that are not images. - We need to override the keymap so tabbing will navigate to all types of mastodon links and not just shr.el-generated ones.") @@ -224,7 +219,6 @@ types of mastodon links and not just shr.el-generated ones.") (define-key map (kbd "<C-return>") 'mastodon-tl--mpv-play-video-at-point) (keymap-canonicalize map)) "The keymap to be set for shr.el generated image links. - We need to override the keymap so tabbing will navigate to all types of mastodon links and not just shr.el-generated ones.") @@ -305,7 +299,6 @@ NAME is not part of the symbol table, '?' is returned." (defun mastodon-tl--next-tab-item () "Move to the next interesting item. - This could be the next toot, link, or image; whichever comes first. Don't move if nothing else to move to is found, i.e. near the end of the buffer. This also skips tab items in invisible text, i.e. hidden spoiler text." @@ -326,7 +319,6 @@ This also skips tab items in invisible text, i.e. hidden spoiler text." (defun mastodon-tl--previous-tab-item () "Move to the previous interesting item. - This could be the previous toot, link, or image; whichever comes first. Don't move if nothing else to move to is found, i.e. near the start of the buffer. This also skips tab items in invisible @@ -569,14 +561,12 @@ The result is added as an attachments property to author-byline." (defun mastodon-tl--field (field toot) "Return FIELD from TOOT. - Return value from boosted content if available." (or (alist-get field (alist-get 'reblog toot)) (alist-get field toot))) (defun mastodon-tl--relative-time-details (timestamp &optional current-time) "Return cons of (descriptive string . next change) for the TIMESTAMP. - Use the optional CURRENT-TIME as the current time (only used for reliable testing). @@ -631,7 +621,6 @@ TIMESTAMP is assumed to be in the past." (defun mastodon-tl--relative-time-description (timestamp &optional current-time) "Return a string with a human readable TIMESTAMP relative to the current time. - Use the optional CURRENT-TIME as the current time (only used for reliable testing). @@ -641,7 +630,6 @@ TIME-STAMP is assumed to be in the past." (defun mastodon-tl--byline (toot author-byline action-byline &optional detailed-p) "Generate byline for TOOT. - AUTHOR-BYLINE is a function for adding the author portion of the byline that takes one variable. ACTION-BYLINE is a function for adding an action, such as boosting, @@ -784,7 +772,6 @@ LETTER is a string, F for favourited, B for boosted, or K for bookmarked." (defun mastodon-tl--render-text (string &optional toot) "Return a propertized text rendering the given HTML string STRING. - The contents comes from the given TOOT which is used in parsing links in the text. If TOOT is nil no parsing occurs." (when string ; handle rare empty notif server bug @@ -896,7 +883,6 @@ Return nil if no matching element" (defun mastodon-tl--extract-userhandle-from-url (url buffer-text) "Return the user hande the URL points to or nil if it is not a profile link. - BUFFER-TEXT is the text covered by the link with URL, for a user profile this should be of the form <at-sign><user id>, e.g. \"@Gargon\"." (let* ((parsed-url (url-generic-parse-url url)) @@ -912,7 +898,6 @@ this should be of the form <at-sign><user id>, e.g. \"@Gargon\"." (defun mastodon-tl--extract-hashtag-from-url (url instance-url) "Return the hashtag that URL points to or nil if URL is not a tag link. - INSTANCE-URL is the url of the instance for the toot that the link came from (tag links always point to a page on the instance publishing the toot)." @@ -963,7 +948,6 @@ the toot)." (defun mastodon-tl--make-link (string link-type) "Return a propertized version of STRING that will act like link. - LINK-TYPE is the type of link to produce." (let ((help-text (cond ((eq link-type 'content-warning) @@ -1020,7 +1004,6 @@ Used for a mouse-click EVENT on a link." (defun mastodon-tl--has-spoiler (toot) "Check if the given TOOT has a spoiler text. - Spoiler text should initially be shown only while the main content should be hidden." (let ((spoiler (mastodon-tl--field 'spoiler_text toot))) @@ -1033,7 +1016,6 @@ content should be hidden." (defun mastodon-tl--spoiler (toot) "Render TOOT with spoiler message. - This assumes TOOT is a toot with a spoiler message. The main body gets hidden and only the spoiler text and the content warning message are displayed. The content warning @@ -1111,7 +1093,6 @@ message is a link which unhides/hides the main body." (defun mastodon-tl--propertize-img-str-or-url (str media-url full-remote-url type help-echo &optional display face) "Propertize an media placeholder string \"[img]\" or media URL. - STR is the string to propertize, MEDIA-URL is the preview link, FULL-REMOTE-URL is the link to the full resolution image on the server, TYPE is the media type. @@ -1150,11 +1131,11 @@ Runs `mastodon-tl--render-text' and fetches poll or media." (defun mastodon-tl--insert-status (toot body author-byline action-byline &optional id base-toot detailed-p) "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 portion of the byline that takes one variable. By default it is -`mastodon-tl--byline-author' +`mastodon-tl--byline-author'. + ACTION-BYLINE is also an optional function for adding an action, such as boosting favouriting and following to the byline. It also takes a single function. By default it is @@ -1350,7 +1331,6 @@ in which case play first video or gif from current toot." (defun mastodon-tl--toot (toot &optional detailed-p) "Formats TOOT and insertes it into the buffer. - DETAILED-P means display more detailed info. For now this just means displaying toot client." (mastodon-tl--insert-status @@ -1439,7 +1419,6 @@ PARAMS are any parameters to send with the request." (defun mastodon-tl--property (prop &optional backward) "Get property PROP for toot at point. - Move forward (down) the timeline unless BACKWARD is non-nil." (or (get-text-property (point) prop) (save-excursion @@ -1471,7 +1450,6 @@ Move forward (down) the timeline unless BACKWARD is non-nil." (defun mastodon-tl--toot-id (json) "Find approproiate toot id in JSON. - If the toot has been boosted use the id found in the reblog portion of the toot. Otherwise, use the body of the toot. This is the same behaviour as the mastodon.social @@ -2634,7 +2612,6 @@ HEADERS is the http headers returned in the response, if any." (defun mastodon-tl--find-property-range (property start-point &optional search-backwards) "Return `nil` if no such range is found. - If PROPERTY is set at START-POINT returns a range around START-POINT otherwise before/after START-POINT. @@ -2670,7 +2647,6 @@ before (non-nil) or after (nil)" (defun mastodon-tl--find-next-or-previous-property-range (property start-point search-backwards) "Find (start . end) property range after/before START-POINT. - Does so while PROPERTY is set to a consistent value (different from the value at START-POINT if that is set). @@ -2695,7 +2671,6 @@ START-POINT otherwise after START-POINT." (defun mastodon-tl--consider-timestamp-for-updates (timestamp) "Take note that TIMESTAMP is used in buffer and ajust timers as needed. - This calculates the next time the text for TIMESTAMP will change and may adjust existing or future timer runs should that time before current plans to run the update function. @@ -2725,7 +2700,6 @@ is a no-op." (defun mastodon-tl--update-timestamps-callback (buffer previous-marker) "Update the next few timestamp displays in BUFFER. - Start searching for more timestamps from PREVIOUS-MARKER or from the start if it is nil." ;; only do things if the buffer hasn't been killed in the meantime @@ -2891,7 +2865,6 @@ JSON and http headers, without it just the JSON." (defun mastodon-tl--init-sync (buffer-name endpoint update-function &optional note-type) "Initialize BUFFER-NAME with timeline targeted by ENDPOINT. - UPDATE-FUNCTION is used to receive more toots. Runs synchronously. Optional arg NOTE-TYPE means only get that type of note." diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 56ad4ed..99b5936 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -113,7 +113,6 @@ Used for completion in toot compose buffer." (defcustom mastodon-toot--use-company-for-completion nil "Whether to enable company for completion. - When non-nil, `company-mode' is enabled in the toot compose buffer, and mastodon completion backends are added to `company-capf'. @@ -160,7 +159,6 @@ You need to install company yourself to use this." (defvar-local mastodon-toot--visibility nil "A string indicating the visibility of the toot being composed. - Valid values are \"direct\", \"private\" (followers-only), \"unlisted\", and \"public\". @@ -279,7 +277,6 @@ NO-TOOT means we are not calling from a toot buffer." (defun mastodon-toot--action-success (marker byline-region remove) "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." @@ -299,7 +296,7 @@ Remove MARKER if REMOVE is non-nil, otherwise add it." (insert (format "(%s) " (propertize marker 'face 'success))))) (when at-byline-p - ;; leave point after the marker: + ;; leave point after the marker: (unless remove (mastodon-tl--goto-next-toot))))) @@ -855,7 +852,6 @@ Remove empty string (self) from result and joins the sequence with whitespace." (defun mastodon-toot--process-local (acct) "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). diff --git a/lisp/mastodon.el b/lisp/mastodon.el index a6ee4bc..cd7dd8e 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -61,7 +61,6 @@ (autoload 'mastodon-profile--make-author-buffer "mastodon-profile") (autoload 'mastodon-profile--show-user "mastodon-profile") (autoload 'mastodon-discover "mastodon-discover") - (autoload 'mastodon-tl--block-user "mastodon-tl") (autoload 'mastodon-tl--unblock-user "mastodon-tl") (autoload 'mastodon-tl--mute-user "mastodon-tl") @@ -107,7 +106,6 @@ (defcustom mastodon-instance-url "https://mastodon.social" "Base URL for the Mastodon instance you want to be active. - For example, if your mastodon username is \"example_user@social.instance.org\", and you want this account to be active, the value of this variable should be @@ -123,7 +121,6 @@ changes to take effect." (defcustom mastodon-active-user nil "Username of the active user. - For example, if your mastodon username is \"example_user@social.instance.org\", and you want this account to be active, the value of this variable should be @@ -139,7 +136,6 @@ changes to take effect." (defcustom mastodon-toot-timestamp-format "%F %T" "Format to use for timestamps. - For valid formatting options see `format-time-string`. The default value \"%F %T\" prints ISO8601-style YYYY-mm-dd HH:MM:SS. Use. e.g. \"%c\" for your locale's date and time format." |