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

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

[elpa] externals/eev a1ae99c028 2/6: Merge branch 'UTF-8'


From: ELPA Syncer
Subject: [elpa] externals/eev a1ae99c028 2/6: Merge branch 'UTF-8'
Date: Sun, 13 Mar 2022 07:57:28 -0400 (EDT)

branch: externals/eev
commit a1ae99c028c77dab14a4b180778feda75ebef4ed
Merge: a68aecc0e0 8ed988fbca
Author: Eduardo Ochs <eduardoochs@gmail.com>
Commit: Eduardo Ochs <eduardoochs@gmail.com>

    Merge branch 'UTF-8'
---
 ChangeLog    |  13 +++++++
 VERSION      |   5 +++
 eev-intro.el |  59 +++++++++++++++++++-----------
 eev-kla.el   | 115 ++++++++++++++++++++++++++++++++++++++++++-----------------
 4 files changed, 140 insertions(+), 52 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 016e5c6f2a..e2c5c223ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+<<<<<<< HEAD
+=======
+2022-03-07  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-kla.el: rewritten almost completely.
+
+2022-03-03  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-intro.el (find-eev-quick-intro): rewrote the section "10.2.
+       Generating short hyperlinks to info nodes" following some ideas
+       by Bruno Macedo (thanks!=)).
+
+>>>>>>> UTF-8
 2022-02-26  Eduardo Ochs  <eduardoochs@gmail.com>
 
        * eev-pdflike.el (ee-code-pdfbackend): make the functions of the
diff --git a/VERSION b/VERSION
index 8504cdfadd..75993f7279 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,7 @@
+<<<<<<< HEAD
 Mon Feb 28 06:20:20 GMT 2022
 Mon Feb 28 03:20:20 -03 2022
+=======
+Mon Mar  7 04:36:03 GMT 2022
+Mon Mar  7 01:36:03 -03 2022
+>>>>>>> UTF-8
diff --git a/eev-intro.el b/eev-intro.el
index 128a1350e4..afcd42e0cf 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20220212
+;; Version:    20220303
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-intro.el>
@@ -1753,30 +1753,44 @@ If you run this
 
 then these three hyperlinks will point to the same info node:
 
