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

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

[elpa] externals/eev 0b2c4ac 07/64: `find-here-links'


From: Stefan Monnier
Subject: [elpa] externals/eev 0b2c4ac 07/64: `find-here-links'
Date: Sun, 7 Apr 2019 16:59:02 -0400 (EDT)

branch: externals/eev
commit 0b2c4acf6031d01639bc971a08f1c3a5bc16395e
Author: Eduardo Ochs <address@hidden>
Commit: Eduardo Ochs <address@hidden>

    `find-here-links'
---
 VERSION       |   4 +-
 eev-blinks.el |  26 +++++++-
 eev-elinks.el | 136 ++++++++++++++++++++++++++++++++-------
 eev-intro.el  | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 eev-rcirc.el  |  24 ++++---
 eev-tlinks.el |  42 +++++++++++-
 6 files changed, 387 insertions(+), 45 deletions(-)

diff --git a/VERSION b/VERSION
index c5abd51..b6cbaf2 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Sun Sep  8 06:46:12 GMT 2013
-Sun Sep  8 03:46:12 BRT 2013
+Mon Sep 30 20:56:42 GMT 2013
+Mon Sep 30 17:56:42 BRT 2013
diff --git a/eev-blinks.el b/eev-blinks.el
index 3c0a967..1b20a12 100644
--- a/eev-blinks.el
+++ b/eev-blinks.el
@@ -22,7 +22,7 @@
 ;;
 ;; Author:     Eduardo Ochs <address@hidden>
 ;; Maintainer: Eduardo Ochs <address@hidden>
-;; Version:    2013aug28
+;; Version:    2013sep12
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-blinks.el>
@@ -290,6 +290,27 @@ then go to the position specified by POS-SPEC-LIST.\n
   (apply 'find-wottb-call '(disassemble function) "*Disassemble*"
         pos-spec-list))
 
+;; New, 2013sep21
+;;
+(defun find-etp (&rest pos-spec-list)
+  "Hyperlink to the output of `describe-text-properties'.
+This is a high-level alternative to `find-etpat'."
+  (interactive)
+  (apply 'find-wottb-call '(describe-text-properties (point))
+        "*Help*" pos-spec-list))
+
+(defun find-epackages (&optional no-fetch &rest pos-spec-list)
+  "Hyperlink to the output of `list-packages'."
+  (interactive "P")
+  (apply 'find-wottb-call '(list-packages no-fetch)
+        "*Packages*" pos-spec-list))
+
+(defun find-epackage (&optional pkg-desc &rest pos-spec-list)
+  "Hyperlink to the output of `describe-package'."
+  (interactive "P")
+  (apply 'find-wottb-call '(describe-package pkg-desc)
+        "*Help*" pos-spec-list))
+
 
 
 
