diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
commit | 07fcbb558d797272b9f43547da60beda485873a3 (patch) | |
tree | 77d5da14e9f9d9d8b1d877c70c01296fd3893796 /lisp/obsolete/url-ns.el | |
parent | c9bdeff3e45a7ac84a74a81bb048046f82dddc91 (diff) | |
parent | fb81c8c3adf8633f2f617c82f6019aef630860c7 (diff) | |
download | emacs-07fcbb558d797272b9f43547da60beda485873a3.tar.gz |
Merge remote-tracking branch 'origin/master' into athena/unstable
Diffstat (limited to 'lisp/obsolete/url-ns.el')
-rw-r--r-- | lisp/obsolete/url-ns.el | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/lisp/obsolete/url-ns.el b/lisp/obsolete/url-ns.el index fff3be95453..6cd6693fc43 100644 --- a/lisp/obsolete/url-ns.el +++ b/lisp/obsolete/url-ns.el @@ -1,4 +1,4 @@ -;;; url-ns.el --- Various netscape-ish functions for proxy definitions +;;; url-ns.el --- Various netscape-ish functions for proxy definitions -*- lexical-binding: t; -*- ;; Copyright (C) 1997-1999, 2004-2021 Free Software Foundation, Inc. @@ -31,7 +31,7 @@ ;;;###autoload (defun isPlainHostName (host) - (not (string-match "\\." host))) + (not (string-search "." host))) ;;;###autoload (defun dnsDomainIs (host dom) @@ -55,9 +55,9 @@ (if (or (/= (length netc) (length ipc)) (/= (length ipc) (length maskc))) nil - (setq netc (mapcar 'string-to-number netc) - ipc (mapcar 'string-to-number ipc) - maskc (mapcar 'string-to-number maskc)) + (setq netc (mapcar #'string-to-number netc) + ipc (mapcar #'string-to-number ipc) + maskc (mapcar #'string-to-number maskc)) (and (= (logand (nth 0 netc) (nth 0 maskc)) (logand (nth 0 ipc) (nth 0 maskc))) @@ -79,24 +79,23 @@ (if (not (and (file-exists-p file) (file-readable-p file))) (message "Could not open %s for reading" file) - (save-excursion - (let ((false nil) - (true t)) - (setq url-ns-user-prefs (make-hash-table :size 13 :test 'equal)) - (set-buffer (get-buffer-create " *ns-parse*")) - (erase-buffer) - (insert-file-contents file) - (goto-char (point-min)) - (while (re-search-forward "^//" nil t) - (replace-match ";;")) - (goto-char (point-min)) - (while (re-search-forward "^user_pref(" nil t) - (replace-match "(url-ns-set-user-pref ")) - (goto-char (point-min)) - (while (re-search-forward "\"," nil t) - (replace-match "\"")) - (goto-char (point-min)) - (eval-buffer))))) + (setq url-ns-user-prefs (make-hash-table :size 13 :test 'equal)) + (with-current-buffer (get-buffer-create " *ns-parse*") + (erase-buffer) + (insert-file-contents file) + (goto-char (point-min)) + (while (re-search-forward "^//" nil t) + (replace-match ";;")) + (goto-char (point-min)) + (while (re-search-forward "^user_pref(" nil t) + (replace-match "(url-ns-set-user-pref ")) + (goto-char (point-min)) + (while (re-search-forward "\"," nil t) + (replace-match "\"")) + (goto-char (point-min)) + (with-suppressed-warnings ((lexical true false)) + (dlet ((false nil) (true t)) + (eval-buffer)))))) (defun url-ns-set-user-pref (key val) (puthash key val url-ns-user-prefs)) |