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

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

[elpa] externals/hyperbole 4fdcb7d 02/53: 2016-08-17 Bob Weiner <address


From: Robert Weiner
Subject: [elpa] externals/hyperbole 4fdcb7d 02/53: 2016-08-17 Bob Weiner <address@hidden>
Date: Wed, 15 Nov 2017 22:46:56 -0500 (EST)

branch: externals/hyperbole
commit 4fdcb7da7b837dd4086ecae6fdbf2853f28005be
Author: Bob Weiner <address@hidden>
Commit: Bob Weiner <address@hidden>

    2016-08-17  Bob Weiner  <address@hidden>
    
    * README: Added Summary section with a description of Hyperbole since this 
file may be shown prior to
        download in the Emacs package manager.
    
    * kotl/kexport.el (kexport:label-html-font-attributes): Fixed improper 
'defvar' definition which should
        have been a 'defcustom'.
    
    2016-08-16  Bob Weiner  <address@hidden>
    
    * hib-kbd.el (kbd-key:normalize): Fixed so C-M-<char> is normalized the 
same way as M-C-<char>.
                 (kbd-key:extended-command-prefix): Added.
                 (kbd-key, kbd-key:act): Added kbd-key:extended-command-p test 
and used in this implicit button
        type and action type to support Action Key presses on M-x extended 
commands like {M-x occur RET} since
        these are included in the Hyperbole DEMO.
    
    2016-08-15  Bob Weiner  <address@hidden>
    
    * hpath.el (hpath:substitute-dir): Added support for environment variables 
including those with PATH
        in their name (colon-separated paths) that should have been there.
        Added call to hpath:exists-p to test path with hpath:suffixes added to 
fix bug where
        "${load-path}/simple.el" did not resolve properly when the file was 
stored compressed
        as simple.el.gz, for example.
---
 Changes         | 24 ++++++++++++++++++++++++
 README          | 55 ++++++++++++++++++++++++++++++++++++++++++++++++-------
 hib-kbd.el      | 38 ++++++++++++++++++++++++++------------
 hpath.el        | 49 +++++++++++++++++++++++++++++++------------------
 hui-mini.el     |  3 +--
 kotl/kexport.el |  2 +-
 6 files changed, 131 insertions(+), 40 deletions(-)

diff --git a/Changes b/Changes
index ebe768b..d0c78bf 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,29 @@
 -- Almost all changes listed herein are new as of 2016. --
 
+2016-08-17  Bob Weiner  <address@hidden>
+
+* README: Added Summary section with a description of Hyperbole since this 
file may be shown prior to
+    download in the Emacs package manager. 
+
+* kotl/kexport.el (kexport:label-html-font-attributes): Fixed improper 
'defvar' definition which should
+    have been a 'defcustom'. 
+
+2016-08-16  Bob Weiner  <address@hidden>
+
+* hib-kbd.el (kbd-key:normalize): Fixed so C-M-<char> is normalized the same 
way as M-C-<char>.
+             (kbd-key:extended-command-prefix): Added.
+             (kbd-key, kbd-key:act): Added kbd-key:extended-command-p test and 
used in this implicit button
+    type and action type to support Action Key presses on M-x extended 
commands like {M-x occur RET} since
+    these are included in the Hyperbole DEMO.
+
+2016-08-15  Bob Weiner  <address@hidden>
+
+* hpath.el (hpath:substitute-dir): Added support for environment variables 
including those with PATH
+    in their name (colon-separated paths) that should have been there.
+    Added call to hpath:exists-p to test path with hpath:suffixes added to fix 
bug where
+    "${load-path}/simple.el" did not resolve properly when the file was stored 
compressed
+    as simple.el.gz, for example.
+
 2016-08-12  Bob Weiner  <address@hidden>
 
 * hui-mini.el (hui:menu-enter): Fixed potential error of (wrong-type-argument 
char-or-string-p 134217741)
diff --git a/README b/README
index cef048f..eb14211 100644
--- a/README
+++ b/README
@@ -1,7 +1,5 @@
 # README --- Information GNU Hyperbole users and maintainers should read
 #
-# See the "HY-ABOUT" file for a description of GNU Hyperbole.
-#
 # Author:       Bob Weiner
 #
 # Orig-Date:    19-Oct-91 at 03:27:47
