Version bump.
[elpher.git] / elpher.el
index c5014f2..4747ab3 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -1,11 +1,10 @@
 ;;; 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"))
@@ -71,7 +70,7 @@
 ;;; Global constants
 ;;
 
-(defconst elpher-version "3.6.0"
+(defconst elpher-version "3.6.5"
   "Current version of elpher.")
 
 (defconst elpher-margin-width 6
@@ -704,9 +703,9 @@ If LINE is non-nil, replace that line instead."
 
 (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))
 
@@ -996,8 +995,13 @@ the host operating system and the local network capabilities.)"
                                     (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)
@@ -1469,7 +1473,7 @@ having URLs begining with URL-PREFIX."
                       #'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))
@@ -1641,9 +1645,10 @@ treatment that a separate function is warranted."
         (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))