[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/elpher 78ea2a7bcb 1/3: Fixed issue to do with current buff
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/elpher 78ea2a7bcb 1/3: Fixed issue to do with current buffer changing during download. |
Date: |
Mon, 8 Aug 2022 20:58:20 -0400 (EDT) |
branch: elpa/elpher
commit 78ea2a7bcbe79ab4a775d245f97c2f24e15ac9e0
Author: plugd <plugd@thelambdalab.xyz>
Commit: plugd <plugd@thelambdalab.xyz>
Fixed issue to do with current buffer changing during download.
Thanks to Troels Henriksen for reporting this issue.
---
ISSUES.org | 9 ++++++---
elpher.el | 20 ++++++++++++--------
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/ISSUES.org b/ISSUES.org
index 1cf6229dd3..60c6a9929b 100644
--- a/ISSUES.org
+++ b/ISSUES.org
@@ -23,13 +23,16 @@ timer fire up early means that it interferes with requests
for
user interaction that may appear during the initial connection setup.
E.g., asking for approval of uknown TLS certificates.
-** OPEN Downloads failing
+* Closed Bugs
+
+** CLOSED Downloads failing
+:LOGBOOK:
+- State "CLOSED" from "OPEN" [2022-08-09 Tue 10:38]
+:END:
Downloads fail when focus is shifted away from
the elpher buffer before the download has completed.
-* Closed Bugs
-
** CLOSED Relative Gemini links processed improperly
:LOGBOOK:
- State "CLOSED" from "OPEN" [2021-08-04 Wed 15:54]
diff --git a/elpher.el b/elpher.el
index 2a30f9947a..882ed2aac9 100644
--- a/elpher.el
+++ b/elpher.el
@@ -570,7 +570,7 @@ This variable is used by `elpher-show-visited-pages'.")
(defun elpher-visit-page (page &optional renderer no-history)
"Visit PAGE using its own renderer or RENDERER, if non-nil.
Additionally, push PAGE onto the history stack and the list of
-previously-visited pages,unless NO-HISTORY is non-nil."
+previously-visited pages, unless NO-HISTORY is non-nil."
(elpher-save-pos)
(elpher-process-cleanup)
(unless no-history
@@ -869,7 +869,8 @@ the host operating system and the local network
capabilities.)"
nil
force-ipv4))
(t
(elpher-network-error address
"Connection time-out."))))))
- (proc (if socks (socks-open-network-stream "elpher-process" nil
host service)
+ (proc (if socks
+ (socks-open-network-stream "elpher-process" nil host
service)
(make-network-process :name "elpher-process"
:host host
:family (and (or force-ipv4
@@ -883,6 +884,7 @@ the host operating system and the local network
capabilities.)"
(cons 'gnutls-x509pki
(apply
#'gnutls-boot-parameters
gnutls-params)))))))
+ (process-put proc 'elpher-buffer (current-buffer))
(setq elpher-network-timer timer)
(set-process-coding-system proc 'binary 'binary)
(set-process-query-on-exit-flag proc nil)
@@ -926,17 +928,19 @@ the host operating system and the local network
capabilities.)"
response-processor
use-tls t))
(response-string-parts
- (elpher-with-clean-buffer
- (insert "Data received.
Rendering..."))
- (funcall response-processor
- (apply #'concat (reverse
response-string-parts)))
- (elpher-restore-pos))
+ (with-current-buffer (process-get proc
'elpher-buffer)
+ (elpher-with-clean-buffer
+ (insert "Data received.
Rendering..."))
+ (funcall response-processor
+ (apply #'concat (reverse
response-string-parts)))
+ (elpher-restore-pos)))
(t
(error "No response from server")))
(error
(elpher-network-error address
the-error)))))
(when socks
- (if use-tls (apply #'gnutls-negotiate :process proc gnutls-params))
+ (if use-tls
+ (apply #'gnutls-negotiate :process proc gnutls-params))
(funcall (process-sentinel proc) proc "open\n")))
(error
(elpher-process-cleanup)