From e8038811c79ff76b6f188acf360a454a8ef7b753 Mon Sep 17 00:00:00 2001 From: Bob Weiner Date: Thu, 14 Dec 2017 17:12:43 -0500 Subject: Fixed a cyclic Lisp library require; improved multi-frame hkey-throw * hmouse-drv.el (hkey-throw): Partially solved temporary display of newly created frames (when not given focus initially with a '(no-focus-on-map . t) property), so hkey-throw to a new target frame now temporarily displays the target frame and then makes the start frame the uppermost frame. When on an item though, the item is not visible during the temporary display yet. * Makefile (texinfo): Added texinfo dependency target and added additional image dependencies in man/im. * hyperbole.el (require 'hmouse-drv): Changed from hmouse-key to prevent a require cycle during macro expansion. hmouse-key.el: Changed requires to just be during compile since hyperbole.el now includes these requires and will load hmouse-key. --- Changes | 13 +++++++++++++ Makefile | 8 +++++--- hmouse-drv.el | 18 ++++++++++-------- hmouse-key.el | 2 +- hyperbole.el | 5 ++--- man/hyperbole.pdf | Bin 1263857 -> 1263857 bytes man/im/C-hh.png | Bin 898836 -> 737355 bytes 7 files changed, 31 insertions(+), 15 deletions(-) diff --git a/Changes b/Changes index 2911def..34d2859 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,16 @@ +2017-12-13 Bob Weiner + +* hmouse-drv.el (hkey-throw): Partially solved temporary display of newly created frames (when not given focus + initially with a '(no-focus-on-map . t) property), so hkey-throw to a new target frame now temporarily displays + the target frame and then makes the start frame the uppermost frame. When on an item though, the item is + not visible during the temporary display yet. + +* Makefile (texinfo): Added texinfo dependency target and added additional image dependencies in man/im. + +* hyperbole.el (require 'hmouse-drv): Changed from hmouse-key to prevent a require cycle during macro expansion. + hmouse-key.el: Changed requires to just be during compile since hyperbole.el now includes these requires and + will load hmouse-key. + 2017-12-12 Bob Weiner * hversion.el: Pushed 7.0.2a test update. diff --git a/Makefile b/Makefile index 637283d..56640d2 100644 --- a/Makefile +++ b/Makefile @@ -256,16 +256,18 @@ version: doc # Build the Info, HTML and Postscript versions of the user manual and README.md.html. doc: info html pdf README.md.html +texinfo: $(man_dir)/hyperbole.texi $(man_dir)/version.texi $(man_dir)/hkey-help.txt $(man_dir)/im/*.png + info: $(man_dir)/hyperbole.info -$(man_dir)/hyperbole.info: $(man_dir)/hyperbole.texi $(man_dir)/version.texi $(man_dir)/hkey-help.txt +$(man_dir)/hyperbole.info: texinfo cd $(man_dir) && $(TEXI2INFO) hyperbole.texi html: $(man_dir)/hyperbole.html -$(man_dir)/hyperbole.html: $(man_dir)/hyperbole.texi $(man_dir)/version.texi $(man_dir)/hkey-help.txt $(man_dir)/hyperbole.css +$(man_dir)/hyperbole.html: texinfo $(man_dir)/hyperbole.css cd ${man_dir} && $(TEXI2HTML) hyperbole.texi pdf: $(man_dir)/hyperbole.pdf -$(man_dir)/hyperbole.pdf: $(man_dir)/hyperbole.texi $(man_dir)/version.texi $(man_dir)/hkey-help.txt +$(man_dir)/hyperbole.pdf: texinfo cd $(man_dir) && $(TEXI2PDF) hyperbole.texi # github-markdown is an npm, installed with: npm install markdown-to-html -g diff --git a/hmouse-drv.el b/hmouse-drv.el index 792f145..8cf1e90 100644 --- a/hmouse-drv.el +++ b/hmouse-drv.el @@ -469,23 +469,25 @@ The selected window does not change." (action-key-depress-args)) (hypb:save-selected-window-and-input-focus (hmouse-item-to-window) + (sit-for 0) ;; Force display of release-window (unless (eq depress-frame (window-frame release-window)) - (message "Buffer or item thrown to frame under this one") ;; Show the frame thrown to before it is covered when ;; input-focus is returned to the depress-frame. - ;; (raise-frame (window-frame release-window)) - ;; (sit-for 1) + (raise-frame (window-frame release-window)) + (switch-to-buffer (current-buffer) t t) + ;; Don't use sit-for here because it can be interrupted early. + (sleep-for 0.5) ))) ;; Throw the current buffer (set-window-buffer release-window (current-buffer)) + (sit-for 0) ;; Force display of release-window (unless (eq depress-frame (window-frame release-window)) - (message "Buffer or item thrown to frame under this one") ;; Show the frame thrown to before it is covered when ;; input-focus is returned to the depress-frame. - ;; (raise-frame (window-frame release-window)) - ;; (sit-for 1) - ;; (select-frame-set-input-focus depress-frame) - )))) + (raise-frame (window-frame release-window)) + ;; Don't use sit-for here because it can be interrupted early. + (sleep-for 0.5) + (select-frame-set-input-focus depress-frame))))) ;;;###autoload (defun hkey-buffer-to (from-window to-window) diff --git a/hmouse-key.el b/hmouse-key.el index 48a4ccc..20982a8 100644 --- a/hmouse-key.el +++ b/hmouse-key.el @@ -26,7 +26,7 @@ ;;; Other required Elisp libraries ;;; ************************************************************************ -(eval-and-compile (mapc #'require '(hsettings hmouse-drv hmouse-sh))) +(eval-when-compile (mapc #'require '(hsettings hmouse-drv hmouse-sh))) ;;; ************************************************************************ ;;; Public variables diff --git a/hyperbole.el b/hyperbole.el index 71ced94..1128370 100644 --- a/hyperbole.el +++ b/hyperbole.el @@ -382,7 +382,8 @@ frame, those functions by default still return the prior frame." (if (consp frame-x-dot-y) (setcar frame-x-dot-y (selected-frame))) frame-x-dot-y))) -(require 'hmouse-key) +;; hmouse-drv will load hui-mouse and hmouse-key +(mapc #'require '(hsettings hmouse-drv hmouse-sh)) ;;; ************************************************************************ ;;; You shouldn't need to modify anything below here. @@ -681,8 +682,6 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden." ;;; Load Site-specific Configurations and Initialize Hyperbole Package ;;; ************************************************************************ -(require 'hsettings) - (defun hyperb:init () "Standard configuration routine for Hyperbole." (interactive) diff --git a/man/hyperbole.pdf b/man/hyperbole.pdf index 314f65f..ac66dff 100644 Binary files a/man/hyperbole.pdf and b/man/hyperbole.pdf differ diff --git a/man/im/C-hh.png b/man/im/C-hh.png index c6e5bb3..10dde2e 100644 Binary files a/man/im/C-hh.png and b/man/im/C-hh.png differ -- cgit v1.0 From b7beb76e7acce94e7f0514d97a976c63a1549bb8 Mon Sep 17 00:00:00 2001 From: Bob Weiner Date: Fri, 15 Dec 2017 11:43:41 -0500 Subject: Fixed hkey-throw temporary display of a buffer in a new frame --- Changes | 25 +++++++++++++++++-------- hmouse-drv.el | 11 ++++++----- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Changes b/Changes index 34d2859..5e947a2 100644 --- a/Changes +++ b/Changes @@ -1,15 +1,24 @@ +2017-12-15 Bob Weiner + +* hmouse-drv.el (hkey-throw): Fully resolved temporary display of newly created frames + with a (redisplay t) to force display of any window updates during the temporary + display. + 2017-12-13 Bob Weiner -* hmouse-drv.el (hkey-throw): Partially solved temporary display of newly created frames (when not given focus - initially with a '(no-focus-on-map . t) property), so hkey-throw to a new target frame now temporarily displays - the target frame and then makes the start frame the uppermost frame. When on an item though, the item is - not visible during the temporary display yet. +* hmouse-drv.el (hkey-throw): Partially solved temporary display of newly created frames + (when not given focus initially with a '(no-focus-on-map . t) property), so hkey-throw + to a new target frame now temporarily displays the target frame and then makes the start + frame the uppermost frame. When on an item though, the item is not visible during the + temporary display yet. -* Makefile (texinfo): Added texinfo dependency target and added additional image dependencies in man/im. +* Makefile (texinfo): Added texinfo dependency target and added additional image dependencies + in man/im. -* hyperbole.el (require 'hmouse-drv): Changed from hmouse-key to prevent a require cycle during macro expansion. - hmouse-key.el: Changed requires to just be during compile since hyperbole.el now includes these requires and - will load hmouse-key. +* hyperbole.el (require 'hmouse-drv): Changed from hmouse-key to prevent a require cycle + during macro expansion. + hmouse-key.el: Changed requires to just be during compile since hyperbole.el now includes + these requires and will load hmouse-key. 2017-12-12 Bob Weiner diff --git a/hmouse-drv.el b/hmouse-drv.el index 8cf1e90..43239e8 100644 --- a/hmouse-drv.el +++ b/hmouse-drv.el @@ -456,32 +456,33 @@ Leave TO-WINDOW as the selected window." ;;;###autoload (defun hkey-throw (release-window) - "Throw either a displayable item at point or the current buffer to RELEASE-WINDOW. + "Throw either a displayable item at point or the current buffer for display in RELEASE-WINDOW. The selected window does not change." (interactive (list (let ((mode-line-text (concat " Ace - " (nth 2 (assq ?t aw-dispatch-alist))))) (aw-select mode-line-text)))) (let ((depress-frame (selected-frame))) (if (cadr (assq major-mode hmouse-drag-item-mode-forms)) - ;; On an item to throw + ;; Throw the item at point (let ((action-key-depress-window (selected-window)) (action-key-release-window release-window) (action-key-depress-args)) (hypb:save-selected-window-and-input-focus (hmouse-item-to-window) - (sit-for 0) ;; Force display of release-window (unless (eq depress-frame (window-frame release-window)) + ;; Force redisplay or item buffer won't be displayed here. + (redisplay t) ;; Show the frame thrown to before it is covered when ;; input-focus is returned to the depress-frame. (raise-frame (window-frame release-window)) - (switch-to-buffer (current-buffer) t t) ;; Don't use sit-for here because it can be interrupted early. (sleep-for 0.5) ))) ;; Throw the current buffer (set-window-buffer release-window (current-buffer)) - (sit-for 0) ;; Force display of release-window (unless (eq depress-frame (window-frame release-window)) + ;; Force redisplay or item buffer won't be displayed here. + (redisplay t) ;; Show the frame thrown to before it is covered when ;; input-focus is returned to the depress-frame. (raise-frame (window-frame release-window)) -- cgit v1.0 From 7efe2f2b381ef8ad530b5976800af66ae6e4e092 Mon Sep 17 00:00:00 2001 From: Bob Weiner Date: Sun, 17 Dec 2017 23:53:58 -0500 Subject: Removed Koutliner use of filladapt mode; it can cause filling errors * kotl/kfill.el: Eliminated use of filladapt.el since it causes kotl-mode filling errors. * kotl/kfill.el (kfill:forward-line): Removed improperly used [] in skip-chars-forward. 2017-12-16 Bob Weiner * hui.el (hui:key-dir): hui-window.el (hmouse-at-item-p): hui-jmenu.el (hui-menu-buffer-mode-name): Simplified using buffer-local-value. --- Changes | 12 ++++++++++++ hmouse-drv.el | 32 +++++++++++++++++++++++++++----- hui-jmenu.el | 5 ++--- hui-mouse.el | 3 ++- hui-window.el | 2 +- hui.el | 2 +- kotl/kfill.el | 13 ++++++++++--- kotl/kotl-mode.el | 4 ++-- 8 files changed, 57 insertions(+), 16 deletions(-) diff --git a/Changes b/Changes index 5e947a2..ea00ef8 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,15 @@ +2017-12-17 Bob Weiner + +* kotl/kfill.el: Eliminated use of filladapt.el since it causes kotl-mode filling errors. + +* kotl/kfill.el (kfill:forward-line): Removed improperly used [] in skip-chars-forward. + +2017-12-16 Bob Weiner + +* hui.el (hui:key-dir): + hui-window.el (hmouse-at-item-p): + hui-jmenu.el (hui-menu-buffer-mode-name): Simplified using buffer-local-value. + 2017-12-15 Bob Weiner * hmouse-drv.el (hkey-throw): Fully resolved temporary display of newly created frames diff --git a/hmouse-drv.el b/hmouse-drv.el index 43239e8..55f0800 100644 --- a/hmouse-drv.el +++ b/hmouse-drv.el @@ -454,6 +454,25 @@ Leave TO-WINDOW as the selected window." (aw-select mode-line-text)))) (hkey-swap-buffers (selected-window) to-window)) +;; Once the "display-until.el" library is added to Emacs, hkey-throw can be simplified to the following: +;; +;; (defun hkey-throw (release-window) +;; "Throw either a displayable item at point or the current buffer for display in RELEASE-WINDOW. +;; The selected window does not change." +;; (interactive +;; (list (let ((mode-line-text (concat " Ace - " (nth 2 (assq ?t aw-dispatch-alist))))) +;; (aw-select mode-line-text)))) +;; (if (cadr (assq major-mode hmouse-drag-item-mode-forms)) +;; ;; Throw the item at point +;; (let ((action-key-depress-window (selected-window)) +;; (action-key-release-window release-window) +;; (action-key-depress-args)) +;; (hmouse-item-to-window) +;; (select-window action-key-depress-window) +;; (display-window-until release-window)) +;; ;; Throw the current buffer +;; (display-window-until release-window (current-buffer)))) + ;;;###autoload (defun hkey-throw (release-window) "Throw either a displayable item at point or the current buffer for display in RELEASE-WINDOW. @@ -461,7 +480,10 @@ The selected window does not change." (interactive (list (let ((mode-line-text (concat " Ace - " (nth 2 (assq ?t aw-dispatch-alist))))) (aw-select mode-line-text)))) - (let ((depress-frame (selected-frame))) + (let ((depress-frame (selected-frame)) + (display-delay (if (boundp 'temp-display-delay) + temp-display-delay + 0.5))) (if (cadr (assq major-mode hmouse-drag-item-mode-forms)) ;; Throw the item at point (let ((action-key-depress-window (selected-window)) @@ -476,7 +498,7 @@ The selected window does not change." ;; input-focus is returned to the depress-frame. (raise-frame (window-frame release-window)) ;; Don't use sit-for here because it can be interrupted early. - (sleep-for 0.5) + (sleep-for display-delay) ))) ;; Throw the current buffer (set-window-buffer release-window (current-buffer)) @@ -487,7 +509,7 @@ The selected window does not change." ;; input-focus is returned to the depress-frame. (raise-frame (window-frame release-window)) ;; Don't use sit-for here because it can be interrupted early. - (sleep-for 0.5) + (sleep-for display-delay) (select-frame-set-input-focus depress-frame))))) ;;;###autoload @@ -896,7 +918,7 @@ Only works when running under a window system, not from a dumb terminal." (assist-key-depress) (when (called-interactively-p 'interactive) (message - "Assist Key depressed; go to release point and hit {%s %s}." + "Assist Key depressed; go to release point and press {%s %s}." (substitute-command-keys "\\[universal-argument]") (substitute-command-keys "\\[hkey-operate]")))) (if action-key-depressed-flag @@ -905,7 +927,7 @@ Only works when running under a window system, not from a dumb terminal." (message "Action Key released."))) (action-key-depress) (when (called-interactively-p 'interactive) - (message "Action Key depressed; go to release point and hit {%s}." + (message "Action Key depressed; go to release point and press {%s}." (substitute-command-keys "\\[hkey-operate]")))))) (defun hkey-summarize (&optional current-window) diff --git a/hui-jmenu.el b/hui-jmenu.el index 981ab85..5ff0543 100644 --- a/hui-jmenu.el +++ b/hui-jmenu.el @@ -141,13 +141,12 @@ ;;; ************************************************************************ (defun hui-menu-buffer-mode-name (buffer) - (let ((mname (cdr (assq 'mode-name (buffer-local-variables buffer))))) + (let ((mname (buffer-local-value 'mode-name buffer))) (if mname ;; Next line needed to ensure mode name is always formatted as ;; a string. (format-mode-line mname) - (capitalize (symbol-name - (cdr (assq 'major-mode (buffer-local-variables buffer)))))))) + (capitalize (symbol-name (buffer-local-value 'major-mode buffer)))))) (defun hui-menu-frame-name (frame) "Return the name of FRAME." diff --git a/hui-mouse.el b/hui-mouse.el index c46b732..2d32025 100644 --- a/hui-mouse.el +++ b/hui-mouse.el @@ -244,7 +244,8 @@ Its default value is #'smart-scroll-down." ;; Python files - ensure this comes before Imenu for more advanced ;; definition lookups ((and (or (and (eq major-mode 'python-mode) buffer-file-name) - (string-match "^Pydoc:\\|\\*?Python" (buffer-name))) + (let ((case-fold-search)) + (string-match "\\`\\(Pydoc:\\|\\*?Python\\)" (buffer-name)))) (smart-python-at-tag-p)) . ((smart-python) . (smart-python nil 'next-tag))) ;; diff --git a/hui-window.el b/hui-window.el index a24f6d8..a77faff 100644 --- a/hui-window.el +++ b/hui-window.el @@ -249,7 +249,7 @@ drag release window.") (defun hmouse-at-item-p () "Return t if point is on an item draggable by Hyperbole, otherwise nil." (let* ((buf (and (window-live-p action-key-depress-window) (window-buffer action-key-depress-window))) - (mode (and buf (cdr (assq 'major-mode (buffer-local-variables buf)))))) + (mode (and buf (buffer-local-value 'major-mode buf)))) (and buf (with-current-buffer buf ;; Point must be on an item, not after one (not (looking-at "\\s-*$"))) diff --git a/hui.el b/hui.el index d32ea3d..a0a9228 100644 --- a/hui.el +++ b/hui.el @@ -823,7 +823,7 @@ Optional NO-SORT means display in decreasing priority order (natural order)." (let ((file (buffer-file-name but-buf))) (if file (file-name-directory (hpath:symlink-referent file)) - (cdr (assq 'default-directory (buffer-local-variables but-buf))))) + (buffer-local-value 'default-directory but-buf))) (hypb:error "(hui:key-dir): '%s' is not a valid buffer."))) (defun hui:key-src (but-buf) diff --git a/kotl/kfill.el b/kotl/kfill.el index a8387e8..0ceadb2 100644 --- a/kotl/kfill.el +++ b/kotl/kfill.el @@ -16,8 +16,14 @@ ;; Quiet byte compiler warnings for this free variable. (eval-when-compile - (unless (require 'filladapt nil t) - (defvar filladapt-function-table nil))) + (defvar filladapt-function-table nil)) + +;; The above formerly looked like this, but the filladapt package is old +;; and unmaintained and causes improper paragraph filling for +;; kotl-mode under modern GNU Emacs versions. -- RSW 12/17/2017 +;; (eval-when-compile +;; (unless (require 'filladapt nil t) +;; (defvar filladapt-function-table nil))) ;;; ************************************************************************ ;;; Public variables @@ -100,7 +106,7 @@ number of lines that could not be moved, otherwise 0." (forward-visible-line n) (if (< n 0) nil - (skip-chars-forward "[\n\r]")) + (skip-chars-forward "\n\r")) ; (- (abs n) (count-matches "\n" opoint (point))) 0)) @@ -232,6 +238,7 @@ fill prefix at the beginning of each line." (fill-region-as-paragraph from (point) justify-flag))))) (defun kfill:funcall (function &rest args) + "Call the original FUNCTION with rest of ARGS that kfill overloaded." (apply (cdr (assq function kfill:function-table)) args)) (defun kfill:hanging-list (paragraph) diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el index ade18b8..ffb4908 100644 --- a/kotl/kotl-mode.el +++ b/kotl/kotl-mode.el @@ -1967,7 +1967,7 @@ If key is pressed: otherwise hide it; (3) between cells or within the read-only indentation region to the left of a cell, then move point to prior location and begin creation of a - klink to some other outline cell; hit the Action Key twice to select the + klink to some other outline cell; press the Action Key twice to select the link referent cell; (4) anywhere else, invoke `action-key-eol-function', typically to scroll up a windowful." @@ -2002,7 +2002,7 @@ If assist-key is pressed: each cell in tree beginning at point; (3) between cells or within the read-only indentation region to the left of a cell, then move point to prior location and prompt to move one tree to - a new location in the outline; hit the Action Key twice to select the + a new location in the outline; press the Action Key twice to select the tree to move and where to move it; (4) anywhere else, invoke `assist-key-eol-function', typically to scroll down a windowful." -- cgit v1.0 From 30600eb69c365cba9b116145882b818d6b2ca69e Mon Sep 17 00:00:00 2001 From: Bob Weiner Date: Tue, 19 Dec 2017 01:27:17 -0500 Subject: Added extensive gitlab-reference ibtype; improved github-reference * hib-social.el (github-reference): Added =item-id syntax. (gitlab-reference): Added to support Gitlab references. 2017-12-18 Bob Weiner * hib-social.el (github-reference): Fixed resolution of these formats of issue reference: gh#gh-34 and gh#issue/34 (needed to be plural). --- Changes | 10 +++ hib-social.el | 246 ++++++++++++++++++++++++++++++++++++++++++++++++----- man/hyperbole.texi | 2 +- 3 files changed, 237 insertions(+), 21 deletions(-) diff --git a/Changes b/Changes index ea00ef8..c43725c 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,13 @@ +2017-12-19 Bob Weiner + +* hib-social.el (github-reference): Added =item-id syntax. + (gitlab-reference): Added to support Gitlab references. + +2017-12-18 Bob Weiner + +* hib-social.el (github-reference): Fixed resolution of these formats of issue reference: + gh#gh-34 and gh#issue/34 (needed to be plural). + 2017-12-17 Bob Weiner * kotl/kfill.el: Eliminated use of filladapt.el since it causes kotl-mode filling errors. diff --git a/hib-social.el b/hib-social.el index 2f0e550..f10eb6c 100644 --- a/hib-social.el +++ b/hib-social.el @@ -16,11 +16,11 @@ ;; When the referent is a web page, this calls the function given by ;; `hibtypes-social-display-function' to display it, initially set to `browse-url'. ;; -;; A hashtag reference is either: [facebook|github|git|instagram|twitter]# -;; or using 2-letter service abbreviations: [fb|gh|gt|in|tw]#. +;; A hashtag reference is either: [facebook|github|gitlab|git|instagram|twitter]# +;; or using 2-letter service abbreviations: [fb|gh|gl|gt|in|tw]#. ;; -;; A username reference is either: [facebook|github|instagram|twitter]@ -;; or [fb|gh|in|tw]@. +;; A username reference is either: [facebook|github|gitlab|instagram|twitter]@ +;; or [fb|gh|gl|in|tw]@. ;; ;; If the social media service is not given, it defaults to the value of ;; `hibtypes-social-default-service', initially set to \"twitter\". @@ -32,6 +32,7 @@ ;; facebook@zuck Display user's home page ;; github@rswgnu +;; gitlab@seriyalexandrov ;; instagram@lostart ;; twitter@nytimestravel @@ -90,6 +91,45 @@ ;; +;; Gitlab (remote) reference links +;; +;; gl@rswgnu Display user's home page & projects +;; +;; gitlab#rswgnu/hyperbole Display user's project +;; gl#rswgnu/helm/global_mouse Display user project's branch +;; gl#rswgnu/hyperbole/55a1f0 Display user project's commit diff +;; +;; gl#orgs/gitlab/people List the org, gitlab's staff +;; +;; (setq hibtypes-gitlab-default-user "rswgnu") +;; gitlab#/hyperbole Display default user's project +;; +;; +;; Once you set the default user and project variables, you can leave +;; them off any reference links: +;; +;; (setq hibtypes-gitlab-default-user "emacs-helm") +;; (setq hibtypes-gitlab-default-project "helm") +;; +;; like so: +;; +;; gl#issues List emacs-helm/helm's open issues +;; gl#1878 Display a specific project issue +;; +;; gl#pulls List project's open pull requests +;; gl#pull/1871 Display a specific project pull request +;; +;; gl#branches List project's branches +;; gl#branch/global_mouse List files in a specific branch +;; gl#global_mouse You can even leave off the `branch' keyword +;; +;; gl#tags List project's tagged commits, typically releases +;; gl#tag/v2.8.4 or gl#v2.8.4 List files in a specific tagged commit +;; +;; gl#commits List project's commits +;; gl#898e55c Display default user and default +;; project commit diff + ;; Github (remote) reference links ;; ;; gh@rswgnu Display user's home page & projects @@ -112,12 +152,12 @@ ;; ;; like so: ;; -;; gh#issues List emacs-helm/helm's open issues -;; gh#1878 Display a specific project issue -;; -;; gh#pulls List project's open pull requests +;; gh#pulls List project's open pull requests (PRs) ;; gh#pull/1871 Display a specific project pull request ;; +;; gh#issues List emacs-helm/helm's open issues +;; gh#1878 Display a specific project issue (or PR) +;; ;; gh#branches List project's branches ;; gh#branch/global_mouse List files in a specific branch ;; gh#global_mouse You can even leave off the `branch' keyword @@ -147,6 +187,7 @@ :type '(radio (const "facebook") (const "git") (const "github") + (const "gitlab") (const "instagram") (const "twitter")) :group 'hyperbole-button) @@ -171,6 +212,16 @@ :type 'string :group 'hyperbole-button) +(defcustom hibtypes-gitlab-default-project nil + "Default project name to associate with any Github commit link." + :type 'string + :group 'hyperbole-button) + +(defcustom hibtypes-gitlab-default-user nil + "Default user name to associate with any Github commit link." + :type 'string + :group 'hyperbole-button) + ;;; ************************************************************************ ;;; Private variables ;;; ************************************************************************ @@ -178,6 +229,7 @@ (defconst hibtypes-social-hashtag-alist '(("\\`\\(fb\\|facebook\\)\\'" . "https://www.facebook.com/hashtag/%s") ("\\`\\(gh\\|github\\)\\'" . "https://github.com/%s/%s/%s%s") + ("\\`\\(gl\\|gitlab\\)\\'" . "https://www.gitlab.com/%s/%s/%s%s") ("\\`\\(gt\\|git\\)\\'" . "(cd %s; git %s %s)") ("\\`\\(in\\|instagram\\)\\'" . "https://www.instagram.com/explore/tags/%s/") ("\\`\\(tw\\|twitter\\)\\'" . "https://twitter.com/search?q=%%23%s&src=hashtag") @@ -187,6 +239,7 @@ (defconst hibtypes-social-username-alist '(("\\`\\(fb\\|facebook\\)\\'" . "https://www.facebook.com/%s") ("\\`\\(gh\\|github\\)\\'" . "https://github.com/%s/") + ("\\`\\(gl\\|gitlab\\)\\'" . "https://www.gitlab.com/%s/") ("\\`\\(in\\|instagram\\)\\'" . "https://www.instagram.com/%s/") ("\\`\\(tw\\|twitter\\)\\'" . "https://twitter.com/search?q=@%s") ) @@ -212,8 +265,8 @@ See `ibtypes::social-reference' for format details.") (defib social-reference () "Display the web page associated with a social hashtag or username reference at point. Reference format is: - [facebook|git|github|instagram|twitter]?[#@] or - [fb|gt|gh|in|tw]?[#@]. + [facebook|git|github|gitlab|instagram|twitter]?[#@] or + [fb|gt|gh|gl|in|tw]?[#@]. The first part of the label for a button of this type is the social service name. The service name defaults to the value of @@ -257,6 +310,8 @@ listed in `hibtypes-social-inhibit-modes'." (hact 'git-reference after-hash-str)) ((string-match "\\`\\(gh\\|github\\)#" ref) (hact 'github-reference after-hash-str)) + ((string-match "\\`\\(gl\\|gitlab\\)#" ref) + (hact 'gitlab-reference after-hash-str)) (t (hact 'social-reference service ref-kind-str after-hash-str)))))) ;; Don't make this a defact or its arguments may be improperly expanded as pathnames. @@ -289,10 +344,10 @@ REFERENCE is a string of one of the following forms: or /. is one of these: - one of the words: branches, commits, issues, pulls, or tags; the associated items are listed; + one of the words: branches, commits, issues, pulls, status or tags; the associated items are listed; - one of the words: branch, commit, issue, pull or tag followed by a '/' and - item id; the item is shown; + one of the words: branch, commit, issue, pull or tag followed by a '/' or '=' and + an item-id; the item is shown; an issue reference given by a positive integer, e.g. 92 or prefaced with GH-, e.g. GH-92; the issue is displayed; @@ -314,7 +369,7 @@ PROJECT value is provided, it defaults to the value of (url-to-format (assoc-default "github" hibtypes-social-hashtag-alist #'string-match)) (ref-type)) (when url-to-format - (cond ((string-match "\\`\\(branch\\|commit\\|issue\\|pull\\|tag\\)/" reference) + (cond ((string-match "\\`\\(branch\\|commit\\|issue\\|pull\\|tag\\)[/=]" reference) ;; [branch | commit | issue | pull | tag]/ref-item nil) ((string-match "\\`/?\\(\\([^/#@]+\\)/\\)\\([^/#@]+\\)\\'" reference) @@ -342,14 +397,16 @@ PROJECT value is provided, it defaults to the value of ;; All branches, commits, open issues, pull requests or commit tags reference (setq ref-type reference reference "")) - ((and (< (length reference) 7) (string-match "\\`\\([gG][hH]-\\)?[0-9]+\\'" reference)) - ;; Specific issue reference - (setq ref-type "issues/")) - ((string-match "\\`\\(commit\\|issue\\|pull\\)/" reference) + ((and (< (length reference) 8) (string-match "\\`\\([gG][hH]-\\)?[0-9]+\\'" reference)) + ;; Issue ref-id reference + (setq ref-type "issues/" + reference (substring reference (match-end 1) (match-end 0)))) + ((string-match "\\`\\(commit\\|issue\\|pull\\)[/=]" reference) ;; Specific reference preceded by keyword branch, commit, ;; issue, or pull - (setq ref-type (substring reference 0 (match-end 0)) - reference (substring reference (match-end 0)))) + (setq ref-type (substring reference 0 (match-end 1)) + reference (substring reference (match-end 0)) + ref-type (concat ref-type (if (string-equal ref-type "issue") "s/" "/")))) ((string-match "\\`[0-9a-f]+\\'" reference) ;; Commit reference (setq ref-type "commit/")) @@ -373,6 +430,155 @@ PROJECT value is provided, it defaults to the value of (unless url-to-format (error "(github-reference): Add an entry for github to `hibtypes-social-hashtag-alist'")))))) +;;; Remote Gitlab commit references + +;; Don't make this a defact or its arguments may be improperly expanded as pathnames. +(defun gitlab-reference (reference &optional user project) + "Display the Gitlab entity associated with REFERENCE and optional USER and PROJECT. +REFERENCE is a string of one of the following forms: + + // + / +or /. + + is one of these: + one of the words: activity, analytics, boards or kanban, branches, commits, issues or + list, jobs, labels, members, merge_requests, milestones, pages, pipelines, pipeline_charts, + pulls, schedules, snippets, status or tags; the associated items are listed; + + one of the words: branch, commit(s), issue(s), milestone(s), pull(s), snippet(s) or + tag(s) followed by a '/' or '=' and an item-id; the item is shown; + + an issue reference given by a positive integer, e.g. 92 or prefaced with GL-, e.g. GL-92; + the issue is displayed; + + a commit reference given by a hex number, 55a1f0; the commit diff is displayed; + + a branch or tag reference given by an alphanumeric name, e.g. hyper20; the + files in the branch are listed. + +USER defaults to the value of `hibtypes-gitlab-default-user'. +If given, PROJECT overrides any project value in REFERENCE. If no +PROJECT value is provided, it defaults to the value of +`hibtypes-gitlab-default-project'." + (cond ((or (null reference) (equal reference "")) + (error "(gitlab-reference): Gitlab reference must not be empty")) + ((equal reference "status") + (funcall hibtypes-social-display-function "https://status.gitlab.com")) + (t (let ((case-fold-search t) + (url-to-format (assoc-default "gitlab" hibtypes-social-hashtag-alist #'string-match)) + (ref-type)) + (when url-to-format + (cond ((string-match "\\`\\(branch\\|commits?\\|issues?\\milestones?\\|pulls?\\|snippets?\\|tags?\\)[/=]" reference) + ;; Reference to a specific ref-item + nil) + ((string-match "\\`/?\\(\\([^/#@]+\\)/\\)\\([^/#@]+\\)\\'" reference) + ;; /?user/project + (setq user (or user (match-string-no-properties 2 reference)) + project (or project (match-string-no-properties 3 reference)) + reference nil)) + ((string-match "\\`/?\\(\\([^/#@]+\\)/\\)?\\([^/#@]+\\)/\\([^#@]+\\)\\'" reference) + ;; /?[user/]project/ref-item + (setq user (or user (match-string-no-properties 2 reference)) + project (or project (match-string-no-properties 3 reference)) + reference (match-string-no-properties 4 reference))) + ((string-match "\\`/\\([^/#@]+\\)\\'" reference) + ;; /project + (setq project (or project (match-string-no-properties 1 reference)) + reference nil))) + (unless (stringp user) (setq user hibtypes-gitlab-default-user)) + (unless (stringp project) (setq project hibtypes-gitlab-default-project)) + (when (equal project "pages") + ;; Project web pages use a reverse pages/ URL format + (setq project user + user "pages" + ref-type nil + reference nil)) + (when reference + (cond ((string-match "\\`\\(analytics\\|cycle_analytics\\)\\'" reference) + ;; Project analytics + (setq ref-type "cycle_analytics" + reference "")) + ((string-match "\\`\\(boards\\|kanban\\)\\'" reference) + ;; Kanban-type Issue Stage Boards + (setq ref-type "boards" + reference "")) + ((equal reference "jobs") + ;; Manual/automated project-related jobs that run + (setq ref-type "-/jobs" + reference "")) + ((equal reference "list") + ;; List all issues + (setq ref-type "issues" + reference "")) + ((equal reference "members") + ;; Members of the project + (setq ref-type "project_members" + reference "")) + ((equal reference "pipeline_charts") + ;; Continuous Integration Pipeline Charts + (setq ref-type "pipelines/charts" + reference "")) + ((equal reference "schedules") + ;; Schedules for CI Pipelines + (setq ref-type "pipeline_schedules" + reference "")) + ((string-match "\\`\\(service\\|service_desk\\)\\'" reference) + ;; Project help desk + (setq ref-type "issues/service_desk" + reference "")) + ((member reference '("activity" "branches" "commits" "issues" "labels" + "merge_requests" "milestones" "pages" "pipelines" + "pulls" "snippets" "tags")) + ;; All activity, branches, commits, cycle analytics, open issues, issue labels, + ;; merge requests, milestones, web pages, pull requests, code snippets + ;; or commit tags reference + (setq ref-type reference + reference "")) + ((and (< (length reference) 8) (string-match "\\`\\([gG][lL]-\\)?[0-9]+\\'" reference)) + ;; Issue ref-id reference + (setq ref-type "issues/" + reference (substring reference (match-end 1) (match-end 0)))) + ((string-match "\\`label[/=]" reference) + ;; Labeled category of issues + (setq ref-type "issues?label_name%5B%5D=" + reference (substring reference (match-end 0)))) + ((string-match "\\`\\(commit\\|issues\\|milestones\\|pull\\|snippets\\|tags\\)[/=]" reference) + ;; Ref-id preceded by a keyword + (setq ref-type (concat (substring reference 0 (match-end 1)) "/") + reference (substring reference (match-end 0)))) + ((string-match "\\`\\(issue\\|milestone\\|snippet\\|tag\\)[/=]" reference) + ;; Ref-id preceded by a singular keyword that must be converted to plural + (setq ref-type (concat (substring reference 0 (match-end 1)) "s/") + reference (substring reference (match-end 0)))) + ((string-match "\\`\\(commit\\|pull\\)s[/=]" reference) + ;; Ref-id preceded by a plural keyword that must be converted to singular + (setq ref-type (concat (substring reference 0 (match-end 1)) "/") + reference (substring reference (1+ (match-end 0))))) + ((string-match "\\`[0-9a-f]+\\'" reference) + ;; Commit reference + (setq ref-type "commit/")) + (t + ;; Specific branch or commit tag reference + (setq ref-type "tree/") + (when (string-match "\\`\\(branch\\|tag\\)[/=]" reference) + ;; If preceded by optional keyword, remove that from the reference. + (setq reference (substring reference (match-end 0))))))) + (if (and (stringp user) (stringp project)) + (funcall hibtypes-social-display-function + (setq a (if reference + (format url-to-format user project ref-type reference) + ;; Remove trailing / + (substring (format url-to-format user project "" "") 0 -1)))) + (cond ((and (null user) (null project)) + (error "(gitlab-reference): Set `hibtypes-gitlab-default-user' and `hibtypes-gitlab-default-project'")) + ((null user) + (error "(gitlab-reference): Set `hibtypes-gitlab-default-user'")) + (t + (error "(gitlab-reference): Set `hibtypes-gitlab-default-project'"))))) + (unless url-to-format + (error "(gitlab-reference): Add an entry for gitlab to `hibtypes-social-hashtag-alist'")))))) + ;;; Local git repository commit references (defib git-commit-reference () diff --git a/man/hyperbole.texi b/man/hyperbole.texi index c699a03..e219197 100644 --- a/man/hyperbole.texi +++ b/man/hyperbole.texi @@ -7882,7 +7882,7 @@ When in a Treemacs file browser buffer: (3) at the end of an entry line: invoke @code{action-key-eol-function}, typically to scroll up proportionally, if an Action Key press; invoke @code{assist-key-eol-function}, typically to scroll down proportionally, - if an Asisst Key press; + if an Assist Key press; (4) on the first line of the buffer (other than the end of line), dired is run on the current directory of this Treemacs; (5) at the end of the first or last line of the buffer, -- cgit v1.0 From c0bd5039c510f533b204c13483df4812e713ef15 Mon Sep 17 00:00:00 2001 From: Mats Lidell Date: Sat, 23 Dec 2017 01:33:04 +0100 Subject: Rebuild doc when doc sources have changed --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 56640d2..cfdf7ea 100644 --- a/Makefile +++ b/Makefile @@ -256,18 +256,18 @@ version: doc # Build the Info, HTML and Postscript versions of the user manual and README.md.html. doc: info html pdf README.md.html -texinfo: $(man_dir)/hyperbole.texi $(man_dir)/version.texi $(man_dir)/hkey-help.txt $(man_dir)/im/*.png +TEXINFO_SRC = $(man_dir)/hyperbole.texi $(man_dir)/version.texi $(man_dir)/hkey-help.txt $(man_dir)/im/*.png info: $(man_dir)/hyperbole.info -$(man_dir)/hyperbole.info: texinfo +$(man_dir)/hyperbole.info: $(TEXINFO_SRC) cd $(man_dir) && $(TEXI2INFO) hyperbole.texi html: $(man_dir)/hyperbole.html -$(man_dir)/hyperbole.html: texinfo $(man_dir)/hyperbole.css +$(man_dir)/hyperbole.html: $(TEXINFO_SRC) $(man_dir)/hyperbole.css cd ${man_dir} && $(TEXI2HTML) hyperbole.texi pdf: $(man_dir)/hyperbole.pdf -$(man_dir)/hyperbole.pdf: texinfo +$(man_dir)/hyperbole.pdf: $(TEXINFO_SRC) cd $(man_dir) && $(TEXI2PDF) hyperbole.texi # github-markdown is an npm, installed with: npm install markdown-to-html -g -- cgit v1.0 From afe3db80385135235b62c2cb106f5c001b932bfc Mon Sep 17 00:00:00 2001 From: Bob Weiner Date: Fri, 22 Dec 2017 20:00:21 -0500 Subject: Added 'k' to klink ids exported to html; Added hui-select-get-region*; Extended github-reference and gitlab-reference with 'people' and 'contributors' 2017-12-20 Bob Weiner * kotl/kexport.el (kexport:html-file-klink) (kexport:html): (kexport:html-replacement-alist): Added 'k' to precede klink HTML HREF references since these must start with a letter. * hui-select.el (hui-select-get-region): Added this to be used in other libraries. (hui-select-get-region-boundaries): Added and used in hui-select-thing. 2017-12-19 Bob Weiner * hib-social.el (github-reference, gitlab-reference): Added "people" reference support to list people who are part of a formal organization as well as a "staff" alias. Added "contributors" reference support to list project contributors as well. --- Changes | 16 +++++++ hib-social.el | 131 ++++++++++++++++++++++++++++++----------------------- hui-select.el | 15 +++++- hyrolo.el | 2 +- kotl/kexport.el | 14 +++--- man/hyperbole.texi | 2 +- 6 files changed, 114 insertions(+), 66 deletions(-) diff --git a/Changes b/Changes index c43725c..bccbe59 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,19 @@ +2017-12-20 Bob Weiner + +* kotl/kexport.el (kexport:html-file-klink) + (kexport:html): + (kexport:html-replacement-alist): Added 'k' to precede klink HTML HREF + references since these must start with a letter. + +* hui-select.el (hui-select-get-region): Added this to be used in other libraries. + (hui-select-get-region-boundaries): Added and used in hui-select-thing. + +2017-12-19 Bob Weiner + +* hib-social.el (github-reference, gitlab-reference): Added "people" reference support + to list people who are part of a formal organization as well as a "staff" alias. + Added "contributors" reference support to list project contributors as well. + 2017-12-19 Bob Weiner * hib-social.el (github-reference): Added =item-id syntax. diff --git a/hib-social.el b/hib-social.el index f10eb6c..29df535 100644 --- a/hib-social.el +++ b/hib-social.el @@ -91,45 +91,6 @@ ;; -;; Gitlab (remote) reference links -;; -;; gl@rswgnu Display user's home page & projects -;; -;; gitlab#rswgnu/hyperbole Display user's project -;; gl#rswgnu/helm/global_mouse Display user project's branch -;; gl#rswgnu/hyperbole/55a1f0 Display user project's commit diff -;; -;; gl#orgs/gitlab/people List the org, gitlab's staff -;; -;; (setq hibtypes-gitlab-default-user "rswgnu") -;; gitlab#/hyperbole Display default user's project -;; -;; -;; Once you set the default user and project variables, you can leave -;; them off any reference links: -;; -;; (setq hibtypes-gitlab-default-user "emacs-helm") -;; (setq hibtypes-gitlab-default-project "helm") -;; -;; like so: -;; -;; gl#issues List emacs-helm/helm's open issues -;; gl#1878 Display a specific project issue -;; -;; gl#pulls List project's open pull requests -;; gl#pull/1871 Display a specific project pull request -;; -;; gl#branches List project's branches -;; gl#branch/global_mouse List files in a specific branch -;; gl#global_mouse You can even leave off the `branch' keyword -;; -;; gl#tags List project's tagged commits, typically releases -;; gl#tag/v2.8.4 or gl#v2.8.4 List files in a specific tagged commit -;; -;; gl#commits List project's commits -;; gl#898e55c Display default user and default -;; project commit diff - ;; Github (remote) reference links ;; ;; gh@rswgnu Display user's home page & projects @@ -138,7 +99,8 @@ ;; gh#rswgnu/helm/global_mouse Display user project's branch ;; gh#rswgnu/hyperbole/55a1f0 Display user project's commit diff ;; -;; gh#orgs/github/people List the org, github's staff +;; gh#orgs/github/people (or staff) List the org, github's staff +;; gh#/github/fetch/contributors List contributors to github's fetch project ;; ;; (setq hibtypes-github-default-user "rswgnu") ;; github#/hyperbole Display default user's project @@ -169,6 +131,40 @@ ;; gh#898e55c Display default user and default ;; project commit diff +;; Gitlab (remote) reference links support the same reference types as Github (but +;; substitute the gl# prefix) plus these additional reference types: +;; +;; gl#/libertybsd/libertybsd-status Group and project +;; +;; gl#gitlab-org/gitlab-ce/activity Summarize user's project activity +;; gl#gitlab-org/gitlab-ce/analytics Display user project's cycle_analytics +;; gl#gitlab-org/gitlab-ce/boards Display user project's kanban-type issue boards +;; +;; Once you set the default user and project variables, you can leave +;; them off any reference links: +;; +;; (setq hibtypes-gitlab-default-user "gitlab-org") +;; (setq hibtypes-gitlab-default-project "gitlab-ce") +;; +;; gl#issues or gl#list Display default project's issue list +;; gl#jobs Display default project's computing jobs +;; gl#labels Display default project's issue categories +;; gl#members Display default project's staff list +;; gl#contributors Show contributor push frequency charts +;; gl#merge_requests or gl#pulls Display default project's pull requests +;; gl#milestones Display default project's milestones status +;; gl#pages Display default project's web pages +;; gl#pipelines List build and test sequences +;; gl#pipeline_charts Graphical view of pipeline run results across time +;; gl#schedules Display schedules for project pipelines +;; gl#snippets Project snippets, diffs and text with discussion +;; +;; gl#groups List all available groups of projects +;; gl#projects List all available projects +;; +;; gl#milestone=38 Show a specific project milestone +;; gl#snippet/1689487 Show a specific project snippet + ;;; Code: ;;; ************************************************************************ ;;; Other required Elisp libraries @@ -344,7 +340,8 @@ REFERENCE is a string of one of the following forms: or /. is one of these: - one of the words: branches, commits, issues, pulls, status or tags; the associated items are listed; + one of the words: branches, commits, contributors, issues, people or staff, + pulls, status or tags; the associated items are listed; one of the words: branch, commit, issue, pull or tag followed by a '/' or '=' and an item-id; the item is shown; @@ -386,15 +383,22 @@ PROJECT value is provided, it defaults to the value of ;; /project (setq project (or project (match-string-no-properties 1 reference)) reference nil))) + (when (or (and project (string-match "\\`\\(members\\|people\\|staff\\)\\'" project)) + ;; Change /[members|people|staff] to /orgs//people. + (and reference (string-match "\\`\\(members\\|people\\|staff\\)\\'" reference))) + ;; Change /project/[people|staff] to /orgs//people. + (setq project user + user "orgs" + reference "people")) + (when (equal reference "contributors") + ;; Change /user/project/contributors to /user/project/graphs/contributors. + (setq ref-type "graphs/" + reference "contributors")) (unless (stringp user) (setq user hibtypes-github-default-user)) (unless (stringp project) (setq project hibtypes-github-default-project)) (when reference - (cond ((equal user "orgs") - ;; A specific organization reference - (setq ref-type reference - reference "")) - ((member reference '("branches" "commits" "issues" "pulls" "tags")) - ;; All branches, commits, open issues, pull requests or commit tags reference + (cond ((member reference '("branches" "commits" "contributors" "issues" "people" "pulls" "tags")) + ;; All branches, commits, contributors, open issues, people, pull requests or commit tags reference (setq ref-type reference reference "")) ((and (< (length reference) 8) (string-match "\\`\\([gG][hH]-\\)?[0-9]+\\'" reference)) @@ -420,7 +424,8 @@ PROJECT value is provided, it defaults to the value of (funcall hibtypes-social-display-function (if reference (format url-to-format user project ref-type reference) - (format url-to-format user project "" ""))) + ;; Remove trailing / + (substring (format url-to-format user project "" "") 0 -1))) (cond ((and (null user) (null project)) (error "(github-reference): Set `hibtypes-github-default-user' and `hibtypes-github-default-project'")) ((null user) @@ -439,12 +444,14 @@ REFERENCE is a string of one of the following forms: // / -or /. + // +or / (where a group is a collection of projects). is one of these: - one of the words: activity, analytics, boards or kanban, branches, commits, issues or - list, jobs, labels, members, merge_requests, milestones, pages, pipelines, pipeline_charts, - pulls, schedules, snippets, status or tags; the associated items are listed; + one of the words: activity, analytics, boards or kanban, branches, commits, contributors, + groups, issues or list, jobs, labels, merge_requests, milestones, pages, pipelines, + pipeline_charts, members or people or staff, projects, pulls, schedules, snippets, + status or tags; the associated items are listed; one of the words: branch, commit(s), issue(s), milestone(s), pull(s), snippet(s) or tag(s) followed by a '/' or '=' and an item-id; the item is shown; @@ -486,6 +493,12 @@ PROJECT value is provided, it defaults to the value of ;; /project (setq project (or project (match-string-no-properties 1 reference)) reference nil))) + (when (and (null (and user project)) (string-match "\\`\\(groups\\|projects\\)\\'" reference)) + ;; List all available groups of projects or projects. + (setq user "explore" + project (match-string-no-properties 1 reference) + ref-type nil + reference nil)) (unless (stringp user) (setq user hibtypes-gitlab-default-user)) (unless (stringp project) (setq project hibtypes-gitlab-default-project)) (when (equal project "pages") @@ -511,14 +524,20 @@ PROJECT value is provided, it defaults to the value of ;; List all issues (setq ref-type "issues" reference "")) - ((equal reference "members") - ;; Members of the project + ((equal reference "contributors") + (setq ref-type "graphs/master" + reference "")) + ((string-match "\\`\\(members\\|people\\|staff\\)\\'" reference) (setq ref-type "project_members" reference "")) ((equal reference "pipeline_charts") ;; Continuous Integration Pipeline Charts (setq ref-type "pipelines/charts" reference "")) + ((equal reference "pulls") + ;; Merge requests for the project + (setq ref-type "merge_requests" + reference "")) ((equal reference "schedules") ;; Schedules for CI Pipelines (setq ref-type "pipeline_schedules" @@ -529,9 +548,9 @@ PROJECT value is provided, it defaults to the value of reference "")) ((member reference '("activity" "branches" "commits" "issues" "labels" "merge_requests" "milestones" "pages" "pipelines" - "pulls" "snippets" "tags")) + "snippets" "tags")) ;; All activity, branches, commits, cycle analytics, open issues, issue labels, - ;; merge requests, milestones, web pages, pull requests, code snippets + ;; members, merge requests, milestones, web pages, pull requests, code snippets ;; or commit tags reference (setq ref-type reference reference "")) diff --git a/hui-select.el b/hui-select.el index 6474acf..a12365e 100644 --- a/hui-select.el +++ b/hui-select.el @@ -310,6 +310,19 @@ Also, add language-specific syntax setups to aid in thing selection." (setq sentence-end "\\([^ \t\n\r>]<\\|>\\(<[^>]*>\\)*\\|[.?!][]\"')}]*\\($\\| $\\|\t\\| \\)\\)[ \t\n]*") (define-key web-mode-map "\C-c." 'hui-select-goto-matching-tag)))) +(defun hui-select-get-region-boundaries () + "Return the (START . END) boundaries of region for `hui-select-thing'." + (or (hui-select-boundaries (point)) + (when (eq hui-select-previous 'punctuation) + (hui-select-word (point))))) + +;;;###autoload +(defun hui-select-get-region () + "Return the region that `hui-select-thing' would select." + (let ((region-bounds (hui-select-get-region-boundaries))) + (when region-bounds + (buffer-substring-no-properties (car region-bounds) (cdr region-bounds))))) + ;;;###autoload (defun hui-select-thing () "Select a region based on the syntax of the thing at point. @@ -325,7 +338,7 @@ interactively, the type of selection is displayed in the minibuffer." ;; Reset selection based on the syntax of character at point. (hui-select-reset) nil))) - (let ((region (hui-select-boundaries (point)))) + (let ((region (hui-select-get-region-boundaries))) (unless region (when (eq hui-select-previous 'punctuation) (setq region (hui-select-word (point))))) diff --git a/hyrolo.el b/hyrolo.el index 00e3f39..1d61a46 100644 --- a/hyrolo.el +++ b/hyrolo.el @@ -694,7 +694,7 @@ If ARG is zero, move to the beginning of the current line." (if (null arg) (setq arg 1)) (forward-visible-line arg)) -;; Derived from `sort-lines' in "sort.el" since through Emacs 25.0 +;; Derived from `sort-lines' in "sort.el" since through at least Emacs 25.0 ;; invisible lines are not grouped with the prior visible line, making ;; rolo entry (or any record) sorts fail. This next function fixes that. (defun hyrolo-sort-lines (reverse beg end) diff --git a/kotl/kexport.el b/kotl/kexport.el index 1e9dc09..cea41c6 100644 --- a/kotl/kexport.el +++ b/kotl/kexport.el @@ -88,10 +88,10 @@ ;; make klinks into hyperlinks (cons (concat "<\\s-*@\\s-*" kexport:kcell-reference-regexp "[^&>]*>") - "\\0") + "\\0") (cons (format "<\\s-*@\\s-*\\(%s\\)[^=&>]*>" kexport:kcell-partial-reference-regexp) - "\\0") + "\\0") (cons (format "<\\s-*\\([^ \t\n\r,<>]+\\)\\s-*,\\s-*%s[^=&>]*>" kexport:kcell-reference-regexp) 'kexport:html-file-klink) @@ -170,7 +170,7 @@ STILL TODO: title))) (princ "\n\n") - (princ "\n") + (princ "\n") (princ (format "%s\n" title)) (if kexport:html-description (princ (format "\n" @@ -196,8 +196,8 @@ STILL TODO: (setq i (1- i))) (princ "\n") (setq label (kcell-view:label)) - (princ (format "" label)) - (princ (format "\n" (kcell-view:idstamp))) + (princ (format "" label)) + (princ (format "\n" (kcell-view:idstamp))) (princ "\n" @@ -236,8 +236,8 @@ Works exclusively within a call to `hypb:replace-match-string'." (match-end 1)))) (if (equal filename (file-name-nondirectory kexport:input-filename)) - "\\0" - (format "\\0" + "\\0" + (format "\\0" (expand-file-name filename (if kexport:input-filename (file-name-directory diff --git a/man/hyperbole.texi b/man/hyperbole.texi index e219197..4a6aa37 100644 --- a/man/hyperbole.texi +++ b/man/hyperbole.texi @@ -1517,7 +1517,7 @@ windows, instead use the @bkbd{M-o t } key sequ @c normally under Hyperbole. @c The code for Smart Key modifiers can be found in -@c @file{@code{$@{hyperb:dir@}}/hmouse-mod.el}. +@c @file{$@{hyperb:dir@}/hmouse-mod.el}. @node Buttons, Menus, Smart Keys, Top -- cgit v1.0 From 66106d3249a784f7c970423dec7c45ccd8945206 Mon Sep 17 00:00:00 2001 From: Bob Weiner Date: Fri, 29 Dec 2017 09:33:09 -0500 Subject: Fixed issue with inhibit-hyperbole-messaging not be set properly --- Changes | 5 +++++ hsettings.el | 18 ++++++++++++++++++ hyperbole.el | 18 ------------------ 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Changes b/Changes index bccbe59..a9a9bae 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +2017-12-29 Bob Weiner + +* hsettings.el (inhibit-hyperbole-messaging): Moved this from hyperbole.el to here to prevent + it being reset when hyperbole-toggle-messaging reloads the hyperbole library. + 2017-12-20 Bob Weiner * kotl/kexport.el (kexport:html-file-klink) diff --git a/hsettings.el b/hsettings.el index a980698..d3c37f5 100644 --- a/hsettings.el +++ b/hsettings.el @@ -149,6 +149,24 @@ package to display search results." search-term))) (user-error "(Hyperbole): Invalid web search service `%s'" service-name)))) +(defcustom inhibit-hyperbole-messaging t + "*Determines whether Hyperbole supports explicit buttons in mail and news buffers. +The default of t means disable such support (work remains to +modernize these features). When t, Hyperbole will not alter +messaging mode hooks nor overload functions from these packages, +preventing potential incompatibilities. + +If you want to use Hyperbole buttons in mail and news buffers, set +this variable to nil by adding (hyperbole-toggle-messaging 1) +to your personal Emacs initialization file, prior to loading +Hyperbole, and then restart Emacs." + :type 'boolean + :initialize 'custom-initialize-set + :set (lambda (symbol value) + ;; Invert value to produce ARG for hyperbole-toggle-messaging. + (hyperbole-toggle-messaging (if value 0 1))) + :group 'hyperbole-buttons) + (defcustom hyperbole-web-search-browser-function browse-url-browser-function "*Function of one url argument called by any Hyperbole Find/Web search." :type 'boolean diff --git a/hyperbole.el b/hyperbole.el index 1128370..c1fbcbe 100644 --- a/hyperbole.el +++ b/hyperbole.el @@ -177,24 +177,6 @@ context (wherever point is). {C-u \\[hkey-help]} shows what the Assist Key will :type 'boolean :group 'hyperbole-keys) -(defcustom inhibit-hyperbole-messaging t - "*Determines whether Hyperbole supports explicit buttons in mail and news buffers. -The default of t means disable such support (work remains to -modernize these features). When t, Hyperbole will not alter -messaging mode hooks nor overload functions from these packages, -preventing potential incompatibilities. - -If you want to use Hyperbole buttons in mail and news buffers, set -this variable to nil by adding (hyperbole-toggle-messaging t) -to your personal Emacs initialization file, prior to loading -Hyperbole, and then restart Emacs." - :type 'boolean - :initialize (lambda (symbol value) (set symbol value)) - :set (lambda (symbol value) - (set symbol (not value)) - (hyperbole-toggle-messaging nil)) - :group 'hyperbole-buttons) - ;;; ************************************************************************ ;;; Public key bindings ;;; ************************************************************************ -- cgit v1.0 From 58920837c68ecf5035228f209e1de0a81b83b417 Mon Sep 17 00:00:00 2001 From: Mats Lidell Date: Fri, 20 Apr 2018 23:12:07 +0200 Subject: Use new treemacs 1.18 function treemacs-toggle-node Remove use of deprecated function treemacs-push-button and update the version check for 1.18 both loading el and elc file. --- hui-treemacs.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hui-treemacs.el b/hui-treemacs.el index db1aee6..ca947d8 100644 --- a/hui-treemacs.el +++ b/hui-treemacs.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 19-Nov-17 ;; -;; Copyright (C) 2017 Free Software Foundation, Inc. +;; Copyright (C) 2017-2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -18,9 +18,9 @@ (eval-and-compile (require 'treemacs nil t)) -(eval-when (load) - (unless (>= (string-to-number treemacs-version) 1.14) - (error "(hui-treemacs): Hyperbole requires Treemacs package version 1.14 or greater"))) +(progn () + (unless (>= (string-to-number treemacs-version) 1.18) + (error "(hui-treemacs): Hyperbole requires Treemacs package version 1.18 or greater"))) ;;; ************************************************************************ ;;; smart-treemacs functions @@ -65,7 +65,7 @@ If key is pressed: (hact 'link-to-buffer-tmp (seq-elt result 0) (seq-elt result 1)) ;; (bufferp result) (hact 'link-to-buffer-tmp result)) - (treemacs-push-button current-prefix-arg)))))) + (treemacs-toggle-node current-prefix-arg)))))) ;;;###autoload (defun smart-treemacs-modeline () -- cgit v1.0 From d4653c540b98b0aa13b5de9daf500ebe2a1e36cf Mon Sep 17 00:00:00 2001 From: Mats Lidell Date: Fri, 11 May 2018 00:57:03 +0200 Subject: Require 2.0 of treemacs and use bury-buffer treemacs-toogle has been removed and replaced by using bury-buffer so use that too. --- hui-treemacs.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hui-treemacs.el b/hui-treemacs.el index ca947d8..7994a7a 100644 --- a/hui-treemacs.el +++ b/hui-treemacs.el @@ -19,8 +19,8 @@ (eval-and-compile (require 'treemacs nil t)) (progn () - (unless (>= (string-to-number treemacs-version) 1.18) - (error "(hui-treemacs): Hyperbole requires Treemacs package version 1.18 or greater"))) + (unless (>= (string-to-number treemacs-version) 2.0) + (error "(hui-treemacs): Hyperbole requires Treemacs package version 2.0 or greater"))) ;;; ************************************************************************ ;;; smart-treemacs functions @@ -51,10 +51,10 @@ If key is pressed: (interactive) (cond ((first-line-p) (if (eolp) - (treemacs-toggle) + (bury-buffer) (hact 'link-to-directory default-directory))) ((and (last-line-p) (eolp)) - (treemacs-toggle)) + (bury-buffer)) ((eolp) (funcall (if assist-flag assist-key-eol-function action-key-eol-function))) (t (let ((over-icon (and (treemacs-current-button) @@ -86,7 +86,7 @@ Suitable for use as a value of `action-key-modeline-buffer-id-function'." (treemacs-is-treemacs-window? action-key-depress-window) (string-match " Treemacs " (format-mode-line mode-line-format))) ;; Quit/hide treemacs. - (treemacs-toggle)) + (bury-buffer)) ;; ;; Treemacs is visible and displaying the same dir as ;; the default dir of the clicked on modeline. @@ -95,7 +95,7 @@ Suitable for use as a value of `action-key-modeline-buffer-id-function'." (with-current-buffer (treemacs-buffer-exists?) default-directory))) ;; Quit/hide treemacs. - (treemacs-toggle)) + (bury-buffer)) ;; ;; Otherwise, invoke treemacs on the default dir of the clicked on modeline. (t (treemacs)))) -- cgit v1.0 From f5f52449266809ed08301e576e3f0d53d98ebf00 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 18 May 2018 22:10:56 -0400 Subject: Fix compilation: don't burp if hui-window is loaded before hui-mouse * hmouse-drv.el: Just require `hui-window` without messing with `hmouse-alist` any more. Move compiler-silencing `defvar`s outside of `eval-when-compile`. * hui-mouse.el: Just use `require` instead of `load`. * hui-window.el: Set hmouse-alist only after loading hui-mouse. (hui-window--register): New function. (hui-mouse): Use with-eval-after-load. --- hmouse-drv.el | 12 ++++-------- hui-mouse.el | 4 ++-- hui-window.el | 9 +++++---- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/hmouse-drv.el b/hmouse-drv.el index 318b62e..6952986 100644 --- a/hmouse-drv.el +++ b/hmouse-drv.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 04-Feb-90 ;; -;; Copyright (C) 1989-2017 Free Software Foundation, Inc. +;; Copyright (C) 1989-2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -16,16 +16,12 @@ ;;; Other required Elisp libraries ;;; ************************************************************************ -(eval-when-compile - (defvar hmouse-alist nil) - (require 'hui-window) - (makunbound 'hmouse-alist)) ;; for `hmouse-drag-item-to-display' +(require 'hui-window) (require 'hypb) ;; Quiet byte compiler warnings for these free variables. -(eval-when-compile - (defvar hkey-action nil) - (defvar pred-value nil)) +(defvar hkey-action) +(defvar pred-value) ;;; ************************************************************************ ;;; Public variables diff --git a/hui-mouse.el b/hui-mouse.el index 000bbcc..922df5d 100644 --- a/hui-mouse.el +++ b/hui-mouse.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 04-Feb-89 ;; -;; Copyright (C) 1991-2017 Free Software Foundation, Inc. +;; Copyright (C) 1991-2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -390,7 +390,7 @@ smart keyboard keys.") (require 'hmouse-key) ;; This next library adds drag actions to `hmouse-alist'. -(load "hui-window") +(require 'hui-window) ;;; ************************************************************************ ;;; support code diff --git a/hui-window.el b/hui-window.el index d58e602..87b6364 100644 --- a/hui-window.el +++ b/hui-window.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 21-Sep-92 ;; -;; Copyright (C) 1992-2017 Free Software Foundation, Inc. +;; Copyright (C) 1992-2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -171,9 +171,9 @@ drag release window.") ;;; ;;; Add window handling to hmouse-alist dispatch table. -;;; -(if (not (boundp 'hmouse-alist)) - (error "\"hui-window.el\": `hmouse-alist' must be defined before loading this.") + +(defvar hmouse-alist) +(defun hui-window--register () (unless (assoc #'(hmouse-inactive-minibuffer-p) hmouse-alist) (setq hmouse-alist (append @@ -241,6 +241,7 @@ drag release window.") ;; ) hmouse-alist)))) +(with-eval-after-load 'hui-mouse (hui-window--register)) ;;; ************************************************************************ ;;; Public functions -- cgit v1.0 From ad584fd453c783957dc08513be91a31c95cfea37 Mon Sep 17 00:00:00 2001 From: Mats Lidell Date: Sun, 20 May 2018 00:06:47 +0200 Subject: Use implicit button org-mode also for org derived modes Plus force cycling through all display views for a heading. --- hsys-org.el | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/hsys-org.el b/hsys-org.el index f9604db..05ae899 100644 --- a/hsys-org.el +++ b/hsys-org.el @@ -4,16 +4,16 @@ ;; ;; Orig-Date: 2-Jul-16 at 14:54:14 ;; -;; Copyright (C) 2016 Free Software Foundation, Inc. +;; Copyright (C) 2016,2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. ;;; Commentary: ;; -;; This defines a context-sensitive implicit button type, org-mode, triggered -;; when the major mode is org-mode and point is anywhere other than -;; the end of a line. +;; This defines a context-sensitive implicit button type, org-mode, +;; triggered when the major mode is org-mode or is derived from org +;; mode and point is anywhere other than at the end of a line. ;; When: ;; on an Org mode link - displays the link referent ;; on an Org mode heading - cycles through the available display @@ -28,6 +28,20 @@ (require 'hbut) (require 'org) +(defun hsys-org-cycle () + "Call org-cycle faking this- and last-command in order to cycle +through all states" + (setq last-command 'org-cycle + this-command 'org-cycle) + (org-cycle)) + +(defun hsys-org-global-cycle () + "Call org-global-cycle faking this- and last-command in order +to cycle through all states" + (setq last-command 'org-cycle + this-command 'org-cycle) + (org-global-cycle nil)) + ;;; ************************************************************************ ;;; Public Button Types ;;; ************************************************************************ @@ -37,22 +51,22 @@ The variable, `browse-url-browser-function', customizes the url browser that is used for urls. Valid values of this variable include `browse-url-default-browser' and `browse-url-generic'." - (when (eq major-mode 'org-mode) + (when (derived-mode-p 'org-mode) (cond ((org-link-at-p) (hact 'org-link nil)) ((org-at-heading-p) - (hact 'org-cycle nil)) + (hact 'hsys-org-cycle)) (t (hact 'org-meta-return))))) (defun org-mode:help (&optional _but) "If on an Org mode heading, cycles through views of the whole buffer outline. If on an Org mode link, displays standard Hyperbole help." - (when (eq major-mode 'org-mode) + (when (derived-mode-p 'org-mode) (cond ((org-link-at-p) (hkey-help current-prefix-arg) t) ((org-at-heading-p) - (org-global-cycle nil) + (hact 'hsys-org-global-cycle) t)))) (defact org-link (link) -- cgit v1.0 From 45a08418c3b2b1568a531998b606c442452e641f Mon Sep 17 00:00:00 2001 From: Mats Lidell Date: Sun, 20 May 2018 23:43:36 +0200 Subject: Add default search term for web searches When region is active and not to big the selected text is used as a default search term. This make it convenient to mark text and use that for different types of web searches. --- hsettings.el | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hsettings.el b/hsettings.el index d3c37f5..48ade5c 100644 --- a/hsettings.el +++ b/hsettings.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 15-Apr-91 at 00:48:49 ;; -;; Copyright (C) 1991-2017 Free Software Foundation, Inc. +;; Copyright (C) 1991-2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -123,6 +123,19 @@ down a windowful." (hyperbole-menubar-menu) (hyperbole-minibuffer-menu)) +(defcustom hyperbole-default-web-search-term-max-lines 2 + "Provide a default search term using the selected text if the +active region contains less than or equal to this number of +lines" + :type 'integer + :group 'hyperbole-commands) + +(defun hyperbole-default-web-search-term () + "Fetch a default search term if region is active and not to big" + (and (region-active-p) + (<= (count-lines (region-beginning) (region-end)) hyperbole-default-web-search-term-max-lines) + (buffer-substring (region-beginning) (region-end)))) + (defun hyperbole-read-web-search-arguments (&optional service-name search-term) "Read from the keyboard a list of (web-search-service-string search-term-string) if not given as arguments." (let ((completion-ignore-case t)) @@ -130,7 +143,8 @@ down a windowful." (setq service-name (completing-read "Search service: " hyperbole-web-search-alist nil t))) (while (or (not (stringp search-term)) (equal search-term "")) - (setq search-term (read-string (format "Search %s for: " service-name)))) + (setq search-term (read-string (format "Search %s for: " service-name) + (hyperbole-default-web-search-term)))) (list service-name search-term))) (defun hyperbole-web-search (&optional service-name search-term) -- cgit v1.0 From 450489ed67a192bde6504370f2fdf850c54ea7e4 Mon Sep 17 00:00:00 2001 From: Mats Lidell Date: Wed, 6 Jun 2018 22:58:46 +0200 Subject: Adjust tramp-file-name-regexp to work with looking-at Recent updates to tramp have introduced an ending match of empty string that does not work together with looking-at as used in hpath. A promising alternative to this change would be to use file-remote-p in combination with a regexp that finds a possible filename after point. This would remove the dependency on the internal regexp in tramp. --- hpath.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/hpath.el b/hpath.el index d26678d..9e076e9 100644 --- a/hpath.el +++ b/hpath.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 1-Nov-91 at 00:44:23 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2016, 2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -372,6 +372,15 @@ directories. The first one in which PATH is found is used." (or (file-exists-p rtn) (setq rtn nil))) (or rtn path))))) +(defun hpath:tramp-file-name-regexp () + "Returns a modified tramp-file-name-regexp used for checking if +point is at the beginning of a remote file name. Removes match +to bol and remove match to empty string if present." + (let ((tramp-regexp (car (if (fboundp 'tramp-file-name-structure) + (tramp-file-name-structure) + tramp-file-name-structure)))) + (substring-no-properties (replace-regexp-in-string "\\\\'" "" tramp-regexp) 1))) + (defun hpath:remote-at-p () "Returns a remote pathname that point is within or nil. See the `(emacs)Remote Files' info documentation for pathname format details. @@ -385,10 +394,7 @@ Always returns nil if (hpath:remote-available-p) returns nil." (skip-chars-backward "^[ \t\n\r\f\"`'|\(\{<") (cond ((and (eq remote-package 'tramp) - ;; Remove match to bol in this regexp before testing. - (looking-at (substring-no-properties (car (if (fboundp 'tramp-file-name-structure) - (tramp-file-name-structure) - tramp-file-name-structure)) 1))) + (looking-at (hpath:tramp-file-name-regexp))) (match-string-no-properties 0)) ((looking-at hpath:url-regexp) (if (string-equal (match-string-no-properties hpath:protocol-grpn) "ftp") -- cgit v1.0 From 2e878cbf1993485fba3b2581e84ce77d22b4e56a Mon Sep 17 00:00:00 2001 From: Bob Weiner Date: Sun, 13 Jan 2019 10:43:20 -0500 Subject: Initial commit of Windows path handling --- hibtypes.el | 11 ++++++++--- hpath.el | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 5 deletions(-) mode change 100644 => 100755 hibtypes.el mode change 100644 => 100755 hpath.el diff --git a/hibtypes.el b/hibtypes.el old mode 100644 new mode 100755 index 47af123..f4dd991 --- a/hibtypes.el +++ b/hibtypes.el @@ -177,6 +177,12 @@ See `hpath:find' function documentation for special file display options." ;;; Displays files at specific lines and optional column number locations. ;;; ======================================================================== +(defconst hibtypes-path-line-and-col-regexp + (if (eq system-type 'windows-nt) + ;; Allow for 'c:' single letter drive prefixes on Windows + "\\([^ \t\n\r:][^ \t\n\r]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?" + "\\([^ \t\n\r:]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?")) + (defib pathname-line-and-column () "Makes a valid pathname:line-num[:column-num] pattern display the path at line-num and optional column-num. Also works for remote pathnames. @@ -187,8 +193,7 @@ removed from pathname when searching for a valid match. See `hpath:find' function documentation for special file display options." (let ((path-line-and-col (hpath:delimited-possible-path))) (if (and (stringp path-line-and-col) - (string-match "\\([^ \t\n\r:]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?" - path-line-and-col)) + (string-match hibtypes-path-line-and-col-regexp path-line-and-col)) (let ((file (expand-file-name (match-string-no-properties 1 path-line-and-col))) (line-num (string-to-number (match-string-no-properties 2 path-line-and-col))) (col-num (if (match-end 3) (string-to-number (match-string-no-properties @@ -740,7 +745,7 @@ This works with JavaScript and Python tracebacks, gdb, dbx, and xdb. Such lines (save-excursion (beginning-of-line) (cond - ;; Python pdb + ;; Python pdb or traceback ((looking-at ".+ File \"\\([^\"\n\r]+\\)\", line \\([0-9]+\\)") (let* ((file (match-string-no-properties 1)) (line-num (match-string-no-properties 2)) diff --git a/hpath.el b/hpath.el old mode 100644 new mode 100755 index d26678d..a391447 --- a/hpath.el +++ b/hpath.el @@ -40,6 +40,35 @@ Default is `nil' since this can slow down normal file finding." :group 'hyperbole-buttons) ;;; ************************************************************************ +;;; MS WINDOWS PATH CONVERSIONS +;;; ************************************************************************ + +(defvar hpath:windows-mount-prefix "/mnt" + "Unix-style path prefix to add when converting MS Windows drive paths.") + +(defvar hpath:windows-system-type-list '(cygwin windows-nt ms-dos) + "List of 'system-type' values for which Windows paths are not converted to UNIX-style.") + +(defun hpath:windows-to-unix-path(path) + "Convert a recognizable Windows path to a UNIX-style path. +If path begins with a Windows drive letter, prefix the converted path with the value of 'windows-mount-prefix'." + (if (not (memq system-type hpath:windows-system-type-list)) + ;; Convert Windows disk drive paths to UNIX-style with a mount prefix. + (cond ((and (stringp path) (string-match "\\`\\([a-zA-Z]\\):" path)) + (expand-file-name + (concat (match-string 1 path) "/" (substring path (match-end 0))) + hpath:windows-mount-prefix)) + ;; !! Finish handling Windows network paths with forward + ;; or backward slashes + ((and (stringp path) (string-match "\\`\\(//\\|\\\\\\\\\\)[^/\\]" path)) + path) + (t path)))) + +;; Replace all backslashes with forward slashes in path +;;(defun a (path) +;; (regexp-re + +;;; ************************************************************************ ;;; FILE VIEWER COMMAND SETTINGS ;;; ************************************************************************ @@ -854,7 +883,7 @@ nonexistent local paths are allowed." (not (string-match "[\t\n\r\"`'|{}\\]" path)) (or (not (hpath:www-p path)) (string-match "\\`ftp[:.]" path)) - (let ((remote-path (string-match "@.+:\\|^/.+:\\|.+:/" path))) + (let ((remote-path (string-match "@.+:\\|^/.+:\\|..+:/" path))) (if (cond (remote-path (cond ((eq type 'file) (not (string-equal "/" (substring path -1)))) @@ -1271,7 +1300,7 @@ Returns \"anonymous\" if no default user is set." string))) (defun hpath:exists-p (path &optional suffix-flag) - "Return PATH if it exists. (This does not mean you can read it.) + "Return PATH if it exists. (This does not mean you can read it). If PATH exists with or without a suffix from hpath:suffixes, then that pathname is returned. -- cgit v1.0 From 09e646e163135178d504a126bb4d1658aa45300e Mon Sep 17 00:00:00 2001 From: Bob Weiner Date: Mon, 21 Jan 2019 18:05:09 -0500 Subject: Add implicit path button support for MSWindows paths --- Changes | 10 +++++++ HY-NEWS | 7 ++--- hargs.el | 9 ++++--- hpath.el | 87 ++++++++++++++++++++++++++++++++++++++++-------------------- hyperbole.el | 11 +++++--- 5 files changed, 83 insertions(+), 41 deletions(-) diff --git a/Changes b/Changes index a9a9bae..11b6821 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,13 @@ +2019-01-21 Bob Weiner + +* hpath.el (hpath:mswindows-mount-prefix, hpath:mswindows-drive-regexp) + (hpath:mswindows-to-posix-path, hpath:mswindows-to-posix-separators): + Added to handle MSWindows path under POSIX OSes, e.g. Windows Subsystem for Linux. + (hpath:find-program): Commented out call to hpath:find-file-mailcap to prevent use of + MIME external viewers on text files. + hargs.el (hargs:delimited): Added call to hpath:mswindows-to-posix-path. + hyperbole.el (hyperb:init): Abbreviated MSWindows mount point paths. + 2017-12-29 Bob Weiner * hsettings.el (inhibit-hyperbole-messaging): Moved this from hyperbole.el to here to prevent diff --git a/HY-NEWS b/HY-NEWS index 2c9ef33..40fcdca 100644 --- a/HY-NEWS +++ b/HY-NEWS @@ -149,7 +149,7 @@ explicit buttons are highlighted with a special colored face or not. By default, they are. - - Python PDB Backtraces: Action Key presses jump to the associated source + - Python Backtraces: Action Key presses jump to the associated source line. - Python Symbols: Action Key presses now look these up in any buffer whose @@ -164,7 +164,7 @@ source of any such lines. - Dired Quit: An Action Key press at the end of the first line in a Dired - buffer nows quit and execute requested actions, just as presses at the + buffer now quits and executes requested actions, just as presses at the end of the buffer do. - Image Thumbnail Browsing: See the Info manual section, @@ -356,9 +356,6 @@ new settings with {M-x hmouse-update-smart-keys RET}. No need to reload or restart Hyperbole. - - Find Web: Added Find Web key binding entry to Hyperbole menus. This key - displays the Hyperbole Web search menu. - - Jump Thing: Added Jump Thing key binding entry to Hyperbole menus. This key jumps between the start and end of a matching delimiter or tag pair. diff --git a/hargs.el b/hargs.el index 50cea02..bb3ac5f 100644 --- a/hargs.el +++ b/hargs.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 31-Oct-91 at 23:17:35 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2019 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -128,9 +128,10 @@ With optional LIST-POSITIONS-FLAG, return list of (string-matched start-pos end (setq end (1- end)) t) (< start end) - (let ((string (substring-no-properties - (hypb:replace-match-string - "[\n\r]\\s-*" (buffer-substring start end) " " t)))) + (let ((string (buffer-substring-no-properties start end))) + (setq string (hypb:replace-match-string "[\n\r]\\s-*" string " " t)) + (unless hyperb:microcruft-os-p + (setq string (hpath:mswindows-to-posix-path string))) (if list-positions-flag (list string start end) string))))))) diff --git a/hpath.el b/hpath.el index a391447..8e13d55 100755 --- a/hpath.el +++ b/hpath.el @@ -1,10 +1,10 @@ -;;; hpath.el --- GNU Hyperbole support routines for handling UNIX paths +;;; hpath.el --- GNU Hyperbole support routines for handling POSIX and MSWindows paths ;; ;; Author: Bob Weiner ;; ;; Orig-Date: 1-Nov-91 at 00:44:23 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2019 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -43,30 +43,55 @@ Default is `nil' since this can slow down normal file finding." ;;; MS WINDOWS PATH CONVERSIONS ;;; ************************************************************************ -(defvar hpath:windows-mount-prefix "/mnt" - "Unix-style path prefix to add when converting MS Windows drive paths.") - -(defvar hpath:windows-system-type-list '(cygwin windows-nt ms-dos) - "List of 'system-type' values for which Windows paths are not converted to UNIX-style.") - -(defun hpath:windows-to-unix-path(path) - "Convert a recognizable Windows path to a UNIX-style path. -If path begins with a Windows drive letter, prefix the converted path with the value of 'windows-mount-prefix'." - (if (not (memq system-type hpath:windows-system-type-list)) - ;; Convert Windows disk drive paths to UNIX-style with a mount prefix. - (cond ((and (stringp path) (string-match "\\`\\([a-zA-Z]\\):" path)) - (expand-file-name - (concat (match-string 1 path) "/" (substring path (match-end 0))) - hpath:windows-mount-prefix)) - ;; !! Finish handling Windows network paths with forward - ;; or backward slashes - ((and (stringp path) (string-match "\\`\\(//\\|\\\\\\\\\\)[^/\\]" path)) - path) - (t path)))) - -;; Replace all backslashes with forward slashes in path -;;(defun a (path) -;; (regexp-re +;; This section adds automatic recognition of MSWindows implicit path +;; links and converts disk drive and path separators to whatever +;; format is needed by the underlying OS upon which Emacs is one, +;; notably either for POSIX or MSWindows (with no POSIC layer). + +;; Especially useful when running Emacs under Windows Subsystem for +;; Linux (WSL) where the system-type variable is gnu/linux but +;; MSWindows is underneath so the user likely has many Windows +;; formatted links. + +;; See "https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats" +;; and "https://docs.microsoft.com/en-us/windows/wsl/interop" for +;; Windows path specifications and use under WSL. + +(defvar hpath:mswindows-mount-prefix + (cond ((eq system-type 'cygwin) + "/cygdrive/") + (hyperb:microcruft-os-p + "") + (t ;; POSIX + "/mnt/")) + "Path prefix to add when converting MSWindows drive paths to POSIX-style. +Must include a trailing directory separator or be nil.") + +(defconst hpath:mswindows-drive-regexp "\\`[\\/]?\\([a-zA-Z]\\)[:/]" + "Regular expression matching an MSWindows drive letter at the beginning of a path string.") + +(defconst hpath:mswindows-path-regexp "\\`.*\\.*[a-zA-Z0-9_.]" + "Regular expression matching the start of an MSWindows path that does not start with a drive letter but contains directory separators.") + +(defun hpath:mswindows-to-posix-path (path) + "Convert a recognizable MSWindows PATH to a POSIX-style path or return the path unchanged. +If path begins with an MSWindows drive letter, prefix the converted path with the value of 'hpath:mswindows-mount-prefix'." + (when (stringp path) + (cond ((string-match hpath:mswindows-drive-regexp path) + ;; Convert Windows disk drive paths to POSIX-style with a mount prefix. + (setq path (concat hpath:mswindows-mount-prefix (downcase (match-string 1 path)) + (if hyperb:microcruft-os-p ":" "/") + (substring path (match-end 0))) + path (hpath:mswindows-to-posix-separators path))) + ((string-match hpath:mswindows-path-regexp path) + (setq path (hpath:mswindows-to-posix-separators path))))) + path) + +(defun hpath:mswindows-to-posix-separators (path) + "Replace all backslashes with forward slashes in PATH and abbreviate the path if possible. +Path must be a string or an error will be triggered. See +'abbreviate-file-name' for how path abbreviation is handled." + (abbreviate-file-name (replace-regexp-in-string "\\\\" "/" path))) ;;; ************************************************************************ ;;; FILE VIEWER COMMAND SETTINGS @@ -831,7 +856,7 @@ See also `hpath:internal-display-alist' for internal, window-system independent (cons "next" hpath:external-display-alist-macos))))))) (defun hpath:is-p (path &optional type non-exist) - "Returns PATH if PATH is a Unix path, else nil. + "Returns PATH if PATH is a Posix path, else nil. If optional TYPE is the symbol 'file or 'directory, then only that path type is accepted as a match. The existence of the path is checked only for locally reachable paths (Info paths are not checked). Single spaces are @@ -1021,7 +1046,7 @@ After any match, the resulting path will contain a varible reference like ${vari ))) ;; -;; The following function recursively resolves all UNIX links to their +;; The following function recursively resolves all POSIX links to their ;; final referents. ;; Works with variable-based and other strange links like: ;; /usr/local -> $(SERVER_LOCAL)/usr/local, /usr/bin -> @@ -1359,7 +1384,11 @@ See also documentation for the function (hpath:get-external-display-alist) and t ((and (fboundp 'image-mode) (string-match hpath:native-image-suffixes filename)) nil) - (t (hpath:find-file-mailcap filename)))) + ;; 01/21/2019 - RSW commented this next line out since it can + ;; trigger external viewers on many file types that Emacs + ;; displays natively. + ;; (t (hpath:find-file-mailcap filename)) + )) (defun hpath:match (filename regexp-alist) "If FILENAME matches the car of any element in REGEXP-ALIST, return its cdr. diff --git a/hyperbole.el b/hyperbole.el index c1fbcbe..76f5af2 100644 --- a/hyperbole.el +++ b/hyperbole.el @@ -1,12 +1,12 @@ ;;; hyperbole.el --- GNU Hyperbole: The Everyday Hypertextual Information Manager -;; Copyright (C) 1992-2017 Free Software Foundation, Inc. +;; Copyright (C) 1992-2019 Free Software Foundation, Inc. ;; Author: Bob Weiner ;; Maintainer: Bob Weiner and Mats Lidell ;; Created: 06-Oct-92 at 11:52:51 -;; Released: 23-Nov-17 -;; Version: 7.0.2a +;; Released: 21-Jan-19 +;; Version: 7.0.3 ;; Keywords: comm, convenience, files, frames, hypermedia, languages, mail, matching, mouse, multimedia, outlines, tools, wp ;; Package: hyperbole ;; Package-Requires: ((emacs "24.4")) @@ -681,6 +681,11 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden." ;; Conditionally initialize Hyperbole key bindings (when hkey-init is t) (hkey-initialize) ;; + ;; Abbreviate MSWindows mount point paths. + (when (or (file-exists-p "/mnt/c") + (file-exists-p "/cygdrive")) + (add-to-list 'directory-abbrev-alist '("\\`\\(/mnt\\|/cygdrive\\)/" . "/"))) + ;; ;; Save button attribute file whenever same dir file is saved and ;; `ebut:hattr-save' is non-nil. (add-hook (if (boundp 'write-file-functions) -- cgit v1.0 From f3d59c4da3f96e3528542fb046a07d0ee9e46f57 Mon Sep 17 00:00:00 2001 From: Bob Weiner Date: Sun, 3 Feb 2019 13:57:13 -0500 Subject: Large set of BW changes for V7.0.2b pre-release. --- Changes | 72 +++++++++-- DEMO | 24 ++-- HY-ABOUT | 2 +- HY-NEWS | 132 ++++++++++++++++++- HY-WHY.kotl | 4 +- Makefile | 2 +- README.md | 2 +- README.md.html | 16 +-- hargs.el | 30 +++-- hbmap.el | 2 +- hbut.el | 2 +- hibtypes.el | 50 ++++---- hmouse-drv.el | 60 ++++++--- hmouse-sh.el | 2 +- hmouse-tag.el | 2 +- hpath.el | 369 +++++++++++++++++++++++++++++++++++------------------ hsettings.el | 4 +- hsys-org.el | 4 +- hui-mini.el | 18 +-- hui.el | 10 +- hversion.el | 16 ++- hyperbole-pkg.el | 2 +- hyperbole.el | 3 + hyrolo.el | 6 +- man/hyperbole.html | 36 ++++-- man/hyperbole.info | Bin 489710 -> 490392 bytes man/hyperbole.pdf | Bin 1263857 -> 1264179 bytes man/hyperbole.texi | 30 +++-- man/version.texi | 8 +- 29 files changed, 636 insertions(+), 272 deletions(-) mode change 100755 => 100644 hibtypes.el mode change 100755 => 100644 hpath.el diff --git a/Changes b/Changes index 11b6821..52e541c 100644 --- a/Changes +++ b/Changes @@ -1,8 +1,57 @@ +2019-02-03 Bob Weiner + +* hversion.el: Pushed BW changes for 7.0.2b test update. + +2019-02-02 Bob Weiner + +* hsys-org.el (org-mode): Support derived modes too. + +2019-01-31 Bob Weiner + +* man/hyperbole.texi (Keyboard Drags): Added doc of {M-o r }, + replace selected window's buffer with that of another window. + +* man/hyperbole.texi (Keyboard Drags): + DEMO (Displaying File and Buffer Items and Moving Buffers): + Added doc of {M-o m }, swap selected window's buffer with + that of 's. + +2019-01-30 Bob Weiner + +* hmouse-drv.el (hkey-drag-to): Fixed to handle the case where it is + called but no drag has taken place, i.e. when invoked from the keyboard + via Ace Window. + +2019-01-29 Bob Weiner + +* hargs.el (hargs:buffer-substring): Added and used in hargs:delimited to + replace null char in colored grep output lines with a colon, so they are + handled properly by the implicit buttons. + +2019-01-27 Bob Weiner + +* hversion.el (hyperb:microsoft-os-p): Renamed to this. + +* hpath.el (hpath:cache-mswindows-mount-points): + Added and called when Hyperbole is initialized, mainly to allow access to + MSWindows network shares which would otherwise not be accessible as links + under POSIX systems. + (hpath:map-plist): Added to map over property lists. + Called in hpath:cache-mswindows-mount-points. + +2019-01-26 Bob Weiner + +* hversion.el (hyperb:wsl-os-p): Added to test for use of Microsoft WSL. + +* hpath.el (hpath:delimited-possible-path): Added optional include-positions parameter. + 2019-01-21 Bob Weiner -* hpath.el (hpath:mswindows-mount-prefix, hpath:mswindows-drive-regexp) - (hpath:mswindows-to-posix-path, hpath:mswindows-to-posix-separators): - Added to handle MSWindows path under POSIX OSes, e.g. Windows Subsystem for Linux. +* hpath.el (hpath:mswindows-mount-prefix, hpath:mswindows-drive-regexp, hpath:mswindows-path-regexp, + hpath:mswindows-to-posix, hpath:mswindows-to-posix-separators, hpath:posix-to-mswindows) + hpath:posix-to-mswindows-separators, hpath:posix-path-p, + hpath:substitute-posix-or-mswindows-at-point, hpath:substitute-posix-or-mswindows): + Added to handle MSWindows paths under POSIX OSes, e.g. Windows Subsystem for Linux. (hpath:find-program): Commented out call to hpath:find-file-mailcap to prevent use of MIME external viewers on text files. hargs.el (hargs:delimited): Added call to hpath:mswindows-to-posix-path. @@ -16,7 +65,7 @@ 2017-12-20 Bob Weiner * kotl/kexport.el (kexport:html-file-klink) - (kexport:html): + (kexport:html): (kexport:html-replacement-alist): Added 'k' to precede klink HTML HREF references since these must start with a letter. @@ -120,16 +169,13 @@ * hypb.el (hypb:rgrep): Added support for ripgrep. hibtypes.el (ripgrep-msg): Added implicit button support for ripgrep (rg) messages where - the associated pathname is output once before all mataching lines. + the associated pathname is output once before all matching lines. See "https://github.com/BurntSushi/ripgrep". 2017-12-04 Bob Weiner * hmouse-drv.el (hmouse-alist): Reload the def of this variable if its value is null. - (hkey-mouse-click-to-replace): Added to allow moving buffers with the mouse by clicking - on the from and to windows. - (hmouse-click-to-drag, hmouse-click-to-drag-to, hmouse-click-to-replace, hmouse-click-to-throw, - hmouse-choose-windows): Added to perform cross-window drags, replacements and throws with 3 mouse + (hmouse-choose-windows): Added to perform cross-window drags, replacements and throws with 3 mouse clicks. 2017-12-03 Bob Weiner @@ -142,7 +188,7 @@ * hmouse-drv.el (hkey-drag-stay, hkey-replace): Added for use as ace-window commands. (hkey-throw): Rewrote so if not on an item, then throws the current buffer. hkey-replace is the inverse, it grabs the specified buffer and places it into the selected - window ({p} command key for ace-window). hkey-drag-stay does a drag but leaves point + window ({r} command key for ace-window). hkey-drag-stay does a drag but leaves point in the originally selected window. (hmouse-click-to-drag, hmouse-click-to-drag-stay, hmouse-click-to-drag-to) hmouse-click-to-replace, hmouse-click-to-swap, hmouse-click-to-throw): Added to click @@ -190,7 +236,7 @@ 2017-11-27 Bob Weiner * hmouse-drv.el (hkey-ace-window-setup): Made new ace-window frames (window id = z) inherit the size - of the prior selected frame; same as HyWindow. + of the prior selected frame; same as HyControl. * hui-window.el (hmouse-kill-and-yank-region, hmouse-yank-region): Added select-frame-set-input-focus in case released in a different frame. @@ -378,7 +424,7 @@ V7.0.1 changes ^^^^: location. Also fixed edge cases where want to copy or move thing to the beginning or end of the thing region. (hmouse-goto-region-point): Renamed to hmouse-goto-region-prev-point, for clarity. (hmouse-kill-and-yank-region, hmouse-kill-region): Used value of point saved in hkey-value to determine - the region if non-nil. + the region if non-nil. * hui-select.el (hui-select-delimited-thing, hui-select-thing): Changed to use use-region-p. hmouse-drv.el (hmouse-use-region-p): Added and used to improve hmouse-drag-thing. @@ -2089,7 +2135,7 @@ V6.0.0 changes ^^^^: * hmouse-drv.el (hkey-help-hide): Changed to utilize quit-window function if *hkey-wconfig* is not set and made it interactive and an autoload so can replace quit-window in help buffers. - (quit-window): Overloaded this function form "window.el" to utilize *hkey-wconfig* + (quit-window): Overloaded this function from "window.el" to utilize *hkey-wconfig* when set. hui-mini.el (hui:menu-help): This fixed an issue where Hyperbole minibuffer menu item help window quit did not properly restore prior window configuration. diff --git a/DEMO b/DEMO index a8e650c..c8c8315 100644 --- a/DEMO +++ b/DEMO @@ -1136,7 +1136,7 @@ If you want a new window where you release (so the original destination window's buffer stays onscreen), just drag to a window's modeline; that window will be split before the buffer is displayed. -*** Displaying File and Buffer Items +*** Displaying File and Buffer Items and Moving Buffers You can do the same thing with items in dired, buffer menu and ibuffer menu listing buffers rather than buffers themselves. Drag with the Action Mouse Key @@ -1153,15 +1153,19 @@ made. An Assist Key Drag will move the the item list buffer to the destination (swapping buffers), just as it does with other buffers. Practice these drags as they will prove very beneficial across time. -For even faster keyboard-based drag emulation, use the Emacs package 'ace-window' -(see "(hyperbole)Keyboard Drags" for setup). Once this is configured, the -leftmost character or two of each window's modeline will show the ID to type to -use that window as the drag destination. Then whenever point is on an item you -want displayed in another window, use M-o i and watch the magic -happen. You can also use this to create explicit button links to other window -buffers when in an editable buffer. If you want to display multiple items in -different windows, instead use the M-o t key sequence to @emph{throw} -the item to the window. +For even faster keyboard-based drag emulation, use the Emacs package +'ace-window' (see "(hyperbole)Keyboard Drags" for setup). Once this is +configured and the suggested M-o key binding is made, the leftmost character or +two of each window's modeline will show the to type to use that +window as the drag destination. Then whenever point is on an item you want +displayed in another window, use M-o i and watch the magic happen. +You can also use this to create explicit button links to other window buffers +when in an editable buffer. If you want to display multiple items in different +windows, instead use the M-o t key sequence to @emph{throw} each +item to a different window, while leaving the same selected window. To replace +the selected window's buffer with that of another window, use M-o r . +To instead swap the selected window's buffer with that of another window, +use M-o m . Try these commands out and they will speed your work. *** Cloning Windows diff --git a/HY-ABOUT b/HY-ABOUT index 0bf1893..72ada9c 100644 --- a/HY-ABOUT +++ b/HY-ABOUT @@ -3,7 +3,7 @@ Designed and Written by Bob Weiner Maintained by Mats Lidell and Bob Weiner https://www.gnu.org/software/hyperbole/ - Version 7.0.2a + Version 7.0.2b GNU Hyperbole (pronounced Ga-new Hi-per-bo-lee), or just Hyperbole, is an efficient and programmable hypertextual information management diff --git a/HY-NEWS b/HY-NEWS index 40fcdca..c1f8fbb 100644 --- a/HY-NEWS +++ b/HY-NEWS @@ -2,14 +2,136 @@ by Bob Weiner =========================================================================== +* V7.0.3 +=========================================================================== + + ACE WINDOW PACKAGE INTEGRATION - fast window and buffer switching + + - Selected Window Buffer Replace: Added the ability to 'replace' the + selected window's buffer with the buffer of another window. Use + {M-o r }. To swap the buffers between the same two windows, + use {M-o m . See "(hyperbole)Keyboard Drags" for setup and + use instructions. + + - New Frame Commands: Any of these M-o commands that involve two windows + can use a new frame as the target window by using a of 'z'. + So, {M-o t z} throws the current buffer to a new frame with a single + window displaying that buffer. The new frame will be the same size as + the prior frame to match the behavior of HyControl. + + - Integrated Ace Window commands with Smart Key Drags and added commands + for use with the mouse that select Ace Window source and target windows + by clicking with the mouse: hmouse-click-to-drag, + hmouse-click-to-drag-stay, hmouse-click-to-drag-to, + hmouse-click-to-replace, hmouse-click-to-swap, hmouse-click-to-throw. + + SMART (ACTION AND ASSIST) KEYS + + - MSWindows Paths: Hyperbole now recognizes typical MSWindows paths (both + local and remote). They may be used within links and implicit path buttons + just like POSIX paths, whether running Emacs under a POSIX system or + MSWindows. If under POSIX, a remote MSWindows path must be accessed through + a mount point to the network share. Hyperbole caches such mount points when + it is loaded. Use {M-x hpath:cache-mswindows-mount-points RET} to update them + if more mounts are made later. See also the NEW COMMANDS section herein for + how to convert a path between POSIX and MSWINDOWS/DOS formats. + + - GitLab and Github Links: Added Gitlab implicit links with equivalent + functionality to those of Github. Added "people" reference support + to list people who are part of a formal organization as well as a + "staff" alias. Added "contributors" reference support to list project + contributors as well. Improved Github implicit issue links: gh#gh-34 + and gh#issue/34 now properly reference an issue in the current project. + + - Ripgrep: Added new ripgrep-msg implicit button type which jumps to + the source referenced by ripgrep (rg) output. Ripgrep by + default outputs pathnames only once beforeall matching lines + within that path. Ripgrep may also be used with the Hyperbole + `hypb:rgrep' command by setting 'hypb:rgrep-command'. See + "https://github.com/BurntSushi/ripgrep". + + - Markdown Mode: Smart Keys now support Markdown internal file link + references and navigation. + + - Org Mode: When in an *Org Help* buffer, the Smart Keys now defer to + org-mode to handle jumps to its own locations for compatibility. + + - Drag-based Kill, Copy and Yank: Added support for dragging across frames. + + - Python Identifiers: If a Jedi server is running and the Action Key is + pressed on a Python identifier, Hyperbole will use Jedi to find the + definition even within nested module references, e.g. a.b.c. Also improved + basic identifier definition finding. + + - Company Mode Completion: Support for the Emacs company-mode completion + package. After a user loads company-mode, the Action Key when pressed on + a source code identifier will run 'smart-company-to-definition' and the + Assist Key will run 'smart-company-help'. + + - Treemacs Mode: Now supports standard Hyperbole end-of-line proportional + scrolling. + + - ChangeLog Mode: Smart Keys now work on Emacs Lisp references in changelogs. + + HYCONTROL + + - Help Buffer Quitting: If HyControl is active, normally {q} quits + it but now if point is in an Emacs help buffer, {q} will quit + from the help buffer instead. Use {Q} to quit from HyControl + unconditionally. + + NEW COMMANDS + + - Buffer Sliding: Four new commands are available that can be + bound to things like control arrow keys: hkey-buffer-move-left, + hkey-buffer-move-right, hkey-buffer-move-down and + hkey-buffer-move-up. Each one slides the current buffer one + window in the direction specified and all other buffers slide + around to match. + + - MSWindows and POSIX Path Toggling: In "hpath.el", added + (hpath:substitute-posix-or-mswindows-at-point) and + (hpath:substitute-posix-or-mswindows) commands to toggle the + format of a path at point or in a string between POSIX and MSWindows + styles. + + PROGRAMMING + + - Added hpath:map-plist, equivalent to mapcar but maps over + key-value pairs in property lists (where the key and value are + individual elements in the list). + + - In "hui-select.el", added functions to return info. on the + context-sensitive region that this library selects. + (hui-select-get-region) returns the region that would be + selected at point and (hui-select-get-region-boundaries) + returns a cons of the start and end position of the same region. + + - In "hpath.el (hpath:delimited-possible-path), added optional + include-positions parameter which if non-nil, adds start and end + positions to returned value. + + - In "hversion.el", added (hyperb:wsl-os-p) flag to test whether + Emacs is running under Microsoft Windows Subsystem for Linux (WSL) + since the system-type variable does not reflect this. + + DOCUMENTATION + + - Popup Menus: Documented how to invoke the Koutliner and + HyRolo popup menus in Emacs. See "(hyperbole)Menu Commands". + +=========================================================================== * V7.0.2 =========================================================================== - - Ace Window: Added the ability to 'throw' an item to a window while - leaving the selected window the same. Use {M-o t }. This - works in Dired, Buffer Menu, iBuffer Menu and Treemacs modes and lets - you throw multiple items to multiple windows quickly. See - "(hyperbole)Keyboard Drags" for setup and use instructions. + ACE WINDOW PACKAGE INTEGRATION + + - Item Throws: Added the ability to 'throw' an item or a buffer to + a window while leaving the selected window the same. Use {M-o t + }. This works in Dired, Buffer Menu, iBuffer Menu and + Treemacs modes and lets you throw multiple items to multiple windows + quickly. See "(hyperbole)Keyboard Drags" for setup and use + instructions. =========================================================================== * V7.0.1 diff --git a/HY-WHY.kotl b/HY-WHY.kotl index d363ad5..bda6d2e 100644 --- a/HY-WHY.kotl +++ b/HY-WHY.kotl @@ -20,7 +20,7 @@ pressing on their names. Hyperbole will automatically embed certain key variables in link pathnames so that as these links are moved from site to site and the variable values change at - each site, the links maintained properly. See "DEMO#Path + each site, the links are properly maintained. See "DEMO#Path Suffixes and Variables" and "DEMO#Path Prefixes". 5. Quickly search the web for targeted types of information such as @@ -115,7 +115,7 @@ alpha ;; label-type  ;; depth-first kcell attributes [[0 - (creator "rsw@gnu.org" create-time "20171212:19:44:57" id-counter 37 file "/Users/bk/Dropbox/emacs/hyperbole/HY-WHY.kotl")] + (creator "rsw@gnu.org" create-time "20190203:156:52:59" id-counter 37 file "/c/Users/bob.weiner/Dropbox/emacs/hyperbole/HY-WHY.kotl")] [1 (creator "rsw@gnu.org" create-time "20160524:15:04:17" no-fill t)] [17 diff --git a/Makefile b/Makefile index cfdf7ea..6fd8ad1 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ # This ver setup won't work under any make except GNU make, so set it manually. #HYPB_VERSION = "`head -3 hversion.el | tail -1 | sed -e 's/.*|\(.*\)|.*/\1/'`" -HYPB_VERSION = 7.0.2a +HYPB_VERSION = 7.0.2b # Emacs executable used to byte-compile .el files into .elc's. # Possibilities include: emacs, infodock, xemacs, etc. diff --git a/README.md b/README.md index 21373a9..d82150b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# GNU Hyperbole 7.0.2a - The Everyday Hypertextual Information Manager +# GNU Hyperbole 7.0.2b - The Everyday Hypertextual Information Manager **Table of Contents** diff --git a/README.md.html b/README.md.html index 69f0f2b..cd24141 100644 --- a/README.md.html +++ b/README.md.html @@ -1,11 +1,11 @@