@@ -18,19 +16,62 @@ written by Bob Weiner.  It is maintained by him and Mats 
Lidell.
 ===========================================================================
 *                      Table of Contents
 ===========================================================================
+                       * Summary
                        * Files
                        * Programmer Quick Reference
                        * User Quotes
                        * Why was Hyperbole developed?
 
 ===========================================================================
-*                         Files
+*                         Summary
 ===========================================================================
 
-For a summary of Hyperbole with text and images, see the Hyperbole home
-page: https://www.gnu.org/software/hyperbole.  If you have already
-downloaded Hyperbole, see the "HY-ABOUT" file for a text-only description
-and overview of Hyperbole.
+GNU Hyperbole (pronounced Ga-new Hi-per-bo-lee), or just Hyperbole, is an
+efficient and programmable hypertextual information management system
+implemented as a GNU Emacs package. It is a toolkit and user interface for
+viewing, retrieving and interlinking all kinds of textual information,
+utilizing Emacs for editing most of that information. Thus, you can build
+new classes of applications with it, but most people will just use it to
+speed their day-to-day information management needs.
+
+Hyperbole works well on GNU Emacs 24.4 or above. It is designed and written
+by Bob Weiner. It is maintained by him and Mats Lidell. Its main
+distribution site is: https://www.gnu.org/software/hyperbole/. If any term
+in here is new or unfamiliar to you, you can look it up in the Hyperbole
+Glossary.
+
+Hyperbole lets you:
+
+1. Create your own button types and use buttons of those types to launch
+arbitrary actions. One action type is a link to a file;
+
+2. Build outlines with multi-level numbered outline nodes, e.g. 1.4.8.6,
+that all renumber automatically as any node or tree is moved in the
+outline. Each node also has a permanent hyperlink anchor that you can
+reference from any other node;
+
+3. Manage all your contacts quickly with hierarchical categories and embed
+hyperlinks within each entry. Or create an archive of documents with
+hierarchical entries and use the same search mechanism to quickly find any
+matching entry;
+
+4. Use single keys to easily manage your Emacs windows or frames and quickly
+retrieve saved window and frame configurations;
+
+5. Search for things in your current buffers, in a directory tree or across
+major web search engines with the touch of a few keys.
+
+The common thread in all these features is making retrieval, management and
+display of information fast and easy. That is Hyperbole's purpose.
+
+For a more extensive summary of Hyperbole with text and images, see the
+Hyperbole home page: https://www.gnu.org/software/hyperbole.  If you have
+already downloaded Hyperbole, see the "HY-ABOUT" file for a text-only
+description and overview of Hyperbole.
+
+===========================================================================
+*                         Files
+===========================================================================
 
 See "DEMO" for a demonstration of standard Hyperbole button capabilities.
 This is the best way to initially interactively learn about Hyperbole after
diff --git a/hib-kbd.el b/hib-kbd.el
index 1a5e793..423bef0 100644
--- a/hib-kbd.el
+++ b/hib-kbd.el
@@ -57,9 +57,9 @@ Forms such as {\C-b}, {\^b}, and {^b} will not be recognized."
                 (not (eq key-sequence "")))
        (setq key-sequence (kbd-key:normalize key-sequence)
              binding (key-binding key-sequence)))
