emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eev 8b55941: Added `ee-eshell/fakewget'.


From: ELPA Syncer
Subject: [elpa] externals/eev 8b55941: Added `ee-eshell/fakewget'.
Date: Wed, 6 Oct 2021 04:57:12 -0400 (EDT)

branch: externals/eev
commit 8b55941bbc41a31c98be61aca95ff12fa317c267
Author: Eduardo Ochs <eduardoochs@gmail.com>
Commit: Eduardo Ochs <eduardoochs@gmail.com>

    Added `ee-eshell/fakewget'.
---
 ChangeLog     |  7 +++++++
 VERSION       |  4 ++--
 eev-code.el   |  5 +++--
 eev-plinks.el | 30 ++++++++++++++++++++++++++++--
 eev.el        |  2 +-
 5 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 298d153..967fa83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-10-06  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-code.el: added a (code-c-d "eshell" ...).
+
+       * eev-plinks.el (ee-very-primitive-wget1, ee-eshell/fakewget): new
+       functions.
+
 2021-10-05  Eduardo Ochs  <eduardoochs@gmail.com>
 
        * eev-plinks.el (ee-very-primitive-wget0): new function.
diff --git a/VERSION b/VERSION
index 19425e4..fd72ed6 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Wed Oct  6 03:57:17 GMT 2021
-Wed Oct  6 00:57:17 -03 2021
+Wed Oct  6 08:09:20 GMT 2021
+Wed Oct  6 05:09:20 -03 2021
diff --git a/eev-code.el b/eev-code.el
index f3df987..3536000 100644
--- a/eev-code.el
+++ b/eev-code.el
@@ -1,6 +1,6 @@
 ;;; eev-code.el -- `code-c-d', that generates and evaluates Lisp defuns.  -*- 
lexical-binding: nil; -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 ;;
 ;; This file is part of GNU eev.
 ;;
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20201228
+;; Version:    20211006
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-code.el>
@@ -345,6 +345,7 @@ Note: the POS-SPEC-LIST arguments are currently not used."
 (code-c-d "el"     ee-emacs-lisp-directory "elisp" :gz) ; (find-elnode  "Top")
 (code-c-d "eli"    ee-emacs-lisp-directory "eintr" :gz) ; (find-elinode "Top")
 (code-c-d "cl"     (ee-efile "emacs-lisp/") "cl"   :gz) ; (find-clnode  "Top")
+(code-c-d "eshell" (ee-efile "eshell/") "eshell" :gz) ; (find-eshellnode "Top")
 (code-c-d "eleim"  ee-emacs-leim-directory :gz)
 (code-c-d "equail" (ee-eleimfile "quail/") :gz)
 (code-c-d "eetc"   data-directory :gz)
diff --git a/eev-plinks.el b/eev-plinks.el
index 7b2651f..598849e 100644
--- a/eev-plinks.el
+++ b/eev-plinks.el
@@ -1,6 +1,6 @@
 ;;; eev-plinks.el -- elisp hyperlinks to invoke external processes.  -*- 
lexical-binding: nil; -*-
 
-;; Copyright (C) 2012-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 ;;
 ;; This file is part of GNU eev.
 ;;
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20211004
+;; Version:    20211006
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-plinks.el>
@@ -302,6 +302,32 @@ This is a quick hack."
       (write-region contents nil (ee-expand fname))
       (string-bytes contents))))
 
+(defun ee-very-primitive-wget1 (url)
+  "This is like `ee-very-primitive-wget0', but always returns a string.
+If URL is, say, http://foo.bar/plic/blech.html then save its
+contents in a file bletch.html in the current directory.
+Return \"Downloaded nnn bytes\" in case of success and the HTTP
+headers in case of error. This is a quick hack."
+  (let* ((fname (replace-regexp-in-string ".*/" "" url))
+         (rslt (ee-very-primitive-wget0 url fname)))
+    (if rslt (format "Downloaded %d bytes" rslt)
+      (format "Error:\n%s\n" ee-urlretrieve-headers))))
+
+;; We can use `ee-very-primitive-wget1' to implement simplistic
+;; versions of wget in eshell - the definition below is an example.
+;; To make it work, run something like:
+;;   (defalias    'eshell/wget 'ee-eshell/fakewget)
+;; To delete it, do:
+;;   (fmakunbound 'eshell/wget)
+;; See:
+;;   (find-eshellnode "Built-ins")
+;;   (find-eshellgrep "grep --color -nH --null -e eshell/ *.el")
+;;
+(defun ee-eshell/fakewget (&rest args)
+  (let* ((lastarg (nth (- (length args) 1) args)))
+    (ee-very-primitive-wget1 lastarg)))
+
+
 
 
 ;;;   __ _           _                         _   
diff --git a/eev.el b/eev.el
index d90c840..06e92e7 100644
--- a/eev.el
+++ b/eev.el
@@ -6,7 +6,7 @@
 ;; Package-Requires: ((emacs "24.4"))
 ;; Keywords: lisp e-scripts
 ;; URL: http://angg.twu.net/#eev
-;; Version: 20211005
+;; Version: 20211006
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by



reply via email to

[Prev in Thread] Current Thread [Next in Thread]