branch: externals/eev commit a065071c9fa310f70b36658989501747f9914107 Author: Eduardo Ochs <eduardoo...@gmail.com> Commit: Eduardo Ochs <eduardoo...@gmail.com>
Added `find-code-pdf-links' and a .dir-locals.el file. --- ChangeLog | 11 +++++++++++ VERSION | 4 ++-- eev-elinks.el | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- eev-intro.el | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- eev.el | 2 +- 5 files changed, 115 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4302a9..f8a1685 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2019-06-10 Eduardo Ochs <eduardoo...@gmail.com> + + * .dir-locals.el: new file. + + * eev-elinks.el (find-code-pdf-links): new function. + +2019-05-24 Eduardo Ochs <eduardoo...@gmail.com> + + * eev-elinks.el (find-efunction-links): added an `eek' link. + (find-evariable-links): added an ``eek' link. + 2019-05-17 Eduardo Ochs <eduardoo...@gmail.com> * eev-elinks.el (find-here-links-3): new function. diff --git a/VERSION b/VERSION index 1ea0fe5..6119cee 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -Fri May 17 07:17:49 GMT 2019 -Fri May 17 04:17:49 -03 2019 +Mon Jun 10 04:40:07 GMT 2019 +Mon Jun 10 01:40:07 -03 2019 diff --git a/eev-elinks.el b/eev-elinks.el index e330221..93e213f 100644 --- a/eev-elinks.el +++ b/eev-elinks.el @@ -19,7 +19,7 @@ ;; ;; Author: Eduardo Ochs <eduardoo...@gmail.com> ;; Maintainer: Eduardo Ochs <eduardoo...@gmail.com> -;; Version: 2019may17 +;; Version: 2019jun10 ;; Keywords: e-scripts ;; ;; Latest version: <http://angg.twu.net/eev-current/eev-elinks.el> @@ -76,6 +76,8 @@ ;; «.find-here-links» (to "find-here-links") +;; «.find-code-c-d-links» (to "find-code-c-d-links") +;; «.find-code-pdf-links» (to "find-code-pdf-links") @@ -229,6 +231,7 @@ The buffer is put in Emacs Lisp mode." (interactive (find-function-read)) (apply 'find-elinks `((find-efunction-links ',f ,@pos-spec-list) + (eek ,(format "M-h M-f %s" f)) ,@(ee-find-efunction-links f) ) pos-spec-list)) @@ -267,7 +270,7 @@ This is an internal function used by `find-efunction-links' and ;; «find-evariable-links» (to ".find-evariable-links") ;; (find-find-links-links "\\M-v" "evariable" "var") ;; A test: (find-evariable-links 'line-move-visual) -;; (eek "M-h M-v line-move-visual") +;; (eek "M-h M-v line-move-visual") ;; Moved to eev-mode.el: ;; (define-key eev-mode-map "\M-h\M-v" 'find-evariable-links) @@ -278,6 +281,7 @@ This is an internal function used by `find-efunction-links' and (interactive (find-function-read 'variable)) (apply 'find-elinks `((find-evariable-links ',var ,@pos-spec-list) + (eek ,(format "M-h M-v %s" var)) ;; Convention: the first sexp always regenerates the buffer. ,var (describe-variable ',var) @@ -1291,6 +1295,46 @@ This needs a temporary directory; see: (find-prepared-intro)" +;;; __ _ _ _ _ _ _ +;;; / _(_)_ __ __| | ___ ___ __| | _____/\__ | (_)_ __ | | _____ +;;; | |_| | '_ \ / _` |_____ / __/ _ \ / _` |/ _ \ /_____| | | '_ \| |/ / __| +;;; | _| | | | | (_| |_____| (_| (_) | (_| | __/_ _\_____| | | | | | <\__ \ +;;; |_| |_|_| |_|\__,_| \___\___/ \__,_|\___| \/ |_|_|_| |_|_|\_\___/ +;;; +;; «find-code-c-d-links» (to ".find-code-c-d-links") + + +;; «find-code-pdf-links» (to ".find-code-pdf-links") +;; Tests: +;; (find-fline "/usr/local/texlive/2018/texmf-dist/doc/latex/base/") +;; (find-code-pdf-links "/usr/local/texlive/2018/texmf-dist/doc/latex/base/source2e.pdf") +;; (find-code-pdf-links "/usr/local/texlive/2018/texmf-dist/doc/latex/base/source2e.pdf" "foo") + +(defun find-code-pdf-links (&optional fname c &rest pos-spec-list) +"Visit a temporary buffer containing hyperlinks to a PDF file." + (interactive (list (and (eq major-mode 'dired-mode) (ee-dired-to-fname)))) + (setq fname (or fname "{fname}")) + (setq c (or c "{c}")) + (let ((dir (file-name-directory fname))) + (apply 'find-elinks-elisp + `((find-code-pdf-links ,fname ,c ,@pos-spec-list) + ;; Convention: the first sexp always regenerates the buffer. + ;; (find-efunction 'find-code-pdf-links) + ,(ee-template0 "\ +;; See: (find-eev-quick-intro \"9.3. Hyperlinks to PDF files\") +;; (find-eev-quick-intro \"9.4. Shorter hyperlinks to PDF files\") + +;; (find-fline {(ee-S (file-name-directory fname))}) +;; (find-pdf-page \"{fname}\") +;; (find-pdf-text \"{fname}\") +\(code-pdf-page \"{c}\" \"{fname}\") +\(code-pdf-text \"{c}\" \"{fname}\") +;; \(find-{c}page) +;; \(find-{c}text) +") + ) + pos-spec-list))) + diff --git a/eev-intro.el b/eev-intro.el index 34ffd52..621f878 100644 --- a/eev-intro.el +++ b/eev-intro.el @@ -19,7 +19,7 @@ ;; ;; Author: Eduardo Ochs <eduardoo...@gmail.com> ;; Maintainer: Eduardo Ochs <eduardoo...@gmail.com> -;; Version: 2019may17 +;; Version: 2019jun05 ;; Keywords: e-scripts ;; ;; Latest version: <http://angg.twu.net/eev-current/eev-intro.el> @@ -1456,7 +1456,7 @@ what is important in that page); the second sexp goes to the page 3 of the PDF converted to text, searches for the string \"LECTURE I.\" and places the cursor right after the end of it. -In section 10.3 we will see how to generate with just a few +In section 10.4 we will see how to generate with just a few keystrokes a short hyperlink to a page of a PDF and a short hyperlink to a string in a page of a PDF. @@ -1599,6 +1599,7 @@ used \"-110\" as the offset. + 10.5. Generating short hyperlinks to anchors -------------------------------------------- @@ -1606,6 +1607,48 @@ used \"-110\" as the offset. + +11. Generating `code-c-d's and friends +====================================== +There are two main ways to generate lines like these + + (code-c-d \"asy\" \"/usr/local/texlive/2019/texmf-dist/doc/asymptote/\") + (code-pdf-page \"asy\" \"/usr/local/texlive/2019/texmf-dist/doc/asymptote/asymptote.pdf\") + (code-pdf-text \"asy\" \"/usr/local/texlive/2019/texmf-dist/doc/asymptote/asymptote.pdf\") + +without having to type much. One way, that is somewhat confusing, +is with `M-C' (`eewrap-code-c-d') and `M-P' (`eewrap-pdflike'); +you can test it by running the `eek' sexps below: + + (eek \"<down> M-C\") + asy /usr/local/texlive/2019/texmf-dist/doc/asymptote/ + + (eek \"<down> M-P\") + asy /usr/local/texlive/2019/texmf-dist/doc/asymptote/asymptote.pdf + +We will only discuss here the other way. + + + +11.1. `find-code-c-d-links' +--------------------------- + +11.2. `find-code-pdf-links' +--------------------------- +Let's call a pair of lines like the ones above, in which we have +a call to `code-pdf-page' and a call to `code-pdf-text', both +pointing to the same PDF file, a \"code-pdf pair\". One quick way +to generate a code-pdf pair is to visit the directory where your +PDF file is, put the point on the line of the PDF, and run `M-x +find-code-pdf-links'. Try it here: + + (find-fline \"$S/https/tannerlectures.utah.edu/_documents/a-to-z/c/\") + + + + + + \(To be continued...) " pos-spec-list))) @@ -3092,6 +3135,16 @@ documentation and examples in the comments of the source files.) +10.4. Quote and backquote +------------------------- +Eev uses backquote a lot and avoids macros. + + (find-elnode \"Backquote\") + (find-elnode \"Macros\") + + + + 11. What else? diff --git a/eev.el b/eev.el index 73a24dd..d169412 100644 --- a/eev.el +++ b/eev.el @@ -6,7 +6,7 @@ ;; Package-Requires: ((emacs "24.1")) ;; Keywords: lisp e-scripts ;; URL: http://angg.twu.net/#eev -;; Version: 20190425 +;; Version: 20190517 ;; 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