@@ -758,7 +779,8 @@ Examples: (find-echarsetchars 'mule-unicode-0100-24ff 
\"733x\")
 
 (defun find-eejumps (&rest pos-spec-list) (interactive)
   (apply 'find-estring-elisp
-        (mapconcat 'ee-defun-str-for (eejump-symbols) "\n")
+        (concat ";; (find-eejumps)\n\n"
+                (mapconcat 'ee-defun-str-for (eejump-symbols) "\n"))
         pos-spec-list))
 
 
diff --git a/eev-elinks.el b/eev-elinks.el
index 54d7051..5374a5b 100644
--- a/eev-elinks.el
+++ b/eev-elinks.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <address@hidden>
 ;; Maintainer: Eduardo Ochs <address@hidden>
-;; Version:    2013aug19
+;; Version:    2013sep30
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-elinks.el>
@@ -68,6 +68,8 @@
 ;; �.ee-hyperlink-prefix�      (to "ee-hyperlink-prefix")
 ;; �.find-color-links�         (to "find-color-links")
 
+;; �.find-here-links�          (to "find-here-links")
+
 
 
 
@@ -357,10 +359,21 @@ This is an internal function used by `find-ekey-links' and
 (defun ee-info-shortp () (string= (ee-info-book-) (ee-info-file-)))
 (defun ee-info-shortf () (ee-intern "find-%snode" ee-info-code))
 (defun ee-info-fullnode () (format "(%s)%s" (ee-info-book-) (ee-info-node)))
-(defun ee-intro-stem (bufname)
+
+(defun ee-find-info-links ()
+  `((info      ,(ee-info-fullnode))
+    (find-node ,(ee-info-fullnode))
+    ,(if (ee-info-shortp)
+        (list (ee-info-shortf) (ee-info-node)))))
+
+(defun ee-intro-stem (&optional bufname)
+  (setq bufname (or bufname (buffer-name (current-buffer))))
   (if (string-match "^\\*(find-\\(.*\\)-intro)\\*$" bufname)
       (match-string 1 bufname)))
 
+(defun ee-find-intro-links (&optional stem)
+  `((,(ee-intern "find-%s-intro" (or stem (ee-intro-stem))))))
+
 ;; A test: (ee-intro-stem "*(find-foo-intro)*")
 
 (defun find-einfo-links (&optional intro &rest rest)
@@ -385,14 +398,12 @@ buffer, also generate a link to that buffer."
     ;; Body:
     ""
     ,@(if (ee-infop)
-         `((info      ,(ee-info-fullnode))
-           (find-node ,(ee-info-fullnode))
-           ,(if (ee-info-shortp) (list (ee-info-shortf) (ee-info-node)))
-           )
+         (ee-find-info-links)
        '("[No \"*info*\" buffer]"))
     ""
-    ,(if intro
-        (list (ee-intern "find-%s-intro" intro))
+    ,@(if intro
+        ;; (list (ee-intern "find-%s-intro" intro))
+        (ee-find-intro-links)
        ;; else: "[Not invoked from a \"*find-xxx-intro*\" buffer]"
        )
     ) rest))
@@ -474,21 +485,26 @@ evaluate f in the context of a big `let', and return the 
result."
               (fname+ (concat newd fname-)))
          (eval code)))))
 
-(defun ee-find-file-extra-links (fname) ())
+(defun ee-find-file-links (&optional fname)
+  (setq fname (or fname (or (buffer-file-name) default-directory)))
+  `(,(ee-if-prefixp "~/" "~/" fname '`(find-fline ,fname+))
+    ,(ee-if-prefixp "$S/http/"   "http://"; fname '(ee-H fname+))
+    ,(ee-if-prefixp "$S/shttp/" "shttp://"; fname '(ee-H fname+))
+    ""
+    (find-file ,fname)         ; non-refinable
+    (find-fline ,fname)                ; refinable
+    ,@(ee-find-xxxfile-sexps (ee-expand fname))
+    ;;
+    ,@(ee-find-file-extra-links fname) ; customizable by the user
+    ))
+
+(defun ee-find-file-extra-links (fname) ()) ; customize this
 
 (defun find-file-links (fname &rest pos-spec-list)
   (interactive (list (or (buffer-file-name) default-directory)))
   (apply 'find-elinks
         `((find-file-links ,fname ,@pos-spec-list)
-          ,(ee-if-prefixp "~/" "~/" fname '`(find-fline ,fname+))
-          ,(ee-if-prefixp "$S/http/"   "http://"; fname '(ee-H fname+))
-          ,(ee-if-prefixp "$S/shttp/" "shttp://"; fname '(ee-H fname+))
-          ""
-          (find-file ,fname)           ; non-refinable
-          (find-fline ,fname)          ; refinable
-          ,@(ee-find-xxxfile-sexps (ee-expand fname))
-          ;;
-          ,@(ee-find-file-extra-links fname) ; customizable by the user
+          ,@(ee-find-file-links fname)
           )
         pos-spec-list))
 
@@ -525,7 +541,7 @@ evaluate f in the context of a big `let', and return the 
result."
   "An internal function used by `find-grep-links'."
   (cons "grep -nH -e _ *" (ee-first-n-elements 4 grep-history)))
 
-(defun ee-find-grep-links (find-xxxgreps grep-commands)
+(defun ee-find-grep-links0 (find-xxxgreps grep-commands)
   "An internal function used by `find-grep-links'."
   (let (result)
     (dolist (head find-xxxgreps)
@@ -533,6 +549,11 @@ evaluate f in the context of a big `let', and return the 
result."
        (setq result (cons `(,head ,command) result))))
     (nreverse result)))
 
+(defun ee-find-grep-links ()
+  (ee-find-grep-links0
+   (ee-find-grep-functions default-directory)
+   (ee-find-grep-commands)))
+
 (defun find-grep-links (&rest pos-spec-list)
 "Visit a temporary buffer containing `find-xxxgrep' sexps."
   (interactive)
@@ -541,9 +562,7 @@ evaluate f in the context of a big `let', and return the 
result."
      ;; Convention: the first sexp always regenerates the buffer.
      (find-efunction 'find-grep-links)
      ""
-     ,@(ee-find-grep-links
-       (ee-find-grep-functions default-directory)
-       (ee-find-grep-commands))
+     ,@(ee-find-grep-links)
      )
    pos-spec-list))
 
@@ -734,7 +753,80 @@ This needs a temporary directory; see: 
(find-prepared-intro)"
 
 
 
+;;;   __ _           _       _                         _ _       _        
+;;;  / _(_)_ __   __| |     | |__   ___ _ __ ___      | (_)_ __ | | _____ 
+;;; | |_| | '_ \ / _` |_____| '_ \ / _ \ '__/ _ \_____| | | '_ \| |/ / __|
+;;; |  _| | | | | (_| |_____| | | |  __/ | |  __/_____| | | | | |   <\__ \
+;;; |_| |_|_| |_|\__,_|     |_| |_|\___|_|  \___|     |_|_|_| |_|_|\_\___/
+;;;                                                                       
+;; �find-here-links� (to ".find-here-links")
+
+;; (find-efunction 'find-grep-links)
+;; (find-efunction 'find-einfo-links)
+;; (find-efunction 'find-file-links)
+;; (find-find-links-links "\\M-h" "here" "")
+;; (find-efunction 'find-ecolors)
+
+(define-key eev-mode-map "\M-h\M-h" 'find-here-links)
+
+(defun ee-buffer-re   (re)  (string-match re (buffer-name)))
+(defun ee-buffer-eq   (str) (string= str (buffer-name)))
+
+(defun ee-grep-bufferp     () (eq major-mode 'grep-mode))
+(defun ee-man-bufferp      () (eq major-mode 'Man-mode))
+(defun ee-rcirc-bufferp    () (eq major-mode 'rcirc-mode))
+(defun ee-info-bufferp     () (eq major-mode 'Info-mode))
+(defun ee-dired-bufferp    () (eq major-mode 'dired-mode))
+(defun ee-wdired-bufferp   () (eq major-mode 'wdired-mode))
+(defun ee-file-bufferp     () buffer-file-name)
+(defun ee-intro-bufferp    () (ee-buffer-re "^\\*(find-\\(.*\\)-intro)\\*$"))
+(defun ee-freenode-bufferp () (ee-buffer-re "^\\(.*\\).freenode\\.net"))
+
+(defun ee-ecolors-bufferp  () (ee-buffer-eq "*Colors*"))
+(defun ee-efaces-bufferp   () (ee-buffer-eq "*Faces*"))
+
+(defun ee-find-man-links (&optional mp) 
+  (setq mp (or mp (replace-regexp-in-string
+                  "^\\*Man \\(.*\\)\\*$" "\\1" (buffer-name))))
+  `((find-man ,mp)))
+
+(defun ee-find-here-links ()
+  (cond ((ee-info-bufferp)     (cons "" (ee-find-info-links)))
+       ((ee-intro-bufferp)    (cons "" (ee-find-intro-links)))
+       ((ee-man-bufferp)      (cons "" (ee-find-man-links)))
+       ((ee-grep-bufferp)     (cons "" (ee-find-grep-links)))
+       ((ee-freenode-bufferp) (cons "" (ee-find-freenode-links)))
+       ((ee-dired-bufferp)    (cons "" (ee-find-file-links)))
+       ((ee-wdired-bufferp)   (cons "" (ee-find-file-links)))
+       ((ee-file-bufferp)     (cons "" (ee-find-file-links)))
+       (t (list "hello" "you"))))
+
+(defun find-here-links-test (sexp)
+"See: (find-links-intro \"`find-here-links'\")"
+  (find-wset "13o_2o_o" sexp '(find-here-links)))
+
+;; (find-man "1 cat")
+;; (progn (find-man "1 cat") (buffer-name))
+;; (find-eevfile "eev-rcirc.el")
+
+;; (find-find-links-links "\\M-h" "here" "")
+;;
+(defun find-here-links (&rest pos-spec-list)
+"Visit a temporary buffer containing hyperlinks pointing to here."
+  (interactive)
+  (apply 'find-elinks
+   `(;; (find-here-links  ,@pos-spec-list)
+     ;; Convention: the first sexp always regenerates the buffer.
+     ;; (find-efunction 'find-here-links)
+     ,(ee-H "See: ")
+     (find-links-intro "`find-here-links'")
+     ;; ""
+     ,@(ee-find-here-links)
+     )
+   pos-spec-list))
 
+;; Test: (find-here-links)
+;; (progn (find-enode "Screen") (find-here-links))
 
 
 
diff --git a/eev-intro.el b/eev-intro.el
index bafca11..d702786 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <address@hidden>
 ;; Maintainer: Eduardo Ochs <address@hidden>
-;; Version:    2013sep08
+;; Version:    2013sep30
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-intro.el>
@@ -62,6 +62,7 @@
 
 ;; �.find-defun-intro�         (to "find-defun-intro")
 ;; �.find-emacs-intro�         (to "find-emacs-intro")
+;; �.find-org-intro�           (to "find-org-intro")
 
 ;; See: (find-anchors-intro)
 
@@ -1223,6 +1224,78 @@ be expanded later:
 
 
 
+`find-here-links'
+=================
+The most important M-h command is `M-h M-h' (`find-here-links'),
+which analyzes the major mode and the buffer name of the current
+buffer and runs the most adequade of several `find-*-links'
+commands. For example, if you type `M-h M-h' now you should get
+a buffer like this:
+   __________________________________________________________
+  |# See:                                                    |
+  |# (find-links-intro \"`find-here-links'\")                  |
+  |                                                          |
+  |# (find-links-intro)                                      |
+  |                                                          |
+  | -:**-  *Elisp hyperlinks*   All L1     (Fundamental eev) |
+  |__________________________________________________________|
+
+where `(find-links-intro)' is a hyperlink to this intro.
+
+  [NOTE: `find-here-links' is a new feature, and its buffers do
+  not yet follow all the conventions of elisp hyperlinks
+  buffers... some minor details will probably change soon to
+  reduce the risk of confusion]
+
+Normally we use `M-h M-h' like this. We are putting our
+\(executable, but messy) notes into something that we will refer
+to as an \"e-script buffer\"; we find a piece of interesting
+information at another buffer, and we want to put a link to that
+into our e-script buffer. The link that we will produce is a
+sexp, which goes to a \"target\" when executed. This is a bit
+confusing, to let's demonstrate it sort of backwards...
+
+The debugging function `find-here-links-test' receives a sexp and
+creates a window setting like this:
+   ___________________________________
+  |          |                        |
+  |          |     target of SEXP     |
+  |          |________________________|
+  |   here   |                        |
+  |          |   result of running    |
+  |          |  `find-here-links' on  |
+  |          |   the target of SEXP   |
+  |__________|________________________|
+
+Try it by running the `find-here-links-test' sexps below. Note
+that they will keep the cursor at the \"here\" window - i.e.,
+here at (find-links-intro) - so you can just move up and down
+between the tests and execute the other tests with `M-e'.
+
+  (find-here-links-test '(find-eval-intro))
+  (find-here-links-test '(find-node \"(dir)Top\"))
+  (find-here-links-test '(find-eevfile \"eepitch.el\"))
+  (find-here-links-test '(find-efunction 'find-here-links))
+  (find-here-links-test '(find-man \"1 cat\"))
+  (find-here-links-test '(find-fline \"~/\"))
+
+Now let's see the typical, real-life usage case. We don't start
+with the sexp that points to a target - we stumble at something
+interesting, and then we want to _produce_ a sexp that points to
+that, and then save it to our notes. When we are at \"interesting
+place\" we type `M-h M-h'; we get a find-here-links buffer, and
+we choose the sexp that looks more adequate between the ones that
+point to \"interesting place\". We edit that sexp - refining it
+if needed - and copy it to our e-script. If we want to go back to
+\"interesting place\" we can do that either with the right
+sequence of `M-K's or by executing the sexp.
+
+  [Note that `M-1 M-j' jumps to ~/TODO... EXPLAIN THIS]
+
+
+
+
+
 
 Basic and non-basic hyperlinks
 ==============================
@@ -1302,13 +1375,13 @@ this:
 
    ___________________________________________________________
   |# (ee-hyperlink-prefix)                                    |
-  |# (setq ee-hyperlink-prefix \"# \")                        |
+  |# (setq ee-hyperlink-prefix \"# \")                          |
   |                                                           |
-  |# (setq ee-hyperlink-prefix \"# \")                        |
-  |# (setq ee-hyperlink-prefix \";; \")                       |
-  |# (setq ee-hyperlink-prefix \"-- \")                       |
-  |# (setq ee-hyperlink-prefix \"// \")                       |
-  |# (setq ee-hyperlink-prefix \"% \")                        |
+  |# (setq ee-hyperlink-prefix \"# \")                          |
+  |# (setq ee-hyperlink-prefix \";; \")                         |
+  |# (setq ee-hyperlink-prefix \"-- \")                         |
+  |# (setq ee-hyperlink-prefix \"// \")                         |
+  |# (setq ee-hyperlink-prefix \"% \")                          |
   |                                                           |
   |                                                           |
   |--:**-  *Elisp hyperlinks*   All L1     (Fundamental eev)--|
@@ -4590,6 +4663,51 @@ Eev video: table of contents
 \(eev-avadj-mode 1)
 \(find-eevvideo t)
 
+ 0:00 introduction
+ 2:45 unpack the tarball and invoke Emacs
+ 5:07 and make the cursor stop blinking
+
+ 5:11 Emacs as a Lisp environment
+11:48 Open the file \"VERSION\" (TAB completes)
+12:15 (eek \"C-x C-f VERSION\") is not very readable
+12:35 (find-file \".../VERSION\") is more readable
+12:43 to follow it we type M-e, and M-k to go back
+14:00 parts for humans and more or less for humans; passive sexps
+14:34 variations of M-e that split the screen
+15:09 left side is \"before\", right side is \"after\"
+
+16:00 help on a key sequence
+16:28 C-h k gives us help on a key sequence
+17:46 (eek \"C-h k  C-x C-f\") is an unreadble way to get help on a key
+17:55 (describe-function 'find-file) is even messier
+18:28 (find-efunctiondescr 'find-file) is cleaner - and why
+
+20:14 introduction the eev documentation in \"intro\"s
+22:30 (eek \"M-h M-k  C-x C-f\") generates a list of hyperlinks
+24:15 the first line regenerates the buffer
+24:40 the intros are temporary buffers
+25:07 we can play without destroying the documentation of eev
+25:40 we can copy the hyperlinks to intros to other places
+
+25:53 introduction to eejump
+26:44 a plain M-j goes to the index of eejumps
+28:00 M-5 M-j goes to the top level of the documentation in intros
+28:22 M-2 M-j goes to (find-emacs-intro)
+28:36 ...which has lots of links to the emacs manuals
+
+28:54 (find-eev-update-links)
+29:47 I could have done that with just instructions in English
+30:01 ...but it was more interesting to do that in an executable way.
+30:21 remember that the first line regenerates the buffer...
+31:07 we use that to select a directory for installation.
+31:40 an eepitch block
+31:53 emacs is made to handle anyting that looks like text...
+32:38 running terminals inside Emacs
+32:52 the best of both worlds
+33:50 f8
+35:48 [oops - I forgot to unpack]
+
+
 
 
 In Portuguese
@@ -5066,6 +5184,74 @@ C-x e   -- call-last-kbd-macro          (find-enode 
\"Keyboard Macros\")
 
 
 
+
+
+;; �find-org-intro� (to ".find-org-intro")
+;; (find-intro-links "org")
+
+(defun find-org-intro (&rest pos-spec-list) (interactive)
+  (let ((ee-buffer-name "*(find-org-intro)*"))
+    (apply 'find-estring "\
+\(Re)generate: (find-org-intro)
+Source code:  (find-efunction 'find-org-intro)
+More intros:  (find-eev-intro)
+              (find-eval-intro)
+              (find-eepitch-intro)
+This buffer is _temporary_ and _editable_.
+Is is meant as both a tutorial and a sandbox.
+
+
+
+Google Tech talk by Carsten Dominik (2008)
+==========================================
+http://orgmode.org/talks.html
+http://orgmode.org/worg/org-tutorials/org-screencasts/org-mode-google-tech-talk.html
+http://www.youtube.com/watch?v=oJTwQvgfgMM Emacs Org-mode - a system for 
note-taking and project planning
+\(find-youtubedl-links \"/sda5/videos/\" 
\"Emacs_Org-mode_-_a_system_for_note-taking_and_project_planning\" 
\"oJTwQvgfgMM\" \".flv\" \"carsten2008\")
+                     (ee-youtubedl-hash-to-fname \"oJTwQvgfgMM\")
+\(setq ee-carsten2008 (ee-youtubedl-hash-to-fname \"oJTwQvgfgMM\"))
+\(code-mplayer \"carsten2008\" ee-carsten2008)
+\(find-carsten2008 \"0:00\")
+
+\(eev-avadj-mode 1)
+\(find-carsten2008 t)
+
+1:20 Carsten Start
+1:50 History
+2:15 Working with Text Files
+3:58 Notes (not tasks) based project planning
+5:50 Outline mode - fixing
+9:56 Structure Editing
+11:00 Note taking other supports
+13:35 Meta data Intro
+14:57 tags
+15:26 Timeplanning
+15:53 Properties
+16:02 Meta data propagation
+16:49 Special Meta entry interfaces
+17:55 DateTime interface
+18:24 Column view
+19:20 Capture with remember
+23:02 Collect and Display
+23:52 Sparse tree
+25:47 Agenda view
+27:27 Exporting and publishing
+29:05 Tables
+31:34 Calc
+32:44 Radio tables
+34:53 Context sensitive keys
+38:13 How is org used
+40:55 Evolved Software software
+
+" pos-spec-list)))
+
+;; (find-org-intro)
+
+
+
+
+
+
 (provide 'eev-intro)
 
 
diff --git a/eev-rcirc.el b/eev-rcirc.el
index e6bc17e..865367e 100644
--- a/eev-rcirc.el
+++ b/eev-rcirc.el
@@ -137,6 +137,19 @@ CHANNEL."
 (defun ee-irc-channel-around-point ()
   (ee-stuff-around-point "#A-Za-z0-9_"))
 
+(defun ee-find-freenode-links (&optional channel)
+  (setq channel (or channel (replace-regexp-in-string
+                            "^\\(.*\\).irc\\.freenode\\.net" "\\1"
+                            (buffer-name))))
+  `((setq ee-freenode-ichannels ,ee-freenode-ichannels)
+    (setq ee-freenode-achannels ,ee-freenode-achannels)
+    ""
+    (find-freenode ,channel)
+    (find-freenode-3a ,channel)
+    (defun eejump-9 () (find-freenode ,channel))
+    (defun eejump-99 () (find-freenode-3a ,channel))
+    ))
+
 (defun find-freenode-links (&optional channel &rest pos-spec-list)
 "Visit a temporary buffer containing hyperlinks for foo."
   (interactive (list (ee-irc-channel-around-point)))
@@ -146,16 +159,7 @@ CHANNEL."
      ;; Convention: the first sexp always regenerates the buffer.
      (find-efunction 'find-freenode-links)
      ""
-     (setq ee-freenode-ichannels ,ee-freenode-ichannels)
-     (setq ee-freenode-achannels ,ee-freenode-achannels)
-     ""
-     (find-freenode ,channel)
-     (find-freenode-3a ,channel)
-     (defun eejump-9 () (find-freenode ,channel))
-     (defun eejump-99 () (find-freenode-3a ,channel))
-     ""
-     ,(ee-template0 "\
-")
+     ,@(ee-find-freenode-links channel)
      )
    pos-spec-list))
 
diff --git a/eev-tlinks.el b/eev-tlinks.el
index a7fa3ac..d55e1a6 100644
--- a/eev-tlinks.el
+++ b/eev-tlinks.el
@@ -186,20 +186,22 @@ This is an internal function used by 
`find-{stem}-links'.\"
 ;; A test: (find-intro-links)
 (define-key eev-mode-map "\M-hi" 'find-intro-links)
 
-(defun ee-intro-stem (bufname)
+(defun ee-intro-stem (&optional bufname)
+  (setq bufname (or bufname (buffer-name)))
   (if (string-match "^\\*(find-\\(.*\\)-intro)\\*$" bufname)
       (match-string 1 bufname)))
 
 (defun find-intro-links (&optional stem &rest pos-spec-list)
 "Visit a temporary buffer with a skeleton for defining `find-<STEM>-intro'.
 See: (find-eev \"eev-intro.el\")"
-  (interactive (list (ee-intro-stem (buffer-name))))
+  (interactive (list (ee-intro-stem)))
   (setq stem (or stem "{stem}"))
   (apply 'find-elinks-elisp
    `((find-intro-links ,stem ,@pos-spec-list)
      ;; Convention: the first sexp always regenerates the buffer.
      (find-efunction 'find-intro-links)
     ,(ee-template0 "\
+;; (ee-copy-rest 1 '(find-eev \"eev-intro.el\"))
 ;; (find-{stem}-intro)
 
 ;; <find-{stem}-intro>
@@ -1060,6 +1062,7 @@ cd {dir}
 
 # {ee-youtubedl-command} -F    'http://www.youtube.com/watch?v={hash}'
 # {ee-youtubedl-command} -f 18 'http://www.youtube.com/watch?v={hash}'
+# {ee-youtubedl-command} -f 18  --write-thumbnail 
'http://www.youtube.com/watch?v={hash}'
 
 # (find-es \"video\" \"youtube-dl\")
 # (find-fline \"{dir}\" \"{hash}\")
@@ -1078,6 +1081,41 @@ cd {dir}
     ) rest))
 
 
+;; Bonus (2013sep10): play a local copy of a video from its URL.
+;; I need to document this!
+;;
+(defun ee-youtubedl-guess** (dirs hash)
+  (apply 'append (mapcar (lambda (d) (ee-youtubedl-guess* d hash)) dirs)))
+
+(defun ee-youtubedl-dirs ()
+  (list ee-youtubedl-dir
+       ee-youtubedl-dir2
+       ee-youtubedl-dir3
+       ee-youtubedl-dir4))
+
+(defun ee-youtubedl-hash-to-fname (hash)
+  (and hash (car (ee-youtubedl-guess** (ee-youtubedl-dirs) hash))))
+
+(defun ee-youtubedl-url-to-hash (url)
+  (if (and url (string-match "[&?]v=\\([^&?#]+\\)" url))
+      (match-string 1 url)
+    url))
+
+(defun ee-youtubedl-url-to-fname (url)
+  (ee-youtubedl-hash-to-fname
+   (ee-youtubedl-url-to-hash url)))
+
+(autoload 'browse-url-url-at-point "browse-url")
+
+(defun bryl (url)
+  "Play a local copy of a video downloaded from youtube."
+  (interactive (list (browse-url-url-at-point)))
+  (let ((fname (and url (ee-youtubedl-url-to-fname url))))
+    (if fname (find-video fname))))
+
+
+
+
 
 ;;;  _   _       _                 _                   _ 
 ;;; | | | |_ __ | | ___   __ _  __| |   __ _ _ __   __| |



reply via email to

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