;;; elpher.el --- A friendly gopher and gemini client -*- lexical-binding: t -*-
-;; Copyright (C) 2019-2024 Tim Vaughan <plugd@thelambdalab.xyz>
-;; Copyright (C) 2020-2022 Elpher contributors (See info manual for full list)
+;; Copyright (C) 2019-2024 Elpher contributors (See info manual for full list)
;; Author: Tim Vaughan <plugd@thelambdalab.xyz>
;; Created: 11 April 2019
-;; Version: 3.6.0
+;; Version: 3.6.5
;; Keywords: comm gopher gemini
;; Homepage: https://thelambdalab.xyz/elpher
;; Package-Requires: ((emacs "27.1"))
;;; Global constants
;;
-(defconst elpher-version "3.6.0"
+(defconst elpher-version "3.6.5"
"Current version of elpher.")
(defconst elpher-margin-width 6
(defvar elpher-link-keymap
(let ((map (make-sparse-keymap)))
- (keymap-set map "S-<down-mouse-1>" 'ignore) ;Prevent buffer face popup
- (keymap-set map "S-<mouse-1>" #'elpher--open-link-new-buffer-mouse)
- (keymap-set map "S-<return>" #'elpher--open-link-new-buffer)
+ (define-key map (kbd "S-<down-mouse-1>") 'ignore) ;Prevent buffer face popup
+ (define-key map (kbd "S-<mouse-1>") #'elpher--open-link-new-buffer-mouse)
+ (define-key map (kbd "S-<return>") #'elpher--open-link-new-buffer)
(set-keymap-parent map button-map)
map))
(error
(elpher-network-error address the-error)))))
(when socks
- (if use-tls
- (apply #'gnutls-negotiate :process proc gnutls-params))
+ (when use-tls
+ (apply #'gnutls-negotiate :process proc gnutls-params)
+ (unless (or (< emacs-major-version 31)
+ (string-suffix-p ".onion" host))
+ ;; Bind this option to nil to suppress DNS lookups.
+ (let (nsm-trust-local-network)
+ (nsm-verify-connection proc host port))))
(funcall (process-sentinel proc) proc "open\n")))
(error
(elpher-process-cleanup)
#'string-prefix-p)))
(if entry
(let ((cert-url-prefix (car entry))
- (cert-name (cadr entry)))
+ (cert-name (if (consp (cdr entry)) (cadr entry) (cdr entry))))
(message "Using certificate \"%s\" specified in elpher-certificate-map with prefix \"%s\""
cert-name cert-url-prefix)
(elpher-get-existing-certificate cert-name cert-url-prefix))
(cond
((string-prefix-p "/" (url-filename address))) ;do nothing for absolute case
((string-prefix-p "?" (url-filename address)) ;handle query-only links
- (setf (url-filename address)
- (concat (url-filename current-address)
- (url-filename address))))
+ (let* ((current-path (car (url-path-and-query current-address))))
+ (setf (url-filename address)
+ (concat current-path ;(url-filename current-address)
+ (url-filename address)))))
(t ;deal with relative links
(setf (url-filename address)
(concat (file-name-directory (url-filename current-address))