commit 27cef30c2bff44a76cf5c3da51de625f4de8112d (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Fri May 12 11:38:04 2017 +0300 Improve doc strings in net-utils.el * lisp/net/net-utils.el (ifconfig, iwconfig, netstat, arp) (route, traceroute, nslookup, ftp, smbclient) (smbclient-list-shares, finger, whois) (network-connection-to-service, network-service-connection) (network-connection-reconnect): Improve doc strings. diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 6b38462ff3..280c667470 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el @@ -424,7 +424,7 @@ This variable is only used if the variable ;;;###autoload (defun ifconfig () - "Run ifconfig and display diagnostic output." + "Run `ifconfig-program' and display diagnostic output." (interactive) (net-utils-run-simple (format "*%s*" ifconfig-program) @@ -435,7 +435,7 @@ This variable is only used if the variable ;;;###autoload (defun iwconfig () - "Run iwconfig and display diagnostic output." + "Run `iwconfig-program' and display diagnostic output." (interactive) (net-utils-run-simple (format "*%s*" iwconfig-program) @@ -444,7 +444,7 @@ This variable is only used if the variable ;;;###autoload (defun netstat () - "Run netstat and display diagnostic output." + "Run `netstat-program' and display diagnostic output." (interactive) (net-utils-run-simple (format "*%s*" netstat-program) @@ -453,7 +453,7 @@ This variable is only used if the variable ;;;###autoload (defun arp () - "Run arp and display diagnostic output." + "Run `arp-program' and display diagnostic output." (interactive) (net-utils-run-simple (format "*%s*" arp-program) @@ -462,7 +462,7 @@ This variable is only used if the variable ;;;###autoload (defun route () - "Run route and display diagnostic output." + "Run `route-program' and display diagnostic output." (interactive) (net-utils-run-simple (format "*%s*" route-program) @@ -475,7 +475,7 @@ This variable is only used if the variable ;;;###autoload (defun traceroute (target) - "Run traceroute program for TARGET." + "Run `traceroute-program' for TARGET." (interactive "sTarget: ") (let ((options (if traceroute-program-options @@ -537,7 +537,7 @@ This command uses `nslookup-program' for looking up the DNS information." ;;;###autoload (defun nslookup () - "Run nslookup program." + "Run `nslookup-program'." (interactive) (switch-to-buffer (make-comint "nslookup" nslookup-program)) (nslookup-mode)) @@ -612,7 +612,7 @@ This command uses `dig-program' for looking up the DNS information." ;; This is a lot less than ange-ftp, but much simpler. ;;;###autoload (defun ftp (host) - "Run `ftp program." + "Run `ftp-program' to connect to HOST." (interactive (list (read-from-minibuffer @@ -648,7 +648,9 @@ This command uses `dig-program' for looking up the DNS information." nil t))) (defun smbclient (host service) - "Connect to SERVICE on HOST via SMB." + "Connect to SERVICE on HOST via SMB. + +This command uses `smbclient-program' to connect to HOST." (interactive (list (read-from-minibuffer @@ -666,7 +668,8 @@ This command uses `dig-program' for looking up the DNS information." (pop-to-buffer buf))) (defun smbclient-list-shares (host) - "List services on HOST." + "List services on HOST. +This command uses `smbclient-program' to connect to HOST." (interactive (list (read-from-minibuffer @@ -761,7 +764,9 @@ queries of the form USER@HOST, and wants a query containing USER only." ;; Finger protocol ;;;###autoload (defun finger (user host) - "Finger USER on HOST." + "Finger USER on HOST. +This command uses `finger-X.500-host-regexps' +and `network-connection-service-alist', which see." ;; One of those great interactive statements that's actually ;; longer than the function call! The idea is that if the user ;; uses a string like "pbreton@cs.umb.edu", we won't ask for the @@ -855,7 +860,8 @@ then the server named by `whois-server-name' is used." (defun whois (arg search-string) "Send SEARCH-STRING to server defined by the `whois-server-name' variable. If `whois-guess-server' is non-nil, then try to deduce the correct server -from SEARCH-STRING. With argument, prompt for whois server." +from SEARCH-STRING. With argument, prompt for whois server. +The port is deduced from `network-connection-service-alist'." (interactive "P\nsWhois: ") (let* ((whois-apropos-host (if whois-guess-server (rassoc (whois-get-tld search-string) @@ -903,7 +909,8 @@ from SEARCH-STRING. With argument, prompt for whois server." ;;;###autoload (defun network-connection-to-service (host service) - "Open a network connection to SERVICE on HOST." + "Open a network connection to SERVICE on HOST. +This command uses `network-connection-service-alist', which see." (interactive (list (read-from-minibuffer "Host: " (net-utils-machine-at-point)) @@ -924,7 +931,8 @@ from SEARCH-STRING. With argument, prompt for whois server." (network-service-connection host (number-to-string port))) (defun network-service-connection (host service) - "Open a network connection to SERVICE on HOST." + "Open a network connection to SERVICE on HOST. +The port to use is determined from `network-connection-service-alist'." (let* ((process-name (concat "Network Connection [" host " " service "]")) (portnum (string-to-number service)) (buf (get-buffer-create (concat "*" process-name "*")))) @@ -940,7 +948,8 @@ from SEARCH-STRING. With argument, prompt for whois server." (defvar comint-input-ring) (defun network-connection-reconnect () - "Reconnect a network connection, preserving the old input ring." + "Reconnect a network connection, preserving the old input ring. +This command uses `network-connection-service-alist', which see." (interactive) (let ((proc (get-buffer-process (current-buffer))) (old-comint-input-ring comint-input-ring) commit a1b69815147b67f4ff7730d0b97b526c8eda2935 Author: Andrew Robbins Date: Fri May 12 11:19:46 2017 +0300 Extend DNS lookup commands to allow specifying the name server * lisp/net/net-utils.el (ffap-string-at-point): Removed due to 'net-utils-machine-at-point' obviating this autoloaded function (Bug#25426). (dig-program-options): New customization variable. (nslookup-host, dns-lookup-host, run-dig): Can now specify optional name server argument interactively (by prefix arg) and non-interactively. * etc/NEWS: Mention the extension of DNS lookup commands. diff --git a/etc/NEWS b/etc/NEWS index 3b830c9342..9be6ee0f3f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -338,6 +338,12 @@ want to reverse the direction of the scroll, customize ** Emacsclient has a new option -u/--suppress-output. The option suppresses display of return values from the server process. +--- +** New user option 'dig-program-options' and extended functionality +for DNS-querying functions 'nslookup-host', 'dns-lookup-host', +and 'run-dig'. Each function now accepts an optional name server +argument interactively (with a prefix argument) and non-interactively. + * Editing Changes in Emacs 26.1 diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 06b67dcc4f..6b38462ff3 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el @@ -199,6 +199,12 @@ This variable is only used if the variable :group 'net-utils :type 'string) +(defcustom dig-program-options nil + "Options for the dig program." + :group 'net-utils + :type '(repeat string) + :version "26.1") + (defcustom ftp-program "ftp" "Program to run to do FTP transfers." :group 'net-utils @@ -507,14 +513,19 @@ If your system's ping continues until interrupted, you can try setting ;; (delete-matching-lines filter)) ;;;###autoload -(defun nslookup-host (host) - "Lookup the DNS information for HOST." +(defun nslookup-host (host &optional name-server) + "Look up the DNS information for HOST (name or IP address). +Optional argument NAME-SERVER says which server to use for +DNS resolution. +Interactively, prompt for NAME-SERVER if invoked with prefix argument. + +This command uses `nslookup-program' for looking up the DNS information." (interactive - (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point)))) + (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point)) + (if current-prefix-arg (read-from-minibuffer "Name server: ")))) (let ((options - (if nslookup-program-options - (append nslookup-program-options (list host)) - (list host)))) + (append nslookup-program-options (list host) + (if name-server (list name-server))))) (net-utils-run-program "Nslookup" (concat "** " @@ -551,14 +562,19 @@ If your system's ping continues until interrupted, you can try setting (setq comint-input-autoexpand t)) ;;;###autoload -(defun dns-lookup-host (host) - "Lookup the DNS information for HOST (name or IP address)." +(defun dns-lookup-host (host &optional name-server) + "Look up the DNS information for HOST (name or IP address). +Optional argument NAME-SERVER says which server to use for +DNS resolution. +Interactively, prompt for NAME-SERVER if invoked with prefix argument. + +This command uses `dns-lookup-program' for looking up the DNS information." (interactive - (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point)))) + (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point)) + (if current-prefix-arg (read-from-minibuffer "Name server: ")))) (let ((options - (if dns-lookup-program-options - (append dns-lookup-program-options (list host)) - (list host)))) + (append dns-lookup-program-options (list host) + (if name-server (list name-server))))) (net-utils-run-program (concat "DNS Lookup [" host "]") (concat "** " @@ -568,15 +584,20 @@ If your system's ping continues until interrupted, you can try setting dns-lookup-program options))) -(autoload 'ffap-string-at-point "ffap") - ;;;###autoload -(defun run-dig (host) - "Run dig program." +(defun run-dig (host &optional name-server) + "Look up DNS information for HOST (name or IP address). +Optional argument NAME-SERVER says which server to use for +DNS resolution. +Interactively, prompt for NAME-SERVER if invoked with prefix argument. + +This command uses `dig-program' for looking up the DNS information." (interactive - (list - (read-from-minibuffer "Lookup host: " - (or (ffap-string-at-point 'machine) "")))) + (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 "** " @@ -584,14 +605,14 @@ If your system's ping continues until interrupted, you can try setting (list "Dig" host dig-program) " ** ")) dig-program - (list host))) + options))) (autoload 'comint-exec "comint") ;; This is a lot less than ange-ftp, but much simpler. ;;;###autoload (defun ftp (host) - "Run ftp program." + "Run `ftp program." (interactive (list (read-from-minibuffer commit d9592104c8aa93a9b92a05c410a546f0abd8d0b5 Author: Glenn Morris Date: Thu May 11 21:22:13 2017 -0400 Don't hard-code loaddefs files in lisp/Makefile * lisp/Makefile.in (loaddefs): New variable. (AUTOGENEL): Use $loaddefs, and include directory. (bootstrap-clean): Update for AUTOGENEL change. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 1da8814370..ba4925fb79 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -68,36 +68,20 @@ BYTE_COMPILE_EXTRA_FLAGS = # BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))' # The example above is just for developers, it should not be used by default. -# Automatically generated autoload files, apart from lisp/loaddefs.el. -# Note this includes only those files that need special rules to -# build; ie it does not need to include things created via -# generated-autoload-file (eg calc/calc-loaddefs.el). +# Those automatically generated autoload files that need special rules +# to build; ie not including things created via generated-autoload-file +# (eg calc/calc-loaddefs.el). LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \ $(lisp)/calendar/diary-loaddefs.el \ $(lisp)/calendar/hol-loaddefs.el \ $(lisp)/mh-e/mh-loaddefs.el \ $(lisp)/net/tramp-loaddefs.el +# All generated autoload files. +loaddefs = $(shell find ${srcdir} -name '*loaddefs.el') # Elisp files auto-generated. -AUTOGENEL = loaddefs.el \ - $(LOADDEFS) \ - cus-load.el \ - finder-inf.el \ - subdirs.el \ - ps-print-loaddefs.el \ - emacs-lisp/cl-loaddefs.el \ - calc/calc-loaddefs.el \ - eshell/esh-groups.el \ - cedet/semantic/loaddefs.el \ - cedet/ede/loaddefs.el \ - cedet/srecode/loaddefs.el \ - org/org-loaddefs.el \ - textmodes/reftex-loaddefs.el \ - mail/rmail-loaddefs.el \ - ibuffer-loaddefs.el \ - htmlfontify-loaddefs \ - emacs-lisp/eieio-loaddefs.el \ - dired-loaddefs.el +AUTOGENEL = ${loaddefs} ${srcdir}/cus-load.el ${srcdir}/finder-inf.el \ + ${srcdir}/subdirs.el ${srcdir}/eshell/esh-groups.el # Set load-prefer-newer for the benefit of the non-bootstrappers. BYTE_COMPILE_FLAGS = \ @@ -470,7 +454,7 @@ $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) $(CAL_DIR)/diary-loaddefs.el bootstrap-clean: find $(lisp) -name '*.elc' $(FIND_DELETE) - -cd $(lisp) && rm -f $(AUTOGENEL) + rm -f $(AUTOGENEL) distclean: -rm -f ./Makefile $(lisp)/loaddefs.el~