-      (and (if binding
-              (not (integerp binding))
-            (kbd-key:hyperbole-mini-menu-key-p key-sequence))
+      (and (cond (binding (not (integerp binding)))
+                ((kbd-key:hyperbole-mini-menu-key-p key-sequence))
+                ((kbd-key:extended-command-p key-sequence)))
           (ibut:label-set seq-and-pos)
           (hact 'kbd-key key-sequence)))))
 
@@ -74,10 +74,12 @@ Returns t if KEY-SEQUENCE has a binding, else nil."
   (setq current-prefix-arg nil) ;; kbd-key:normalize below sets it.
   (let ((binding (key-binding key-sequence)))
     (cond ((null binding)
-          ;; If this is a Hyperbole minibuffer menu item key sequence, execute 
it
-          ;; by adding its keys to the stream of unread command events.
-          (if (kbd-key:hyperbole-mini-menu-key-p key-sequence)
-              (setq unread-command-events (nconc unread-command-events (mapcar 
'identity key-sequence)))))
+          ;; If this is a Hyperbole minibuffer menu item key sequence
+          ;; or a M-x extended command, execute it by adding its keys
+          ;; to the stream of unread command events.
+          (when (or (kbd-key:hyperbole-mini-menu-key-p key-sequence)
+                    (kbd-key:extended-command-p key-sequence))
+            (setq unread-command-events (nconc unread-command-events (mapcar 
'identity key-sequence)))))
          ((memq binding '(action-key action-mouse-key hkey-either))
           (beep)
           (message "(kbd-key:act): This key does what the Action Key does.")
@@ -109,6 +111,10 @@ With optional prefix arg FULL, displays full documentation 
for command."
             (message doc)))
          (t (error "(kbd-key:doc): No binding found for keys {%s}" 
key-sequence)))))
 
+(defun kbd-key:extended-command-p (key-sequence)
+  "Returns non-nil if the string KEY-SEQUENCE is a normalized extended command 
invocation, i.e. M-x command."
+  (and (stringp key-sequence) (string-match kbd-key:extended-command-prefix 
key-sequence)))
+  
 (defun kbd-key:help (but)
   "Display documentation for binding of keyboard key given by BUT's label."
   (let ((kbd-key (hbut:key-to-label (hattr:get but 'lbl-key))))
@@ -126,7 +132,6 @@ With optional prefix arg FULL, displays full documentation 
for command."
   (if (stringp key-sequence)
       (let ((norm-key-seq (copy-sequence key-sequence))
            (case-fold-search nil) (case-replace t))
-       ;; Quote Control and Meta key names
        (setq norm-key-seq (hypb:replace-match-string
                            "[ \t\n\r]+" norm-key-seq "" t)
              norm-key-seq (hypb:replace-match-string
@@ -140,6 +145,8 @@ With optional prefix arg FULL, displays full documentation 
for command."
                            "ESCESC" norm-key-seq "\233" t)
              norm-key-seq (hypb:replace-match-string
                            "@key{ESC}\\|<ESC>\\|ESC" norm-key-seq "M-" t)
+             norm-key-seq (hypb:replace-match-string
+                           "C-M-" norm-key-seq "M-C-" t)
              ;; Unqote special {} chars.
              norm-key-seq (hypb:replace-match-string "\\\\\\([{}]\\)"
                                                      norm-key-seq "\\1"))
@@ -157,6 +164,7 @@ With optional prefix arg FULL, displays full documentation 
for command."
            (setq arg-val (* arg-val 4)
                  current-prefix-arg (cons arg-val nil)
                  norm-key-seq (substring norm-key-seq (match-end 0)))))
+       ;; Quote Control and Meta key names
        (setq norm-key-seq (hypb:replace-match-string
                            "C-\\(.\\)" norm-key-seq
                            (lambda (str)
@@ -169,12 +177,18 @@ With optional prefix arg FULL, displays full 
documentation for command."
              norm-key-seq (hypb:replace-match-string
                            "M-\\(.\\)" norm-key-seq
                            (lambda (str)
-                             (char-to-string (+ (downcase (string-to-char
-                                                           (substring str 
(match-beginning 1)
-                                                                      (1+ 
(match-beginning 1)))))
-                                                128))))))
+                             (concat "" (substring str (match-beginning 1)
+                                                     (1+ (match-beginning 
1))))))))
     (error "(kbd-key:normalize): requires a string argument, not `%s'" 
key-sequence)))
 
+;;; ************************************************************************
+;;; Private variables
+;;; ************************************************************************
+
+(defconst kbd-key:extended-command-prefix
+  (kbd-key:normalize (key-description (where-is-internal 
'execute-extended-command (current-global-map) t)))
+  "Normalized prefix string that invokes an extended command; typically ESC 
x.")
+
 (provide 'hib-kbd)
 
 ;;; hib-kbd.el ends here
diff --git a/hpath.el b/hpath.el
index 635936f..2718b80 100644
--- a/hpath.el
+++ b/hpath.el
@@ -220,7 +220,7 @@ When embedded within a path, the format is ${variable}."
 to create a path to the RFC document for `rfc-num'.")
 
 (defcustom hpath:suffixes '(".gz" ".Z")
-  "*List of filename suffixes to add or remove within (hpath:exists-p) calls."
+  "*List of filename suffixes to add or remove within `hpath:exists-p' and 
`hpath:substitute-dir' calls."
   :type '(repeat string)
   :group 'hyperbole-commands)
 
@@ -1319,28 +1319,41 @@ list, the first directory prepended to REST-OF-PATH 
which produces a valid
 local pathname is returned."
   (let (sym val)
     (cond ((not (stringp var-name))
-          (error "(hpath:substitute-dir): VAR-NAME arg, `%s', must be a 
string" var-name))
-         ((not (and (setq sym (intern-soft var-name))
-                    (boundp sym)))
-          (error "(hpath:substitute-dir): VAR-NAME arg, \"%s\", is not a bound 
variable"
+          (error "(hpath:substitute-dir): VAR-NAME, `%s', must be a string" 
var-name))
+         ((not (or (and (setq sym (intern-soft var-name))
+                        (boundp sym))
+                   (getenv var-name)))
+          (error "(hpath:substitute-dir): VAR-NAME, \"%s\", is not a bound 
variable nor a set environment variable"
                  var-name))
-         ((stringp (setq val (symbol-value sym)))
+         ((let ((case-fold-search t))
+            (stringp (setq val (cond (sym (symbol-value sym))
+                                     ((string-match "path" var-name)
+                                      (split-string (getenv var-name) ":"))
+                                     (t (getenv var-name))))))
           (if (hpath:validate (expand-file-name rest-of-path val))
               val))
          ((listp val)
-          (let ((dir))
-            (while (and val (not dir))
-              (setq dir (car val) val (cdr val))
-              (or (and (stringp dir)
-                       (file-name-absolute-p dir)
-                       (file-readable-p (expand-file-name rest-of-path dir)))
-                  (setq dir nil)))
-            (if dir (hpath:validate (directory-file-name dir))
+          (let* ((path (locate-file rest-of-path val (cons "" hpath:suffixes)))
+                 (dir (if path (file-name-directory path))))
+            (if dir
+                (hpath:validate (directory-file-name dir))
               (error "(hpath:substitute-dir): Can't find match for \"%s\""
-                     (concat "$\{" var-name "\}/" rest-of-path))
-              )))
-         (t (error "(hpath:substitute-dir): Value of VAR-NAME, \"%s\", must be 
a string or list" var-name))
-         )))
+                     (concat "$\{" var-name "\}/" rest-of-path))))
+          ;; Code prior to utilizing locate-file.
+;;        (let (dir path)
+;;          (while (and val (not dir))
+;;            (setq dir (car val) val (cdr val))
+;;            (or (and (stringp dir)
+;;                     (file-name-absolute-p dir)
+;;                     (setq path (hpath:exists-p (expand-file-name 
rest-of-path dir)))
+;;                     (file-readable-p path))
+;;                (setq dir nil)))
+;;          (if dir
+;;              (hpath:validate (directory-file-name dir))
+;;            (error "(hpath:substitute-dir): Can't find match for \"%s\""
+;;                   (concat "$\{" var-name "\}/" rest-of-path))))
+          )
+         (t (error "(hpath:substitute-dir): Value of VAR-NAME, \"%s\", must be 
a string or list" var-name)))))
 
 (defun hpath:substitute-var-name (var-symbol var-dir-val path)
   "Replaces with VAR-SYMBOL any occurrences of VAR-DIR-VAL in PATH.
diff --git a/hui-mini.el b/hui-mini.el
index e1659b5..07678db 100644
--- a/hui-mini.el
+++ b/hui-mini.el
@@ -157,8 +157,7 @@ With optional HELP-STRING-FLAG, instead returns the one 
line help string for the
           (if (eventp input)
               (setq input (event-to-character input)))))
     (if (or (symbolp input)
-           (and (integerp input)
-                (= input ?\r)))
+           (and (integerp input) (= input ?\r)))
        (setq input (hargs:at-p)))
     (erase-buffer)
     (when (or (characterp input) (stringp input))
diff --git a/kotl/kexport.el b/kotl/kexport.el
index 16a2273..dd793e3 100644
--- a/kotl/kexport.el
+++ b/kotl/kexport.el
@@ -50,7 +50,7 @@
                 (string))
   :group 'hyperbole-koutliner)
 
-(defvar kexport:label-html-font-attributes
+(defcustom kexport:label-html-font-attributes
   "COLOR=\"#C100C1\" SIZE=\"-1\""
   "*String of HTML font attributes attached to kcell labels when exported."
   :type 'string



reply via email to

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