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

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

[elpa] externals/hyperbole f6f9dccab5 1/2: HyControl windows grid displa


From: ELPA Syncer
Subject: [elpa] externals/hyperbole f6f9dccab5 1/2: HyControl windows grid display BLANK buffer when exhaust buffer list
Date: Sun, 30 Jan 2022 04:57:39 -0500 (EST)

branch: externals/hyperbole
commit f6f9dccab5e9d1c2b0fcce6ed7524e2728a57271
Author: Robert Weiner <rsw@gnu.org>
Commit: Robert Weiner <rsw@gnu.org>

    HyControl windows grid display BLANK buffer when exhaust buffer list
    
    HyControl support negative prefix arguments
---
 ChangeLog          |  26 +++-
 DEMO               |  61 +++++----
 HY-ANNOUNCE        | 390 +++++++----------------------------------------------
 HY-NEWS            |  10 +-
 hycontrol.el       | 112 ++++++++++++---
 kotl/kfile.el      |   4 +-
 man/hyperbole.texi |  83 ++++++++----
 7 files changed, 267 insertions(+), 419 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 83fd0fa6c3..30c053c285 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2022-01-29  Bob Weiner  <rsw@gnu.org>
 
+* hycontrol.el (hycontrol-invert-prefix-arg): Add to invert prefix arg or 
change
+    0 to -1.
+               (hycontrol-reset-prefix-arg): Turn into a named function so can
+    test if was 'last-command'.
+               (hycontrol-universal-arg-digit): Rewrite to handle negative 
args.
+              (hycontrol-multiply-universal-arg):
+              (hycontrol-minus-key): Add to have named commands.
+  man/hyperbole.texi (HyControl):
+  DEMO (Windows Grid): Rewrite section to match latest behavior.
+  man/hyperbole.texi (HyControl): Update to include - and C-u key bindings.
+
+* hycontrol.el (hycontrol-window-display-buffer): Rewrite to display a BLANK
+    buffer in each window after exhaust the selected list of buffers, rather
+    than displaying the same non-blank buffers in multiple windows.  Also,
+    no longer use 'hycontrol--invert-display-buffer-predicates' to fill
+    extra windows with the inversion of any filters
+
+    Update doc to reflect full behavior of the function.
+
+    Left for reference 'hycontrol-window-display-buffer-with-repeats' with all
+    of this pre-V8 behavior.
+
 * test/hypb-tests.el (hypb--installation-type-test): Comment out until decide
     all contexts it should handle and when best to use it.
 
@@ -14,11 +36,13 @@
 
 * test/hypb-tests.el (hypb--installation-type-test): Add unit test.
 
-2022-01-25  Bob Weiner  <rsw@gnu.org>
+2022-01-25  Mats Lidell  <matsl@gnu.org>
 
 * hypb.el (hypb--installation-type, hypb:configuration): Add function to
     provide installation type and version number and use it.
 
+2022-01-25  Bob Weiner  <rsw@gnu.org>
+
 * kotl/kotl-mode.el (kotl-mode:copy-region-to-buffer): Fix interactive args 
listed in wrong
     order.
 * kotl/kotl-mode.el (kotl-mode:copy-region-to-buffer): Replace 
'kotl-mode:insert-region'.
diff --git a/DEMO b/DEMO
index a387d9edaa..bc543e7e5d 100644
--- a/DEMO
+++ b/DEMO
@@ -264,45 +264,54 @@ the argument is used to adjust one dimension of the frame.
 ** Windows Grid
 
 The @ command splits a frame into a grid of up to 9 rows by 9 columns of
-windows, showing a different buffer in each window, if available.  First
-let's expand our frame to full screen with the {.1 %} command and then show
-a 2 x 3 grid.  We can do multiple commands in one 'key series'.  Press the
-action key within the braces: {.1 % .23 @}.
-
-You can even write something like this to do the whole thing in one sequence.
-First, let's quit out of HyControl Frames mode with {Q}.  Then go back to one
-window with {C-x 1}.  Now we can execute a single sequence from any buffer
-that creates our 2x3 window grid: {C-h h s f .1 % .23 @ Q}.  Pretty amazing,
-right?  You can separate each command by any number of spaces or even jam
-them all together: {C-hhsf.1%.23@Q}.  Use SPC (separated by spaces) to
-include a space as part of the key series.
-
-A zero argument to the @ command is special.  It means you want to display
-buffers with a particular major mode first, e.g. emacs-lisp-mode.  You will
-be prompted for the major mode and then the size of the grid.
-
+windows, showing a different buffer in each window, if available.  Outside of
+HyControl, you can invoke the grid of windows command with {C-c @} in most
+buffers.
+
+By default, this command shows buffers with attached files only and prompts
+for the size of the grid to display.  With a negative prefix argument, the @
+command prompts for a shell glob-type pattern of files to match, e.g. 
*hypb*.el,
+and then chooses the smallest square grid patterns that can accomodate the 
number
+of files matched, e.g. 3x3 or 4x4, etc.
+
+
+With a zero prefix argument, the @ command prompts for a major mode name,
+e.g. emacs-lisp-mode, then the size of the grid and then displays the existing
+buffers with that major mode.
+
+Let's try this unique command.  First we will expand our frame to full screen
+with the {C-h h s f .1 % Q} command and then show a 2 x 3 grid.  We can do the 
whole
+thing in one 'key series'.  Press the action key within the braces:
+{C-h h s f .1 % .23 @ Q}.  Using the global key binding in any buffer is even 
simpler:
+{C-23 C-c @}. Pretty amazing, right?  You can separate each command by any 
number of
+spaces or even jam them all together: {C-hhsf.1%.23@Q}.  Use SPC (separated by 
spaces)
+to include a space as part of the key series.
+
+Now let's display a 2x2 grid of windows preferring Emacs Lisp buffers.
 First let's add a few Emacs Lisp files to the bottom of our buffer list.