-GNU Hyperbole 7.0.2 - The Everyday Hypertextual Information Manager

+GNU Hyperbole 7.0.2b - The Everyday Hypertextual Information Manager

Table of Contents

-

Hyperbole screenshot of the Koutliner, DEMO file and HyRolo

+

Hyperbole screenshot of the Koutliner, DEMO file and HyRolo

Summary

GNU Hyperbole (pronounced Ga-new Hi-per-bo-lee), or just Hyperbole, @@ -163,7 +163,7 @@ menubar and {C-h h} will display a Hyperbole menu in the minibuffer for quick keyboard-based selection.

You can invoke Hyperbole commands in one of three ways:

use the Hyperbole menu on your menubar;

-

Hyperbole Menubar Menu

+

Hyperbole Menubar Menu

type {C-h h} or {M-x hyperbole RET} to bring up the Hyperbole main menu in the minibuffer window, for fast keyboard or mouse-based selection; select an item from this menu by typing the item's first letter; use {q} @@ -172,10 +172,10 @@ to quit from the menu.

a pathname to display the associated file or directory.

Use {C-h h d d} for an interactive demonstration of standard Hyperbole button capabilities.

-

Hyperbole screenshot of the DEMO

+

Hyperbole screenshot of the DEMO

{C-h h k e} offers an interactive demonstration of the Koutliner, Hyperbole's multi-level autonumbered hypertextual outliner.