-  (info      \"(elisp)Top\")
-  (find-node \"(elisp)Top\")
-  (find-elnode      \"Top\")
+  (info      \"(elisp)Box Diagrams\")
+  (find-node \"(elisp)Box Diagrams\")
+  (find-elnode      \"Box Diagrams\")
 
-Note that the last one is a short hyperlink. If you open that
-info node and type `M-h M-h' this will run `find-here-links',
-that will run something similar to:
+Note that the last one is a short hyperlink. If you follow it and
+then type `M-h M-h' you will see that the last hyperlink in the
+\"*(find-here-links)*\" is exactly that short hyperlink. But try
+this big sexp:
 
-  (find-einfo-links \"(elisp)Top\")
+  (progn (find-elnode \"Box Diagrams\")
+         (eek \"C-h r    ;; info-emacs-manual\")
+         (eek \"M-h M-h  ;; find-here-links\")
+         )
 
-The code that produces the short hyperlink to an info node is not
-currently very smart. If you look at the definition of
-`find-elnode' here
+You will get a \"*(find-here-links)*\" buffer that points to a
+page in the \"(emacs)\" manual instead of to one in the
+\"(elisp)\" manual, and that does not have a short hyperlink at
+the end. What happened?
 
-  (find-code-c-d \"el\" ee-emacs-lisp-directory \"elisp\")
+The trick is that the code that produces that short hyperlink
+uses two global variables and runs conditionally. When you run
+
+  (find-elnode \"Box Diagrams\")
 
-you will see that it saves the \"el\" and the \"elisp\" in global
-variables by running this:
+it sets these two variables:
 
   (setq ee-info-code \"el\")
   (setq ee-info-file \"elisp\")
 
-The short hyperlink to an info node is only produced when Info is
-visiting a node in a manual whose name matches the variable
+You can check that in its source code:
+
+  (find-efunctionpp 'find-elnode)
+  (find-code-c-d \"el\" ee-emacs-lisp-directory \"elisp\")
+
+The sub-function of `find-here-links' that is executed when
+`find-here-links' detects that \"here\" is an info node only
+generates the short hyperlink when the current \"info file\"
+corresponds to the value saved in the global variable
 `ee-info-file'.
 
 
@@ -1827,9 +1841,11 @@ There are two main ways to generate lines like these
   (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:
+without having to type much. The old way is with
+`M-C' (`eewrap-code-c-d') and `M-P' (`eewrap-pdflike'), that
+transform the current line in a way similar to
+`M-T' (`eewrap-eepitch'). You can test these key sequences by
+running the `eek' sexps below:
 
   (eek \"<down> M-C\")
   asy /usr/local/texlive/2019/texmf-dist/doc/asymptote/
@@ -1837,7 +1853,10 @@ you can test it by running the `eek' sexps below:
   (eek \"<down> M-P\")
   asy /usr/local/texlive/2019/texmf-dist/doc/asymptote/asymptote.pdf
 
-We will only discuss here the other way.
+The new way is with `M-h M-e', that is explained here:
+
+  (find-audiovideo-intro \"4.1. `find-extra-file-links'\")
+
 
 
 
diff --git a/eev-kla.el b/eev-kla.el
index 63ed0e2a5d..2308f21cfb 100644
--- a/eev-kla.el
+++ b/eev-kla.el
@@ -1,4 +1,4 @@
-;;; eev-kla.el -- kill link to anchor and variants.  -*- lexical-binding: nil; 
-*-
+;;; eev-kla.el -- kill link to anchor and friends.  -*- lexical-binding: nil; 
-*-
 
 ;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 ;;
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20220224
+;; Version:    20220307
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-kla.el>
@@ -144,6 +144,10 @@
 ;;
 ;;         Copied to the kill ring: (find-eevfile "eev-kla.el")
 ;;
+;;   3) `M-x eeklas'
+;;
+;;   4) `M-x eeklfs'
+;;
 ;;   3) `M-x ee-preferred-c-show', that shows the current directory
 ;;      and the value of `ee-preferred-c' at the window at the right.
 ;;      This is useful to check if the ".dir-locals.el" file was
@@ -193,12 +197,33 @@
 
 
 ;; «utils»  (to ".utils")
+;; Tests: (ee-kl-c)
+;;        (ee-kl-dir)
+;;        (ee-kl-fname)
+;;                   ee-edir
+;;        (ee-kl-dir   "e")
+;;                         (ee-efile "textmodes/fill.el")
+;;        (ee-kl-fname "e" (ee-efile "textmodes/fill.el"))
 ;;
-(defun ee-kl-dir (c)
-  (ee-expand (eval (read (format "ee-%sdir" c)))))
+(defun ee-kl-c ()
+  (or ee-preferred-c (error "`ee-preferred-c' is nil here!")))
 
-(defun ee-kl-fname (c fname)
-  (ee-remove-prefix (ee-kl-dir c) (ee-expand fname)))
+(defun ee-kl-dir (&optional c)
+  (ee-expand (eval (read (format "ee-%sdir" (or c (ee-kl-c)))))))
+
+(defun ee-kl-fname (&optional c fname)
+  (ee-remove-prefix (ee-kl-dir c) (ee-expand (or fname buffer-file-name))))
+
+;; Tests: (ee-kl-anchor)
+;;        (ee-kl-region)
+;;        (ee-kl-kill "(FOO \"BAR\")")
+;;
+(defun ee-kl-anchor ()
+  (ee-copy-preceding-tag-to-kill-ring))
+
+(defun ee-kl-region ()
+  (if (not (use-region-p)) (error "The region is not active!"))
+  (buffer-substring-no-properties (point) (mark)))
 
 (defun ee-kl-kill (sexp)
   (kill-new (concat sexp "\n"))
@@ -206,6 +231,32 @@
 
 
 
+;; Tests:
+;;   (defun find-2ae (sexp) (find-2a nil `(find-estring ,sexp :end)))
+;;   (find-2ae ' (concat "FOO\n" "BAR") )
+;;   (find-2ae ' (ee-kla-sexp  "eev" "foo.el" "ANCHOR") )
+;;   (find-2ae ' (ee-klas-sexp "eev" "foo.el" "ANCHOR" "FOO\nBAR") )
+;;   (find-2ae ' (ee-klf-sexp  "eev" "foo.el") )
+;;   (find-2ae ' (ee-klfs-sexp "eev" "foo.el" "FOO\nBAR") )
+;;        
+(defun ee-kla-sexp (c fname anchor)
+  (format "(find-%s \"%s\" \"%s\")" c fname anchor))
+
+(defun ee-klas-sexp (c fname anchor str)
+  (format "(find-%s \"%s\" \"%s\" %s)" c fname anchor (ee-S str)))
+
+(defun ee-klf-sexp (c fname)
+  (format "(find-%sfile \"%s\")" c fname))
+
+(defun ee-klfs-sexp (c fname str)
+  (format "(find-%sfile \"%s\" %s)" c fname (ee-S str)))
+
+
+
+
+
+
+
 ;;;            _    _       
 ;;;   ___  ___| | _| | __ _ 
 ;;;  / _ \/ _ \ |/ / |/ _` |
@@ -213,46 +264,46 @@
 ;;;  \___|\___|_|\_\_|\__,_|
 ;;;                         
 ;; «eekla»  (to ".eekla")
-;; <K>ill <L>ink to <A>nchor.
+;; <K>ill <L>ink to <A>nchor,
+;; <K>ill <L>ink to <A>nchor and <S>tring,
+;; <K>ill <L>ink to <File>.
+;; <K>ill <L>ink to <File> and <S>tring.
 ;; More precisely: produce a link to the preceding anchor and put it
 ;; in the kill-ring.
 
-(defun ee-kla-sexp (c fname anchor)
-  (format "(find-%s \"%s\" \"%s\")" c (ee-kl-fname c fname) anchor))
+;; (eek "C-e 4*<left> C-SPC <<klas>>")
+
 
 (defun eekla ()
-  "Put in the kill ring a link to the preceding anchor."
+  "<K>ill <L>ink to <A>nchor.
+Put in the kill ring a link to the preceding anchor."
   (interactive)
-  (let* ((c (or ee-preferred-c (error "`ee-preferred-c' is nil here!")))
-         (fname buffer-file-name)
-        (anchor (ee-copy-preceding-tag-to-kill-ring)))
-    (ee-kl-kill (ee-kla-sexp c fname anchor))))
-
-
-;;;            _    _  __ 
-;;;   ___  ___| | _| |/ _|
-;;;  / _ \/ _ \ |/ / | |_ 
-;;; |  __/  __/   <| |  _|
-;;;  \___|\___|_|\_\_|_|  
-;;;                       
-;; «eeklf»  (to ".eeklf")
-;; <K>ill <L>ink to <File>.
+  (ee-kl-kill (ee-kla-sexp (ee-kl-c) (ee-kl-fname) (ee-kl-anchor))))
 
-(defun ee-klf-sexp (c fname)
-  (format "(find-%sfile \"%s\")" c (ee-kl-fname c fname)))
+(defun eeklas ()
+  "<K>ill <L>ink to <A>nchor and <S>tring.
+Put in the kill ring a link to the preceding anchor."
+  (interactive)
+  (ee-kl-kill (ee-klas-sexp (ee-kl-c) (ee-kl-fname) (ee-kl-anchor) 
(ee-kl-region))))
 
 (defun eeklf ()
-  "Put in the kill ring a link to this file."
+  "<K>ill <L>ink to <F>ile."
   (interactive)
-  (let* ((c (or ee-preferred-c (error "`ee-preferred-c' is nil here!")))
-         (fname buffer-file-name))
-    (ee-kl-kill (ee-klf-sexp c fname))))
+  (ee-kl-kill (ee-klf-sexp (ee-kl-c) (ee-kl-fname))))
+
+(defun eeklfs ()
+  "<K>ill <L>ink to <F>ile and <S>tring."
+  (interactive)
+  (ee-kl-kill (ee-klfs-sexp (ee-kl-c) (ee-kl-fname) (ee-kl-region))))
+
 
 
 ;; «aliases»  (to ".aliases")
 ;; I use these aliases:
-;; (defalias 'kla 'eekla)
-;; (defalias 'klf 'eeklf)
+;; (defalias 'kla  'eekla)
+;; (defalias 'klas 'eeklas)
+;; (defalias 'klf  'eeklf)
+;; (defalias 'klfs 'eeklfs)
 
 
 



reply via email to

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