-Press the Action Key anywhere within the first line of this action button:
+Press the Action Key anywhere within the first line of the code of this
+action button:
 
-   <progn (mapc (lambda (f) (bury-buffer (find-file-noselect (expand-file-name 
f hyperb:dir))))
+   <progn (mapc (lambda (f) (bury-buffer (find-file-noselect f)))
                 '("hibtypes.el" "hactypes.el" "hsettings.el"))
           (message "Last 3 buffers are: %S"
                    (mapcar #'buffer-name
                            (nthcdr (- (length (buffer-list)) 3) 
(buffer-list))))>
 
-Now let's display a 2x2 grid of windows preferring Emacs Lisp buffers:
-To try it, activate this key series button:
+To display the grid, activate this key series button:
+
+   {C-0 C-c @ emacs-lisp-mode RET 22 RET}
 
-   {C-hhsf .0 @ emacs-lisp-mode RET 22 RET}
+Or how about we display a bunch of matching files in a directory, say Elisp 
files
+with 'hypb' in their names:
+
+   {C--1 C-c @ *hypb*.el RET}
 
 If you ever need to experiment with different sized window grids, use
 {M-x hycontrol-window-grid-repeatedly RET}.  It will repeatedly prompt you
 for a grid size and then display it.  When you are done, simply press RET
 to exit.
 
-Outside of HyControl, you can invoke the grid of windows command with {C-c @}
-in most buffers.
-
 There is lots more to discover in HyControl as you explore.
 
 
@@ -792,7 +801,7 @@ brackets, < >, and come in three types:
      with an Elisp function name rather than an action type name.  They may
      contain any number of levels of embedded Lisp s-expressions, e.g.
 
-          <find-file-other-window (expand-file-name "EXAMPLE.kotl" hyperb:dir)>
+          <find-file-other-window (expand-file-name "kotl/EXAMPLE.kotl" 
hyperb:dir)>
 
   3. variable displays - these consist of an Elisp variable name only and
      display a message with the variable name and value, e.g.
diff --git a/HY-ANNOUNCE b/HY-ANNOUNCE
index 66feeb0309..cb34d91989 100644
--- a/HY-ANNOUNCE
+++ b/HY-ANNOUNCE
@@ -1,195 +1,62 @@
-----------------------------------------------------------------------
-7.0.3 Announcement
-----------------------------------------------------------------------
 From: Bob Weiner <rsw@gnu.org>
 To: emacs-devel@gnu.org, gnu-emacs-sources@gnu.org, emacs-tangents@gnu.org, 
hyperbole-users@gnu.org, hyperbole-announce@gnu.org
-Subject: GNU Hyperbole 7.0.3: link your world quickly and easily
+Subject: GNU Hyperbole Version 8: The Connect Everything Release
 --text follows this line--
-========================================================================
-* Introduction
-========================================================================
-
-GNU Hyperbole 7.0.3 is released and ready for action.
+GNU Hyperbole 8.0.0, The Connect Everything Release, is now available on GNU 
ELPA.
 
-Hyperbole is an amazing hypertextual information management system
-that installs quickly and easily as an Emacs package.  It is part of
-GNU Elpa, the Emacs Lisp Package Archive.
-
-Hyperbole interlinks all your working information within Emacs for
-fast access and editing, not just within special modes.  An hour
-invested exploring Hyperbole's built-in interactive DEMO file will
-save you hundreds of hours in your future work.
-
-7.0.3 is a significant release with a number of interesting
-improvements.  What's new in this release is described here:
+What's new in this release is described here:
 
    www.gnu.org/s/hyperbole/HY-NEWS.html
 
-Hyperbole is described here:
-
-   www.gnu.org/s/hyperbole
-
-For use cases, see:
-
-   www.gnu.org/s/hyperbole/HY-WHY.html
-
-For what users think about Hyperbole, see:
+   Everything back until release 7.1.3 is new since the last major
+   release announcement (over a year ago), so updates are extensive.
 
-  https://www.gnu.org/s/hyperbole/hyperbole.html#user-quotes
-
-Hyperbole can supplement and extend Org-mode's capabilities.  It adds
-many features not found elsewhere in Emacs, including Org mode, see:
-
-   www.emacswiki.org/emacs/Hyperbole
-
-Hyperbole includes its own easy-to-use hypertextual buttons and links
-that can be created without the need for any markup language.
-
-Hyperbole has an interactive demo to introduce you to its features as
-well as a detailed reference manual, as explained here:
-
-  https://www.gnu.org/s/hyperbole/hyperbole.html#invocation-and-doc
-
-========================================================================
-* Quick Reasons to Try Hyperbole
 ========================================================================
-
-It contains:
-
-- the most flexible and easy-to-use hyperbuttons available, including
-  implicit buttons automatically recognized by context, e.g. stack
-  trace source line references.
-
-- the only Emacs outliner with full legal item numbering,
-  e.g. 1.4.2.6, and automatic permanent hyperlink anchors for every
-  item
-
-- the only free-form contact manager with full-text search for Emacs
-
-- rapid and precise window, frame and buffer placement on screen
-
-- an extensive menu of typed web searches, e.g. dictionary, wikipedia
-  and stackoverflow, plus convenient, fast file and line finding
-  functions
-
-- immediate execution of a series of key presses just by typing them
-  out.  For example, a M-RETURN press on: {C-x C-b C-s scratch RET
-  C-a} will find the first buffer menu item that contains 'scratch';
-  then leave point at the beginning of its line.  Build interactive
-  tutorials with this.
-
-
-========================================================================
-* The Magic of Implicit Buttons and the Action Key
+* Introduction
 ========================================================================
 
-For near instant gratification, try Hyperbole's 'implicit button'
-capabilities (hyper-buttons that Hyperbole gives you for free by
-recognizing all types of references embedded within text such as
-pathnames or error message lines).  Below are more complex examples to
-show the power; simpler ones can be found within the Hyperbole DEMO
-file.
-
-Implicit buttons are activated by pressing the Action Key, M-RETURN.
-Once Hyperbole is loaded in your Emacs, pressing M-RETURN on any of
-these examples *in virtually any buffer* will display the associated
-referent in a chosen window or frame, handling all variable
-substitution and full path resolution:
-
-    "find-func.el"                            Find this file whether gzipped 
or not
-                                              in the Emacs Lisp load-path
-
-    "${hyperb:dir}/HY-NEWS"                   Resolve variable, show Hyperbole 
news
-
-    "${PATH}/umask"                           Display a script somewhere in 
multi-dir PATH
-
-    "${hyperb:dir}/DEMO#Hyperbole Menus"      Org mode outline, Markdown, and 
HTML # refs
-
-    "(hyperbole)Menus"                        Texinfo and Info node links
-
-    "c:/Users", "c:\Users", "/C/Users", "/c/Users", and "/mnt/c/Users"
-                                            On Windows and Windows Subsystem 
for Linux,
-                                            Hyperbole recognizes all of these 
as the
-                                            same path and can translate 
between Windows
-                                            and POSIX path formats in both 
directions
-
-Git Links:
-    git#branches                              List branches in current 
repo/project
-    git#commits                               List and browse commits for 
current project
-    git#tags                                  List tags in current project
-
-    git#/hyperbole                            From any buffer, dired on the top
-                                              directory of the local hyperbole
-                                              project
-
-    git#/hyperbole/55a1f0 or                  From any buffer, display 
hyperbole
-    git#hyperbole/55a1f0                      local git commit diff
-
-
-Github Links:
-    gh@rswgnu                                 Display user's home page & 
projects
-
-    github#rswgnu/hyperbole                   Display user's project
-    gh#rswgnu/helm/global_mouse               Display user project's branch
-    gh#rswgnu/hyperbole/55a1f0                Display user project's commit 
diff
-
-Gitlab Links:
-    gitlab@seriyalexandrov                    Display user's home page
-    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#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#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
-
-Even useful social media links:
-    tw#travel or twitter#travel               Display twitter hashtag matches
-    fb#technology                             Display facebook hashtag matches
-
-Hyperbole uses simple prefix characters with paths to make them executable:
-    "!/bin/date"                              Execute as a non-windowed 
program within a shell
-    "&/opt/X11/bin/xeyes"                     Execute as a windowed program;
-    "-find-func.el"                           Load/execute this Emacs Lisp 
library
-
-    File "/usr/lib/python3.7/ast.py", line 37, in parse
-                                              Jump to error/stack trace source
-
-    "/ftp:anonymous@ftp.gnu.org:"             Tramp remote paths
+Hyperbole is like Markdown for hypertext.  Hyperbole automatically
+recognizes dozens of common patterns in any buffer regardless of mode
+and can instantly activate them as hyperbuttons with a single key:
+email addresses, URLs, grep -n outputs, programming backtraces,
+sequences of Emacs keys, programming identifiers, Texinfo and Info
+cross-references, Org links, Markdown links and on and on.  All you do
+is load Hyperbole and then your text comes to life with no extra
+effort or complex formatting.
 
+Hyperbole interlinks all your working information within Emacs for
+fast access and editing, not just within special modes.  Every button
+is automatically assigned a type and new types can be developed for
+your own buttons with simple function definitions.  You can create
+your own buttons by simply dragging between two buffers.
+
+But Hyperbole is also a hub controller for your information supplying
+built-in capabilities of contact management/hierarchical record
+lookup, legal-numbered outlines with hyperlinkable views and a unique
+window and frame manager.  It is even Org-compatible so you can use
+all of Org's capabilities together with Hyperbole.
+
+Hyperbole is unique, powerful, extensively documented, and free.  Like
+Emacs, Org, Counsel and Helm, Hyperbole has many different uses all
+based around the theme of reducing cognitive load and improving your
+everyday information management.  It reduces cognitive load by using
+a single Action Key, {M-RET}, across many different contexts
+which automatically chooses the best action
+
+Then as you grow with it across
+time, it helps you build new capabilities that continue to speed your
+work.
 
 ========================================================================
-* Try It - Installs or Uninstalls in a Minute
+* Using Hyperbole
 ========================================================================
 
-Hyperbole lets you concentrate more on your work.  Then as you grow
-with it across time, it helps speed your work across weeks and months.
-It installs in about a minute and can be uninstalled even faster if
-ever need be.  Give it a try.
-
-Hyperbole can boost your day-to-day productivity with Emacs and
-your ability to manage information stored across many different
-machines on the internet.
+To install:
 
-Hyperbole can be installed like any other package with the Emacs
-package manager:
+   {M-x package-install RET hyperbole RET} to install it.
 
-   {M-x list-packages RET C-s hyperbole RET i x y}
+   It installs in about a minute and can be uninstalled even faster if
+   ever need be.  Give it a try.
 
 Then to invoke its menu:
 
@@ -200,181 +67,18 @@ invoke the interactive DEMO and explore sections of 
interest:
 
    {C-h h d d}
 
-Enjoy,
-
-The Hyperbole Team
-
-
-----------------------------------------------------------------------
-7.0.2 Announcement
-----------------------------------------------------------------------
-From: Bob Weiner <rsw@gnu.org>
-To: info-gnu@gnu.org, hyperbole-users@gnu.org, emacs-devel@gnu.org, 
gnu-emacs-sources@gnu.org, emacs-tangents@gnu.org
-Subject: GNU Hyperbole 7.0.1-7.0.2 is now available
-Date: Wed, 23 Nov 2017
---text follows this line--
-This is a minor release with a number of small issues resolved and the 
following
-new features:
-
-  SMART (ACTION AND ASSIST) KEYS
-
-    - Keyboard Drags: Keyboard emulation of many Smart Mouse Key drag actions.
-      See "(hyperbole)Keyboard Drags".
-  
-    - Keyboard Help: When {M-o} is bound to the `hkey-operate' command to
-      emulate drag depress and release events, then when in the release window
-      prior to pressing the second {M-o}, {C-h A} now reports the drag
-      action associated with the current release point.  See "(hyperbole)C-h 
A".
-
-    - Ace Window: Integrated Hyperbole item drag and link creation with this
-      package's direct window selection.  Use {M-o i <window-id>}.
-      You typically can display any Dired or Buffer Menu item in any window
-      with a single 3 keystroke command!
-
-      Also added the ability to 'throw' an item to a window while leaving the
-      selected window the same.  Use {M-o t <window-id>}.  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.
-
-    - Smart Treemacs: Smart Key and item drag support for the Treemacs package.
-      See "(hyperbole)Smart Key - Treemacs".
-
-  HYROLO
-
-    - Fixed Google Contacts support to prompt for authorization only during
-      first time use.
-
------
-
-For details on what Hyperbole is and how to obtain and install it, see:
-
-  https://www.gnu.org/s/hyperbole
-
-For a list of use cases, see:
-
-  https://www.gnu.org/s/hyperbole/HY-WHY.html
-
-For a full list of new features in Hyperbole 7, see:
-
-  https://git.savannah.gnu.org/cgit/hyperbole.git/plain/HY-NEWS
-
-For what users think about Hyperbole, see:
-
-  https://www.gnu.org/s/hyperbole/hyperbole.html#user-quotes
-
-Bob Weiner designed and wrote GNU Hyperbole.  He and Mats
-Lidell maintain it with the Free Software Foundation.  It includes
-an interactive demo to introduce you to its features as well as a
-detailed reference manual, as explained here:
-
-  https://www.gnu.org/s/hyperbole/hyperbole.html#invocation-and-doc
-
+The Hyperbole home page with screen shots is here:
 
-Happy Thanksgiving,
-
-Bob Weiner and Mats Lidell
-
-
-----------------------------------------------------------------------
-7.0.0 Announcement
-----------------------------------------------------------------------
-To: info-gnu@gnu.org, hyperbole-users@gnu.org, emacs-devel@gnu.org, 
gnu-emacs-sources@gnu.org, emacs-tangents@gnu.org
-ANNOUNCE: GNU Hyperbole 7, a.k.a the Git Ready for Action Release, is now 
available
-
-This is the main public release of GNU Hyperbole for 2017 and it is
-bursting with new features and further quality improvements.  New
-capabilities, including Git and Github object links, are summarized
-here:
-
-  https://git.savannah.gnu.org/cgit/hyperbole.git/plain/HY-NEWS
-
-A short explanation of Hyperbole is included below.  For more
-detail or how to obtain and install it, see:
-
-  https://www.gnu.org/s/hyperbole
+   www.gnu.org/s/hyperbole
 
-For a list of use cases, see:
+For use cases, see:
 
-  https://www.gnu.org/s/hyperbole/HY-WHY.html
+   www.gnu.org/s/hyperbole/HY-WHY.html
 
 For what users think about Hyperbole, see:
 
-  https://www.gnu.org/s/hyperbole/hyperbole.html#user-quotes
-
-----
-
-GNU Hyperbole (pronounced Ga-new Hi-per-bo-lee), or just Hyperbole,
-is an amazing, programmable hypertextual information management
-system implemented as a GNU Emacs package and extensively
-documented.  Hyperbole has been greatly expanded and updated for
-use with the latest Emacs 26 releases; it supports GNU Emacs 24.4
-or above.
-
-Hyperbole can boost your day-to-day productivity with Emacs and
-your ability to manage information stored across many different
-machines on the internet.  People who get used to Hyperbole often
-find they prefer never to use Emacs without it.
-
-Hyperbole includes its own easy-to-use hypertextual buttons and
-links that can be created without the need for any markup language.
-
-It also comes out-of-the-box with:
-
-  - a hierarchical, record-based contact manager
-
-  - a rapid window and frame control system
-
-  - a powerful multi-level auto-numbered outliner
-
-  - and two very smart context-dependent mouse and keyboard keys
-    that simplify operations in many editing and browsing modes.
-    All features are aimed at making textual information management
-    and display fast and easy.
-
-Bob Weiner designed and programmed GNU Hyperbole.  He and Mats
-Lidell maintain it with the Free Software Foundation.  It includes
-an interactive demo to introduce you to its features as well as a
-detailed reference manual, as explained here:
-
-  https://www.gnu.org/s/hyperbole/hyperbole.html#invocation-and-doc
-
-----
-
-Please give Hyperbole a try.  It's free, man.  It adapts to your
-needs. It connects everything.  It rewires your brain.  It speeds
-your web searches for `carpal tunnel syndrome'.  It makes you feel
-like the sun is out on a gray winter day :-)
-
-But wait, there's more and this part is serious.  For a limited
-time, to encourage use and feedback, the first 30 people who try
-out the Hyperbole DEMO or read the Hyperbole Manual and send a few
-thoughtful sentences to <rsw at gnu dot org> will receive either of
-their choice of the following as yet unpublished single file Emacs
-Lisp libraries:
-
-;;  rsw-linecol.el: User-editable mode-line col/line number formats
-;;
-;;  GNU Emacs buries the formatting of mode-line line and column
-;;  numbers in a way that makes it virtually impossible for a user
-;;  to change this formatting.  This library fixes that with a new
-;;  variable which may be modified to instantly alter the mode-line
-;;  column and line number display.
-
-or
-
-;;  rsw-chrome-macos.el: Open a URL in Google Chrome and reuse an
-;;     existing tab/window if already displayed.
-;;
-;;  This library resolves the many problems of sending URLs to
-;;  Google Chrome on MacOS.  It properly sends # hash in-file links
-;;  (these are typically stripped when Chrome is called as a MacOS
-;;  application).  It reuses any tab already displaying any
-;;  matching URL that is sent and it does this even if the
-;;  ultimately displayed URL goes through several redirects before
-;;  display.
+   www.gnu.org/s/hyperbole/hyperbole.html#user-quotes
 
 Enjoy,
 
-Bob Weiner and Mats Lidell
+The Hyperbole Team
diff --git a/HY-NEWS b/HY-NEWS
index 9822fabbfe..f871ee79dc 100644
--- a/HY-NEWS
+++ b/HY-NEWS
@@ -600,14 +600,18 @@
 
   HYCONTROL
 
+    - Windows Grid by File Pattern: {C--1 C-c @} prompts for a glob-type file
+      pattern, finds all the matching files and then displays them in an 
auto-sized
+      windows grid based on the number of files.
+
     - Buffer/Window Swapping: Improved {~} so current buffer remains the same 
but
       the selected window changes.  Also made frame buffer swapping work 
anytime
       there are two or more frames regardless of how many windows in each.  See
       "DEMO#Swapping Buffers".
 
-    - Windows Grid by File Pattern: {C--1 C-c @} prompts for a glob-type file 
pattern,
-      finds all the matching files and then displays them in an auto-sized 
windows grid
-      based on the number of files.
+    - HyControl Now Accepts Negative Prefix Args: If the minus key is pressed 
when
+      HyControl is invoked or after any other prefix arg command, it will 
invert the
+      current prefix arg value (or when zero, set the prefix arg to -1).
 
   HYROLO
 
diff --git a/hycontrol.el b/hycontrol.el
index 9fd5b8452e..f6e058d9c0 100644
--- a/hycontrol.el
+++ b/hycontrol.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     1-Jun-16 at 15:35:36
-;; Last-Mod:     24-Jan-22 at 00:19:05 by Bob Weiner
+;; Last-Mod:     29-Jan-22 at 16:03:51 by Bob Weiner
 ;;
 ;; Copyright (C) 2016-2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -257,7 +257,7 @@ The final predicate should always be t, for default values, 
typically of zero.")
     (define-key map [kp-9]  (lambda () (interactive) (hycontrol-numeric-keypad 
'kp-9 hycontrol-arg)))
 
     ;; Clear hycontrol-arg
-    (define-key map "."     (lambda () (interactive) (setq hycontrol-arg 0) 
(hycontrol-frame-to-screen-edges 0)))
+    (define-key map "."     'hycontrol-reset-prefix-arg)
     (define-key map "@"     'hycontrol-windows-grid)
     (define-key map "?"     'hycontrol-toggle-help)
     (define-key map "a"     'hycontrol-frame-adjust-widths)
@@ -302,7 +302,7 @@ The final predicate should always be t, for default values, 
typically of zero.")
     (define-key map "~"     (lambda () (interactive)
                              (unless (hycontrol-frame-swap-buffers)
                                (hycontrol-user-error hycontrol-debug 
"(HyControl): There must be at least two frames and the frame to swap to must 
have only a single window."))))
-    (define-key map "-"     'hycontrol-frame-minimize-lines)
+    (define-key map "-"     'hycontrol-minus-key)
     (define-key map "+"     'toggle-frame-maximized)
     (define-key map "="     (lambda () (interactive)
                              (and (> (length (visible-frame-list)) 1)
@@ -312,8 +312,7 @@ The final predicate should always be t, for default values, 
typically of zero.")
                                            f (frame-pixel-width) 
(frame-pixel-height) t))
                                         (visible-frame-list)))))
 
-    (define-key map "\C-u"  (lambda () (interactive) (setq hycontrol-arg (* 
hycontrol-arg 4))
-                             (if (> hycontrol-arg hycontrol-maximum-units) 
(setq hycontrol-arg 4))))
+    (define-key map "\C-u"  'hycontrol-multiply-universal-arg)
     (define-key map "0"     (lambda () (interactive) 
(hycontrol-universal-arg-digit 0)))
     (define-key map "1"     (lambda () (interactive) 
(hycontrol-universal-arg-digit 1)))
     (define-key map "2"     (lambda () (interactive) 
(hycontrol-universal-arg-digit 2)))
@@ -358,7 +357,7 @@ The final predicate should always be t, for default values, 
typically of zero.")
     (define-key map [kp-9]  (lambda () (interactive) (hycontrol-numeric-keypad 
'kp-9 hycontrol-arg)))
 
     ;; Clear hycontrol-arg
-    (define-key map "."     (lambda () (interactive) (setq hycontrol-arg 0) 
(hycontrol-frame-to-screen-edges 0)))
+    (define-key map "."     'hycontrol-reset-prefix-arg)
     (define-key map "@"     'hycontrol-windows-grid)
     (define-key map "?"     'hycontrol-toggle-help)
     (define-key map "a"     'hycontrol-frame-adjust-widths)
@@ -408,14 +407,13 @@ The final predicate should always be t, for default 
values, typically of zero.")
     (define-key map "~"     (lambda () (interactive)
                              (unless (hycontrol-window-swap-buffers)
                                (hycontrol-user-error hycontrol-debug 
"(HyControl): There must be precisely two windows within the selected frame to 
swap buffers."))))
-    (define-key map "-"     'hycontrol-window-minimize-lines)
+    (define-key map "-"     'hycontrol-minus-key)
     (define-key map "+"     'hycontrol-window-maximize-lines)
     (define-key map "="     (lambda () (interactive) (and (> (length 
(window-list)) 1)
                                                          (y-or-n-p "Resize 
windows evenly across this frame?")
                                                          (balance-windows))))
 
-    (define-key map "\C-u"  (lambda () (interactive) (setq hycontrol-arg (* 
hycontrol-arg 4))
-                             (if (> hycontrol-arg hycontrol-maximum-units) 
(setq hycontrol-arg 4))))
+    (define-key map "\C-u"  'hycontrol-multiply-universal-arg)
     (define-key map "0"     (lambda () (interactive) 
(hycontrol-universal-arg-digit 0)))
     (define-key map "1"     (lambda () (interactive) 
(hycontrol-universal-arg-digit 1)))
     (define-key map "2"     (lambda () (interactive) 
(hycontrol-universal-arg-digit 2)))
@@ -542,9 +540,55 @@ associated key: quit {q}, abort {C-g}, or toggle {t}.")
   "Return non-nil if HyControl mode should remain active."
   (null hycontrol--exit-status))
 
+
+(defun hycontrol-invert-prefix-arg ()
+  "Invert the sign of the current Hycontrol prefix argument.
+If the argument is 0, set it to -1."
+  (interactive)
+  (setq this-command 'hycontrol-invert-prefix-arg
+       hycontrol-arg (if (zerop hycontrol-arg) -1 (- hycontrol-arg))))
+
+(defun hycontrol-minus-key ()
+  "Conditional command to execute when the minus key is pressed in a HyControl 
mode."
+  (interactive)
+  (cond ((and (symbolp last-command)
+             (string-match-p 
"\\`\\(hui:menu-enter\\|hycontrol.*-\\(frames\\|windows\\|prefix\\|universal\\)-\\(mode\\|arg\\)\\)"
 (symbol-name last-command)))
+        (hycontrol-invert-prefix-arg))
+       (hycontrol-frames-mode
+        (hycontrol-frame-minimize-lines))
+       (t
+        (hycontrol-window-minimize-lines))))
+
+(defun hycontrol-multiply-universal-arg ()
+  "Return the new prefix argument based on existing `hycontrol-arg' and one 
press of the universal arg, C-u."
+  (interactive)
+  (setq this-command 'hycontrol-multiply-universal-arg
+       hycontrol-arg (* hycontrol-arg 4))
+  (when (> (abs hycontrol-arg) hycontrol-maximum-units)
+    (setq hycontrol-arg (if (< hycontrol-arg 0) -4 4)))
+  hycontrol-arg)
+
+(defun hycontrol-reset-prefix-arg ()
+  "Reset HyControl prefix arg to 0."
+  (interactive)
+  (setq hycontrol-arg 0)
+  (hycontrol-frame-to-screen-edges 0))
+
 (defun hycontrol-universal-arg-digit (digit)
   "Return the new prefix argument based on existing `hycontrol-arg' and new 
DIGIT."
-  (setq hycontrol-arg (+ (* hycontrol-arg 10) digit)) (if (> hycontrol-arg 
hycontrol-maximum-units) (setq hycontrol-arg digit))
+  (setq this-command 'hycontrol-universal-arg-digit
+       hycontrol-arg
+       (if (< hycontrol-arg 0)
+           (if (and (= hycontrol-arg -1)
+                    (not (zerop digit)))
+               (- digit)
+              (- (* hycontrol-arg 10) digit))
+         (+ (* hycontrol-arg 10) digit)))
+  (when (> (abs hycontrol-arg) hycontrol-maximum-units)
+    (setq hycontrol-arg
+         (if (< hycontrol-arg 0)
+             (- digit)
+           digit)))
   hycontrol-arg)
 
 
@@ -784,8 +828,39 @@ multiple of the default frame font width."
              hycontrol-display-buffer-predicate-list)
     (error "(HyDebug): Invalid expression in 
`hycontrol-display-buffer-predicate-list' - %s" err)))
 
+(defvar hycontrol--blank-buffer (get-buffer-create "BLANK")
+      "Blank buffer to display in extra window grid windows after selected 
buffer list is exhausted.")
+
 (defun hycontrol-window-display-buffer (window)
-  "Given a WINDOW, choose the next appropriate buffer to display therein using 
`hycontrol-display-buffer-predicate-list'.
+  "Given a WINDOW, choose the next appropriate buffer to display from 
`hycontrol--buffer-list'.
+
+When `hycontrol--invert-display-buffer-predicates' is non-nil and not 'ignore,
+the list of buffers used is further filtered using the functions and 
sexpressions
+in `hycontrol-display-buffer-predicate-list', which by default filters
+a frame's buffer-list to just those buffers with attached files.
+
+Filtering is disabled if a specific list of buffers is sent to the
+`hycontrol-make-windows-grid' function that calls this."
+  (let ((buf (car hycontrol--buffer-list-pointer)))
+    (setq hycontrol--buffer-list-pointer (cdr hycontrol--buffer-list-pointer))
+    (while (and buf (or (= (aref (buffer-name buf) 0) ?\ )
+                       (and (not hycontrol--invert-display-buffer-predicates)
+                            (not (eval (cons 'or 
(hycontrol-display-buffer-predicate-results buf)))))
+                       (and hycontrol--invert-display-buffer-predicates
+                            (not (eq 
hycontrol--invert-display-buffer-predicates 'ignore))
+                            (eval (cons 'or 
(hycontrol-display-buffer-predicate-results buf))))))
+      ;; Buffer is not one to display, get the next one and test again.
+      (setq buf (car hycontrol--buffer-list-pointer)
+           hycontrol--buffer-list-pointer (cdr 
hycontrol--buffer-list-pointer)))
+    (set-window-buffer window
+                      (or buf
+                          ;; Out of buffers to display, display a blank one
+                          hycontrol--blank-buffer))))
+
+(defun hycontrol-window-display-buffer-with-repeats (window)
+  "This is no longer used since Hyperbole V8.  Left here for reference.
+
+Given a WINDOW, choose the next appropriate buffer to display therein using 
`hycontrol-display-buffer-predicate-list'.
 Also uses the value of`hycontrol--buffer-list' as the list of
 buffers to distribute among the windows."
   (let ((buf (car hycontrol--buffer-list-pointer)))
@@ -1413,8 +1488,8 @@ Menu or IBuffer mode."
       ;; items are not filtered out.
       (setq hycontrol--invert-display-buffer-predicates
            (when items 'ignore))
-      ;; Prepend items to buffer list.
-      (apply #'set:create (nconc items (buffer-list (selected-frame)))))))
+      ;; Return either non-nil items or frame's full buffer list.
+      (or items (buffer-list (selected-frame))))))
 
 ;;; Split selected frame into a grid of windows given by row and
 ;;; column count, displaying different buffers in each window.
@@ -1468,7 +1543,7 @@ argument."
     (if (null buffers)
        (error "(hycontrol-windows-grid-by-buffer-list): No matching buffers")
       (mapc #'switch-to-buffer (reverse buffers))
-      (hycontrol-make-windows-grid grid-size))))
+      (hycontrol-make-windows-grid grid-size buffers))))
 
 (defun hycontrol-windows-grid-by-file-list (files)
   "Display an automatically sized window grid showing list of FILES."
@@ -1477,8 +1552,8 @@ argument."
         (grid-size (+ (* grid-digit 10) grid-digit)))
     (if (null files)
        (error "(hycontrol-windows-grid-by-file-list): No matching files")
-      (mapc #'find-file (reverse files))
-      (hycontrol-make-windows-grid grid-size))))
+      (setq buffers (nreverse (mapcar #'find-file (reverse files))))
+      (hycontrol-make-windows-grid grid-size buffers))))
 
 ;;;###autoload
 (defun hycontrol-windows-grid-by-file-pattern (pattern &optional full)
@@ -1527,7 +1602,7 @@ See documentation of `hycontrol-windows-grid' for further 
details."
        (hycontrol-windows-grid arg)
        (setq arg nil)))))
 
-(defun hycontrol-make-windows-grid (arg)
+(defun hycontrol-make-windows-grid (arg &optional buffer-list)
   "Display a grid of windows in the selected frame, sized according to prefix 
ARG.
 Left digit of ARG is the number of grid rows and the right digit is
 the number of grid columns. 
@@ -1595,7 +1670,8 @@ See documentation of `hycontrol-windows-grid' for further 
details."
               ;; the predicate tests.  Always ignore buffers that
               ;; start with a space.  With each succeeding pass, the
               ;; predicate list is inverted again.
-              (setq hycontrol--buffer-list (hycontrol-windows-grid-buffer-list)
+              (setq hycontrol--buffer-list (or buffer-list
+                                               
(hycontrol-windows-grid-buffer-list))
                     hycontrol--buffer-list-pointer hycontrol--buffer-list)
               (walk-windows #'hycontrol-window-display-buffer 'no-minibuf)
 
diff --git a/kotl/kfile.el b/kotl/kfile.el
index 28c407604b..0603f5840a 100644
--- a/kotl/kfile.el
+++ b/kotl/kfile.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    10/31/93
-;; Last-Mod:     24-Jan-22 at 00:25:17 by Bob Weiner
+;; Last-Mod:     29-Jan-22 at 15:24:12 by Bob Weiner
 ;;
 ;; Copyright (C) 1993-2021  Free Software Foundation, Inc.
 ;; See the "../HY-COPY" file for license information.
@@ -412,7 +412,7 @@ hidden."
     (while
        (progn
          (skip-chars-forward "\n")
-         ;; !!! Won't work if label-type is 'no.
+         ;; !! Todo: Won't work if label-type is 'no.
          ;; Here we search past the cell identifier
          ;; for the location at which to place cell properties.
          ;; Be sure not to skip past a period which may terminate the label.
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index c9913a68f4..6ce08f4830 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -7,6 +7,7 @@
 @c Author:       Bob Weiner
 @c
 @c Orig-Date:     6-Nov-91 at 11:18:03
+@c Last-Mod:     29-Jan-22 at 18:04:53 by Bob Weiner
 
 @c %**start of header (This is for running Texinfo on a region.)
 @setfilename hyperbole.info
@@ -155,7 +156,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</P>
 
 <PRE>
 Edition 8.0.0pre
-Printed January 22, 2022.
+Printed January 29, 2022.
 
   Published by the Free Software Foundation, Inc.
   Author:    Bob Weiner
@@ -197,7 +198,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 @example
 Edition 8.0.0pre
-January 22, 2022
+January 29, 2022
 
   Published by the Free Software Foundation, Inc.
   Author:    Bob Weiner
@@ -3908,7 +3909,19 @@ Clear the prefix argument to a value of 0.
 
 @kindex screen, 0-9
 @kitem 0-9
-Multiply the prefix argument by 10 and add the digit pressed.
+Multiply the prefix argument by 10 and add the digit pressed (or subtract it if
+prefix argument is negative).
+
+@kindex screen, -
+@kitem -
+If HyControl mode was just enabled or the last command was prefix arg-related,
+invert the value of the prefix argument or if 0, set it to -1.  Otherwise,
+depending on whether in Frames or Windows mode, shrink the frame or window to
+the minimum size needed to display its text.
+
+@kindex C-u
+@kitem C-u
+Multiply the prefix argument by 4 each time this is pressed.
 
 @cindex windows grid
 @cindex grid of windows
@@ -3919,7 +3932,15 @@ Multiply the prefix argument by 10 and add the digit 
pressed.
 Display a @dfn{grid of windows} in the selected frame sized according to
 the prefix argument or via a prompted input.  Left digit of the argument is
 the number of grid rows and the right digit is the number of grid columns
-to display.
+to display.  The buffers displayed in the grid are determined by the value
+of the prefix argument given to the command or by the selected items in the
+current window if in Buffer Menu, Ibuffer Menu or Dired mode.
+
+@vindex hycontrol-display-buffer-predicate-list
+With no prefix argument and no items chosen, the selected frame's buffer list
+is filtered through @code{hycontrol-display-buffer-predicate-list}, a list of
+predicate/boolean filter functions.  The default predicate selects existing
+buffers with attached files and displays those.
 
 @float Image,image:2x3-Windows-Grid
 @caption{2x3 Windows Grid}
@@ -3927,31 +3948,38 @@ to display.
 @end float
 @sp 1
 
-If the prefix argument is 0, prompt for a major mode whose buffers
-should be displayed first in the grid windows, then prompt for the grid size.
+With a prefix argument of 0, the user is prompted for a major mode name and
+the windows grid size.  Only those buffers with the named major mode are
+displayed.
 
-If the prefix argument is < 0, prompt for a glob-type file pattern and display
-files that match the pattern in an auto-sized windows grid.
+With a prefix argument < 0, the user is prompted for a shell glob-type file
+pattern; matching files are read into buffers and displayed in an auto-sized
+square windows grid.
 
-Otherwise, prompt for the grid size if the prefix argument is an invalid
-size.
+Otherwise, when the prefix argument is an invalid size, the windows grid
+command prompts for the grid size.
 
-@vindex hycontrol-display-buffer-predicate-list
-With a current buffer in Dired, Buffer Menu or IBuffer mode that
-contains marked items, the buffers associated with those items are
-displayed first in the grid (unless the prefix argument is 0).
+When done, this resets the persistent prefix argument to 1 to prevent
+following commands from using the often large grid size argument.
 
-Then the most recently used buffers are displayed in each window, first
-selecting only those buffers which match any of the predicate expressions
-in @code{hycontrol-display-buffer-predicate-list}.  (The default predicate
-list chooses buffers with attached files).
+@c OLD PRE-VERSION 8 BEHAVIOR
+@c @vindex hycontrol-display-buffer-predicate-list
+@c With a current buffer in Dired, Buffer Menu or IBuffer mode that
+@c contains marked items, the buffers associated with those items exclusively
+@c are displayed in the grid (unless the prefix argument is 0).
 
-Then, if there are not enough buffers for all windows, the buffers that
-failed to match to any predicate are used. In all cases, buffers whose
-names start with a space are ignored.
+@c Then the most recently used buffers are displayed in each window, first
+@c selecting only those buffers which match any of the predicate expressions
+@c in @code{hycontrol-display-buffer-predicate-list}.  (The default predicate
+@c list chooses buffers with attached files).
+
+@c Then, if there are not enough buffers for all windows, the buffers that
+@c failed to match to any predicate are used. In all cases, buffers whose
+@c names start with a space are ignored.
+
+@c When done, this resets the persistent prefix argument to 1 to prevent
+@c following commands from using the often large grid size argument.
 
-When done, this resets the persistent prefix argument to 1 to prevent
-following commands from using the often large grid size argument.
 
 @findex hycontrol-window-grid-repeatedly
 If you ever need to experiment with different sized window grids, use
@@ -3964,7 +3992,10 @@ are done, simply press @bkbd{@key{RET}} to exit.
 @findex hycontrol-windows-grid-by-file-list
 Programmatically, there are a number of ways to generate and display a windows 
grid.
 @code{hycontrol-windows-grid-by-file-pattern} creates a windows grid from a 
glob file
-pattern.  It is bound to @bkbd{C--1 C-c @@}.  
@code{hycontrol-windows-grid-by-buffer-list} creates a windows grid from a list 
of buffers or buffer names.  @code{hycontrol-windows-grid-by-file-list} creates 
a windows grid from a list of file names.
+pattern.  It is bound to @bkbd{C--1 C-c @@}.  
@code{hycontrol-windows-grid-by-buffer-list}
+creates a windows grid from a list of buffers or buffer names.
+@code{hycontrol-windows-grid-by-file-list} creates a windows grid from a list 
of file
+names.
 
 @cindex frame resize
 @vindex hycontrol-frame-widths
@@ -7245,7 +7276,7 @@ Frames may contain many windows.
 A feature of HyControl invoked with @bkbd{@@} which creates, lays out
 and populates a grid of a specified size of new Emacs windows, e.g. 4 rows
 by 3 columns, each displaying a different buffer chosen by a set of user
-specifiable filters.
+specifiable filters or from a list.
 @end table
 
 @node Setup, Hyperbole Key Bindings, Glossary, Top
@@ -7974,7 +8005,7 @@ prompted for if not given.
 If the argument is 0, prompt for a major mode whose buffers should be
 displayed first in the grid windows, then prompt for the grid size.
 
-If the argument is < 0, prompt for a glob-type file pattern and display
+If the argument is < 0, prompt for a shell glob-type file pattern and display
 files that match the pattern in an auto-sized windows grid.
 
 This binding is made only if the key is not bound prior to loading Hyperbole.



reply via email to

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