From 707124d2b92780b4f21d72c7c62899e074fa8ced Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Thu, 7 Jul 2022 11:11:34 +0200
Subject: Make 'run-dig' command obsolete in favor of 'dig'

* lisp/net/net-utils.el (run-dig): Redefine in terms of `dig' and make
obsolete.  (Bug#56432).
(dig-program): Delete duplicate defcustom; it is also in dig.el.
(dig-program-options): Move from here...
* lisp/net/dig.el (dig-program-options): ...to here.
(dig-invoke): Respect 'dig-program-options'.
(dig): Prompt for DNS server when given double prefix argument.
---
 lisp/net/net-utils.el | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

(limited to 'lisp/net/net-utils.el')

diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index 411b6ed4132..ea1dd0f3ca9 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -176,15 +176,6 @@ This variable is only used if the variable
 `comint-use-prompt-regexp' is non-nil."
   :type  'regexp)
 
-(defcustom dig-program "dig"
-  "Program to query DNS information."
-  :type  'string)
-
-(defcustom dig-program-options nil
-  "Options for the dig program."
-  :type '(repeat string)
-  :version "26.1")
-
 (defcustom ftp-program "ftp"
   "Program to run to do FTP transfers."
   :type  'string)
@@ -633,20 +624,11 @@ DNS resolution.
 Interactively, prompt for NAME-SERVER if invoked with prefix argument.
 
 This command uses `dig-program' for looking up the DNS information."
+  (declare (obsolete dig "29.1"))
   (interactive
    (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point))
          (if current-prefix-arg (read-from-minibuffer "Name server: "))))
-  (let ((options
-         (append dig-program-options (list host)
-                 (if name-server (list (concat "@" name-server))))))
-  (net-utils-run-program
-   "Dig"
-   (concat "** "
-	   (mapconcat #'identity
-		      (list "Dig" host dig-program)
-		      " ** "))
-   dig-program
-   options)))
+  (dig host nil nil nil nil name-server))
 
 (autoload 'comint-exec "comint")
 (declare-function comint-watch-for-password-prompt "comint" (string))
-- 
cgit v1.2.3