-

Hyperbole screenshot of the Koutliner

+

Hyperbole screenshot of the Koutliner

To try out HyControl, Hyperbole's interactive frame and window control system, use {C-h h s w} for window control or {C-h h s f} for frame control. {t} switches between window and frame control once in one of @@ -237,7 +237,7 @@ HyRolo, which anyone can use is also included. It is easy to learn to use since it introduces only a few new mechanisms and has a menu interface, which may be operated from the keyboard or the mouse.

-

HyRolo Menubar Menu

+

HyRolo Menubar Menu

  • Screen Control: Hyperbole includes HyControl, the fastest, @@ -439,7 +439,7 @@ Keys).


    One of the nicest things about Hyperbole is that it's available everywhere. Org-mode is a mode and its features are only available in -Org files. For instance if you dropped into eshell' oransi-term' and +Org files. For instance if you dropped into eshell' or ansi-term' and did `ls', you can move point to any of the directory's contents, do M-RET (or Shift-Button2) and jump to that file. And that's just one example. Note that this means that all Hyperbole functionality is available in diff --git a/hargs.el b/hargs.el index bb3ac5f..822f967 100644 --- a/hargs.el +++ b/hargs.el @@ -90,13 +90,21 @@ interactive form or takes no arguments." (action:path-args-rel (hargs:iform-read interactive-form modifying)))))) +(defun hargs:buffer-substring (start end) + (let ((string (buffer-substring-no-properties start end))) + ;; This may trigger on a colored grep-like output line which has + ;; an embedded null character with a display text property that + ;; displays it as a colon. Since the display property is stripped + ;; here, convert the null character to a colon. + (subst-char-in-string ?\^@ ?: string t))) + (defun hargs:delimited (start-delim end-delim &optional start-regexp-flag end-regexp-flag list-positions-flag) "Returns a normalized, single line, delimited string that point is within, or nil. START-DELIM and END-DELIM are strings that specify the argument delimiters. With optional START-REGEXP-FLAG non-nil, START-DELIM is treated as a regular expression. END-REGEXP-FLAG is similar. -With optional LIST-POSITIONS-FLAG, return list of (string-matched start-pos end pos)." +With optional LIST-POSITIONS-FLAG, return list of (string-matched start-pos end-pos)." (let* ((opoint (point)) (limit (if start-regexp-flag opoint (+ opoint (1- (length start-delim))))) @@ -121,17 +129,23 @@ With optional LIST-POSITIONS-FLAG, return list of (string-matched start-pos end (goto-char opoint) (and (funcall end-search-func end-delim limit t) (setq end (match-beginning 0)) - ;; Ignore any preceding backquote, e.g. when a double-quoted - ;; string is embedded within a doc string. + ;; Ignore any preceding backslash, e.g. when a double-quoted + ;; string is embedded within a doc string, except when + ;; the string starts with 2 backslashes or an MSWindows + ;; disk drive prefix, in which case the backslash is + ;; considered part of a pathname. (if (and (> end (point-min)) - (= (char-before end) ?\\)) + (= (char-before end) ?\\) + (not (string-match (concat "\\(\\`[\\][\\]\\)\\|" + hpath:mswindows-mount-prefix) + (hargs:buffer-substring start end)))) (setq end (1- end)) t) (< start end) - (let ((string (buffer-substring-no-properties start end))) - (setq string (hypb:replace-match-string "[\n\r]\\s-*" string " " t)) - (unless hyperb:microcruft-os-p - (setq string (hpath:mswindows-to-posix-path string))) + (let ((string (hargs:buffer-substring start end))) + (setq string (hypb:replace-match-string "[\n\r\f]\\s-*" string " " t)) + (unless hyperb:microsoft-os-p + (setq string (hpath:mswindows-to-posix string))) (if list-positions-flag (list string start end) string))))))) diff --git a/hbmap.el b/hbmap.el index 085e888..baf0273 100644 --- a/hbmap.el +++ b/hbmap.el @@ -106,7 +106,7 @@ the error. Optional NO-SAVE disables saving of the map after operation." ;;; ************************************************************************ (defvar hbmap:dir-user - (if (and hyperb:microcruft-os-p + (if (and hyperb:microsoft-os-p (or (not (fboundp 'getenv)) (not (getenv "HOME")))) "c:/_hyperb/" "~/.hyperb/") diff --git a/hbut.el b/hbut.el index 8198af7..e4104f9 100644 --- a/hbut.el +++ b/hbut.el @@ -810,7 +810,7 @@ Suitable for use as part of `write-file-functions'." (defalias 'hattr:summarize 'hattr:report) (defvar hattr:filename - (if hyperb:microcruft-os-p "_hypb" ".hypb") + (if hyperb:microsoft-os-p "_hypb" ".hypb") "Per directory file name in which explicit button attributes are stored. If you change its value, you will be unable to use buttons created by others who use a different value!") diff --git a/hibtypes.el b/hibtypes.el old mode 100755 new mode 100644 index f4dd991..f682c6e --- a/hibtypes.el +++ b/hibtypes.el @@ -1,18 +1,18 @@ ;;; hibtypes.el --- GNU Hyperbole default implicit button types ;; -;; Author: Bob Weiner +;; Author: Bob Weiner ;; -;; Orig-Date: 19-Sep-91 at 20:45:31 +;; Orig-Date: 19-Sep-91 at 20:45:31 ;; -;; Copyright (C) 1991-2017 Free Software Foundation, Inc. -;; See the "HY-COPY" file for license information. +;; Copyright (C) 1991-2017 Free Software Foundation, Inc. See +;; the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. -;; ;;; Commentary: ;; -;; Implicit button types in this file are defined in increasing order -;; of priority within this file (last one is highest priority). +;; Implicit button types in this file are defined in increasing +;; order of priority within this file (last one is highest +;; priority). ;;; Code: ;;; ************************************************************************ @@ -60,7 +60,7 @@ ;;; ************************************************************************ ;;; Public implicit button types ;;; ************************************************************************ - + (run-hooks 'hibtypes-begin-load-hook) ;;; ======================================================================== @@ -74,9 +74,10 @@ ;;; ======================================================================== (defvar mail-address-mode-list - '(emacs-lisp-mode lisp-interaction-mode lisp-mode scheme-mode c-mode - c++-mode html-mode java-mode js2-mode objc-mode python-mode - smalltalk-mode fundamental-mode text-mode indented-text-mode web-mode) + '(emacs-lisp-mode lisp-interaction-mode lisp-mode scheme-mode + c-mode c++-mode html-mode java-mode js2-mode objc-mode + python-mode smalltalk-mode fundamental-mode text-mode + indented-text-mode web-mode) "List of major modes in which mail address implicit buttons are active.") (defun mail-address-at-p () @@ -125,20 +126,22 @@ any buffer attached to a file in `hyrolo-file-list', or any buffer with (defib pathname () "Makes a valid pathname display the path entry. -Also works for delimited and non-delimited remote pathnames, Texinfo @file{} -entries, and hash-style link references to HTML, Markdown or Emacs outline -headings. Emacs Lisp library files (filenames without any directory component -that end in .el and .elc) are looked up using the `load-path' directory list. +Also works for delimited and non-delimited remote pathnames, +Texinfo @file{} entries, and hash-style link references to HTML, +Markdown or Emacs outline headings. Emacs Lisp library +files (filenames without any directory component that end in .el +and .elc) are looked up using the `load-path' directory list. See `hpath:at-p' function documentation for possible delimiters. -See `hpath:suffixes' variable documentation for suffixes that are added to or -removed from pathname when searching for a valid match. -See `hpath:find' function documentation for special file display options." +See `hpath:suffixes' variable documentation for suffixes that are +added to or removed from pathname when searching for a valid +match. See `hpath:find' function documentation for special file +display options." ;; ;; Ignore paths in Buffer menu, dired and helm modes. (unless (or (eq major-mode 'helm-major-mode) - (delq nil (mapcar (lambda (substring) (string-match - substring (format-mode-line mode-name))) + (delq nil (mapcar (lambda (substring) + (string-match substring (format-mode-line mode-name))) '("Buffer Menu" "IBuffer" "Dired")))) (let ((path (hpath:at-p)) full-path) @@ -174,12 +177,13 @@ See `hpath:find' function documentation for special file display options." )))))) ;;; ======================================================================== -;;; Displays files at specific lines and optional column number locations. +;;; Displays files at specific lines and optional column number +;;; locations. ;;; ======================================================================== (defconst hibtypes-path-line-and-col-regexp - (if (eq system-type 'windows-nt) - ;; Allow for 'c:' single letter drive prefixes on Windows + (if hyperb:microsoft-os-p + ;; Allow for 'c:' single letter drive prefixes on MSWindows "\\([^ \t\n\r:][^ \t\n\r]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?" "\\([^ \t\n\r:]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?")) diff --git a/hmouse-drv.el b/hmouse-drv.el index 55f0800..507594b 100644 --- a/hmouse-drv.el +++ b/hmouse-drv.el @@ -215,7 +215,7 @@ Any ARGS will be passed to `hmouse-function'." (setq action-key-cancelled nil assist-key-depressed-flag nil)) (assist-key-depressed-flag - (hmouse-function nil nil args)) + (hmouse-function nil nil args)) ((hkey-mouse-help nil args)) (t (run-hooks 'action-key-release-hook) @@ -358,6 +358,9 @@ window, use {M-o i } and watch the magic happen." (require 'ace-window) (when key (global-set-key key 'ace-window)) + (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l) + ;; allows {i} operation to work when only 2 windows exist + aw-dispatch-always t) ;; New ace-window frames (window id = z) inherit the size of the ;; prior selected frame; same as HyWindow. (setq aw-frame-size '(0 . 0) @@ -368,26 +371,28 @@ magic happen." ;; Ace-window includes ?m as the swap windows key, so it is not added here. (push '(?r hkey-replace "Hyperbole: Replace Here") aw-dispatch-alist) (push '(?t hkey-throw "Hyperbole: Throw To") aw-dispatch-alist) - (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l) - ;; allows {i} operation to work when only 2 windows exist - aw-dispatch-always t) (ace-window-display-mode 1)) ;;;###autoload (defun hkey-drag (release-window) - "Emulate Smart Mouse Key drag from selected window to RELEASE-WINDOW, interactively chosen via ace-window. + "Emulate Smart Mouse Key drag from the selected window to RELEASE-WINDOW, interactively chosen via ace-window. The drag action determines the final selected window. -Optional prefix ARG non-nil means emulate Assist Key rather than the +Optional prefix arg non-nil means emulate Assist Key rather than the Action Key. Works only when running under a window system, not from a dumb terminal." + ;; Note: Cannot add start-window as first parameter to this function + ;; because it is called like many other functions herein with a + ;; single release-window argument by 'hmouse-choose-windows'. + ;; Cancel any partial drag that may have been recorded. (interactive (list (aw-select " Ace - Hyperbole: Drag"))) (condition-case nil - ;; This may trigger a No Action error if start-window and - ;; release-window are the same; in that case, use the error - ;; handler to handle dragging an item. + ;; This may trigger a No Action error if starting window + ;; (window of depress) and release-window are the same; in that + ;; case: use the error handler to emulate dragging an item if on + ;; one. (progn (if current-prefix-arg (setq assist-key-depressed-flag nil) (setq action-key-depressed-flag nil)) @@ -404,7 +409,7 @@ Works only when running under a window system, not from a dumb terminal." After the drag, the selected window remains the same as it was before the drag. -Optional prefix ARG non-nil means emulate Assist Key rather than the +Optional prefix arg non-nil means emulate Assist Key rather than the Action Key. Works only when running under a window system, not from a dumb terminal." @@ -417,24 +422,39 @@ Works only when running under a window system, not from a dumb terminal." ;;;###autoload (defun hkey-drag-to (release-window) - "Emulate Smart Mouse Key drag from selected window to RELEASE-WINDOW, interactively chosen via ace-window. + "Emulate Smart Mouse Key drag from a selected window to RELEASE-WINDOW, interactively chosen via ace-window. If an item is dragged to RELEASE-WINDOW, then RELEASE-WINDOW is selected; -otherwise, the drag action determines the selected window. +otherwise, the drag action determines the selected window. If no drag +has taken place, then the selected window's buffer is displayed in +RELEASE-WINDOW and that becomes the selected window. -Optional prefix ARG non-nil means emulate Assist Key rather than the +Optional prefix arg non-nil means emulate Assist Key rather than the Action Key. Works only when running under a window system, not from a dumb terminal." (interactive (list (let ((mode-line-text (concat " Ace - " (nth 2 (assq ?i aw-dispatch-alist))))) (aw-select mode-line-text)))) - (if (and (hmouse-at-item-p) (window-live-p release-window)) - (progn (hkey-drag release-window) - ;; Leave release-window selected - (when (window-live-p release-window) - (hypb:select-window-frame release-window))) - ;; Leave hkey-drag to choose selected window - (hkey-drag release-window))) + (let ((start-window (if (and (boundp 'start-window) (window-live-p start-window)) + start-window + (if current-prefix-arg + assist-key-depress-window + action-key-depress-window)))) + (unless (window-live-p start-window) + (setq start-window (selected-window))) + (if (and (hmouse-at-item-p) (window-live-p release-window)) + (progn (hkey-drag release-window) + ;; Leave release-window selected + (when (window-live-p release-window) + (hypb:select-window-frame release-window))) + (if (eq start-window release-window) + ;; Leave hkey-drag to choose final selected window + (hkey-drag release-window) + ;; Replace release window's buffer with selected + ;; window's buffer. + (hkey-buffer-to start-window release-window) + (when (window-live-p release-window) + (hypb:select-window-frame release-window)))))) ;;;###autoload (defun hkey-replace (release-window) diff --git a/hmouse-sh.el b/hmouse-sh.el index ac5c609..7923124 100644 --- a/hmouse-sh.el +++ b/hmouse-sh.el @@ -574,7 +574,7 @@ With optional MIDDLE-KEY-ONLY-FLAG non-nil, binds only the middle mouse key." ;; ;; In Info-mode, Emacs uses key-translation-map to link mouse-1 to ;; do whatever mouse-2 does but because Hyperbole uses both down - ;; and up bindings on mouse2, this does work. So we rebind + ;; and up bindings on mouse2, this does not work. So we rebind ;; mouse-1 in Info mode to be an actual Action Mouse Key (which ;; makes it follow Info links/cross-references properly, doing a ;; superset of what it did before). diff --git a/hmouse-tag.el b/hmouse-tag.el index e37f5e3..18e7c64 100644 --- a/hmouse-tag.el +++ b/hmouse-tag.el @@ -1199,7 +1199,7 @@ Look for packages in `smart-java-package-path'." dir-list (if (setq found (file-exists-p path)) nil (cdr dir-list)))) - (when (and (not found) subpath hyperb:microcruft-os-p) + (when (and (not found) subpath hyperb:microsoft-os-p) ;; Try .jav suffix. (setq subfile (concat subpath ".jav") dir-list smart-java-package-path) diff --git a/hpath.el b/hpath.el old mode 100755 new mode 100644 index 8e13d55..c460e3f --- a/hpath.el +++ b/hpath.el @@ -57,34 +57,48 @@ Default is `nil' since this can slow down normal file finding." ;; and "https://docs.microsoft.com/en-us/windows/wsl/interop" for ;; Windows path specifications and use under WSL. +(defvar hpath:posix-mount-points-regexp + "^\\(Filesystem\\|rootfs\\|none\\) " + "Regexp of 'mount' command output lines that are not mount points of MSWindows paths.") + (defvar hpath:mswindows-mount-prefix (cond ((eq system-type 'cygwin) "/cygdrive/") - (hyperb:microcruft-os-p + (hyperb:microsoft-os-p "") (t ;; POSIX "/mnt/")) "Path prefix to add when converting MSWindows drive paths to POSIX-style. Must include a trailing directory separator or be nil.") -(defconst hpath:mswindows-drive-regexp "\\`[\\/]?\\([a-zA-Z]\\)[:/]" - "Regular expression matching an MSWindows drive letter at the beginning of a path string.") +(defconst hpath:mswindows-drive-regexp (format "\\`\\(%s\\)?[\\/]?\\([a-zA-Z]\\)[:\\/]" + hpath:mswindows-mount-prefix) + "Regular expression matching an MSWindows drive letter at the beginning of a path string. +Grouping 2 is the actual letter of the drive. +If the value of 'hpath:mswindows-mount-prefix' changes, then re-initialize this constant.") (defconst hpath:mswindows-path-regexp "\\`.*\\.*[a-zA-Z0-9_.]" "Regular expression matching the start of an MSWindows path that does not start with a drive letter but contains directory separators.") -(defun hpath:mswindows-to-posix-path (path) - "Convert a recognizable MSWindows PATH to a POSIX-style path or return the path unchanged. +;;;###autoload +(defun hpath:mswindows-to-posix (path) + "Convert a recognizable MSWindows PATH to a Posix-style path or return the path unchanged. If path begins with an MSWindows drive letter, prefix the converted path with the value of 'hpath:mswindows-mount-prefix'." + (interactive "sMSWindows path to convert to POSIX: ") (when (stringp path) - (cond ((string-match hpath:mswindows-drive-regexp path) - ;; Convert Windows disk drive paths to POSIX-style with a mount prefix. - (setq path (concat hpath:mswindows-mount-prefix (downcase (match-string 1 path)) - (if hyperb:microcruft-os-p ":" "/") - (substring path (match-end 0))) - path (hpath:mswindows-to-posix-separators path))) - ((string-match hpath:mswindows-path-regexp path) - (setq path (hpath:mswindows-to-posix-separators path))))) + (setq path (hpath:mswindows-to-posix-separators path)) + (when (string-match hpath:mswindows-drive-regexp path) + (when (string-match hpath:mswindows-drive-regexp path) + (let* ((drive-prefix (downcase (match-string 2 path))) + (rest-of-path (substring path (match-end 0))) + (absolute-p (and (not (string-empty-p rest-of-path)) + (= (aref rest-of-path 0) ?/)))) + ;; Convert MSWindows disk drive paths to POSIX-style with a mount prefix. + (setq path (concat hpath:mswindows-mount-prefix drive-prefix + (cond (hyperb:microsoft-os-p ":") + (absolute-p "") + (t "/")) + rest-of-path)))))) path) (defun hpath:mswindows-to-posix-separators (path) @@ -93,6 +107,101 @@ Path must be a string or an error will be triggered. See 'abbreviate-file-name' for how path abbreviation is handled." (abbreviate-file-name (replace-regexp-in-string "\\\\" "/" path))) +;;;###autoload +(defun hpath:posix-to-mswindows (path) + "Convert and return a Posix-style PATH to an MSWindows path or return the path unchanged. +If path begins with an optional mount prefix, 'hpath:mswindows-mount-prefix', followed by an MSWindows drive letter, remove the mount prefix." + (interactive "sPOSIX path to convert to MSWindows: ") + (when (stringp path) + (setq path (hpath:posix-to-mswindows-separators path)) + ;; Remove any POSIX mount prefix preceding an MSWindows path. + (if (eq 0 (string-match hpath:mswindows-mount-prefix path)) + (setq path (substring path (match-end 0)))) + (when (string-match hpath:mswindows-drive-regexp path) + (when (string-match hpath:mswindows-drive-regexp path) + (let* ((drive-prefix (downcase (match-string 2 path))) + (rest-of-path (substring path (match-end 0))) + (absolute-p (= (aref path (1- (match-end 0))) ?\\))) + ;; Convert formerly Posix-style Windows disk drive paths to MSWindows-style. + (setq path (concat drive-prefix ":" + (if (or (not absolute-p) + (string-match "\\`[~/]" rest-of-path)) + "" + "\\") + rest-of-path)))))) + path) + + +(defun hpath:posix-to-mswindows-separators (path) + "Replace all forward slashes with backslashes in PATH and abbreviate the path if possible. +Path must be a string or an error will be triggered. See +'abbreviate-file-name' for how path abbreviation is handled." + (replace-regexp-in-string "/" "\\\\" (abbreviate-file-name path))) + +(defun hpath:posix-path-p (path) + "Return non-nil if PATH looks like a Posix path." + (and (stringp path) (string-match "/" path))) + +;;;###autoload +(defun hpath:substitute-posix-or-mswindows-at-point () + "If point is within a recognizable Posix or MSWindows path, change the path to the other type of path." + (interactive "*") + (barf-if-buffer-read-only) + (let* ((opoint (point)) + (str-and-positions (hpath:delimited-possible-path t t)) + (path (car str-and-positions)) + (start (nth 1 str-and-positions)) + (end (nth 2 str-and-positions))) + (when path + (if (hpath:posix-path-p path) + (setq path (hpath:posix-to-mswindows path)) + (setq path (hpath:mswindows-to-posix path))) + (delete-region start end) + (insert path) + (goto-char (min opoint (point-max)))))) + +;;;###autoload +(defun hpath:substitute-posix-or-mswindows (path) + "Change a recognizable Posix or MSWindows PATH to the other type of path." + (when (stringp path) + (if (hpath:posix-path-p path) + (hpath:posix-to-mswindows path) + (hpath:mswindows-to-posix path)))) + +;;;###autoload +(defun hpath:map-plist (func plist) + "Returns result of applying FUNC of two args, key and value, to key-value pairs in PLIST, a property list." + (cl-loop for (k v) on plist by #'cddr + collect (funcall func k v) into result + return result)) + +;;;###autoload +(defun hpath:cache-mswindows-mount-points () + "Cache valid MSWindows mount points in 'directory-abbrev-alist' when under a non-MSWindows operating system, e.g. WSL. +Call this function manually if mount points change after Hyperbole is loaded." + (interactive) + (when (not hyperb:microsoft-os-p) + (let (path mount-point) + (mapcar (lambda (path-and-mount-point) + (setq path (car path-and-mount-point) + mount-point (cdr path-and-mount-point)) + (add-to-list 'directory-abbrev-alist (cons (format "\\`%s" (regexp-quote path)) + mount-point))) + ;; Sort alist of (path-mounted . mount-point) elements from shortest + ;; to longest path so that the longest path is selected first within + ;; 'directory-abbrev-alist' (elements are added in reverse order). + (sort + ;; Convert plist to alist for sorting. + (hpath:map-plist (lambda (path mount-point) + (if (string-match "\\`\\([a-zA-Z]\\):\\'" path) + (setq path (concat "/" (downcase (match-string 1 path))))) + (cons path mount-point)) + ;; Return a plist of MSWindows path-mounted mount-point pairs. + (split-string (shell-command-to-string + (format "df 2> /dev/null | grep -v '%s' | sed -e 's/ .*%%//g'" hpath:posix-mount-points-regexp)))) + (lambda (cons1 cons2) (<= (length (car cons1)) (length (car cons2))))))))) + + ;;; ************************************************************************ ;;; FILE VIEWER COMMAND SETTINGS ;;; ************************************************************************ @@ -112,7 +221,8 @@ See the function `hpath:get-external-display-alist' for detailed format document :type 'regexp :group 'hyperbole-commands) -(defvar hpath:external-display-alist-mswindows (list (cons (format "\\.\\(%s\\)$" hpath:external-open-office-suffixes) +(defvar hpath:external-display-alist-mswindows (list '("\\.vba$" . "/c/Windows/System32/cmd.exe //c start \"${@//&/^&}\"") + (cons (format "\\.\\(%s\\)$" hpath:external-open-office-suffixes) "openoffice.exe")) "*An alist of (FILENAME-REGEXP . DISPLAY-PROGRAM-STRING-OR-LIST) elements for MS Windows. See the function `hpath:get-external-display-alist' for detailed format documentation.") @@ -578,28 +688,37 @@ paths are allowed. Absolute pathnames must begin with a `/' or `~'." ((hpath:www-at-p) nil) ((hpath:is-p (hpath:delimited-possible-path non-exist) type non-exist)))) -(defun hpath:delimited-possible-path (&optional non-exist) +(defun hpath:delimited-possible-path (&optional non-exist include-positions) "Returns delimited possible path or non-delimited remote path at point, if any. No validity checking is done on the possible path. Delimiters may be: double quotes, open and close single quote, whitespace, or Texinfo file references. + With optional NON-EXIST, nonexistent local paths are allowed. Absolute pathnames -must begin with a `/' or `~'." - (or (hargs:delimited "\"" "\"") - ;; Filenames in Info docs or Python files - (hargs:delimited "[`'‘]" "[`'’]" t t) - ;; Filenames in TexInfo docs - (hargs:delimited "@file{" "}") - ;; Any existing whitespace delimited filename at point. - ;; If match consists of only punctuation, like - ;; . or .., don't treat it as a pathname. Only look for - ;; whitespace delimited filenames if non-exist is nil. - (unless non-exist - (let ((p (hargs:delimited "^\\|\\(\\s \\|[\]\[(){}<>\;&,@]\\)*" - "\\([\]\[(){}<>\;&,@]\\|:*\\s \\)+\\|$" - t t)) - (punc (char-syntax ?.))) - (if (delq nil (mapcar (lambda (c) (/= punc (char-syntax c))) p)) - p))))) +must begin with a `/' or `~'. + +With optional INCLUDE-POSITIONS, returns a triplet list of (path start-pos +end-pos) or nil." + ;; Prevents MSWindows to Posix path substitution + (let ((hyperb:microsoft-os-p t)) + (or (hargs:delimited "\"" "\"" nil nil include-positions) + ;; Filenames in Info docs or Python files + (hargs:delimited "[`'‘]" "[`'’]" t t include-positions) + ;; Filenames in TexInfo docs + (hargs:delimited "@file{" "}" nil nil include-positions) + ;; Any existing whitespace delimited filename at point. + ;; If match consists of only punctuation, like + ;; . or .., don't treat it as a pathname. Only look for + ;; whitespace delimited filenames if non-exist is nil. + (unless non-exist + (let* ((triplet (hargs:delimited "^\\|\\(\\s-\\|[\]\[(){}<>\;&,@]\\)*" + "\\([\]\[(){}<>\;&,@]\\|:*\\s-\\)+\\|$" + t t t)) + (p (car triplet)) + (punc (char-syntax ?.))) + (if (delq nil (mapcar (lambda (c) (/= punc (char-syntax c))) p)) + (if include-positions + triplet + p))))))) ;;;###autoload (defun hpath:display-buffer (buffer &optional display-where) @@ -773,7 +892,7 @@ program)." (hash (goto-char (point-min))))) (defun hpath:find-executable (executable-list) - "Return the first executable string from EXECUTABLE-LIST found within `exec-path'." + "Return the first executable string from EXECUTABLE-LIST found within `exec-path' or nil." (catch 'found (mapc (lambda (executable) @@ -847,7 +966,7 @@ programs, such as a pdf reader. The cdr of each element may be: See also `hpath:internal-display-alist' for internal, window-system independent display settings." (cond ((memq window-system '(dps ns)) hpath:external-display-alist-macos) - (hyperb:microcruft-os-p + (hyperb:microsoft-os-p hpath:external-display-alist-mswindows) (t (cdr (assoc (hyperb:window-system) (list (cons "emacs" hpath:external-display-alist-x) ; GNU Emacs under X @@ -864,93 +983,94 @@ permitted in the middle of existing pathnames, but not at the start or end. Tabs and newlines are converted to space before the pathname is checked, this normalized path form is what is returned for PATH. With optional NON-EXIST, nonexistent local paths are allowed." - (let ((rtn-path path) - (suffix)) - (and (stringp path) - ;; Path may be a link reference with components other than a - ;; pathname. These components always follow a comma or # symbol, so - ;; strip them, if any, before checking path. - (if (string-match "\\`[^#][^#,]*\\([ \t\n\r]*[#,]\\)" path) - (setq rtn-path (concat (substring path 0 (match-beginning 1)) - "%s" (substring path (match-beginning 1))) - path (substring path 0 (match-beginning 1))) - (setq rtn-path (concat rtn-path "%s"))) - ;; If path is just a local reference that begins with #, - ;; prepend the file name to it. - (cond ((and buffer-file-name - ;; ignore HTML color strings - (not (string-match "\\`#[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]\\'" path)) - ;; match to in-file HTML references - (string-match "\\`#[^\'\"<>#]+\\'" path)) - (setq rtn-path (concat "file://" buffer-file-name rtn-path) - path buffer-file-name)) - ((string-match "\\`[^#]+\\(#[^#]*\\)\\'" path) - ;; file and # reference - (setq path (substring path 0 (match-beginning 1))) - (if (memq (aref path 0) '(?/ ?~)) - ;; absolute - (setq rtn-path (concat "file://" rtn-path)) - (setq path (concat default-directory path) - rtn-path (concat "file://" default-directory rtn-path)))) - (t)) - (if (string-match hpath:prefix-regexp path) - (setq path (substring path (match-end 0))) - t) - (not (or (string-equal path "") - (string-match "\\`\\s \\|\\s \\'" path))) - ;; Convert tabs and newlines to space. - (setq path (hbut:key-to-label (hbut:label-to-key path))) - (or (not (string-match "[()]" path)) - (string-match "\\`([^ \t\n\r\)]+)[ *A-Za-z0-9]" path)) - (if (string-match "\\$\{[^\}]+}" path) - (setq path (hpath:substitute-value path)) - t) - (not (string-match "[\t\n\r\"`'|{}\\]" path)) - (or (not (hpath:www-p path)) - (string-match "\\`ftp[:.]" path)) - (let ((remote-path (string-match "@.+:\\|^/.+:\\|..+:/" path))) - (if (cond (remote-path - (cond ((eq type 'file) - (not (string-equal "/" (substring path -1)))) - ((eq type 'directory) - (string-equal "/" (substring path -1))) - (t))) - ((or (and non-exist - (or - ;; Info or remote path, so don't check for. - (string-match "[()]" path) - (hpath:remote-p path) - (setq suffix (hpath:exists-p path t)) - ;; Don't allow spaces in non-existent - ;; pathnames. - (not (string-match " " path)))) - (setq suffix (hpath:exists-p path t))) - (cond ((eq type 'file) - (not (file-directory-p path))) - ((eq type 'directory) - (file-directory-p path)) - (t)))) - (progn - ;; Might be an encoded URL with % characters, so - ;; decode it before calling format below. - (when (string-match "%" rtn-path) - (let (decoded-path) - (while (not (equal rtn-path (setq decoded-path (hypb:decode-url rtn-path)))) - (setq rtn-path decoded-path)))) - ;; Quote any % except for one %s at the end of the - ;; path part of rtn-path (immediately preceding a # - ;; or , character or the end of string). - (setq rtn-path (hypb:replace-match-string "%" rtn-path "%%") - rtn-path (hypb:replace-match-string "%%s\\([#,]\\|\\'\\)" rtn-path "%s\\1")) - ;; Return path if non-nil return value. - (if (stringp suffix) ;; suffix could = t, which we ignore - (if (string-match (concat (regexp-quote suffix) "%s") rtn-path) - ;; remove suffix - (concat (substring rtn-path 0 (match-beginning 0)) - (substring rtn-path (match-end 0))) - ;; add suffix - (format rtn-path suffix)) - (format rtn-path "")))))))) + (when (stringp path) + (setq path (hpath:mswindows-to-posix path)) + (let ((rtn-path path) + (suffix)) + ;; Path may be a link reference with components other than a + ;; pathname. These components always follow a comma or # symbol, so + ;; strip them, if any, before checking path. + (and (if (string-match "\\`[^#][^#,]*\\([ \t\n\r]*[#,]\\)" path) + (setq rtn-path (concat (substring path 0 (match-beginning 1)) + "%s" (substring path (match-beginning 1))) + path (substring path 0 (match-beginning 1))) + (setq rtn-path (concat rtn-path "%s"))) + ;; If path is just a local reference that begins with #, + ;; prepend the file name to it. + (cond ((and buffer-file-name + ;; ignore HTML color strings + (not (string-match "\\`#[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]\\'" path)) + ;; match to in-file HTML references + (string-match "\\`#[^\'\"<>#]+\\'" path)) + (setq rtn-path (concat "file://" buffer-file-name rtn-path) + path buffer-file-name)) + ((string-match "\\`[^#]+\\(#[^#]*\\)\\'" path) + ;; file and # reference + (setq path (substring path 0 (match-beginning 1))) + (if (memq (aref path 0) '(?/ ?~)) + ;; absolute + (setq rtn-path (concat "file://" rtn-path)) + (setq path (concat default-directory path) + rtn-path (concat "file://" default-directory rtn-path)))) + (t)) + (if (string-match hpath:prefix-regexp path) + (setq path (substring path (match-end 0))) + t) + (not (or (string-equal path "") + (string-match "\\`\\s \\|\\s \\'" path))) + ;; Convert tabs and newlines to space. + (setq path (hbut:key-to-label (hbut:label-to-key path))) + (or (not (string-match "[()]" path)) + (string-match "\\`([^ \t\n\r\)]+)[ *A-Za-z0-9]" path)) + (if (string-match "\\$\{[^\}]+}" path) + (setq path (hpath:substitute-value path)) + t) + (not (string-match "[\t\n\r\"`'|{}\\]" path)) + (or (not (hpath:www-p path)) + (string-match "\\`ftp[:.]" path)) + (let ((remote-path (string-match "@.+:\\|^/.+:\\|..+:/" path))) + (if (cond (remote-path + (cond ((eq type 'file) + (not (string-equal "/" (substring path -1)))) + ((eq type 'directory) + (string-equal "/" (substring path -1))) + (t))) + ((or (and non-exist + (or + ;; Info or remote path, so don't check for. + (string-match "[()]" path) + (hpath:remote-p path) + (setq suffix (hpath:exists-p path t)) + ;; Don't allow spaces in non-existent + ;; pathnames. + (not (string-match " " path)))) + (setq suffix (hpath:exists-p path t))) + (cond ((eq type 'file) + (not (file-directory-p path))) + ((eq type 'directory) + (file-directory-p path)) + (t)))) + (progn + ;; Might be an encoded URL with % characters, so + ;; decode it before calling format below. + (when (string-match "%" rtn-path) + (let (decoded-path) + (while (not (equal rtn-path (setq decoded-path (hypb:decode-url rtn-path)))) + (setq rtn-path decoded-path)))) + ;; Quote any % except for one %s at the end of the + ;; path part of rtn-path (immediately preceding a # + ;; or , character or the end of string). + (setq rtn-path (hypb:replace-match-string "%" rtn-path "%%") + rtn-path (hypb:replace-match-string "%%s\\([#,]\\|\\'\\)" rtn-path "%s\\1")) + ;; Return path if non-nil return value. + (if (stringp suffix) ;; suffix could = t, which we ignore + (if (string-match (concat (regexp-quote suffix) "%s") rtn-path) + ;; remove suffix + (concat (substring rtn-path 0 (match-beginning 0)) + (substring rtn-path (match-end 0))) + ;; add suffix + (format rtn-path suffix)) + (format rtn-path ""))))))))) (defun hpath:push-tag-mark () "Add a tag return marker at point if within a programming language file buffer. @@ -1105,9 +1225,10 @@ validation checks. Default-directory should be equal to the current Hyperbole button source directory when called, so that PATH is expanded relative to it." - (cond ((not (stringp path)) - (error "(hpath:validate): \"%s\" is not a pathname." path)) - ((or (string-match "[()]" path) (hpath:remote-p path)) + (unless (stringp path) + (error "(hpath:validate): \"%s\" is not a pathname." path)) + (setq path (hpath:mswindows-to-posix path)) + (cond ((or (string-match "[()]" path) (hpath:remote-p path)) ;; info or remote path, so don't validate path) ((if (not (hpath:www-p path)) diff --git a/hsettings.el b/hsettings.el index d3c37f5..809dd31 100644 --- a/hsettings.el +++ b/hsettings.el @@ -34,7 +34,7 @@ ;; The following section applies only to MS-DOS and MS-Windows OSs. ;; Users of other OSs may simply ignore this section. -;; Some versions of Microcruft OSs don't automatically set the +;; Some versions of Microsoft OSs don't automatically set the ;; timezone so that Hyperbole can read it. Nor do they include a ;; UNIX-style date program. So follow the commented instructions in ;; the code below here. @@ -43,7 +43,7 @@ ;; timezone properly and you need not do anything. If you receive a ;; timezone error, simply follow the instructions below to set the ;; timezone manually and then reload Hyperbole. -(if (and hyperb:microcruft-os-p +(if (and hyperb:microsoft-os-p (require 'htz) (not (stringp htz:local))) (progn diff --git a/hsys-org.el b/hsys-org.el index f9604db..1ad9a9e 100644 --- a/hsys-org.el +++ b/hsys-org.el @@ -37,7 +37,7 @@ The variable, `browse-url-browser-function', customizes the url browser that is used for urls. Valid values of this variable include `browse-url-default-browser' and `browse-url-generic'." - (when (eq major-mode 'org-mode) + (when (derived-mode-p 'org-mode) (cond ((org-link-at-p) (hact 'org-link nil)) ((org-at-heading-p) @@ -47,7 +47,7 @@ and `browse-url-generic'." (defun org-mode:help (&optional _but) "If on an Org mode heading, cycles through views of the whole buffer outline. If on an Org mode link, displays standard Hyperbole help." - (when (eq major-mode 'org-mode) + (when (derived-mode-p 'org-mode) (cond ((org-link-at-p) (hkey-help current-prefix-arg) t) diff --git a/hui-mini.el b/hui-mini.el index 4483ede..80389cb 100644 --- a/hui-mini.el +++ b/hui-mini.el @@ -210,7 +210,7 @@ MENU defaults to 'hyperbole and MENU-LIST to `hui:menus'. See `hui:menus' definition for the format of the menu list structure." (mapcar (lambda (entry) - (or (consp entry) + (or (consp entry) (error "(hui:menu-xemacs): Invalid menu entry: %s" entry)) (let ((label (car entry)) (content (car (cdr entry)))) @@ -446,7 +446,7 @@ constructs. If not given, the top-level Hyperbole menu is used." "Edits directory-specific button file.") ("Info" (id-info "(hyperbole)Button Files") - "Displays manual section on button files.") + "Displays manual section on button files.") ("PersonalFile" (find-file (expand-file-name hbmap:filename hbmap:dir-user)) "Edits user-specific button file.") @@ -490,7 +490,7 @@ constructs. If not given, the top-level Hyperbole menu is used." ("MarkThing" (hui:bind-key #'hui-select-thing)) ;; {C-c RET} ("SmartHelp" (hui:bind-key #'hkey-help)) ;; {C-h A} ("WinControl" (hui:bind-key #'hycontrol-enable-windows-mode)) ;; {C-c \} - )) + )) '(cust-referents . (("Ref Display>") ("Any-Frame" (setq hpath:display-where 'other-frame)) @@ -589,17 +589,17 @@ constructs. If not given, the top-level Hyperbole menu is used." )) '(gbut . (("GButton>") - ("Act" gbut:act "Activates global button by name.") + ("Act" gbut:act "Activates global button by name.") ("Create" hui:gbut-create "Adds a global button to gbut:file.") ("Edit" hui:gbut-modify "Modifies global button attributes.") - ("Help" gbut:help "Reports on a global button by name.") + ("Help" gbut:help "Reports on a global button by name.") ("Info" (id-info "(hyperbole)Global Buttons") "Displays manual section on global buttons.") ("Modify" hui:gbut-modify "Modifies global button attributes.") )) '(ibut . (("IButton>") - ("Act" hui:hbut-current-act "Activates implicit button at point.") + ("Act" hui:hbut-current-act "Activates implicit button at point.") ("DeleteIButType" (hui:htype-delete 'ibtypes) "Deletes specified button type.") ("Help" hui:hbut-help "Reports on button's attributes.") @@ -635,7 +635,7 @@ constructs. If not given, the top-level Hyperbole menu is used." )) '(otl . (("Kotl>") - ("All" kotl-mode:show-all "Expand all collapsed cells.") + ("All" kotl-mode:show-all "Expand all collapsed cells.") ("Blanks" kvspec:toggle-blank-lines "Toggle blank lines between cells on or off.") ("Create" kfile:find "Create or edit an outline file.") @@ -659,7 +659,7 @@ constructs. If not given, the top-level Hyperbole menu is used." (kotl-mode:show-tree (kcell-view:label))) "Expand tree rooted at point.") ("Top" kotl-mode:top-cells - "Hide all but top-level cells.") + "Hide all but top-level cells.") ("Vspec" kvspec:activate "Prompt for and activate a view specifiction.") )) @@ -713,7 +713,7 @@ constructs. If not given, the top-level Hyperbole menu is used." (hui:menu-web-search) )))) -;; Always rebuild the Hyperbole minibuffer menu when this file is loaded. +;; Always rebuild the Hyperbole minibuffer menu when this file is loaded. (hyperbole-minibuffer-menu) (provide 'hui-mini) diff --git a/hui.el b/hui.el index a0a9228..011e13a 100644 --- a/hui.el +++ b/hui.el @@ -220,19 +220,17 @@ Signals an error if any problem occurs." (list curr-label new-label)))) (save-excursion - (if (called-interactively-p 'interactive) - nil + (unless (called-interactively-p 'interactive) (hui:buf-writable-err (current-buffer) "ebut-rename") (if (or (not (stringp curr-label)) (string= curr-label "")) (hypb:error "(ebut-rename): 'curr-label' must be a non-empty string: %s" - curr-label)) + curr-label)) (and (stringp new-label) (string= new-label "") (hypb:error "(ebut-rename): 'new-label' must be a non-empty string: %s" - new-label))) + new-label))) (or (ebut:get (ebut:label-to-key curr-label)) (hypb:error "(ebut-rename): Can't rename %s since no button data." - curr-label)) - ) + curr-label))) (cond (new-label (ebut:operate curr-label new-label) (setq hui:ebut-label-prev nil) diff --git a/hversion.el b/hversion.el index 363dcc1..b883001 100644 --- a/hversion.el +++ b/hversion.el @@ -5,7 +5,7 @@ ;; ;; Orig-Date: 1-Jan-94 ;; -;; Copyright (C) 1994-2017 Free Software Foundation, Inc. +;; Copyright (C) 1994-2019 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -23,16 +23,22 @@ ;;; Public variables ;;; ************************************************************************ -(defconst hyperb:version "7.0.2a" "GNU Hyperbole revision number.") +(defconst hyperb:version "7.0.2b" "GNU Hyperbole revision number.") ;;;###autoload -(defvar hyperb:microcruft-os-p +(defvar hyperb:microsoft-os-p (memq system-type '(ms-windows windows-nt ms-dos win32)) - "T iff Hyperbole is running under a Microcruft OS.") + "T iff Hyperbole is running under a Microsoft OS.") + +;;;###autoload +(defvar hyperb:wsl-os-p + (and (memq system-type '(gnu/linux)) + (executable-find "wsl.exe")) + "T iff Hyperbole is running under Microsoft Windows Subsystem for Linux (WSL).") ;;;###autoload (defvar hyperb:mouse-buttons - (if (or (and hyperb:microcruft-os-p (not (memq window-system '(w32 w64 x)))) + (if (or (and hyperb:microsoft-os-p (not (memq window-system '(w32 w64 x)))) (and hyperb:emacs-p (memq window-system '(ns dps)))) 2 3) "Number of live buttons available on the mouse. diff --git a/hyperbole-pkg.el b/hyperbole-pkg.el index c2390d7..3a94cb7 100644 --- a/hyperbole-pkg.el +++ b/hyperbole-pkg.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t -*- -(define-package "hyperbole" "7.0.2a" "GNU Hyperbole: The Everyday Hypertextual Information Manager" +(define-package "hyperbole" "7.0.2b" "GNU Hyperbole: The Everyday Hypertextual Information Manager" '((emacs "24.4")) :url "http://www.gnu.org/software/hyperbole" :keywords '("comm" "convenience" "files" "frames" "hypermedia" "languages" diff --git a/hyperbole.el b/hyperbole.el index 76f5af2..6a13e2f 100644 --- a/hyperbole.el +++ b/hyperbole.el @@ -685,6 +685,9 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden." (when (or (file-exists-p "/mnt/c") (file-exists-p "/cygdrive")) (add-to-list 'directory-abbrev-alist '("\\`\\(/mnt\\|/cygdrive\\)/" . "/"))) + ;; When running under a POSIX system with possible access to MSWindows servers, + ;; cache valid MSWindows mount points. + (hpath:cache-mswindows-mount-points) ;; ;; Save button attribute file whenever same dir file is saved and ;; `ebut:hattr-save' is non-nil. diff --git a/hyrolo.el b/hyrolo.el index 1d61a46..d716a33 100644 --- a/hyrolo.el +++ b/hyrolo.el @@ -85,10 +85,10 @@ executable must be found as well (for Oauth security)." (ms "c:/_rolo.otl") (unix "~/.rolo.otl") (list (delq nil (if (and (boundp 'bbdb-file) (stringp bbdb-file)) - (if hyperb:microcruft-os-p + (if hyperb:microsoft-os-p (list ms bbdb-file gcontacts) (list "~/.rolo.otl" bbdb-file gcontacts)) - (if hyperb:microcruft-os-p (list ms gcontacts) (list unix gcontacts)))))) + (if hyperb:microsoft-os-p (list ms gcontacts) (list unix gcontacts)))))) (setq hyrolo-file-list list) (when (called-interactively-p 'interactive) (message "HyRolo Search List: %S" list)) @@ -606,7 +606,7 @@ XEmacs only." (defun hyrolo-rename (old-file new-file) "Prompt user to rename OLD-FILE to NEW-FILE." - (interactive (if hyperb:microcruft-os-p + (interactive (if hyperb:microsoft-os-p '("c:/_rolodex.otl" "c:/_rolo.otl") '("~/.rolodex.otl" "~/.rolo.otl"))) (if (and (equal (car hyrolo-file-list) new-file) diff --git a/man/hyperbole.html b/man/hyperbole.html index bd2b5c6..44b27b4 100644 --- a/man/hyperbole.html +++ b/man/hyperbole.html @@ -1,9 +1,9 @@ **Table of Contents** @@ -497,8 +497,16 @@ Keys). products I have ever come across. It is certainly the one which has made the biggest improvement in my personal productivity. + My Hyperbole button file is my start page in Emacs. It's a quickly + searchable index with links to countless resources. We also have a + library of implicit buttons that enable rapid navigation from references + in our code to our issue tracking system, so clicking a reference like + Client6502 opens the relevant conversation. Hyperbole provides a really + useful set of power tools. If Emacs is your preferred productivity + environment, it's definitely worth getting familiar with it. + -- Chris Nuzum - Co-founder, Traction Software, Inc. + Co-founder, Traction Softwarea, Inc. ------- diff --git a/README.md.html b/README.md.html index 4a45809..e69de29 100644 --- a/README.md.html +++ b/README.md.html @@ -1,612 +0,0 @@ -

    -GNU Hyperbole 7.0.2b - The Everyday Hypertextual Information Manager

    - -

    Table of Contents

    - - -

    Hyperbole screenshot of the Koutliner, DEMO file and HyRolo

    -

    -Summary

    -

    GNU Hyperbole (pronounced Ga-new Hi-per-bo-lee), or just Hyperbole, -is an easy-to-use, yet powerful and programmable hypertextual information -management system implemented as a GNU Emacs package. It offers rapid views -and interlinking of all kinds of textual information, utilizing Emacs for -editing. It can dramatically increase your productivity and greatly reduce -the number of keyboard/mouse keys you'll need to work efficiently.

    -

    Hyperbole lets you:

    -
      -
    1. -

      Quickly create hyperlink buttons either from the keyboard or by dragging -between a source and destination window with a mouse button depressed. -Later, activate buttons by pressing/clicking on them or by giving the -name of the button.

      -
    2. -
    3. -

      Activate many kinds of implicit buttons recognized by context -within text buffers, e.g. URLs, grep output lines, and git commits. -A single key or mouse button automatically does the right thing in -dozens of contexts; just press and go.

      -
    4. -
    5. -

      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;

      -
    6. -
    7. -

      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;

      -
    8. -
    9. -

      Use single keys to easily manage your Emacs windows or frames and -quickly retrieve saved window and frame configurations;

      -
    10. -
    11. -

      Search for things in your current buffers, in a directory tree or -across major web search engines with the touch of a few keys.

      -
    12. -
    -

    The common thread in all these features is making retrieval, -management and display of information fast and easy. That is -Hyperbole's purpose. It may be broad but it works amazingly well. If -it is textual information, Hyperbole can work with it. In contrast to -Org mode, Hyperbole works across all Emacs modes and speeds your work -by turning all kinds of references into clickable hyperlinks and -allowing you to create new hyperlinks by dragging between two windows. -The Hyperbole wiki page -explains the many ways it differs from and is complementary to Org -mode.

    -

    Hyperbole allows hypertext buttons to be embedded within unstructured -and structured files, mail messages and news articles. It offers -intuitive keyboard and mouse-based control of information display -within multiple windows. It also provides point-and-click access to -World-Wide Web URLs, Info manuals, ftp archives, etc.

    -

    Hyperbole includes easy-to-use, powerful hypertextual button types -without the need to learn a markup language. Hyperbole's button types -are written in Lisp and can be wholly independent of the web, i.e. web -links are one type of Hyperbole link, not fundamental to its link -architecture. However, Hyperbole is a great assistant when editing -HTML or Javascript or when browsing web pages and links.

    -

    Hyperbole is something to be experienced and interacted with, not -understood from reading alone. If you like an Emacs package to do -only one thing than Hyperbole is not for you, but if you would -rather learn fewer packages and get more work done faster, then -Hyperbole is for you.

    -

    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 is available for download and installation -through the GNU Emacs package manager.

    -

    -Mailing Lists

    - -

    -Ftp and Git Repository Downloads

    -

    To inspect the Hyperbole source code online rather than installing it for -use (which will also give you the source code), open a web page to:

    - -

    Alternatively, you may download a tar.gz source archive from either:

    - -

    which will find the closest mirror of the GNU ftp site and show it to you.

    -

    If you want to follow along with Hyperbole development and maintain a -copy/clone of the current version-controlled git tree, use a -command listed here -to clone the Hyperbole project tree.

    -

    -Installation

    -

    Once you have Emacs set up at your site, GNU Hyperbole may be -installed by using the Emacs Package Manager. If you are not -familiar with it, see the Packages section of the GNU Emacs Manual, -Emacs Packages.

    -

    If you have Hyperbole 5.10 or higher already installed and simply want to -upgrade it, invoke the Emacs Package Manager with {M-x list-packages RET}, -then use the {U} key followed by the {x} key to upgrade all out-of-date -packages, Hyperbole among them. Then skip the text below and move on to -the next section, Invocation.

    -

    Otherwise, to download and install the Hyperbole package, you should -add several lines to your personal Emacs initialization file, -typically "~/.emacs". For further details, see Emacs Init -File.

    -

    Below are the lines to add:

    -
    (require 'package)
    -(setq package-enable-at-startup nil) ;; Prevent double loading of libraries
    -(package-initialize)
    -(unless (package-installed-p 'hyperbole)
    -  (package-refresh-contents)
    -  (package-install 'hyperbole))
    -(require 'hyperbole)
    -
    -
    -

    Now save the file and then restart Emacs. Hyperbole will then be -downloaded and compiled for use with your version of Emacs; give it a -minute or two. You may see a bunch of compilation warnings but these -can be safely ignored.

    -

    -Invocation

    -

    Once Hyperbole has been installed for use at your site and loaded into your -Emacs session, it is ready for use. You will see a Hyperbole menu on your -menubar and {C-h h} will display a Hyperbole menu in the minibuffer for -quick keyboard-based selection.

    -

    You can invoke Hyperbole commands in one of three ways:

    -

    use the Hyperbole menu on your menubar;

    -

    Hyperbole Menubar Menu

    -

    type {C-h h} or {M-x hyperbole RET} to bring up the Hyperbole main menu -in the minibuffer window, for fast keyboard or mouse-based selection; -select an item from this menu by typing the item's first letter; use {q} -to quit from the menu.

    -

    use a specific Hyperbole command such as an Action Key click {M-RET} on -a pathname to display the associated file or directory.

    -

    Use {C-h h d d} for an interactive demonstration of standard Hyperbole -button capabilities.

    -

    Hyperbole screenshot of the DEMO

    -

    {C-h h k e} offers an interactive demonstration of the Koutliner, -Hyperbole's multi-level autonumbered hypertextual outliner.

    -

    Hyperbole screenshot of the Koutliner

    -

    To try out HyControl, Hyperbole's interactive frame and window control -system, use {C-h h s w} for window control or {C-h h s f} for frame -control. {t} switches between window and frame control once in one of -them. Hyperbole also binds {C-c } for quick access to HyControl's -window control menu if it was not already bound prior to Hyperbole's -initialization. A long video demonstrating many of HyControl's -features is available at https://youtu.be/M3-aMh1ccJk.

    -

    The above are the best interactive ways to learn about Hyperbole. -Hyperbole also includes the Hyperbole Manual, a full reference manual, -not a simple introduction. It is included in the "man/" subdirectory -of the Hyperbole package directory in four forms:

    -

    hyperbole.info - online Info browser version
    -hyperbole.html - web HTML version
    -hyperbole.pdf - printable version
    -hyperbole.texi - source form

    -

    The Hyperbole package installation places the Info version of this manual -where needed and adds an entry for Hyperbole into the Info directory under -the Emacs category. {C-h h d i} will let you browse the manual. For web -browsing, point your browser at "${hyperb:dir}/man/hyperbole.html", -wherever the Hyperbole package directory is on your system; often this is: -"~/.emacs.d/elpa/hyperbole-${hyperb:version}/".

    -

    -Hyperbole Components

    -

    Hyperbole consists of five parts:

    -
      -
    1. -

      Buttons and Smart Keys: A set of hyperbutton types which supply -core hypertext and other behaviors. Buttons may be added to -documents (explicit buttons) with a simple drag between windows, -no markup language needed. Implicit buttons are patterns -automatically recognized within text that perform actions, -e.g. bug#24568 displays the bug status information for that bug -number.

      -

      These actions may be links or arbitrary Lisp expressions. So -for example, you could create your own button type of -Wikipedia searches that jumped to the named Wikipedia page -whenever point was within text of the form [wp]. -You define the pattern so {} might do the same -thing if you preferred. And this works within any Emacs -buffer you want it to, regardless of major or minor mode.

      -

      Buttons are accessed by clicking on them or referenced by name -(global buttons), so they can be activated regardless of what is -on screen. Users can make simple changes to button types and -those familiar with Emacs Lisp can prototype and deliver new -types quickly with just a few lines of code.

      -

      Hyperbole includes two special `Smart Keys', the Action Key -and the Assist Key, that perform an extensive array of -context-sensitive operations across emacs usage, including -activating and showing help for Hyperbole buttons. In many -popular Emacs modes, they allow you to perform common, sometimes -complex operations without having to use a different key for each -operation. Just press a Smart Key and the right thing happens;

      -
    2. -
    3. -

      Contact and Text Finder: an interactive textual information -management interface, including fast, flexible file and text -finding commands. A powerful, hierarchical contact manager, -HyRolo, which anyone can use is also included. It is easy to -learn to use since it introduces only a few new mechanisms and -has a menu interface, which may be operated from the keyboard or -the mouse.

      -

      HyRolo Menubar Menu

      -
    4. -
    5. -

      Screen Control: Hyperbole includes HyControl, the fastest, -easiest-to-use window and frame control available for GNU -Emacs. With just a few keystrokes, you can shift from -increasing a window's height by 5 lines to moving a frame by -220 pixels or immediately moving it to a screen corner. Text -in each window or frame may be enlarged or shrunk (zoomed) for -easy viewing, plus many other features;

      -

      The broader vision for HyControl is to support persistent -window and frame configurations as link targets. Then a user -will be able to create the views of information he wants and -store them as links for rapid display. Work remains to -implement this feature but it helps explain the connection of -HyControl to the rest of Hyperbole;

      -
    6. -
    7. -

      The Koutliner: an advanced outliner with multi-level -autonumbering and permanent ids attached to each outline node for -use as hypertext link anchors, per node properties and flexible -view specifications that can be embedded within links or used -interactively;

      -
    8. -
    9. -

      Programming Library: a set of programming library classes for -system developers who want to integrate Hyperbole with another -user interface or as a back-end to a distinct system. (All of -Hyperbole is written in Emacs Lisp for ease of modification. -Hyperbole has been engineered for real-world usage and is well -structured).

      -
    10. -
    -

    We find Hyperbole's parts are more powerful as one package, i.e. the -sum is greater than the parts, so we don't offer them separately. -Hyperbole is free software, however, so you may modify it as you see -fit.

    -

    -Hyperbole Buttons

    -

    A Hyperbole hypertext user works with buttons; he may create, modify, move -or delete buttons. Each button performs a specific action, such as linking -to a file or executing a shell command.

    -

    There are three categories of Hyperbole buttons:

    -
      -
    1. -

      Explicit Buttons -created by Hyperbole, accessible from within a single document;

      -
    2. -
    3. -

      Global Buttons -created by Hyperbole, accessible anywhere within a user's -network of documents;

      -
    4. -
    5. -

      Implicit Buttons -buttons created and managed by other programs or embedded -within the structure of a document, accessible from within a -single document. Hyperbole recognizes implicit buttons by -contextual patterns given in their type specifications.

      -
    6. -
    -

    Hyperbole buttons may be clicked upon with a mouse to activate them or to -describe their actions. Thus, a user can always check how a button will act -before activating it. Buttons may also be activated from a keyboard. (In -fact, virtually all Hyperbole operations, including menu usage, may be -performed from any standard terminal interface, so one can use it on distant -machines that provide limited display access).

    -

    Hyperbole does not enforce any particular hypertext or information -management model, but instead allows you to organize your information in -large or small chunks as you see fit, organizing each bit as time allows. -The Hyperbole Koutliner and HyRolo tools organize textual hierarchies and -may also contain links to external information sources.

    -

    -Important Features

    -

    Some of Hyperbole's most important features include:

    -
      -
    • -

      Buttons may link to information or may execute commands, such as -computing a complex value or communicating with external programs;

      -
    • -
    • -

      Buttons are quick and easy to create with no programming nor -markup needed. One simply drags between a button source location -and a link destination to create or to modify a link button. The -same result can be achieved from the keyboard.

      -
    • -
    • -

      Buttons may be embedded within email messages and activated from -Emacs mail readers; hyperlinks may include variables so that they -work at different locations where the variable settings differ;

      -
    • -
    • -

      Koutlines allow rapid browsing, editing and movement of chunks of -information organized into trees (hierarchies) and offer links -that include viewspecs which determine how documents are to be -displayed, e.g. show just the first two lines of all levels in a -Koutline;

      -
    • -
    • -

      Other hypertext and information retrieval systems may be -encapsulated under a Hyperbole user interface very easily.

      -
    • -
    -

    -Hyperbole Uses

    -

    Typical Hyperbole applications include:

    -
      -
    • -

      Personal Information Management
      -Overlapping link paths provide a variety of views into an -information space. A single key press activates buttons -regardless of their types, making navigation easy.

      -

      A search facility locates buttons in context and permits quick -selection.

      -
    • -
    • -

      Documentation Browsing
      -Embedding cross-references in a favorite documentation format.

      -

      Addition of a point-and-click interface to existing documentation.

      -

      Linkage of code and design documents. Jumping to the definition -of an identifier from its use within code or its reference within -documentation.

      -
    • -
    • -

      Brainstorming
      -Capture of ideas and then quick reorganization with the Hyperbole -Koutliner. Link to related ideas, eliminating the need to copy -and paste information into a single place.

      -
    • -
    • -

      Help/Training Systems
      -Creation of tutorials with embedded buttons that show students how -things work while explaining the concepts, e.g. an introduction -to UNIX commands. This technique can be much more effective than -descriptions alone.

      -
    • -
    • -

      Archive Managers
      -Supplementation of programs that manage archives from incoming -information stream, having them add topic-based buttons that -link to the archive holdings. Users can then search and create -their own links to archive entries.

      -
    • -
    -

    -Files

    -

    See the HY-ABOUT file for a description and overview of Hyperbole.

    -

    See the HY-NEWS file for a summary of new features in this release.

    -

    See the INSTALL file for installation and invocation instructions.

    -

    See the HY-COPY and COPYING files for license information.

    -

    See the MANIFEST file for summaries of Hyperbole distribution files.

    -

    See DEMO for a demonstration of standard Hyperbole button capabilities. -This is the best way to initially interactively learn about Hyperbole after -installing it.

    -

    Various forms of the Hyperbole are below the "man/" subdirectory.

    -

    -Programmer Quick Reference

    -

    MANIFEST summarizes most of the files in the distribution.

    -

    See DEMO for a demonstration of standard Hyperbole button -capabilities. This is the best way to initially interactively learn -about Hyperbole. The Hyperbole Manual is a reference manual, not a -simple introduction.

    -

    Naming conventions:

    -
      -
    • -

      All Hyperbole-specific code files begin with an 'h', aside from the -Koutliner files which are in the kotl/ subdirectory and begin with a 'k'.

      -
    • -
    • -

      Hyperbole user-interface files begin with 'hui-' or 'hmous'.

      -
    • -
    • -

      Files that define implicit button types begin with 'hib'.

      -
    • -
    • -

      Encapsulations of foreign systems begin with 'hsys-'.

      -
    • -
    -

    Most of the standard Emacs user interface for Hyperbole is located in -hui.el. Most of the Hyperbole application programming -interface can be found in hbut.el. hbdata.el -encapsulates the button attribute storage implemented by Hyperbole. -hmail.el provides a basic abstract interface for -integrating mail readers other than Rmail into Hyperbole.

    -

    See the [Hyperbole Questions and Answers](man/hyperbole.html#Questions -and Answers) appendix in the Hyperbole manual for information on how -to alter the default context-sensitive Hyperbole key bindings (Smart -Keys).

    -

    -User Quotes

    -

    *** MAN I love Hyperbole!!! Wow! ***

    -
                        -- Ken Olstad  
    -                       Cheyenne Software, Inc.
    -
    -
    -

    I love koutlines.

    -
                        -- Bob Glickstein  
    -                       Z-Code Software Corporation
    -
    -
    -

    One of the nicest things about Hyperbole is that it's available -everywhere. Org-mode is a mode and its features are only available in -Org files. For instance if you dropped into eshell' or ansi-term' and -did `ls', you can move point to any of the directory's contents, do M-RET -(or Shift-Button2) and jump to that file. And that's just one example. -Note that this means that all Hyperbole functionality is available in -Org files as well. To me, except for the Hyperbole outliner, that means -complementary not conflicting. It's Hyperbole and org-mode, not -Hyperbole vs. org-mode.

    -

    Additionally, off the bat, I found it very well documented and for me -that's a proxy for the quality of a package. The maintainers are quite -responsive. There's plenty more functionality that I haven't uncovered yet -but due to the ease of installation and the quality of the documentation, -digging into it is actually fun.

    -
                        -- Aditya Siram  
    -
    -
    -

    For me, Emacs isn't Emacs without Hyperbole. I have depended on Hyperbole -daily since 1992, when I first started using it to manage my development -environment. It didn't take long before I could summon almost any -information I needed directly from within my editing environment with an -implicit button. Since I almost never have to slow down to look for -things--one context-dependent button usually produces exactly what I need ---I am able to maintain focus on the task I am working on and complete it -more quickly. With its gestural interface, seamless integration with other -Emacs packages and incredibly useful set of core features. I think that -Hyperbole is one of the best designed and most easily extensible software -products I have ever come across. It is certainly the one which has made -the biggest improvement in my personal productivity.

    -
                        -- Chris Nuzum  
    -                       Co-founder, Traction Software, Inc.
    -
    -
    -

    I've found Hyperbole (in conjunction with XEmacs) to be very useful -for signal processing algorithm development.

    -

    For me, it has almost completely obsoleted the engineering notebook: -I keep a set of files with ideas, algorithms, and results, linked -together and to the implementation in C++ files. Using XEmacs' -support for embedding graphics, I've written a mode that accepts -image tags (formatted like HTML), and reads in GIF files to display -plots. I have another program that converts the file to HTML (not -perfect, but adequate), so I can put any aspect of development on -our internal web for others to see.

    -
                        -- Farzin Guilak  
    -                       Protocol Systems, Inc., Engineer
    -
    -
    -

    I am blind and have been using Hyperbole since 1992. I used to use a PC as -a talking terminal attached to a UNIX system, but then I developed -Emacspeak which lets me use Emacs and Hyperbole from standard UNIX -workstations with an attached voice synthesizer.

    -

    My main uses are:

    -
      -
    1. -

      Global and implicit buttons for jumping to ftp sites.

      -
    2. -
    3. -

      The contact manager with Emacspeak support.

      -
    4. -
    5. -

      Explicit buttons as part of comments made about a structured document. -Each button jumps to the document section referred to by the comment. -This is very, very useful.

      -
    6. -
    7. -

      The Hyperbole Koutliner, which I find a very useful tool. I've -implemented Emacspeak extensions to support it.

      -
                    -- TV Raman  
      -                 Google Inc.
      -
      -
    8. -
    -
    -

    I've been a grateful Hyperbole user for a few years now. Hyperbole's -flexibility and ease of use is a marvel.

    -

    Mainly, I write easy little implicit button types (and corresponding action -types) to make my life easier. For example, I have an implicit button type -to bury certain buffers when I click at their bottoms, one that recognizes -a bug report record in various contexts and edits it, one that links pieces -of test output in a log file to the corresponding test case source code -(EXTREMELY helpful in interpreting test output), others that support our -homegrown test framework, one that handles tree dired mode the way I'd -like, one that completely handles wico menus (I've also overloaded the -wconfig actions triggered by diagonal mouse drags with wicos actions), and -a couple that support interaction with BBDB.

    -

    Other than that, I keep a global button file with 30 or so explicit buttons -that do various little things, and I index saved mail messages by putting -explicit link-to-mail buttons in an outline file.

    -
                        -- Ken Olstad  
    -                       Cheyenne Software, Inc.
    -
    -
    -

    In general, Hyperbole is an embeddable, highly extensible hypertext -tool. As such, I find it very useful. As it stands now, Hyperbole is -particularly helpful for organizing ill-structured or loosely coupled -information, in part because there are few tools geared for this purpose. -Hyperbole also possesses a lot of potential in supporting a wider -spectrum of structuredness, ranging from unstructured to highly -structured environments, as well as structural changes over time.

    -

    Major Uses:

    -
      -
    • -

      Menu interface to our own collaborative support environment called -CoReView: This interface brings together all top-level user commands -into a single partitioned screen, and allows the end user to interact -with the system using simple mouse-clicking instead of the meta-x key.

      -
    • -
    • -

      Gateway to internet resources: this includes links to major Internet -archive sites of various types of information. Links are made at both -directory and file levels.

      -
    • -
    • -

      Alternative directory organizer: The hierarchical nature of the Unix -file system sometimes makes it difficult to find things quickly and -easily using directory navigational tools such as dired. Hyperbole -enables me to create various "profile" views of my directory tree, with -entries in these views referring to files anywhere in the hierarchy.

      -
    • -
    • -

      Organizing and viewing online documentation: using Hyperbole along with -Hyper-man and Info makes it truly easy to look up online documentation.

      -
    • -
    • -

      Other desktop organization tasks: including links to various mail -folders, saved newsgroup conversation threads, online note-taker, -emacs-command invocations, etc.

      -
                      -- Dadong Wan  
      -                   University of Hawaii
      -
      -
    • -
    -
    -

    Hyperbole is the first hyper-link system I've run across that is -actually part of the environment I use regularly, namely Emacs. The -complete flexibility of the links is both impressive and expected -- the -idea of making the link itself programmable is clever, and given that one -assumes the full power of Emacs. Being able to send email with buttons -in it is a very powerful capability. Using ange-ftp mode, one can make -file references "across the world" as easily as normal file references.

    -
                        -- Mark Eichin  
    -                       Cygnus Support
    -
    -
    -

    I just wanted to say how much I enjoy using the Hyperbole Koutliner. -It is a great way to quickly construct very readable technical documents -that I can pass around to others. Thanks for the great work.

    -
                        -- Jeff Fried  
    -                       Informix
    -
    -
    -

    The Hyperbole system provides a nice interface to exploring corners of -Unix that I didn't know existed before.

    -
                        -- Craig Smith  
    -
    -

    -Why was Hyperbole developed?

    -

    Hyperbole was originally designed to aid in research aimed at Personalized -Information production/retrieval Environments (PIEs). Hyperbole was a -PIE Manager that provided services to PIE Tools. PIEmail, a mail reader was -the only PIE Tool developed as part of this research but Hyperbole has -greatly expanded since then and has long been a production quality toolset.

    -

    An examination of many hypertext environments as background research did -not turn up any that seemed suitable for the research envisioned, mainly -due to the lack of rich, portable programmer and user environments. We also -tired of trying to manage our own distributed information pools with standard -UNIX tools. And so Hyperbole was conceived and raved about until it -got its name.

    -

    Since then Hyperbole has proved indispensible at improving information -access and organization in daily use over many years. Why not start -improving your information handling efficiency today?

    -

    -- The End --

    - diff --git a/_hypb b/_hypb index a3c7217..65fd41d 100644 Binary files a/_hypb and b/_hypb differ diff --git a/hargs.el b/hargs.el index f87628e..57b78a6 100644 --- a/hargs.el +++ b/hargs.el @@ -99,12 +99,14 @@ interactive form or takes no arguments." (subst-char-in-string ?\^@ ?: string t))) (defun hargs:delimited (start-delim end-delim - &optional start-regexp-flag end-regexp-flag list-positions-flag) + &optional start-regexp-flag end-regexp-flag + list-positions-flag exclude-regexp) "Returns a normalized, single line, delimited string that point is within the first line of, or nil. START-DELIM and END-DELIM are strings that specify the argument delimiters. With optional START-REGEXP-FLAG non-nil, START-DELIM is treated as a regular expression. END-REGEXP-FLAG is similar. -With optional LIST-POSITIONS-FLAG, return list of (string-matched start-pos end-pos)." +With optional LIST-POSITIONS-FLAG, return list of (string-matched start-pos end-pos). +With optional EXCLUDE-REGEXP, any matched string is ignored if it this regexp." (let* ((opoint (point)) (limit (if start-regexp-flag opoint (+ opoint (1- (length start-delim))))) @@ -156,12 +158,13 @@ With optional LIST-POSITIONS-FLAG, return list of (string-matched start-pos end- (< start end) (>= end opoint) (let ((string (hargs:buffer-substring start end))) - (setq string (hypb:replace-match-string "[\n\r\f]\\s-*" string " " t)) - (unless hyperb:microsoft-os-p - (setq string (hpath:mswindows-to-posix string))) - (if list-positions-flag - (list string start end) - string))))))) + (unless (and (stringp exclude-regexp) (string-match exclude-regexp string) ) + (setq string (hypb:replace-match-string "[\n\r\f]\\s-*" string " " t)) + (unless hyperb:microsoft-os-p + (setq string (hpath:mswindows-to-posix string))) + (if list-positions-flag + (list string start end) + string)))))))) (defun hargs:get (interactive-entry &optional default prior-arg) "Prompts for an argument, if need be, from INTERACTIVE-ENTRY, a string. diff --git a/hmh.el b/hmh.el index 38ac5c9..919903b 100644 --- a/hmh.el +++ b/hmh.el @@ -1,4 +1,4 @@ -;;; hmh.el --- GNU Hyperbole buttons in mail reader: Mh +;;; hmh.el --- GNU Hyperbole buttons in mail reader: Mh ;; ;; Author: Bob Weiner ;; diff --git a/hmouse-drv.el b/hmouse-drv.el index eb21235..0000049 100644 --- a/hmouse-drv.el +++ b/hmouse-drv.el @@ -238,13 +238,8 @@ Any ARGS will be passed to `hmouse-function'." hkey-value nil)))) ;;; Smart Key Commands -(defun action-key () - "Use one key to perform functions that vary by context. -If no matching context is found, the default function set with -the `action-key-default-function' variable is run. Return t -unless the `action-key-default-function' variable is not bound to -a valid function." - (interactive) +(defun action-key-clear-variables () + "Clear all Action Key variables." ;; Clear all these variables so there can be no confusion between ;; mouse presses and keyboard presses. (setq action-key-depress-prev-point nil @@ -254,7 +249,29 @@ a valid function." action-key-release-position nil action-key-release-args nil action-key-release-window nil - action-key-release-prev-point nil) + action-key-release-prev-point nil)) + +(defun assist-key-clear-variables () + "Clear all Assist Key variables." + ;; Clear all these variables so there can be no confusion between + ;; mouse presses and keyboard presses. + (setq assist-key-depress-prev-point nil + assist-key-depress-position nil + assist-key-depress-args nil + assist-key-depress-window nil + assist-key-release-position nil + assist-key-release-args nil + assist-key-release-window nil + assist-key-release-prev-point nil)) + +(defun action-key () + "Use one key to perform functions that vary by context. +If no matching context is found, the default function set with +the `action-key-default-function' variable is run. Return t +unless the `action-key-default-function' variable is not bound to +a valid function." + (interactive) + (action-key-clear-variables) (prog1 (action-key-internal) (run-hooks 'action-key-depress-hook 'action-key-release-hook))) @@ -275,16 +292,7 @@ the `assist-key-default-function' variable is run. Return non-nil unless `assist-key-default-function' variable is not bound to a valid function." (interactive) - ;; Clear all these variables so there can be no confusion between - ;; mouse presses and keyboard presses. - (setq assist-key-depress-prev-point nil - assist-key-depress-position nil - assist-key-depress-args nil - assist-key-depress-window nil - assist-key-release-position nil - assist-key-release-args nil - assist-key-release-window nil - assist-key-release-prev-point nil) + (assist-key-clear-variables) (prog1 (assist-key-internal) (run-hooks 'assist-key-depress-hook 'assist-key-release-hook))) @@ -719,6 +727,10 @@ Return non-nil iff a non-nil predicate is found." With optional ASSIST-FLAG non-nil, display help for the Assist Key command. Return non-nil iff associated help documentation is found." (interactive "P") + (unless (or action-key-depressed-flag action-key-help-flag) + (action-key-clear-variables)) + (unless (or assist-key-depressed-flag assist-key-help-flag) + (assist-key-clear-variables)) (let ((hkey-forms hmouse-alist) hkey-form pred-value call calls cmd-sym doc) (while (and (null pred-value) (setq hkey-form (car hkey-forms))) diff --git a/hmouse-mod.el b/hmouse-mod.el index 0c3df2b..4417e2f 100644 --- a/hmouse-mod.el +++ b/hmouse-mod.el @@ -1,4 +1,4 @@ -;;; hmouse-mod.el --- Action Key acts as CONTROL modifier and Assist Key as META modifier. +;;; hmouse-mod.el --- Action Key acts as CONTROL modifier and Assist Key as META modifier. ;; ;; Author: Bob Weiner ;; diff --git a/hpath.el b/hpath.el index cd7d80a..ebc17b0 100644 --- a/hpath.el +++ b/hpath.el @@ -704,9 +704,9 @@ With optional INCLUDE-POSITIONS, returns a triplet list of (path start-pos end-pos) or nil." ;; Prevents MSWindows to Posix path substitution (let ((hyperb:microsoft-os-p t)) - (or (hargs:delimited "\"" "\"" nil nil include-positions) + (or (hargs:delimited "\"" "\"" nil nil include-positions "[`'’]") ;; Filenames in Info docs or Python files - (hargs:delimited "[`'‘]" "[`'’]" t t include-positions) + (hargs:delimited "[`'‘]" "[`'’]" t t include-positions "\"") ;; Filenames in TexInfo docs (hargs:delimited "@file{" "}" nil nil include-positions) ;; Any existing whitespace delimited filename at point. diff --git a/hsys-www.el b/hsys-www.el index c46b138..663a7c1 100644 --- a/hsys-www.el +++ b/hsys-www.el @@ -1,4 +1,4 @@ -;;; hsys-www.el --- GNU Hyperbole support for Emacs World-Wide Web (WWW) browsing +;;; hsys-www.el --- GNU Hyperbole support for Emacs World-Wide Web (WWW) browsing ;; ;; Author: Bob Weiner ;; diff --git a/htz.el b/htz.el index f467077..3341d6b 100644 --- a/htz.el +++ b/htz.el @@ -1,4 +1,4 @@ -;;; htz.el --- Timezone-based time and date support for GNU Hyperbole +;;; htz.el --- Timezone-based time and date support for GNU Hyperbole ;; ;; Author: Masanobu Umeda / Bob Weiner ;; diff --git a/hui-jmenu.el b/hui-jmenu.el index 5ff0543..59b4861 100644 --- a/hui-jmenu.el +++ b/hui-jmenu.el @@ -1,4 +1,4 @@ -;;; hui-jmenu.el --- Popup menus for jumping to and managing buffers, frames, and windows +;;; hui-jmenu.el --- Popup menus for jumping to and managing buffers, frames, and windows ;; ;; Author: Bob Weiner ;; diff --git a/hui-mouse.el b/hui-mouse.el index ae34581..8f4f94b 100644 --- a/hui-mouse.el +++ b/hui-mouse.el @@ -631,7 +631,7 @@ If assist-key is pressed: ;;; ************************************************************************ ;; These functions are called from hkey-alist when keyboard Smart Keys -;; are used but for mouse keys, they are bound to local keys in +;; are used. For mouse keys, they are bound to local keys in ;; company-mode's minor mode map. (defun smart-company-to-definition (event) diff --git a/hui-select.el b/hui-select.el index a12365e..895ad21 100644 --- a/hui-select.el +++ b/hui-select.el @@ -1,4 +1,4 @@ -;;; hui-select.el --- Select larger and larger syntax-driven regions in a buffer. +;;; hui-select.el --- Select larger and larger syntax-driven regions in a buffer. ;; ;; Author: Bob Weiner ;; diff --git a/hui-window.el b/hui-window.el index 26a94b0..703e490 100644 --- a/hui-window.el +++ b/hui-window.el @@ -173,7 +173,7 @@ drag release window.") ;;; Add window handling to hmouse-alist dispatch table. (defvar hmouse-alist) -(defun hui-window--register () +(defun hmouse-alist-add-window-handlers () (unless (assoc #'(hmouse-inactive-minibuffer-p) hmouse-alist) (setq hmouse-alist (append @@ -241,7 +241,7 @@ drag release window.") ;; ) hmouse-alist)))) -(with-eval-after-load 'hui-mouse (hui-window--register)) +(with-eval-after-load 'hui-mouse (hmouse-alist-add-window-handlers)) ;;; ************************************************************************ ;;; Public functions diff --git a/hui-xe-but.el b/hui-xe-but.el index 7e216ac..458a52a 100644 --- a/hui-xe-but.el +++ b/hui-xe-but.el @@ -1,4 +1,4 @@ -;;; hui-xe-but.el --- XEmacs button highlighting and flashing support +;;; hui-xe-but.el --- XEmacs button highlighting and flashing support ;; ;; Author: Bob Weiner ;; diff --git a/hui.el b/hui.el index 011e13a..f0d1d48 100644 --- a/hui.el +++ b/hui.el @@ -1,4 +1,4 @@ -;;; hui.el --- GNU Hyperbole button and hyperlink user interface +;;; hui.el --- GNU Hyperbole button and hyperlink user interface ;; ;; Author: Bob Weiner ;; diff --git a/hversion.el b/hversion.el index b883001..5329608 100644 --- a/hversion.el +++ b/hversion.el @@ -23,17 +23,17 @@ ;;; Public variables ;;; ************************************************************************ -(defconst hyperb:version "7.0.2b" "GNU Hyperbole revision number.") +(defconst hyperb:version "7.0.2c" "GNU Hyperbole revision number.") ;;;###autoload (defvar hyperb:microsoft-os-p (memq system-type '(ms-windows windows-nt ms-dos win32)) - "T iff Hyperbole is running under a Microsoft OS.") + "Non-nil iff Hyperbole is running under a Microsoft OS but not under Windows Subsystem for Linux (WSL). +Use `hyperb:wsl-os-p' to test if running under WSL.") ;;;###autoload (defvar hyperb:wsl-os-p - (and (memq system-type '(gnu/linux)) - (executable-find "wsl.exe")) + (and (eq system-type 'gnu/linux) (executable-find "wsl.exe") t) "T iff Hyperbole is running under Microsoft Windows Subsystem for Linux (WSL).") ;;;###autoload diff --git a/hvm.el b/hvm.el index 50417dd..8351d0e 100644 --- a/hvm.el +++ b/hvm.el @@ -1,4 +1,4 @@ -;;; hvm.el --- GNU Hyperbole buttons in mail reader: Vm +;;; hvm.el --- GNU Hyperbole buttons in mail reader: Vm ;; ;; Author: Bob Weiner ;; diff --git a/hyperbole-pkg.el b/hyperbole-pkg.el index 3a94cb7..5ca5087 100644 --- a/hyperbole-pkg.el +++ b/hyperbole-pkg.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t -*- -(define-package "hyperbole" "7.0.2b" "GNU Hyperbole: The Everyday Hypertextual Information Manager" +(define-package "hyperbole" "7.0.2c" "GNU Hyperbole: The Everyday Hypertextual Information Manager" '((emacs "24.4")) :url "http://www.gnu.org/software/hyperbole" :keywords '("comm" "convenience" "files" "frames" "hypermedia" "languages" diff --git a/hyperbole.el b/hyperbole.el index 4aa427d..dd431c4 100644 --- a/hyperbole.el +++ b/hyperbole.el @@ -6,7 +6,7 @@ ;; Maintainer: Bob Weiner and Mats Lidell ;; Created: 06-Oct-92 at 11:52:51 ;; Released: 21-Jan-19 -;; Version: 7.0.3 +;; Version: 7.0.2c ;; Keywords: comm, convenience, files, frames, hypermedia, languages, mail, matching, mouse, multimedia, outlines, tools, wp ;; Package: hyperbole ;; Package-Requires: ((emacs "24.4")) diff --git a/hyrolo-logic.el b/hyrolo-logic.el index e257df8..d532b6c 100644 --- a/hyrolo-logic.el +++ b/hyrolo-logic.el @@ -1,4 +1,4 @@ -;;; hyrolo-logic.el --- Logic functions for GNU Hyperbole Rolo files +;;; hyrolo-logic.el --- Logic functions for GNU Hyperbole Rolo files ;; ;; Author: Bob Weiner ;; diff --git a/kotl/kotl-autoloads.el b/kotl/kotl-autoloads.el index 3b33e73..bf3492d 100644 --- a/kotl/kotl-autoloads.el +++ b/kotl/kotl-autoloads.el @@ -5,7 +5,7 @@ ;;; Code: -;;;### (autoloads nil "kexport" "kexport.el" (23052 37373 0 0)) +;;;### (autoloads nil "kexport" "kexport.el" (0 0 0 0)) ;;; Generated autoloads from kexport.el (autoload 'kexport:html "kexport" "\ @@ -18,6 +18,8 @@ STILL TODO: \(fn EXPORT-FROM OUTPUT-TO &optional SOFT-NEWLINES-FLAG)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kexport" '("kexport:"))) + ;;;*** ;;;### (autoloads nil "kfile" "kfile.el" (22415 50714 78447 943000)) @@ -41,7 +43,14 @@ View an existing kotl version-2 file FILE-NAME in a read-only mode. ;;;*** -;;;### (autoloads nil "kimport" "kimport.el" (23051 38597 0 0)) +;;;### (autoloads nil "kfill" "kfill.el" (0 0 0 0)) +;;; Generated autoloads from kfill.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kfill" '("fill-paragraph" "kfill:" "prior-fill-prefix" "set-fill-prefix"))) + +;;;*** + +;;;### (autoloads nil "kimport" "kimport.el" (0 0 0 0)) ;;; Generated autoloads from kimport.el (defvar kimport:mode-alist '((t . kimport:text) (outline-mode . kimport:star-outline)) "\ @@ -126,6 +135,8 @@ The variable, `paragraph-start,' is used to determine paragraphs. \(fn IMPORT-FROM OUTPUT-TO &optional CHILDREN-P)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kimport" '("kimport:"))) + ;;;*** ;;;### (autoloads nil "klink" "klink.el" (22481 28335 0 0)) @@ -140,7 +151,14 @@ See documentation for `kcell:ref-to-id' for valid cell-ref formats. ;;;*** -;;;### (autoloads nil "kotl-mode" "kotl-mode.el" (22989 19633 0 0)) +;;;### (autoloads nil "kmenu" "kmenu.el" (0 0 0 0)) +;;; Generated autoloads from kmenu.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kmenu" '("id-" "kotl-"))) + +;;;*** + +;;;### (autoloads nil "kotl-mode" "kotl-mode.el" (0 0 0 0)) ;;; Generated autoloads from kotl-mode.el (autoload 'kotl-mode "kotl-mode" "\ @@ -189,11 +207,26 @@ Signal an error if current buffer is not a Hyperbole outline, else return t. \(fn)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kotl-mode" '("delete-selection-pre-hook" "kotl-mode" "yank-"))) + +;;;*** + +;;;### (autoloads nil "kview" "kview.el" (0 0 0 0)) +;;; Generated autoloads from kview.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kview" '("kcell-view:" "kview:"))) + +;;;*** + +;;;### (autoloads nil "kvspec" "kvspec.el" (0 0 0 0)) +;;; Generated autoloads from kvspec.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "kvspec" '("kvspec:"))) + ;;;*** -;;;### (autoloads nil nil ("kcell.el" "kfill.el" "klabel.el" "kmenu.el" -;;;;;; "knode.el" "kprop-em.el" "kprop-xe.el" "kproperty.el" "kview.el" -;;;;;; "kvspec.el") (22989 23220 0 0)) +;;;### (autoloads nil nil ("kcell.el" "klabel.el" "knode.el" "kprop-em.el" +;;;;;; "kprop-xe.el" "kproperty.el") (0 0 0 0)) ;;;*** diff --git a/man/hkey-help.txt b/man/hkey-help.txt index 2ba4cad..492d75c 100644 --- a/man/hkey-help.txt +++ b/man/hkey-help.txt @@ -73,6 +73,8 @@ Mouse-only Control Hyperbole Key Press/Click in Special Modes Region Active Yanks region at release Kills and yanks at release + Company Mode Completion Displays definition Displays documentation + Treemacs Displays item Display item Emacs Push Button Activates button Button help Thing Begin or End Mark thing region Mark & kill thing region Page Directory Listing Jumps to page <- same diff --git a/man/hyperbole.html b/man/hyperbole.html index 44b27b4..9ea74f5 100644 --- a/man/hyperbole.html +++ b/man/hyperbole.html @@ -1,7 +1,7 @@ **Table of Contents** diff --git a/README.md.html b/README.md.html index e69de29..0ed4301 100644 --- a/README.md.html +++ b/README.md.html @@ -0,0 +1,620 @@ +

    +GNU Hyperbole 7.0.3 - The Everyday Hypertextual Information Manager

    +

    [Say thanks if you like Hyperbole.(https://saythanks.io/to/rswgnu)]

    + +

    Table of Contents

    + + +

    Hyperbole screenshot of the Koutliner, DEMO file and HyRolo

    +

    +Summary

    +

    GNU Hyperbole (pronounced Ga-new Hi-per-bo-lee), or just Hyperbole, +is an easy-to-use, yet powerful and programmable hypertextual information +management system implemented as a GNU Emacs package. It offers rapid views +and interlinking of all kinds of textual information, utilizing Emacs for +editing. It can dramatically increase your productivity and greatly reduce +the number of keyboard/mouse keys you'll need to work efficiently.

    +

    Hyperbole lets you:

    +
      +
    1. +

      Quickly create hyperlink buttons either from the keyboard or by dragging +between a source and destination window with a mouse button depressed. +Later, activate buttons by pressing/clicking on them or by giving the +name of the button.

      +
    2. +
    3. +

      Activate many kinds of implicit buttons recognized by context +within text buffers, e.g. URLs, grep output lines, and git commits. +A single key or mouse button automatically does the right thing in +dozens of contexts; just press and go.

      +
    4. +
    5. +

      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;

      +
    6. +
    7. +

      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;

      +
    8. +
    9. +

      Use single keys to easily manage your Emacs windows or frames and +quickly retrieve saved window and frame configurations;

      +
    10. +
    11. +

      Search for things in your current buffers, in a directory tree or +across major web search engines with the touch of a few keys.

      +
    12. +
    +

    The common thread in all these features is making retrieval, +management and display of information fast and easy. That is +Hyperbole's purpose. It may be broad but it works amazingly well. If +it is textual information, Hyperbole can work with it. In contrast to +Org mode, Hyperbole works across all Emacs modes and speeds your work +by turning all kinds of references into clickable hyperlinks and +allowing you to create new hyperlinks by dragging between two windows. +The Hyperbole wiki page +explains the many ways it differs from and is complementary to Org +mode.

    +

    Hyperbole allows hypertext buttons to be embedded within unstructured +and structured files, mail messages and news articles. It offers +intuitive keyboard and mouse-based control of information display +within multiple windows. It also provides point-and-click access to +World-Wide Web URLs, Info manuals, ftp archives, etc.

    +

    Hyperbole includes easy-to-use, powerful hypertextual button types +without the need to learn a markup language. Hyperbole's button types +are written in Lisp and can be wholly independent of the web, i.e. web +links are one type of Hyperbole link, not fundamental to its link +architecture. However, Hyperbole is a great assistant when editing +HTML or Javascript or when browsing web pages and links.

    +

    Hyperbole is something to be experienced and interacted with, not +understood from reading alone. If you like an Emacs package to do +only one thing than Hyperbole is not for you, but if you would +rather learn fewer packages and get more work done faster, then +Hyperbole is for you.

    +

    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 is available for download and installation +through the GNU Emacs package manager.

    +

    +Mailing Lists

    + +

    +Ftp and Git Repository Downloads

    +

    To inspect the Hyperbole source code online rather than installing it for +use (which will also give you the source code), open a web page to:

    + +

    Alternatively, you may download a tar.gz source archive from either:

    + +

    which will find the closest mirror of the GNU ftp site and show it to you.

    +

    If you want to follow along with Hyperbole development and maintain a +copy/clone of the current version-controlled git tree, use a +command listed here +to clone the Hyperbole project tree.

    +

    +Installation

    +

    Once you have Emacs set up at your site, GNU Hyperbole may be +installed by using the Emacs Package Manager. If you are not +familiar with it, see the Packages section of the GNU Emacs Manual, +Emacs Packages.

    +

    If you have Hyperbole 5.10 or higher already installed and simply want to +upgrade it, invoke the Emacs Package Manager with {M-x list-packages RET}, +then use the {U} key followed by the {x} key to upgrade all out-of-date +packages, Hyperbole among them. Then skip the text below and move on to +the next section, Invocation.

    +

    Otherwise, to download and install the Hyperbole package, you should +add several lines to your personal Emacs initialization file, +typically "~/.emacs". For further details, see Emacs Init +File.

    +

    Below are the lines to add:

    +
    (require 'package)
    +(setq package-enable-at-startup nil) ;; Prevent double loading of libraries
    +(package-initialize)
    +(unless (package-installed-p 'hyperbole)
    +  (package-refresh-contents)
    +  (package-install 'hyperbole))
    +(require 'hyperbole)
    +
    +
    +

    Now save the file and then restart Emacs. Hyperbole will then be +downloaded and compiled for use with your version of Emacs; give it a +minute or two. You may see a bunch of compilation warnings but these +can be safely ignored.

    +

    +Invocation

    +

    Once Hyperbole has been installed for use at your site and loaded into your +Emacs session, it is ready for use. You will see a Hyperbole menu on your +menubar and {C-h h} will display a Hyperbole menu in the minibuffer for +quick keyboard-based selection.

    +

    You can invoke Hyperbole commands in one of three ways:

    +

    use the Hyperbole menu on your menubar;

    +

    Hyperbole Menubar Menu

    +

    type {C-h h} or {M-x hyperbole RET} to bring up the Hyperbole main menu +in the minibuffer window, for fast keyboard or mouse-based selection; +select an item from this menu by typing the item's first letter; use {q} +to quit from the menu.

    +

    use a specific Hyperbole command such as an Action Key click {M-RET} on +a pathname to display the associated file or directory.

    +

    Use {C-h h d d} for an interactive demonstration of standard Hyperbole +button capabilities.

    +

    Hyperbole screenshot of the DEMO

    +

    {C-h h k e} offers an interactive demonstration of the Koutliner, +Hyperbole's multi-level autonumbered hypertextual outliner.

    +

    Hyperbole screenshot of the Koutliner

    +

    To try out HyControl, Hyperbole's interactive frame and window control +system, use {C-h h s w} for window control or {C-h h s f} for frame +control. {t} switches between window and frame control once in one of +them. Hyperbole also binds {C-c } for quick access to HyControl's +window control menu if it was not already bound prior to Hyperbole's +initialization. A long video demonstrating many of HyControl's +features is available at https://youtu.be/M3-aMh1ccJk.

    +

    The above are the best interactive ways to learn about Hyperbole. +Hyperbole also includes the Hyperbole Manual, a full reference manual, +not a simple introduction. It is included in the "man/" subdirectory +of the Hyperbole package directory in four forms:

    +

    hyperbole.info - online Info browser version
    +hyperbole.html - web HTML version
    +hyperbole.pdf - printable version
    +hyperbole.texi - source form

    +

    The Hyperbole package installation places the Info version of this manual +where needed and adds an entry for Hyperbole into the Info directory under +the Emacs category. {C-h h d i} will let you browse the manual. For web +browsing, point your browser at "${hyperb:dir}/man/hyperbole.html", +wherever the Hyperbole package directory is on your system; often this is: +"~/.emacs.d/elpa/hyperbole-${hyperb:version}/".

    +

    +Hyperbole Components

    +

    Hyperbole consists of five parts:

    +
      +
    1. +

      Buttons and Smart Keys: A set of hyperbutton types which supply +core hypertext and other behaviors. Buttons may be added to +documents (explicit buttons) with a simple drag between windows, +no markup language needed. Implicit buttons are patterns +automatically recognized within text that perform actions, +e.g. bug#24568 displays the bug status information for that bug +number.

      +

      These actions may be links or arbitrary Lisp expressions. So +for example, you could create your own button type of +Wikipedia searches that jumped to the named Wikipedia page +whenever point was within text of the form [wp]. +You define the pattern so {} might do the same +thing if you preferred. And this works within any Emacs +buffer you want it to, regardless of major or minor mode.

      +

      Buttons are accessed by clicking on them or referenced by name +(global buttons), so they can be activated regardless of what is +on screen. Users can make simple changes to button types and +those familiar with Emacs Lisp can prototype and deliver new +types quickly with just a few lines of code.

      +

      Hyperbole includes two special `Smart Keys', the Action Key +and the Assist Key, that perform an extensive array of +context-sensitive operations across emacs usage, including +activating and showing help for Hyperbole buttons. In many +popular Emacs modes, they allow you to perform common, sometimes +complex operations without having to use a different key for each +operation. Just press a Smart Key and the right thing happens;

      +
    2. +
    3. +

      Contact and Text Finder: an interactive textual information +management interface, including fast, flexible file and text +finding commands. A powerful, hierarchical contact manager, +HyRolo, which anyone can use is also included. It is easy to +learn to use since it introduces only a few new mechanisms and +has a menu interface, which may be operated from the keyboard or +the mouse.

      +

      HyRolo Menubar Menu

      +
    4. +
    5. +

      Screen Control: Hyperbole includes HyControl, the fastest, +easiest-to-use window and frame control available for GNU +Emacs. With just a few keystrokes, you can shift from +increasing a window's height by 5 lines to moving a frame by +220 pixels or immediately moving it to a screen corner. Text +in each window or frame may be enlarged or shrunk (zoomed) for +easy viewing, plus many other features;

      +

      The broader vision for HyControl is to support persistent +window and frame configurations as link targets. Then a user +will be able to create the views of information he wants and +store them as links for rapid display. Work remains to +implement this feature but it helps explain the connection of +HyControl to the rest of Hyperbole;

      +
    6. +
    7. +

      The Koutliner: an advanced outliner with multi-level +autonumbering and permanent ids attached to each outline node for +use as hypertext link anchors, per node properties and flexible +view specifications that can be embedded within links or used +interactively;

      +
    8. +
    9. +

      Programming Library: a set of programming library classes for +system developers who want to integrate Hyperbole with another +user interface or as a back-end to a distinct system. (All of +Hyperbole is written in Emacs Lisp for ease of modification. +Hyperbole has been engineered for real-world usage and is well +structured).

      +
    10. +
    +

    We find Hyperbole's parts are more powerful as one package, i.e. the +sum is greater than the parts, so we don't offer them separately. +Hyperbole is free software, however, so you may modify it as you see +fit.

    +

    +Hyperbole Buttons

    +

    A Hyperbole hypertext user works with buttons; he may create, modify, move +or delete buttons. Each button performs a specific action, such as linking +to a file or executing a shell command.

    +

    There are three categories of Hyperbole buttons:

    +
      +
    1. +

      Explicit Buttons +created by Hyperbole, accessible from within a single document;

      +
    2. +
    3. +

      Global Buttons +created by Hyperbole, accessible anywhere within a user's +network of documents;

      +
    4. +
    5. +

      Implicit Buttons +buttons created and managed by other programs or embedded +within the structure of a document, accessible from within a +single document. Hyperbole recognizes implicit buttons by +contextual patterns given in their type specifications.

      +
    6. +
    +

    Hyperbole buttons may be clicked upon with a mouse to activate them or to +describe their actions. Thus, a user can always check how a button will act +before activating it. Buttons may also be activated from a keyboard. (In +fact, virtually all Hyperbole operations, including menu usage, may be +performed from any standard terminal interface, so one can use it on distant +machines that provide limited display access).

    +

    Hyperbole does not enforce any particular hypertext or information +management model, but instead allows you to organize your information in +large or small chunks as you see fit, organizing each bit as time allows. +The Hyperbole Koutliner and HyRolo tools organize textual hierarchies and +may also contain links to external information sources.

    +

    +Important Features

    +

    Some of Hyperbole's most important features include:

    +
      +
    • +

      Buttons may link to information or may execute commands, such as +computing a complex value or communicating with external programs;

      +
    • +
    • +

      Buttons are quick and easy to create with no programming nor +markup needed. One simply drags between a button source location +and a link destination to create or to modify a link button. The +same result can be achieved from the keyboard.

      +
    • +
    • +

      Buttons may be embedded within email messages and activated from +Emacs mail readers; hyperlinks may include variables so that they +work at different locations where the variable settings differ;

      +
    • +
    • +

      Koutlines allow rapid browsing, editing and movement of chunks of +information organized into trees (hierarchies) and offer links +that include viewspecs which determine how documents are to be +displayed, e.g. show just the first two lines of all levels in a +Koutline;

      +
    • +
    • +

      Other hypertext and information retrieval systems may be +encapsulated under a Hyperbole user interface very easily.

      +
    • +
    +

    +Hyperbole Uses

    +

    Typical Hyperbole applications include:

    +
      +
    • +

      Personal Information Management
      +Overlapping link paths provide a variety of views into an +information space. A single key press activates buttons +regardless of their types, making navigation easy.

      +

      A search facility locates buttons in context and permits quick +selection.

      +
    • +
    • +

      Documentation Browsing
      +Embedding cross-references in a favorite documentation format.

      +

      Addition of a point-and-click interface to existing documentation.

      +

      Linkage of code and design documents. Jumping to the definition +of an identifier from its use within code or its reference within +documentation.

      +
    • +
    • +

      Brainstorming
      +Capture of ideas and then quick reorganization with the Hyperbole +Koutliner. Link to related ideas, eliminating the need to copy +and paste information into a single place.

      +
    • +
    • +

      Help/Training Systems
      +Creation of tutorials with embedded buttons that show students how +things work while explaining the concepts, e.g. an introduction +to UNIX commands. This technique can be much more effective than +descriptions alone.

      +
    • +
    • +

      Archive Managers
      +Supplementation of programs that manage archives from incoming +information stream, having them add topic-based buttons that +link to the archive holdings. Users can then search and create +their own links to archive entries.

      +
    • +
    +

    +Files

    +

    See the HY-ABOUT file for a description and overview of Hyperbole.

    +

    See the HY-NEWS file for a summary of new features in this release.

    +

    See the INSTALL file for installation and invocation instructions.

    +

    See the HY-COPY and COPYING files for license information.

    +

    See the MANIFEST file for summaries of Hyperbole distribution files.

    +

    See DEMO for a demonstration of standard Hyperbole button capabilities. +This is the best way to initially interactively learn about Hyperbole after +installing it.

    +

    Various forms of the Hyperbole are below the "man/" subdirectory.

    +

    +Programmer Quick Reference

    +

    MANIFEST summarizes most of the files in the distribution.

    +

    See DEMO for a demonstration of standard Hyperbole button +capabilities. This is the best way to initially interactively learn +about Hyperbole. The Hyperbole Manual is a reference manual, not a +simple introduction.

    +

    Naming conventions:

    +
      +
    • +

      All Hyperbole-specific code files begin with an 'h', aside from the +Koutliner files which are in the kotl/ subdirectory and begin with a 'k'.

      +
    • +
    • +

      Hyperbole user-interface files begin with 'hui-' or 'hmous'.

      +
    • +
    • +

      Files that define implicit button types begin with 'hib'.

      +
    • +
    • +

      Encapsulations of foreign systems begin with 'hsys-'.

      +
    • +
    +

    Most of the standard Emacs user interface for Hyperbole is located in +hui.el. Most of the Hyperbole application programming +interface can be found in hbut.el. hbdata.el +encapsulates the button attribute storage implemented by Hyperbole. +hmail.el provides a basic abstract interface for +integrating mail readers other than Rmail into Hyperbole.

    +

    See the [Hyperbole Questions and Answers](man/hyperbole.html#Questions +and Answers) appendix in the Hyperbole manual for information on how +to alter the default context-sensitive Hyperbole key bindings (Smart +Keys).

    +

    +User Quotes

    +

    *** MAN I love Hyperbole!!! Wow! ***

    +
                        -- Ken Olstad  
    +                       Cheyenne Software, Inc.
    +
    +
    +

    I love koutlines.

    +
                        -- Bob Glickstein  
    +                       Z-Code Software Corporation
    +
    +
    +

    One of the nicest things about Hyperbole is that it's available +everywhere. Org-mode is a mode and its features are only available in +Org files. For instance if you dropped into eshell' or ansi-term' and +did `ls', you can move point to any of the directory's contents, do M-RET +(or Shift-Button2) and jump to that file. And that's just one example. +Note that this means that all Hyperbole functionality is available in +Org files as well. To me, except for the Hyperbole outliner, that means +complementary not conflicting. It's Hyperbole and org-mode, not +Hyperbole vs. org-mode.

    +

    Additionally, off the bat, I found it very well documented and for me +that's a proxy for the quality of a package. The maintainers are quite +responsive. There's plenty more functionality that I haven't uncovered yet +but due to the ease of installation and the quality of the documentation, +digging into it is actually fun.

    +
                        -- Aditya Siram  
    +
    +
    +

    For me, Emacs isn't Emacs without Hyperbole. I have depended on Hyperbole +daily since 1992, when I first started using it to manage my development +environment. It didn't take long before I could summon almost any +information I needed directly from within my editing environment with an +implicit button. Since I almost never have to slow down to look for +things--one context-dependent button usually produces exactly what I need +--I am able to maintain focus on the task I am working on and complete it +more quickly. With its gestural interface, seamless integration with other +Emacs packages and incredibly useful set of core features. I think that +Hyperbole is one of the best designed and most easily extensible software +products I have ever come across. It is certainly the one which has made +the biggest improvement in my personal productivity.

    +

    My Hyperbole button file is my start page in Emacs. It's a quickly +searchable index with links to countless resources. We also have a +library of implicit buttons that enable rapid navigation from references +in our code to our issue tracking system, so clicking a reference like +Client6502 opens the relevant conversation. Hyperbole provides a really +useful set of power tools. If Emacs is your preferred productivity +environment, it's definitely worth getting familiar with it.

    +
                        -- Chris Nuzum  
    +                       Co-founder, Traction Softwarea, Inc.
    +
    +
    +

    I've found Hyperbole (in conjunction with XEmacs) to be very useful +for signal processing algorithm development.

    +

    For me, it has almost completely obsoleted the engineering notebook: +I keep a set of files with ideas, algorithms, and results, linked +together and to the implementation in C++ files. Using XEmacs' +support for embedding graphics, I've written a mode that accepts +image tags (formatted like HTML), and reads in GIF files to display +plots. I have another program that converts the file to HTML (not +perfect, but adequate), so I can put any aspect of development on +our internal web for others to see.

    +
                        -- Farzin Guilak  
    +                       Protocol Systems, Inc., Engineer
    +
    +
    +

    I am blind and have been using Hyperbole since 1992. I used to use a PC as +a talking terminal attached to a UNIX system, but then I developed +Emacspeak which lets me use Emacs and Hyperbole from standard UNIX +workstations with an attached voice synthesizer.

    +

    My main uses are:

    +
      +
    1. +

      Global and implicit buttons for jumping to ftp sites.

      +
    2. +
    3. +

      The contact manager with Emacspeak support.

      +
    4. +
    5. +

      Explicit buttons as part of comments made about a structured document. +Each button jumps to the document section referred to by the comment. +This is very, very useful.

      +
    6. +
    7. +

      The Hyperbole Koutliner, which I find a very useful tool. I've +implemented Emacspeak extensions to support it.

      +
                    -- TV Raman  
      +                 Google Inc.
      +
      +
    8. +
    +
    +

    I've been a grateful Hyperbole user for a few years now. Hyperbole's +flexibility and ease of use is a marvel.

    +

    Mainly, I write easy little implicit button types (and corresponding action +types) to make my life easier. For example, I have an implicit button type +to bury certain buffers when I click at their bottoms, one that recognizes +a bug report record in various contexts and edits it, one that links pieces +of test output in a log file to the corresponding test case source code +(EXTREMELY helpful in interpreting test output), others that support our +homegrown test framework, one that handles tree dired mode the way I'd +like, one that completely handles wico menus (I've also overloaded the +wconfig actions triggered by diagonal mouse drags with wicos actions), and +a couple that support interaction with BBDB.

    +

    Other than that, I keep a global button file with 30 or so explicit buttons +that do various little things, and I index saved mail messages by putting +explicit link-to-mail buttons in an outline file.

    +
                        -- Ken Olstad  
    +                       Cheyenne Software, Inc.
    +
    +
    +

    In general, Hyperbole is an embeddable, highly extensible hypertext +tool. As such, I find it very useful. As it stands now, Hyperbole is +particularly helpful for organizing ill-structured or loosely coupled +information, in part because there are few tools geared for this purpose. +Hyperbole also possesses a lot of potential in supporting a wider +spectrum of structuredness, ranging from unstructured to highly +structured environments, as well as structural changes over time.

    +

    Major Uses:

    +
      +
    • +

      Menu interface to our own collaborative support environment called +CoReView: This interface brings together all top-level user commands +into a single partitioned screen, and allows the end user to interact +with the system using simple mouse-clicking instead of the meta-x key.

      +
    • +
    • +

      Gateway to internet resources: this includes links to major Internet +archive sites of various types of information. Links are made at both +directory and file levels.

      +
    • +
    • +

      Alternative directory organizer: The hierarchical nature of the Unix +file system sometimes makes it difficult to find things quickly and +easily using directory navigational tools such as dired. Hyperbole +enables me to create various "profile" views of my directory tree, with +entries in these views referring to files anywhere in the hierarchy.

      +
    • +
    • +

      Organizing and viewing online documentation: using Hyperbole along with +Hyper-man and Info makes it truly easy to look up online documentation.

      +
    • +
    • +

      Other desktop organization tasks: including links to various mail +folders, saved newsgroup conversation threads, online note-taker, +emacs-command invocations, etc.

      +
                      -- Dadong Wan  
      +                   University of Hawaii
      +
      +
    • +
    +
    +

    Hyperbole is the first hyper-link system I've run across that is +actually part of the environment I use regularly, namely Emacs. The +complete flexibility of the links is both impressive and expected -- the +idea of making the link itself programmable is clever, and given that one +assumes the full power of Emacs. Being able to send email with buttons +in it is a very powerful capability. Using ange-ftp mode, one can make +file references "across the world" as easily as normal file references.

    +
                        -- Mark Eichin  
    +                       Cygnus Support
    +
    +
    +

    I just wanted to say how much I enjoy using the Hyperbole Koutliner. +It is a great way to quickly construct very readable technical documents +that I can pass around to others. Thanks for the great work.

    +
                        -- Jeff Fried  
    +                       Informix
    +
    +
    +

    The Hyperbole system provides a nice interface to exploring corners of +Unix that I didn't know existed before.

    +
                        -- Craig Smith  
    +
    +

    +Why was Hyperbole developed?

    +

    Hyperbole was originally designed to aid in research aimed at Personalized +Information production/retrieval Environments (PIEs). Hyperbole was a +PIE Manager that provided services to PIE Tools. PIEmail, a mail reader was +the only PIE Tool developed as part of this research but Hyperbole has +greatly expanded since then and has long been a production quality toolset.

    +

    An examination of many hypertext environments as background research did +not turn up any that seemed suitable for the research envisioned, mainly +due to the lack of rich, portable programmer and user environments. We also +tired of trying to manage our own distributed information pools with standard +UNIX tools. And so Hyperbole was conceived and raved about until it +got its name.

    +

    Since then Hyperbole has proved indispensible at improving information +access and organization in daily use over many years. Why not start +improving your information handling efficiency today?

    +

    -- The End --

    + diff --git a/hibtypes.el b/hibtypes.el index 56a53a0..c018f3c 100644 --- a/hibtypes.el +++ b/hibtypes.el @@ -128,9 +128,11 @@ any buffer attached to a file in `hyrolo-file-list', or any buffer with "Makes a valid pathname display the path entry. Also works for delimited and non-delimited remote pathnames, Texinfo @file{} entries, and hash-style link references to HTML, -Markdown or Emacs outline headings. Emacs Lisp library -files (filenames without any directory component that end in .el -and .elc) are looked up using the `load-path' directory list. +Markdown or Emacs outline headings, and MSWindows paths (see +\"${hyperb:dir}/DEMO#POSIX and MSWindows Paths\" for details). +Emacs Lisp library files (filenames without any directory +component that end in .el and .elc) are looked up using the +`load-path' directory list. See `hpath:at-p' function documentation for possible delimiters. See `hpath:suffixes' variable documentation for suffixes that are diff --git a/hmouse-drv.el b/hmouse-drv.el index 0000049..9d81962 100644 --- a/hmouse-drv.el +++ b/hmouse-drv.el @@ -363,7 +363,7 @@ magic happen." aw-dispatch-alist (delq (assq ?t aw-dispatch-alist) (delq (assq ?r aw-dispatch-alist) (delq (assq ?i aw-dispatch-alist) aw-dispatch-alist)))) - (push '(?i hkey-drag-to "Hyperbole: Drag To") aw-dispatch-alist) + (push '(?i hkey-drag-item "Hyperbole: Drag Item") aw-dispatch-alist) ;; Ace-window includes ?m as the swap windows key, so it is not added here. (push '(?r hkey-replace "Hyperbole: Replace Here") aw-dispatch-alist) (push '(?t hkey-throw "Hyperbole: Throw To") aw-dispatch-alist) @@ -417,6 +417,38 @@ Works only when running under a window system, not from a dumb terminal." (hypb:select-window-frame start-window))))) ;;;###autoload +(defun hkey-drag-item (release-window) + "Emulate Smart Mouse Key drag from an item in a selected window to RELEASE-WINDOW, interactively chosen via ace-window. +RELEASE-WINDOW is left selected unless point is not on an item, in +which case, an error is signalled. + +Optional prefix arg non-nil means emulate Assist Key rather than the +Action Key. + +Works only when running under a window system, not from a dumb terminal." + (interactive + (list (let ((mode-line-text (concat " Ace - " (nth 2 (assq ?i aw-dispatch-alist))))) + (aw-select mode-line-text)))) + (let ((start-window (if (and (boundp 'start-window) (window-live-p start-window)) + start-window + (if current-prefix-arg + assist-key-depress-window + action-key-depress-window))) + at-item-flag) + (unless (window-live-p start-window) + (setq start-window (selected-window))) + (cond ((and (setq at-item-flag (hmouse-at-item-p)) + (window-live-p release-window)) + (hkey-drag release-window) + ;; Leave release-window selected + (when (window-live-p release-window) + (hypb:select-window-frame release-window))) + (at-item-flag + (error "(hkey-drag-item): No listing item at point")) + (t ;; No item at point or selected release is invalid + (error "(hkey-drag-item): Invalid final window, %s" release-window))))) + +;;;###autoload (defun hkey-drag-to (release-window) "Emulate Smart Mouse Key drag from a selected window to RELEASE-WINDOW, interactively chosen via ace-window. If an item is dragged to RELEASE-WINDOW, then RELEASE-WINDOW is selected; @@ -575,6 +607,14 @@ The selected window does not change." (hmouse-choose-windows #'hkey-drag-stay)) ;;;###autoload +(defun hmouse-click-to-drag-item () + "Mouse click on start and end windows for use with `hkey-drag-item'. +Emulate {M-o i} from start window to end window. +After the drag, the end window is the selected window." + (interactive) + (hmouse-choose-windows #'hkey-drag-item)) + +;;;###autoload (defun hmouse-click-to-drag-to () "Mouse click on start and end windows for use with `hkey-drag-to'. Emulate Smart Mouse Key drag from start window to end window. diff --git a/hmouse-tag.el b/hmouse-tag.el index 49e9046..1f9f3c3 100644 --- a/hmouse-tag.el +++ b/hmouse-tag.el @@ -771,23 +771,35 @@ If key is pressed: (buffer-substring-no-properties (match-beginning 2) (match-end 2)) (match-beginning 2) (match-end 2))))))) +(defun smart-jedi-find-file (file line column other-window) + "Function that reads a source file for jedi navigation. +It takes these arguments: (file-to-read other-window-flag line_number column_number)." + (hpath:display-buffer (find-file file) other-window) + (jedi:goto--line-column line column)) (defun smart-python-jedi-to-definition-p () "If the Jedi Python identifier server is running, test and use it to jump to the definition. See https://tkf.github.io/emacs-jedi/latest/." ;; Use functions from jedi-core.el only, not from jedi.el, since ;; company-jedi.el users will have loaded only jedi-core.el. - (when (featurep 'jedi-core) + (when (and (featurep 'jedi-core) jedi-mode) (let* ((servers (jedi:-get-servers-in-use)) (proc (epc:manager-server-process (car servers)))) (and servers (processp proc) (eq 'run (process-status (process-buffer proc))) ;; The goto is performed asynchronously. ;; It reports in the minibuffer when a definition is not found. - (progn (jedi:goto-definition t) - ;; For use as a predicate, always return t if the Jedi server - ;; is running so other lookup techniques are not tried. - t))))) + ;; !! Only works on tag at point, not the tagname passed in as jedi + ;; does not accept a tag parameter. + ;; + ;; jedi:find-file-function is an RSW custom + ;; modification that allows display-where to work; + ;; otherwise, will just display in another window. + (let ((jedi:find-file-function #'smart-jedi-find-file)) + (jedi:goto-definition hpath:display-where) + ;; For use as a predicate, always return t if the Jedi server + ;; is running so other lookup techniques are not tried. + t))))) ;;;###autoload (defun smart-python (&optional identifier next) @@ -1289,7 +1301,7 @@ See the \"${hyperb:dir}/smart-clib-sym\" script for more information." (with-no-warnings (find-tag tag)))) ;; Signals an error if tag is not found which is caught by ;; many callers of this function. - (with-no-warnings (find-tag tag))))) + (with-no-warnings (find-tag tag))))) ;;;###autoload (defun smart-tags-file-path (file) diff --git a/hpath.el b/hpath.el index ebc17b0..f31c9ed 100644 --- a/hpath.el +++ b/hpath.el @@ -80,6 +80,13 @@ If the value of 'hpath:mswindows-mount-prefix' changes, then re-initialize this (defconst hpath:mswindows-path-regexp "\\`.*\\.*[a-zA-Z0-9_.]" "Regular expression matching the start of an MSWindows path that does not start with a drive letter but contains directory separators.") +(defvar hpath:mswindows-path-posix-mount-alist nil + "Automatically set alist of (window-path-prefix . posix-mount-point) elements.") + +(defvar hpath:directory-expand-alist nil + "Automatically set alist of (posix-mount-point . window-path-prefix) elements. + Used to expand windows prefixes to posix mount points during mswindows-to-posix.") + ;;;###autoload (defun hpath:mswindows-to-posix (path) "Convert a recognizable MSWindows PATH to a Posix-style path or return the path unchanged. @@ -102,10 +109,10 @@ If path begins with an MSWindows drive letter, prefix the converted path with th path) (defun hpath:mswindows-to-posix-separators (path) - "Replace all backslashes with forward slashes in PATH and abbreviate the path if possible. -Path must be a string or an error will be triggered. See -'abbreviate-file-name' for how path abbreviation is handled." - (abbreviate-file-name (replace-regexp-in-string "\\\\" "/" path))) + "Replace all backslashes with forward slashes in PATH and expand the path against `directory-abbrev-alist', if possible. +Path must be a string or an error will be triggered." + (let ((directory-abbrev-alist hpath:directory-expand-alist)) + (replace-regexp-in-string "\\\\" "/" (abbreviate-file-name path)))) ;;;###autoload (defun hpath:posix-to-mswindows (path) @@ -131,7 +138,6 @@ If path begins with an optional mount prefix, 'hpath:mswindows-mount-prefix', fo rest-of-path)))))) path) - (defun hpath:posix-to-mswindows-separators (path) "Replace all forward slashes with backslashes in PATH and abbreviate the path if possible. Path must be a string or an error will be triggered. See @@ -169,36 +175,40 @@ Path must be a string or an error will be triggered. See (hpath:mswindows-to-posix path)))) ;;;###autoload -(defun hpath:map-plist (func plist) - "Returns result of applying FUNC of two args, key and value, to key-value pairs in PLIST, a property list." - (cl-loop for (k v) on plist by #'cddr - collect (funcall func k v) into result - finally return result)) - -;;;###autoload (defun hpath:cache-mswindows-mount-points () "Cache valid MSWindows mount points in 'directory-abbrev-alist' when under a non-MSWindows operating system, e.g. WSL. Call this function manually if mount points change after Hyperbole is loaded." (interactive) (when (not hyperb:microsoft-os-p) - (let (path mount-point) + (let ((mount-points-to-add + ;; Sort alist of (path-mounted . mount-point) elements from shortest + ;; to longest path so that the longest path is selected first within + ;; 'directory-abbrev-alist' (elements are added in reverse order). + (sort + ;; Convert plist to alist for sorting. + (hypb:map-plist (lambda (path mount-point) + (if (string-match "\\`\\([a-zA-Z]\\):\\'" path) + ;; Drive letter must be downcased + ;; in order to work when converted back to Posix. + (setq path (concat "/" (downcase (match-string 1 path))))) + ;; Assume all mounted Windows paths are + ;; lowercase for now. + (cons (downcase path) mount-point)) + ;; Return a plist of MSWindows path-mounted mount-point pairs. + (split-string (shell-command-to-string (format "df -a -t drvfs 2> /dev/null | sort | uniq | grep -v '%s' | sed -e 's+ .*[-%%] /+ /+g'" hpath:posix-mount-points-regexp)))) + (lambda (cons1 cons2) (<= (length (car cons1)) (length (car cons2)))))) + path mount-point) (mapcar (lambda (path-and-mount-point) (setq path (car path-and-mount-point) mount-point (cdr path-and-mount-point)) (add-to-list 'directory-abbrev-alist (cons (format "\\`%s" (regexp-quote path)) mount-point))) - ;; Sort alist of (path-mounted . mount-point) elements from shortest - ;; to longest path so that the longest path is selected first within - ;; 'directory-abbrev-alist' (elements are added in reverse order). - (sort - ;; Convert plist to alist for sorting. - (hpath:map-plist (lambda (path mount-point) - (if (string-match "\\`\\([a-zA-Z]\\):\\'" path) - (setq path (concat "/" (downcase (match-string 1 path))))) - (cons path mount-point)) - ;; Return a plist of MSWindows path-mounted mount-point pairs. - (split-string (shell-command-to-string (format "df -a -t drvfs 2> /dev/null | sort | uniq | grep -v '%s' | sed -e 's+ .*[-%%] /+ /+g'" hpath:posix-mount-points-regexp)))) - (lambda (cons1 cons2) (<= (length (car cons1)) (length (car cons2))))))))) + mount-points-to-add) + (setq hpath:directory-expand-alist + ;; Save the reverse of each mount-points-to-add so + ;; can expand paths when going from posix-to-mswindows. + (mapcar (lambda (elt) (cons (cdr elt) (car elt))) mount-points-to-add)) + mount-points-to-add))) ;;; ************************************************************************ @@ -793,17 +803,17 @@ program)." (if (string-match hpath:prefix-regexp filename) (setq modifier (aref filename 0) filename (substring filename (match-end 0)))) - (setq filename (hpath:substitute-value filename) + (setq path (hpath:substitute-value + (if (string-match hpath:markup-link-anchor-regexp filename) + (progn (setq hash t + anchor (match-string 3 filename)) + (substring filename 0 (match-end 1))) + filename)) loc (hattr:get 'hbut:current 'loc) dir (file-name-directory ;; Loc may be a buffer without a file (if (stringp loc) loc default-directory)) - filename (hpath:absolute-to filename dir) - path (if (string-match hpath:markup-link-anchor-regexp filename) - (progn (setq hash t - anchor (match-string 3 filename)) - (substring filename 0 (match-end 1))) - filename)) + filename (hpath:absolute-to path dir)) (let ((remote-filename (hpath:remote-p path))) (or modifier remote-filename (file-exists-p path) diff --git a/hui-mouse.el b/hui-mouse.el index 8f4f94b..146860d 100644 --- a/hui-mouse.el +++ b/hui-mouse.el @@ -246,8 +246,8 @@ Its default value is #'smart-scroll-down." ((and (or (and (eq major-mode 'python-mode) buffer-file-name) (let ((case-fold-search)) (string-match "\\`\\(Pydoc:\\|\\*?Python\\)" (buffer-name)))) - (smart-python-at-tag-p)) . - ((smart-python) . (smart-python nil 'next-tag))) + (setq hkey-value (smart-python-at-tag-p))) . + ((smart-python hkey-value) . (smart-python hkey-value 'next-tag))) ;; ;; Imenu listing in GNU Emacs ((smart-imenu-item-at-p) diff --git a/hversion.el b/hversion.el index 5329608..9470edb 100644 --- a/hversion.el +++ b/hversion.el @@ -23,7 +23,7 @@ ;;; Public variables ;;; ************************************************************************ -(defconst hyperb:version "7.0.2c" "GNU Hyperbole revision number.") +(defconst hyperb:version "7.0.3" "GNU Hyperbole revision number.") ;;;###autoload (defvar hyperb:microsoft-os-p diff --git a/hypb.el b/hypb.el index a385e00..c0d0595 100644 --- a/hypb.el +++ b/hypb.el @@ -471,6 +471,13 @@ INACTIVE-P is unused, it is for compatibility with XEmacs' version of mark-marker." (mark-marker))) +;;;###autoload +(defun hypb:map-plist (func plist) + "Returns result of applying FUNC of two args, key and value, to key-value pairs in PLIST, a property list." + (cl-loop for (k v) on plist by #'cddr + collect (funcall func k v) into result + finally return result)) + (defun hypb:map-sublists (func list) "Applies FUNC to every atom found at any level of LIST. FUNC must take two arguments, an atom and a list in which the atom is found. diff --git a/hyperbole-pkg.el b/hyperbole-pkg.el index 5ca5087..71907c9 100644 --- a/hyperbole-pkg.el +++ b/hyperbole-pkg.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t -*- -(define-package "hyperbole" "7.0.2c" "GNU Hyperbole: The Everyday Hypertextual Information Manager" +(define-package "hyperbole" "7.0.3" "GNU Hyperbole: The Everyday Hypertextual Information Manager" '((emacs "24.4")) :url "http://www.gnu.org/software/hyperbole" :keywords '("comm" "convenience" "files" "frames" "hypermedia" "languages" diff --git a/hyperbole.el b/hyperbole.el index dd431c4..4aa427d 100644 --- a/hyperbole.el +++ b/hyperbole.el @@ -6,7 +6,7 @@ ;; Maintainer: Bob Weiner and Mats Lidell ;; Created: 06-Oct-92 at 11:52:51 ;; Released: 21-Jan-19 -;; Version: 7.0.2c +;; Version: 7.0.3 ;; Keywords: comm, convenience, files, frames, hypermedia, languages, mail, matching, mouse, multimedia, outlines, tools, wp ;; Package: hyperbole ;; Package-Requires: ((emacs "24.4")) diff --git a/man/hkey-help.txt b/man/hkey-help.txt index 492d75c..c567c6d 100644 --- a/man/hkey-help.txt +++ b/man/hkey-help.txt @@ -9,7 +9,7 @@ Hyperbole 1st press at an arg value Value copied to minibuffer <- same 2nd press at an arg value Value used as argument <- same In minibuffer Accepts minibuffer arg Completion help - On an implicit button Activates button Button help + On an implicit button/path Activates button Button help Within a koutline cell Collapses and expands Shows tree props Left of a koutline cell Creates a klink Moves a tree HyRolo Match Buffer Edits entries and mails to e-mail addresses diff --git a/man/hyperbole.html b/man/hyperbole.html index 9ea74f5..6aa4874 100644 --- a/man/hyperbole.html +++ b/man/hyperbole.html @@ -1,7 +1,7 @@
  • \n")
     	 (princ (format
     		 "%s%s