[nongnu] elpa/cdlatex 9a09c2ad32 1/2: $ puts active region into math mode

2023-07-08 Thread ELPA Syncer
branch: elpa/cdlatex
commit 9a09c2ad32e45889ab7696a8cedbf99d6a17edd6
Author: Carsten Dominik 
Commit: Carsten Dominik 

$ puts active region into math mode
---
 CHANGES.org |  6 +-
 cdlatex.el  | 20 ++--
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/CHANGES.org b/CHANGES.org
index efe9d53d99..c4a43a90db 100644
--- a/CHANGES.org
+++ b/CHANGES.org
@@ -1,6 +1,10 @@
 This file documents some more visible changes, in particular if they
 change previous behavior.
 
+* Version 4.15
+When the region is active, pressing dollar will bracket the region
+with two $ characters, putting it into math mode.
+
 * Version 4.13
 - The default value of
   `cdlatex-cdlatex-make-sub-superscript-roman-if-pressed-twice' is now
@@ -8,7 +12,7 @@ change previous behavior.
 - We used to use _{\rm ...} to create roman subscripts.  This is not
   longer up to standards with LaTeX, so we have now switched to using
   \mathrm instead.  Thanks to Sinthoras for pointing this out.  
-- The selection characters for the \overbrace construct has changes.
+- The selection characters for the \overbrace construct has changed.
   It used to be '{ and it is now '] .  The changes was needed to free
   up the { character for the next point.
 - It is now easier to inject a \left( ... \right) construct after the
diff --git a/cdlatex.el b/cdlatex.el
index 4c85b87c9d..c03e321c20 100644
--- a/cdlatex.el
+++ b/cdlatex.el
@@ -3,7 +3,7 @@
 ;;
 ;; Author: Carsten Dominik 
 ;; Keywords: tex
-;; Version: 4.14
+;; Version: 4.15
 ;;
 ;; This file is not part of GNU Emacs.
 ;;
@@ -197,6 +197,9 @@
 ;;delimiter are inserted pairwise by configuring the variable
 ;;`cdlatex-paired-parens'.
 ;;
+;;If the region is active when you press $, the region will be
+;;bracketed by a pair of $ characters.
+;;
 ;;Also, the keys `_' and `^' will insert "_{}" and "^{}",
 ;;respectively, and, if necessary, also a pair of dollar signs to
 ;;switch to math mode.  You can use TAB to exit paired parenthesis.
@@ -823,6 +826,12 @@ Elements of KEEP-LIST are not removed even if duplicate."
 With ARG, insert pair of double dollars."
   (interactive "P")
   (cond
+   ((region-active-p)
+(let ((s (region-beginning)) (e (region-end)))
+  (goto-char s)
+  (insert "$")
+  (goto-char (1+ e))
+  (insert "$")))
((cdlatex-number-of-backslashes-is-odd)
 (insert "$"))
((cdlatex--texmathp)
@@ -856,7 +865,6 @@ When pressed twice, make the sub/superscript roman."
   (if (and cdlatex-make-sub-superscript-roman-if-pressed-twice
(equal this-command last-command))
   (progn
-;; (insert "\\rm ")
 (insert "\\mathrm{}")
 (backward-char 1))
 (if (cdlatex-number-of-backslashes-is-odd)
@@ -1595,7 +1603,7 @@ zZ
 ( ?\-   "\\bar"   nilt   t   nil )
 ( ?T"\\overline"  nilt   nil nil )
 ( ?\_   "\\underline" nilt   nil nil )
-( ?\]"\\overbrace" nilt   nil nil )
+( ?\]   "\\overbrace" nilt   nil nil )
 ( ?\}   "\\underbrace"nilt   nil nil )
 ( ?\>   "\\vec"   nilt   t   nil )
 ( ?/"\\grave" nilt   t   nil )
@@ -1616,9 +1624,9 @@ zZ
 ( ?1"\\displaystyle"  nilnil nil nil )
 ( ?2"\\scriptstyle"   nilnil nil nil )
 ( ?3"\\scriptscriptstyle" nilnil nil nil )
-( ?\("\\left( ? \\right)"  nilnil nil nil )
-( ?\["\\left[ ? \\right]"  nilnil nil nil )
-( ?\{"\\left\\{ ? \\right\\}" nil nil nil nil )
+( ?\(   "\\left( ? \\right)"  nilnil nil nil )
+( ?\[   "\\left[ ? \\right]"  nilnil nil nil )
+( ?\{   "\\left\\{ ? \\right\\}" nil nil nil nil )
 ( ?<"\\left< ? \\right>"  nilnil nil nil )
 ( ?|"\\left| ? \\right|"  nilnil nil nil )
 )



[nongnu] elpa/cdlatex 0f6dac9d75 2/2: Merge branch 'master' of https://github.com/cdominik/cdlatex

2023-07-08 Thread ELPA Syncer
branch: elpa/cdlatex
commit 0f6dac9d75fcc6af3e7d16ac2e271d0c0f6ffd71
Merge: 9a09c2ad32 692142603c
Author: Carsten Dominik 
Commit: Carsten Dominik 

Merge branch 'master' of https://github.com/cdominik/cdlatex
---
 cdlatex.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cdlatex.el b/cdlatex.el
index c03e321c20..821a1e9dfb 100644
--- a/cdlatex.el
+++ b/cdlatex.el
@@ -1060,7 +1060,7 @@ With a non-nil ARG, or a prefix argument, run texdoc 
instead."
 If the environment is not found in the list, a \\begin \\end pair is
 inserted.  Any keywords AUTOLABEL will be replaced by an automatic label
 statement.  Any keywords AUTOFILE will prompt the user for a file name
-\(with completion) and insert that file names.  If a template starts with
+\(with completion) and insert that file name.  If a template starts with
 \"\", the function will make sure that a double backslash occurs before
 the template.  This is mainly useful for \"items\" of environments, where
 \"\" is often needed as separator."



[elpa] externals/cursory 1e9f38527f: Add missing metadata to certain headings

2023-07-08 Thread ELPA Syncer
branch: externals/cursory
commit 1e9f38527f7598778dbce7f2b576d424d73749d7
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add missing metadata to certain headings
---
 README.org | 4 
 1 file changed, 4 insertions(+)

diff --git a/README.org b/README.org
index da537a4cee..1a5465a8e7 100644
--- a/README.org
+++ b/README.org
@@ -47,6 +47,7 @@ Current development target is {{{development-version}}}.
 
 * COPYING
 :PROPERTIES:
+:COPYING: t
 :CUSTOM_ID: h:acadd212-7168-48b2-aded-f257d5fafeb3
 :END:
 
@@ -778,16 +779,19 @@ to permit their use in free software.
 
 ** Function index
 :PROPERTIES:
+:INDEX: fn
 :CUSTOM_ID: h:01120471-a610-449f-87a8-65e60d30a37b
 :END:
 
 ** Variable index
 :PROPERTIES:
+:INDEX: vr
 :CUSTOM_ID: h:069fc5e0-f487-4430-a41c-47d8540e7b42
 :END:
 
 ** Concept index
 :PROPERTIES:
+:INDEX: cp
 :CUSTOM_ID: h:efef3d9a-f9c7-4184-a64c-7e0033192fb5
 :END:
 



[elpa] externals/org caa27be102 1/2: org-element.el: Fix Emacs-26 compatibility

2023-07-08 Thread ELPA Syncer
branch: externals/org
commit caa27be102d13fef5c335b8f444d0ab0190cdd2c
Author: Max Nikulin 
Commit: Ihor Radchenko 

org-element.el: Fix Emacs-26 compatibility

* org-element.el (org-element--current-element-re): Use `rx-to-string'
instead of `rx' to expand variables.
(org-element--cache-setup-change-functions): Avoid multiple variables in
`setq-local'.

Reported as: Justin to emacs-orgmode. [BUG] org-element loading fails
with "regexp" argument not "stringp" Tue, 4 Jul 2023 19:51:44 -0400.

https://list.orgmode.org/2ff109c7-b3ec-27ac-e75d-ae5ddac14...@vallon.homeip.net
---
 lisp/org-element.el | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index bfb1d206ec..1c97075735 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -4278,20 +4278,20 @@ Assume point is at the first equal sign marker."
 ;; point.
 
 (defconst org-element--current-element-re
-  (rx
-   (or
-(group-n 1 (regexp org-element--latex-begin-environment-nogroup))
-(group-n 2 (regexp org-element-drawer-re-nogroup))
-(group-n 3 (regexp "[ \t]*:\\( \\|$\\)"))
-(group-n 7 (regexp org-element-dynamic-block-open-re-nogroup))
-(seq (group-n 4 (regexp "[ \t]*#\\+"))
- (or
-  (seq "BEGIN_" (group-n 5 (1+ (not space
-  (group-n 6 "CALL:")
-  (group-n 8 (1+ (not space)) ":")))
-(group-n 9 (regexp org-footnote-definition-re))
-(group-n 10 (regexp "[ \t]*-+[ \t]*$"))
-(group-n 11 "%%(")))
+  (rx-to-string
+   `(or
+ (group-n 1 (regexp ,org-element--latex-begin-environment-nogroup))
+ (group-n 2 (regexp ,org-element-drawer-re-nogroup))
+ (group-n 3 (regexp "[ \t]*:\\( \\|$\\)"))
+ (group-n 7 (regexp ,org-element-dynamic-block-open-re-nogroup))
+ (seq (group-n 4 (regexp "[ \t]*#\\+"))
+  (or
+   (seq "BEGIN_" (group-n 5 (1+ (not space
+   (group-n 6 "CALL:")
+   (group-n 8 (1+ (not space)) ":")))
+ (group-n 9 (regexp ,org-footnote-definition-re))
+ (group-n 10 (regexp "[ \t]*-+[ \t]*$"))
+ (group-n 11 "%%(")))
   "Bulk regexp matching multiple elements in a single regexp.
 This is a bit more efficient compared to invoking regexp search
 multiple times.")
@@ -6916,8 +6916,8 @@ that range.  See `after-change-functions' for more 
information."
 ;; Clear copied local cache to avoid extra memory usage.
 ;; We only use cache stored in the base buffer.
 (when (buffer-base-buffer)
-  (setq-local org-element--cache nil
-  org-element--headline-cache nil))
+  (setq-local org-element--cache nil)
+  (setq-local org-element--headline-cache nil))
 (add-hook 'before-change-functions
  #'org-element--cache-before-change nil t)
 ;; Run `org-element--cache-after-change' early to handle cases



[elpa] externals/org 879ba22ef6 2/2: org-compat.el: `org--flatten-tree' for Emacs-26 compatibility

2023-07-08 Thread ELPA Syncer
branch: externals/org
commit 879ba22ef69cc54d757b02e84d4f8d37dcef866f
Author: Max Nikulin 
Commit: Ihor Radchenko 

org-compat.el: `org--flatten-tree' for Emacs-26 compatibility

* lisp/org-compat.el (org--flatten-tree): New internal compatibility
alias or function based on `flatten-tree' added to Emacs-27.1.
* lisp/org-protocol.el (org-protocol-flatten): Convert to an obsolete
function alias.
(org-protocol-flatten-greedy): Use the `org--flatten-tree' new
compatibility alias or function instead of `org-protocol-flatten'.
* lisp/org-src.el (org-src--get-known-shells): Make the function
compatible with Emacs-26 by using `org--flatten-tree' instead of
`flatten-tree'.

Reported as: Justin to emacs-orgmode. [PATCH] org-src: flatten-tree is
Emacs 27.1; require compat. Tue, 4 Jul 2023 19:21:05 -0400.

https://list.orgmode.org/0288575b-fde8-0e7d-ac74-1f0ac93ce...@vallon.homeip.net
---
 lisp/org-compat.el   | 19 +++
 lisp/org-protocol.el | 24 +---
 lisp/org-src.el  |  2 +-
 3 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index c5ab655d25..bbda04a15b 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -211,6 +211,25 @@ removed."
   `(progn ,@body))
   (defalias 'org-combine-change-calls 'combine-change-calls))
 
+;; `flatten-tree' was added in Emacs 27.1.
+(if (fboundp 'flatten-tree)
+(defalias 'org--flatten-tree #'flatten-tree)
+  ;; The implementation is taken from Emacs subr.el 8664ba18c7c5.
+  (defun org--flatten-tree (tree)
+"Return a \"flattened\" copy of TREE.
+
+A `flatten-tree' polyfill for compatibility with Emacs versions
+older than 27.1"
+(let (elems)
+  (while (consp tree)
+(let ((elem (pop tree)))
+  (while (consp elem)
+(push (cdr elem) tree)
+(setq elem (car elem)))
+  (if elem (push elem elems
+  (if tree (push tree elems))
+  (nreverse elems
+
 (if (version< emacs-version "27.1")
 (defsubst org-replace-buffer-contents (source &optional _max-secs 
_max-costs)
   (replace-buffer-contents source))
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 2b07a377e2..d6cc39aa93 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -328,7 +328,7 @@ results of that splitting are returned as a list."
 Greedy handlers might receive a list like this from emacsclient:
 \((\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\"))
 where \"/dir/\" is the absolute path to emacsclient's working directory.  This
-function transforms it into a flat list using `org-protocol-flatten' and
+function transforms it into a flat list using `flatten-tree' and
 transforms the elements of that list as follows:
 
 If STRIP-PATH is non-nil, remove the \"/dir/\" prefix from all members of
@@ -343,9 +343,9 @@ Note, that this function will always behave as if
 `org-protocol-reverse-list-of-files' was set to t and the returned list will
 reflect that.  emacsclient's first parameter will be the first one in the
 returned list."
-  (let* ((l (org-protocol-flatten (if org-protocol-reverse-list-of-files
- param-list
-   (reverse param-list
+  (let* ((l (org--flatten-tree (if org-protocol-reverse-list-of-files
+  param-list
+(reverse param-list
 (trigger (car l))
 (len 0)
 dir
@@ -368,21 +368,15 @@ returned list."
  ret)
   l)))
 
-;; `flatten-tree' was added in Emacs 27.1.
-(defalias 'org-protocol-flatten
-  (if (fboundp 'flatten-tree) 'flatten-tree
-(lambda (list)
-  "Transform LIST into a flat list.
+(define-obsolete-function-alias 'org-protocol-flatten
+  (if (fboundp 'flatten-tree) 'flatten-tree 'org--flatten-tree)
+  "9.7"
+  "Transform LIST into a flat list.
 
 Greedy handlers might receive a list like this from emacsclient:
 \((\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\"))
 where \"/dir/\" is the absolute path to emacsclients working directory.
-This function transforms it into a flat list."
-  (if list
- (if (consp list)
- (append (org-protocol-flatten (car list))
- (org-protocol-flatten (cdr list)))
-   (list list))
+This function transforms it into a flat list.")
 
 (defun org-protocol-parse-parameters (info &optional new-style default-order)
   "Return a property list of parameters from INFO.
diff --git a/lisp/org-src.el b/lisp/org-src.el
index e1f7d50dcf..7edbe0570d 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -208,7 +208,7 @@ but which mess up the display of a snippet in Org exported 
files.")
 The shells are associated with `sh-mode'."
   (mapcar
(lambda (shell) (cons (symbol-name shell) 'sh))
-   (delete-dups (flatten-tree sh-ancestor-alist
+   (delete-dups (org--flatten-tree 

[elpa] externals/org updated (2e2ed40553 -> 879ba22ef6)

2023-07-08 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  2e2ed40553 org-src.el: Use native value of `indent-tabs-mode' for 
indentation
   new  caa27be102 org-element.el: Fix Emacs-26 compatibility
   new  879ba22ef6 org-compat.el: `org--flatten-tree' for Emacs-26 
compatibility


Summary of changes:
 lisp/org-compat.el   | 19 +++
 lisp/org-element.el  | 32 
 lisp/org-protocol.el | 24 +---
 lisp/org-src.el  |  2 +-
 4 files changed, 45 insertions(+), 32 deletions(-)



[elpa] externals/ement 60e9a50b8a: Docs: Update changelog

2023-07-08 Thread ELPA Syncer
branch: externals/ement
commit 60e9a50b8a230c00d92f639ba25040944bcda9ab
Author: Adam Porter 
Commit: Adam Porter 

Docs: Update changelog
---
 README.org | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/README.org b/README.org
index 270beae13b..f08e495c3a 100644
--- a/README.org
+++ b/README.org
@@ -305,9 +305,12 @@ Note that, while ~matrix-client~ remains usable, and 
probably will for some time
 
 *Changes*
 + Command ~ement-room-image-show~ is not used for mouse events.
++ Show useful message in SSO login page.
 
 *Fixes*
 + Allow editing of already-edited events.
++ Call external browser for SSO login page.  (JavaScript is usually required, 
which EWW doesn't support, and loading the page twice seems to change state on 
the server that causes the SSO login to fail, so it's best to load the page in 
the external browser directly).
++ Clean up SSO server process after two minutes in case SSO login fails.
 + Don't stop syncing if an error is signaled while sending a notification.
 
 ** 0.10



[elpa] main 2ec80977e1: * elpa-packages (dired-preview): New package

2023-07-08 Thread Protesilaos Stavrou
branch: main
commit 2ec80977e10c39607d3214fbb5bc2e1e4ad6
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

* elpa-packages (dired-preview): New package
---
 elpa-packages | 4 
 1 file changed, 4 insertions(+)

diff --git a/elpa-packages b/elpa-packages
index f94c76e4c3..3949d8fe14 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -211,6 +211,10 @@
   :ignored-files ("LICENSE"))
  (dired-du :url nil)
  (dired-git-info   :url "https://github.com/clemera/dired-git-info";)
+ (dired-preview:url 
"https://git.sr.ht/~protesilaos/dired-preview";
+  :doc "README.org"
+  :readme "README.md"
+  :ignored-files ("COPYING" "doclicense.texi"))
  (disk-usage   :url "https://gitlab.com/ambrevar/emacs-disk-usage";)
  (dismal   :url nil)
  (djvu :url nil)



[elpa] externals/diff-hl b9a69265a3: Whitelist --textconv

2023-07-08 Thread ELPA Syncer
branch: externals/diff-hl
commit b9a69265a3d54e6a7b094e117f1433a698c82cf8
Author: Dmitry Gutov 
Commit: Dmitry Gutov 

Whitelist --textconv

Resolves #198
---
 diff-hl.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/diff-hl.el b/diff-hl.el
index 52aae21ce6..7717ef64fe 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -290,7 +290,7 @@ the current version of the file)."
  (listp vc-git-diff-switches)
  (cl-remove-if-not
   (lambda (arg)
-(member arg '("--histogram" "--patience" "--minimal")))
+(member arg '("--histogram" "--patience" "--minimal" 
"--textconv")))
   vc-git-diff-switches
  (vc-hg-diff-switches nil)
  (vc-svn-diff-switches nil)



[elpa] externals/dired-preview 4dc5a9f430 06/67: Reorganise a couple of functions

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 4dc5a9f430020fd671400e55b78498c22b1673a8
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Reorganise a couple of functions
---
 dired-preview.el | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 7c0296b43f..5cd2b755e2 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -140,6 +140,16 @@ Always return FILE buffer."
window))
(window-list)))
 
+(defun dired-preview--file-ignored-p (file)
+  "Return non-nil if FILE extension is among the ignored extensions.
+See user option `dired-preview-ignored-extensions-regexp'."
+  (when-let ((ext (file-name-extension file)))
+(string-match-p ext dired-preview-ignored-extensions-regexp)))
+
+(defun dired-preview--file-large-p (file)
+  "Return non-nil if FILE exceeds `dired-preview-max-size'."
+  (> (file-attribute-size (file-attributes file)) dired-preview-max-size))
+
 (defun dired-preview--preview-p (file)
   "Return non-nil if FILE can be previewed."
   (and (not (file-directory-p file))
@@ -153,16 +163,6 @@ conforms with `dired-preview--preview-p'."
   (when (dired-preview--preview-p file)
 (dired-preview--add-to-previews file)))
 
-(defun dired-preview--file-ignored-p (file)
-  "Return non-nil if FILE extension is among the ignored extensions.
-See user option `dired-preview-ignored-extensions-regexp'."
-  (when-let ((ext (file-name-extension file)))
-(string-match-p ext dired-preview-ignored-extensions-regexp)))
-
-(defun dired-preview--file-large-p (file)
-  "Return non-nil if FILE exceeds `dired-preview-max-size'."
-  (> (file-attribute-size (file-attributes file)) dired-preview-max-size))
-
 (defun dired-preview--delete-windows ()
   "Delete preview windows."
   (mapc



[elpa] externals/dired-preview a653299672 09/67: Do not preview already visible file

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit a653299672c11a9e565a7ba83a070c23b001677d
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Do not preview already visible file
---
 dired-preview.el | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index 3b4c2fddba..80b7a277cd 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -150,10 +150,17 @@ See user option 
`dired-preview-ignored-extensions-regexp'."
   "Return non-nil if FILE exceeds `dired-preview-max-size'."
   (> (file-attribute-size (file-attributes file)) dired-preview-max-size))
 
+(defun dired-preview--file-displayed-p (file)
+  "Return non-nil if FILE is already displayed in a window."
+  (when-let* ((buffer (get-file-buffer file))
+  (window (get-buffer-window buffer)))
+(window-live-p window)))
+
 (defun dired-preview--preview-p (file)
   "Return non-nil if FILE can be previewed."
   (and (file-exists-p file)
(not (file-directory-p file))
+   (not (dired-preview--file-displayed-p file))
(not (dired-preview--file-ignored-p file))
(not (dired-preview--file-large-p file
 



[elpa] externals/dired-preview 0fa9aab1df 53/67: Add FIXME for how/why window parameters are unset

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 0fa9aab1dfbe104b99b1a96c9cdf894de47b6e00
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add FIXME for how/why window parameters are unset
---
 dired-preview.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index 303fbcc84b..faf131f3e8 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -117,6 +117,9 @@ details."
 (defun dired-preview--run-mode-hooks ()
   "Run mode hooks in current buffer, if `delayed-mode-hooks' is non-nil."
   (when (and delay-mode-hooks (current-buffer))
+;; FIXME 2023-07-05: When we remove the window parameters, we
+;; disconnect the window from the preview.  Then what is the point
+;; of trying to close previews outside of Dired?  Which previews?
 (set-window-parameter (selected-window) 'dired-preview-window nil)
 (set-window-parameter (selected-window) 'dedicated nil)
 (apply #'run-hooks (delete-dups delayed-mode-hooks))



[elpa] externals/dired-preview 18b607fc48 40/67: Simplify dired-preview-return-window-size

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 18b607fc4835f2263701bd8b08fa8ae02dd79206
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Simplify dired-preview-return-window-size

I was wrong about the FIXME I mentioned in commit 959299b, regarding
the calculation of the height.  What I should have noted is that we
could not predict its value.
---
 dired-preview.el | 17 ++---
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 0983f6a380..11040ab4c3 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -179,17 +179,12 @@ DIMENSION is either a `:width' or `:height' keyword.  It 
is
 checked against `split-width-threshold' or
 `split-height-threshold'"
   (pcase dimension
-;; FIXME 2023-07-03: In both cases, this assumes that the "else"
-;; result is smaller than the "then".  This is not a given though,
-;; because we do not know the result of the calculation ahead of
-;; time.
-(:width (if (>= (* fill-column 2) split-width-threshold)
-fill-column
-  (- (window-body-width) fill-column)))
-(:height (let ((height (frame-height)))
-   (if (>= (* height 2) split-height-threshold)
-   height
- (- (window-body-height) height))
+(:width (if (and (numberp split-width-threshold)
+ (> (window-width) split-width-threshold)
+ (> split-width-threshold fill-column))
+split-width-threshold
+  fill-column))
+(:height (floor split-height-threshold 2
 
 (defun dired-preview-display-action-side ()
   "Pick a side window that is appropriate for the given frame."



[elpa] externals/dired-preview 8c1c73716e 37/67: Tighten the event loop to avoid inconsistencies

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 8c1c73716e7bd738a1bfc49311f6552d7e16ccc6
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Tighten the event loop to avoid inconsistencies

I am continuously testing the results.  I want this to be rock solid
before adding any new features.
---
 dired-preview.el | 136 +++
 1 file changed, 66 insertions(+), 70 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 68ceaa5460..de0417098c 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -166,47 +166,10 @@ See user option 
`dired-preview-ignored-extensions-regexp'."
   (window (get-buffer-window buffer)))
 (window-live-p window)))
 
-(defun dired-preview--delete-windows ()
-  "Delete preview windows."
-  (mapc
-   (lambda (window)
- (delete-window window))
-   (dired-preview--get-windows)))
-
-(defun dired-preview--kill-buffers ()
-  "Kill preview buffers."
-  (mapc
-   (lambda (buffer)
- (when (and (not (eq buffer (current-buffer)))
-(window-parameter (get-buffer-window buffer) 
'dired-preview-window))
-   (ignore-errors
- (kill-buffer-if-not-modified buffer
-   (dired-preview--get-buffers))
-  (setq dired-preview--buffers nil))
-
-(defun dired-preview--close-previews ()
-  "Kill preview buffers and delete their windows."
-  (dired-preview--delete-windows)
-  (dired-preview--kill-buffers))
-
 (defun dired-preview--return-preview-buffer (file)
   "Return buffer to preview FILE in."
   (dired-preview--add-to-previews file))
 
-(defun dired-preview--close-previews-outside-dired ()
-  "Call `dired-preview--close-previews' if BUFFER is not in Dired mode."
-  (when (and (not (one-window-p :no-minibuffer))
- (not (minibufferp))
- (not (eq major-mode 'dired-mode)))
-(dired-preview--close-previews)
-(remove-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
-
-(defun dired-preview-set-up-preview-window (buffer)
-  "Set BUFFER window `:preview' parameter."
-  (when-let ((window (get-buffer-window buffer)))
-(set-window-parameter window 'dired-preview-window :preview)
-(add-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
-
 (defvar dired-preview-buffer-name "*dired-preview*"
   "Name of preview buffer.")
 
@@ -245,19 +208,6 @@ aforementioned user option."
  mode-line-front-space
  
,dired-preview-buffer-name)))
 
-(defun dired-preview--display-buffer (buffer)
-  "Call `display-buffer' for BUFFER.
-Only do it with the current major mode is Dired."
-  (display-buffer buffer (funcall (or 
dired-preview-display-action-alist-function
-  
#'dired-preview-display-action-alist-dwim)))
-  (when (window-live-p (get-buffer-window buffer))
-(dired-preview-set-up-preview-window buffer)))
-
-(defun dired-preview-display-file (file)
-  "Display preview of FILE if appropriate."
-  (when-let ((buffer (dired-preview--return-preview-buffer file)))
-(dired-preview--display-buffer buffer)))
-
 (defvar dired-preview-trigger-commands
   '(dired-next-line dired-previous-line dired-mark dired-goto-file)
   "List of Dired commands that trigger a preview.")
@@ -270,6 +220,55 @@ Only do it with the current major mode is Dired."
   (when (timerp dired-preview--timer)
 (cancel-timer dired-preview--timer)))
 
+(defun dired-preview--delete-windows ()
+  "Delete preview windows."
+  (mapc
+   (lambda (window)
+ (unless (or (eq window (minibuffer-window))
+ (one-window-p))
+   (delete-window window)))
+   (dired-preview--get-windows)))
+
+(defun dired-preview--kill-buffers ()
+  "Kill preview buffers."
+  (mapc
+   (lambda (buffer)
+ (when (and (not (eq buffer (current-buffer)))
+(window-parameter (get-buffer-window buffer) 
'dired-preview-window))
+   (ignore-errors
+ (kill-buffer-if-not-modified buffer
+   (dired-preview--get-buffers))
+  (setq dired-preview--buffers nil))
+
+(defun dired-preview--close-previews ()
+  "Kill preview buffers and delete their windows."
+  (dired-preview--cancel-timer)
+  (dired-preview--delete-windows)
+  (dired-preview--kill-buffers))
+
+(defun dired-preview--close-previews-outside-dired ()
+  "Call `dired-preview--close-previews' if BUFFER is not in Dired mode."
+  (when (not (eq major-mode 'dired-mode))
+(dired-preview--close-previews)
+(remove-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
+
+(defun dired-preview--display-buffer (buffer)
+  "Call `display-buffer' for BUFFER.
+Only do it with the current major mode is Dired."
+  (display-buffer
+   buffer
+   (funcall (or dired-preview-display-action-alist-function
+#'dired-preview-display-action-alist-dwim
+
+(defun dired-preview-display-file (file)
+  "Display 

[elpa] externals/dired-preview 86e11c105b 41/67: Make dired-preview-display-file delete windows eagerly

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 86e11c105b5b2bdd481f73aff5678d55411984df
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Make dired-preview-display-file delete windows eagerly

The previous behaviour would produce more than one preview windows in
the case where (i) the Emacs frame displayed a preview per the
function 'dired-preview-display-action-alist-dwim', (ii) the frame was
resized, and (iii) a new preview was requested.

Thanks to Bruno Boal for bringing this matter to my attention and for
checking the workaround with me: .  This was
done in a private channel and the information is shared with
permission.
---
 dired-preview.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 11040ab4c3..6c56d69144 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -261,12 +261,12 @@ Only do it with the current major mode is Dired."
 
 (defun dired-preview-display-file (file)
   "Display preview of FILE if appropriate."
+  (dired-preview--delete-windows)
   (when-let ((buffer (dired-preview--return-preview-buffer file)))
 (dired-preview--display-buffer buffer)
-(if-let ((window (get-buffer-window buffer)))
-(with-selected-window window
-  (set-window-parameter window 'dired-preview-window :preview))
-  (dired-preview--close-previews
+(when-let ((window (get-buffer-window buffer)))
+  (with-selected-window window
+(set-window-parameter window 'dired-preview-window :preview)
 
 (defun dired-preview--preview-p (file)
   "Return non-nil if FILE can be previewed."



[elpa] externals/dired-preview 5dd110bea6 02/67: Fix typo in backronym

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 5dd110bea6bbfc3c232245fd051f4dcf056a2d7a
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix typo in backronym
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 84749d88b1..16c6e84806 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
 + GitLab: 
 + Mailing list: 
 + Backronym: Directories Invariably Render Everything Decently; PDFs
-  Require Extra Viewing Impediments for Emacs to Work.
+  Require Extra Viewing Instructions for Emacs to Work.
 
 * * *
 



[elpa] externals/dired-preview ea643a8912 54/67: Simplify dired-preview-trigger

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit ea643a89128166749eef079c9edc8e5a9ed1b694
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Simplify dired-preview-trigger
---
 dired-preview.el | 26 +++---
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index faf131f3e8..653dd758eb 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -283,21 +283,17 @@ With optional NO-DELAY do not start a timer.  Otherwise 
produce
 the preview with `dired-preview-delay' of idleness."
   (add-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)
   (dired-preview--cancel-timer)
-  (if-let* ((file (dired-file-name-at-point)))
-  (cond
-   ((and (dired-preview--preview-p file)
- (memq this-command dired-preview-trigger-commands))
-(if no-delay
-(dired-preview-display-file file)
-  (setq dired-preview--timer
-(run-with-idle-timer
- dired-preview-delay
- nil
- #'dired-preview-display-file
- file
-   ((and (not (dired-preview--preview-p file))
- (eq major-mode 'dired-mode))
-(dired-preview--close-previews)))
+  (if-let* ((file (dired-file-name-at-point))
+((dired-preview--preview-p file))
+((memq this-command dired-preview-trigger-commands)))
+  (if no-delay
+  (dired-preview-display-file file)
+(setq dired-preview--timer
+  (run-with-idle-timer
+   dired-preview-delay
+   nil
+   #'dired-preview-display-file
+   file)))
 (dired-preview--close-previews-outside-dired)))
 
 (defun dired-preview-disable-preview ()



[elpa] externals/dired-preview 959299b18a 39/67: Add FIXME for dired-preview-return-window-size

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 959299b18acc25df3d4302fd3d69e7d814ad4f78
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add FIXME for dired-preview-return-window-size
---
 dired-preview.el | 4 
 1 file changed, 4 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index 97bbf86545..0983f6a380 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -179,6 +179,10 @@ DIMENSION is either a `:width' or `:height' keyword.  It is
 checked against `split-width-threshold' or
 `split-height-threshold'"
   (pcase dimension
+;; FIXME 2023-07-03: In both cases, this assumes that the "else"
+;; result is smaller than the "then".  This is not a given though,
+;; because we do not know the result of the calculation ahead of
+;; time.
 (:width (if (>= (* fill-column 2) split-width-threshold)
 fill-column
   (- (window-body-width) fill-column)))



[elpa] externals/dired-preview 4010cc9987 60/67: Implement garbage collection for buffer killing

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 4010cc99874aa5d19f2abe67717623cab3acb133
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Implement garbage collection for buffer killing

This way we avoid killing buffers too eagerly.  The accumulated
buffers are still useful for bringing back up a preview shortly after
it has been removed from the preview window.

Thanks to Bruno Boal[1] for testing this with me.  It was done in a
private channel and the information is shared with permission.

[1] 
---
 dired-preview.el | 47 ---
 1 file changed, 32 insertions(+), 15 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 4ca4efd163..440eea484a 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -114,22 +114,39 @@ details."
   "Return non-nil if WINDOW has `dired-preview-window' parameter."
   (window-parameter window 'dired-preview-window))
 
-;; TODO 2023-07-05: We need a garbage collection function so that we
-;; do not accummulate too many buffers that exceed a given threshold.
+;; TODO 2023-07-07: This can become a user option, but let's keep it
+;; simple for now.  We need to be sure this is always doing the right
+;; thing.
+(defvar dired-preview--buffers-threshold (* 1000 1024)
+  "Maximum cumulative buffer size of previews.
+When the accummulated preview buffers exceed this number and
+`dired-preview--kill-buffers' is called, it will kill buffers
+until it drops below this number.")
+
+(defun dired-preview--get-buffer-cummulative-size ()
+  "Return cummulative buffer size of `dired-preview--get-buffers'."
+  (let ((size 0))
+(mapc
+ (lambda (buffer)
+   (setq size (+ (buffer-size buffer) size)))
+ (dired-preview--get-buffers))
+size))
+
 (defun dired-preview--kill-buffers ()
-  "Kill preview buffers."
-  (mapc
-   (lambda (buffer)
- (let ((window (get-buffer-window buffer)))
-   (cond
-((and (dired-preview--window-parameter-p window)
-  (current-buffer))
- (delete-window (get-buffer-window buffer)))
-((dired-preview--window-parameter-p window)
- (ignore-errors
-   (kill-buffer-if-not-modified buffer)
-   (setq dired-preview--buffers (delq buffer 
dired-preview--buffers)))
- (dired-preview--get-buffers)))
+  "Kill preview buffers up to `dired-preview--buffers-threshold'."
+  (let ((buffers (nreverse (dired-preview--get-buffers
+(catch 'stop
+  (mapc
+   (lambda (buffer)
+ (if (and (>= (dired-preview--get-buffer-cummulative-size)
+  dired-preview--buffers-threshold))
+ (when (and (buffer-local-value 'delayed-mode-hooks buffer)
+(not (eq buffer (current-buffer
+   (ignore-errors (kill-buffer-if-not-modified buffer))
+   (setq buffers (delq buffer buffers)))
+   (throw 'stop t)))
+   buffers))
+(setq dired-preview--buffers (delq nil (nreverse buffers)
 
 (defun dired-preview--get-windows ()
   "Return windows that show previews."



[elpa] externals/dired-preview 7413c6f59a 62/67: Define dired-preview-global-mode

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 7413c6f59a9959d5913e459462771e47b669ab2d
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Define dired-preview-global-mode
---
 dired-preview.el | 9 +
 1 file changed, 9 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index 03ad6dc059..ee1810dbd5 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -345,5 +345,14 @@ the preview with `dired-preview-delay' of idleness."
   (dired-preview-enable-preview)
 (dired-preview-disable-preview)))
 
+(defun dired-preview--on ()
+  "Enable `dired-preview-mode' in Dired."
+  (when (eq major-mode 'dired-mode)
+(dired-preview-mode 1)))
+
+;;;###autoload
+(define-globalized-minor-mode dired-preview-global-mode
+  dired-preview-mode dired-preview--on)
+
 (provide 'dired-preview)
 ;;; dired-preview.el ends here



[elpa] externals/dired-preview 49bea8f6d4 34/67: Delete windows, then kill buffers

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 49bea8f6d4b2e0ef17e1f85103fe53d324177e97
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Delete windows, then kill buffers
---
 dired-preview.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 569815de7f..c13a5f2b08 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -201,8 +201,8 @@ See user option `dired-preview-ignored-extensions-regexp'."
 
 (defun dired-preview--close-previews ()
   "Kill preview buffers and delete their windows."
-  (dired-preview--kill-buffers)
-  (dired-preview--delete-windows))
+  (dired-preview--delete-windows)
+  (dired-preview--kill-buffers))
 
 (defun dired-preview--return-preview-buffer (file)
   "Return buffer to preview FILE in."



[elpa] externals/dired-preview 5ffcfb0c85 24/67: Tweak the format of the timer call

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 5ffcfb0c85403d51440a4b0b15733e00e7585ec1
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Tweak the format of the timer call
---
 dired-preview.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index dfd8f5c79e..9394c84e52 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -268,8 +268,9 @@ Only do it with the current major mode is Dired."
   "Display BUFFER with `dired-preview-delay'."
   (dired-preview--cancel-timer)
   (setq dired-preview--timer
-(run-with-idle-timer dired-preview-delay
- nil #'dired-preview--display-buffer buffer)))
+(run-with-idle-timer
+ dired-preview-delay
+ nil #'dired-preview--display-buffer buffer)))
 
 (defun dired-preview-display-file ()
   "Display preview of `dired-file-name-at-point' if appropriate.



[elpa] externals/dired-preview 9d44584802 63/67: Update package commentary; mention dired-preview-global-mode

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 9d445848020b14e8da29e0850244eb4d43b4ca7d
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update package commentary; mention dired-preview-global-mode
---
 dired-preview.el | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index ee1810dbd5..a43bbd6d0a 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -31,9 +31,9 @@
 ;; are no longer relevant, while preview buffers are killed if they have
 ;; not been used for other purposes beside previewing.
 ;;
-;; Enable the `dired-preview-mode' in the current Dired buffer and
-;; then perform the regular up/down motions.  Those will trigger the
-;; preview.
+;; Enable the `dired-preview-mode' in the current Dired buffer or
+;; `dired-preview-global-mode' for all Dired buffers and then perform
+;; the regular up/down motions.  Those will trigger the preview.
 ;;
 ;; The previewed file is displayed in a side window if its size is below
 ;; the number specified in the user option `dired-preview-max-size'.
@@ -45,13 +45,7 @@
 ;; PDFs, and EPUBs.
 ;;
 ;; [ In the future, we may find ways to quickly preview any file type
-;;   without affecting the performance of Emacs.  Though `dired-preview'
-;;   is designed to have no external dependencies, so such an ambition
-;;   may not be realisable (e.g. produce a thumbnail out of a video).  ]
-;;
-;; To set up `dired-preview-mode' in every Dired buffer, set it up thus:
-;;
-;; (add-hook 'dired-mode-hook #'dired-preview-mode)
+;;   without affecting the performance of Emacs.]
 ;;
 ;; I took inspiration for `dired-preview' from the now unmaintained
 ;; `peep-dired' package by Adam Sokolnicki: 
.



[elpa] externals/dired-preview 33a27a68dc 64/67: Add README.org, which GNU ELPA converts into the Info manual

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 33a27a68dc71741d7794f73e719fac01abcafc00
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add README.org, which GNU ELPA converts into the Info manual
---
 README.org  | 682 
 doclicense.texi | 505 +
 2 files changed, 1187 insertions(+)

diff --git a/README.org b/README.org
new file mode 100644
index 00..3613a76d20
--- /dev/null
+++ b/README.org
@@ -0,0 +1,682 @@
+#+title: dired-preview.el: automatically preview files in Dired
+#+author:Protesilaos Stavrou
+#+email: i...@protesilaos.com
+#+language:  en
+#+options:   ':t toc:nil author:t email:t num:t
+#+startup:   content
+#+macro: stable-version 0.1.0
+#+macro: release-date N/A
+#+macro: development-version 0.2.0-dev
+#+macro: file @@texinfo:@file{@@$1@@texinfo:}@@
+#+macro: space @@texinfo:@: @@
+#+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@
+#+export_file_name:  dired-preview.texi
+#+texinfo_filename:  dired-preview.info
+#+texinfo_dir_category:  Emacs misc features
+#+texinfo_dir_title: Dired-Preview: (dired-preview)
+#+texinfo_dir_desc:  Automatically preview files in Dired
+#+texinfo_header:@set MAINTAINERSITE 
@uref{https://protesilaos.com,maintainer webpage}
+#+texinfo_header:@set MAINTAINER Protesilaos Stavrou
+#+texinfo_header:@set MAINTAINEREMAIL @email{i...@protesilaos.com}
+#+texinfo_header:@set MAINTAINERCONTACT 
@uref{mailto:i...@protesilaos.com,contact the maintainer}
+
+#+texinfo: @insertcopying
+
+This manual, written by Protesilaos Stavrou, describes the
+functionality and customization options of ~dired-preview~ (or
+~dired-preview.el~) package, and provides every other piece of
+information pertinent to it.
+
+The documentation furnished herein corresponds to stable version
+{{{stable-version}}}, released on {{{release-date}}}.  Any reference
+to a newer feature which does not yet form part of the latest tagged
+Git commit, is explicitly marked as such.
+
+Current development target is {{{development-version}}}.
+
++ Package name (GNU ELPA): ~dired-preview~
++ Official manual: 
++ Git repo on SourceHut: 
+  - Mirrors:
++ GitHub: 
++ GitLab: 
++ Mailing list: 
++ Backronym: Directories Invariably Render Everything Decently; PDFs
+  Require Extra Viewing Instructions for Emacs to Work.
+
+#+toc: headlines 8 insert TOC here, with eight headline levels
+
+* COPYING
+:PROPERTIES:
+:COPYING: t
+:CUSTOM_ID: h:475b7969-8a84-4ae6-9bf8-3a7cb741cd64
+:END:
+
+Copyright (C) 2023  Free Software Foundation, Inc.
+
+#+begin_quote
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover Texts being “A GNU Manual,” and
+with the Back-Cover Texts as in (a) below.  A copy of the license is
+included in the section entitled “GNU Free Documentation License.”
+
+(a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
+modify this GNU manual.”
+#+end_quote
+
+* Overview
+:PROPERTIES:
+:CUSTOM_ID: h:b518b406-ed29-4739-9b55-fd633e957b22
+:END:
+
+This is a simple and robust package to automatically preview in a side
+window the file at point in Dired buffers.  Preview windows are closed
+when they are no longer relevant, while preview buffers are killed if
+they have not been used for other purposes beside previewing.
+
+#+findex: dired-preview-mode
+#+findex: dired-preview-global-mode
+Enable the ~dired-preview-mode~ in the current Dired buffer or
+~dired-preview-global-mode~ for all Dired buffers and then perform the
+regular up/down motions.  Those will trigger the preview.
+
+#+vindex: dired-preview-max-size
+#+vindex: dired-preview-delay
+The previewed file is displayed in a side window if its size is below
+the number specified in the user option ~dired-preview-max-size~.
+Previews are shown subject to a small delay, per ther user option
+~dired-preview-delay~.
+
+#+vindex: dired-preview-ignored-extensions-regexp
+Files matching the ~dired-preview-ignored-extensions-regexp~ are not
+previewed.  The default value of that user option includes multimedia,
+PDFs, and EPUBs.
+
+[ In the near future, we may find ways to quickly preview any file
+  type without affecting the performance of Emacs. ]
+
+I took inspiration for ~dired-preview~ from the now unmaintained
+~peep-dired~ package by Adam Sokolnicki: 

[elpa] externals/dired-preview 3304286c17 04/67: Use an advice instead of defining new commands; delete our keymap

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 3304286c175387602032a15a7d1888473ca054b0
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Use an advice instead of defining new commands; delete our keymap

This is the same ideas as in commit ae93720, except more generalised.
Instead of defining our own commands, we advise Dired to display a
preview after one of its standard commands is called.  This way we
avoid the problem where the key remap mechanism does not actually
remap all keys associated with a given command.[1][2]

[1] Thanks to Peter Prevos for reporting this in issue 1 on the GitHub
mirror: .

[2] Thanks to Christian Tietze and Ed Hamilton for discussing this
with me on the mailing list:

.
Commit ae93720 by Christian Tietze is based on this discussion.
---
 dired-preview.el | 50 +-
 1 file changed, 13 insertions(+), 37 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 9e6501c7bc..8c2e57bea9 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -242,62 +242,38 @@ Only do it with the current major mode is Dired."
 (run-with-timer dired-preview-delay nil
 #'dired-preview--display-buffer-action buffer)))
 
-(defun dired-preview--display-file (&optional file)
-  "Display preview of file if appropriate.
-
-File is either FILE or the value of `dired-file-name-at-point'.
-
-Return buffer object of displayed buffer."
-  (if-let* ((f (or file (dired-file-name-at-point)))
-(buffer (dired-preview--return-preview-buffer f)))
+(defun dired-preview-display-file (&rest _)
+  "Display preview of `dired-file-name-at-point' if appropriate.
+Return buffer object of displayed buffer.  Ignore any arguments.
+
+Use this as advice after relevant Dired commands (see
+`dired-preview-enable-preview', `dired-preview-disable-preview')."
+  (if-let* ((file (dired-file-name-at-point))
+(buffer (dired-preview--return-preview-buffer file)))
 (dired-preview--display-buffer-with-delay buffer)
 (dired-preview--close-previews)))
 
-(defun dired-preview--display-file-after-mark (&rest args)
-  "Preview file at point in dired buffer after a mark was changed."
-  (dired-preview--display-file))
-
 (defun dired-preview-disable-preview ()
   "Disable preview."
   (unless (eq major-mode 'dired-mode)
 (error "Can only use `dired-preview' in Dired"))
-  (advice-remove #'dired-mark #'dired-preview--display-file-after-mark)
+  (dolist (command '(dired-next-line dired-previous-line dired-mark 
dired-goto-file))
+(advice-remove command #'dired-preview-display-file))
   (dired-preview--close-previews))
 
 (defun dired-preview-enable-preview ()
   "Enable preview and store window configuration."
   (unless (eq major-mode 'dired-mode)
 (error "Can only use `dired-preview' in Dired"))
-  (advice-add #'dired-mark :after #'dired-preview--display-file-after-mark)
+  (dolist (command '(dired-next-line dired-previous-line dired-mark 
dired-goto-file))
+(advice-add command :after #'dired-preview-display-file))
   (add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)
-  (dired-preview--display-file))
-
-(defun dired-preview-next-file (number)
-  "Preview next file in Dired.
-With optional numeric argument NUMBER move than many lines.  Default is 1."
-  (interactive "^p")
-  (dired-next-line (or number 1))
-  (dired-preview--display-file))
-
-(defun dired-preview-previous-file (number)
-  "Preview previous file in Dired.
-With optional numeric argument NUMBER move than many lines.  Default is 1."
-  (interactive "^p")
-  (dired-next-line (- (or number 1)))
-  (dired-preview--display-file))
-
-(defvar dired-preview-mode-map
-  (let ((map (make-sparse-keymap)))
-(define-key map [remap dired-next-line] #'dired-preview-next-file)
-(define-key map [remap dired-previous-line] #'dired-preview-previous-file)
-map)
-  "Keymap for `dired-preview-mode'.")
+  (dired-preview-display-file))
 
 ;;;###autoload
 (define-minor-mode dired-preview-mode
   "Buffer-local mode to preview file at point in Dired."
   :global nil
-  :keymap dired-preview-mode-map
   (if dired-preview-mode
   (dired-preview-enable-preview)
 (dired-preview-disable-preview)))



[elpa] externals/dired-preview 91fc74d122 49/67: Stop using a side window for previews

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 91fc74d122bd90e82eacd3ef55db540f831f0d66
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Stop using a side window for previews

We want the user to be able to focus the window, either with the
keyboard or the mouse.  The window must then be a regular window.  Any
special restrictions feel counter-intuitive as the user will not know
that we had decided to set them in the first place.

Thanks to Bruno Boal for bringing this matter to my attention:
.  This was done in a private channel and
the information is shared with permission.
---
 dired-preview.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 0761ae2194..a5cc28de0b 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -202,9 +202,8 @@ checked against `split-width-threshold' or
 Return a `display-buffer' action alist, as described in the
 aforementioned user option."
   (let ((properties (dired-preview-display-action-side)))
-`((display-buffer-in-side-window)
-  (side . ,(plist-get properties :side))
-  (slot . -1)
+`((display-buffer-in-direction)
+  (direction . ,(plist-get properties :side))
   (,(plist-get properties :dimension) . ,(plist-get properties :size))
   (dedicated . t
 



[elpa] externals/dired-preview 4857868357 33/67: Harden dired-preview--close-previews-outside-dired conditionality

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 4857868357a98c9dc2f9835f2de7834cfa3e2db6
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Harden dired-preview--close-previews-outside-dired conditionality
---
 dired-preview.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index 81adeee873..569815de7f 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -210,7 +210,9 @@ See user option `dired-preview-ignored-extensions-regexp'."
 
 (defun dired-preview--close-previews-outside-dired ()
   "Call `dired-preview--close-previews' if BUFFER is not in Dired mode."
-  (when (not (eq major-mode 'dired-mode))
+  (when (and (not (one-window-p :no-minibuffer))
+ (not (minibufferp))
+ (not (eq major-mode 'dired-mode)))
 (dired-preview--close-previews)
 (remove-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
 



[elpa] externals/dired-preview 4da6ee04bf 12/67: Make the display-buffer action alist customisable

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 4da6ee04bf5b39f74af37532cfbe98f03f893367
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Make the display-buffer action alist customisable

This addresses a TODO I had.  It was also discussed with Karthik
Chikmagalur as part of the preparatory work towards a potential option
to set the other-window-scroll-buffer to the previewed buffer:

.
---
 dired-preview.el | 51 +++
 1 file changed, 31 insertions(+), 20 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index e780a084b4..41bd7fba88 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -82,6 +82,34 @@
   :group 'dired-preview
   :type 'integer)
 
+(defcustom dired-preview-buffer-name "*dired-preview*"
+  "Name of preview buffer.
+Used by the default value of `dired-preview-display-action-alist'."
+  :group 'dired-preview
+  :type 'string)
+
+(defcustom dired-preview-display-action-alist
+  `((display-buffer-in-side-window)
+(side . right)
+(slot . -1)
+(window-width . 0.3)
+(dedicated . t)
+(body-function . dired-preview-set-up-preview-window)
+(window-parameters . ((no-other-window . t)
+  (mode-line-format . ("%e"
+   mode-line-front-space
+   ,dired-preview-buffer-name)
+  "The `display-buffer' action for the preview.
+This is the same data that is passed to `display-buffer-alist'.
+Read Info node `(elisp) Displaying Buffers'.  As such, it is
+meant for experienced users.
+
+To ensure best results, the `body-function' in the alist must be
+set to `dired-preview-set-up-preview-window', as shown in this
+user option's default value."
+  :group 'dired-preview
+  :type 'alist)
+
 (defcustom dired-preview-delay 0.7
   "Time in seconds to wait before previewing."
   :group 'dired-preview
@@ -106,7 +134,7 @@
 (defun dired-preview--run-mode-hooks ()
   "Run mode hooks in current buffer, if `delayed-mode-hooks' is non-nil.
 See `dired-preview--find-file-no-select' for how hooks are
-delayed and `dired-preview--set-up-preview-window' for how this function
+delayed and `dired-preview-set-up-preview-window' for how this function
 is used."
   (when (and delay-mode-hooks (current-buffer))
 (run-mode-hooks delayed-mode-hooks)
@@ -203,20 +231,13 @@ conforms with `dired-preview--preview-p'."
   (when (not (eq major-mode 'dired-mode))
 (dired-preview--close-previews)))
 
-(defun dired-preview--set-up-preview-window (window &rest _)
+(defun dired-preview-set-up-preview-window (window &rest _)
   "Set WINDOW `:preview' parameter."
   (set-window-parameter window 'dired-preview-window :preview)
   (with-current-buffer (window-buffer window)
 (add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)
 (add-hook 'post-command-hook #'dired-preview--run-mode-hooks nil :local)))
 
-(defvar dired-preview-buffer-name "*dired-preview*"
-  "Name of preview buffer.")
-
-;; TODO 2023-06-13: Determine best way to make the placement of the
-;; preview configurable.
-(defvar dired-preview-display-buffer-side 'right)
-
 (defun dired-preview--display-buffer-action (buffer)
   "Call `display-buffer' for BUFFER.
 Only do it with the current major mode is Dired."
@@ -226,17 +247,7 @@ Only do it with the current major mode is Dired."
   (when (eq major-mode 'dired-mode)
 (display-buffer
  buffer
- ;; NOTE 2023-06-13: See TODO above.
- `((display-buffer-in-side-window)
-   (side . ,dired-preview-display-buffer-side)
-   (slot . -1)
-   (window-width . 0.3)
-   (dedicated . t)
-   (body-function . dired-preview--set-up-preview-window)
-   (window-parameters . ((no-other-window . t)
- (mode-line-format . ("%e"
-  mode-line-front-space
-  
,dired-preview-buffer-name
+ dired-preview-display-action-alist)))
 
 (defun dired-preview--cancel-timer ()
   "Cancel `dired-preview--timer' if it is a timer object."



[elpa] externals/dired-preview 5338f5c1a7 26/67: Make commit 3ba4c3f more resilient

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 5338f5c1a70e8c11c9c43a053f991b44483c8c09
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Make commit 3ba4c3f more resilient

The previous version assumed 'dired-file-name-at-point' to always
return a non-nil value.
---
 dired-preview.el | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 9cfdaaf804..a9b92f9615 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -251,15 +251,16 @@ Only do it with the current major mode is Dired."
   ;; We check for `dired-mode' because we want to avoid the scenario
   ;; where the user switches to another buffer/window/frame before the
   ;; timer elapses.
-  (when (and (eq major-mode 'dired-mode)
- ;; FIXME 2023-06-29: We check again for the file in Dired
- ;; because this function runs on a timer and we only want
- ;; it to happen if the file at point is still the one we
- ;; were about to display.  There probably is a better way
- ;; of doing things, given that `dired-file-name-at-point'
- ;; is called by the `dired-preview-display-file' that
- ;; ultimately calls this one.
- (eq buffer (get-file-buffer (dired-file-name-at-point
+  (when-let* (((eq major-mode 'dired-mode))
+  ;; FIXME 2023-06-29: We check again for the file in Dired
+  ;; because this function runs on a timer and we only want
+  ;; it to happen if the file at point is still the one we
+  ;; were about to display.  There probably is a better way
+  ;; of doing things, given that `dired-file-name-at-point'
+  ;; is called by the `dired-preview-display-file' that
+  ;; ultimately calls this one.
+  (file (dired-file-name-at-point))
+  ((eq buffer (get-file-buffer file
 (display-buffer
  buffer
  dired-preview-display-action-alist)))



[elpa] externals/dired-preview 3ba4c3f533 25/67: Add FIXME to preview only when it is still the current one

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 3ba4c3f533e8752398523d30f08f9837b3a257a8
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add FIXME to preview only when it is still the current one
---
 dired-preview.el | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index 9394c84e52..9cfdaaf804 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -251,7 +251,15 @@ Only do it with the current major mode is Dired."
   ;; We check for `dired-mode' because we want to avoid the scenario
   ;; where the user switches to another buffer/window/frame before the
   ;; timer elapses.
-  (when (eq major-mode 'dired-mode)
+  (when (and (eq major-mode 'dired-mode)
+ ;; FIXME 2023-06-29: We check again for the file in Dired
+ ;; because this function runs on a timer and we only want
+ ;; it to happen if the file at point is still the one we
+ ;; were about to display.  There probably is a better way
+ ;; of doing things, given that `dired-file-name-at-point'
+ ;; is called by the `dired-preview-display-file' that
+ ;; ultimately calls this one.
+ (eq buffer (get-file-buffer (dired-file-name-at-point
 (display-buffer
  buffer
  dired-preview-display-action-alist)))



[elpa] externals/dired-preview 22f44d083c 10/67: Clear previewed buffers after they are killed

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 22f44d083c75b03eccdffd6e56841f5ad5b8c3df
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Clear previewed buffers after they are killed

Thanks to Karthik Chikmagalur for bringing this matter to my
attention: 
.
---
 dired-preview.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index 80b7a277cd..d05e1c0ed0 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -187,7 +187,8 @@ conforms with `dired-preview--preview-p'."
 delayed-mode-hooks)
(ignore-errors
  (kill-buffer-if-not-modified buffer
-   (dired-preview--get-buffers)))
+   (dired-preview--get-buffers))
+  (setq dired-preview--buffers nil))
 
 (defvar dired-preview--timer nil
   "Most recent timer object to display a preview.")



[elpa] externals/dired-preview c20af9c9eb 31/67: Fix how the window is set up and closed outside Dired

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit c20af9c9eb5d6941159cbc476aca4103fa0c2b6b
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix how the window is set up and closed outside Dired

Thanks to Bruno Boal for taking a look into this with me:
.  This was done in a private channel and
the information is shared with permission.
---
 dired-preview.el | 51 +--
 1 file changed, 21 insertions(+), 30 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 4ccaa827c9..b61f5ded41 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -94,10 +94,6 @@ Used by the default value of 
`dired-preview-display-action-alist'."
 (slot . -1)
 (window-width . 0.3)
 (dedicated . t)
-;; FIXME 2023-06-29: Should `dired-preview-set-up-preview-window'
-;; be part of the `body-function'?  It seems wrong as the user may
-;; omit this entry from the alist, thus breaking the preview.
-(body-function . dired-preview-set-up-preview-window)
 (window-parameters . ((no-other-window . t)
   (mode-line-format . ("%e"
mode-line-front-space
@@ -105,11 +101,7 @@ Used by the default value of 
`dired-preview-display-action-alist'."
   "The `display-buffer' action for the preview.
 This is the same data that is passed to `display-buffer-alist'.
 Read Info node `(elisp) Displaying Buffers'.  As such, it is
-meant for experienced users.
-
-To ensure best results, the `body-function' in the alist must be
-set to `dired-preview-set-up-preview-window', as shown in this
-user option's default value."
+meant for experienced users."
   :group 'dired-preview
   :type 'alist)
 
@@ -170,8 +162,7 @@ Always return FILE buffer."
   "Return windows that show previews."
   (seq-filter
(lambda (window)
- (when (window-parameter window 'dired-preview-window)
-   window))
+ (window-parameter window 'dired-preview-window))
(window-list)))
 
 (defun dired-preview--file-ignored-p (file)
@@ -210,8 +201,7 @@ See user option `dired-preview-ignored-extensions-regexp'."
   (mapc
(lambda (buffer)
  (when (and (not (eq buffer (current-buffer)))
-(window-parameter (get-buffer-window buffer) 
'dired-preview-window)
-delayed-mode-hooks)
+(window-parameter (get-buffer-window buffer) 
'dired-preview-window))
(ignore-errors
  (kill-buffer-if-not-modified buffer
(dired-preview--get-buffers))
@@ -219,8 +209,8 @@ See user option `dired-preview-ignored-extensions-regexp'."
 
 (defun dired-preview--close-previews ()
   "Kill preview buffers and delete their windows."
-  (dired-preview--delete-windows)
-  (dired-preview--kill-buffers))
+  (dired-preview--kill-buffers)
+  (dired-preview--delete-windows))
 
 (defun dired-preview--return-preview-buffer (file)
   "Return buffer to preview FILE in.
@@ -235,13 +225,10 @@ conforms with `dired-preview--preview-p'."
 (dired-preview--close-previews)
 (remove-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
 
-;; NOTE 2023-06-29: See the FIXME for `dired-preview-display-action-alist'.
-(defun dired-preview-set-up-preview-window (window &rest _)
-  "Set WINDOW `:preview' parameter.
-Use this as the `body-function' in the user option
-`dired-preview-display-action-alist'."
-  (set-window-parameter window 'dired-preview-window :preview)
-  (with-current-buffer (window-buffer window)
+(defun dired-preview-set-up-preview-window (buffer)
+  "Set BUFFER window `:preview' parameter."
+  (when-let ((window (get-buffer-window buffer)))
+(set-window-parameter window 'dired-preview-window :preview)
 (add-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
 
 (defun dired-preview--display-buffer (buffer)
@@ -262,7 +249,8 @@ Only do it with the current major mode is Dired."
   ((eq buffer (get-file-buffer file
 (display-buffer
  buffer
- dired-preview-display-action-alist)))
+ dired-preview-display-action-alist)
+(dired-preview-set-up-preview-window buffer)))
 
 (defun dired-preview-display-file ()
   "Display preview of `dired-file-name-at-point' if appropriate.
@@ -286,13 +274,16 @@ Return buffer object of displayed buffer."
 
 (defun dired-preview-trigger ()
   "Trigger display of file at point after `dired-preview-trigger-commands'."
-  (when (memq this-command dired-preview-trigger-commands)
-(dired-preview--cancel-timer)
-(setq dired-preview--timer
-  (run-with-idle-timer
-   dired-preview-delay
-   nil
-   #'dired-preview-display-file
+  (if (and (eq major-mode 'dired-mode)
+   (memq this-command dired-preview-trigger-commands))
+  (progn
+(dired-preview--cancel-timer)
+(setq dired-preview--timer
+  (run-with-idle-timer
+   dired-preview

[elpa] externals/dired-preview 4b89363599 61/67: Delete preview windows, including the selected one

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 4b893635992f80255cf6e9af87b8a8aa8b0b1273
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Delete preview windows, including the selected one

This is to account for the scenario where the user selects the side
window of the preview using their mouse.
---
 dired-preview.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 440eea484a..03ad6dc059 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -157,8 +157,7 @@ until it drops below this number.")
   (mapc
(lambda (window)
  (unless (or (one-window-p)
- (eq window (minibuffer-window))
- (eq window (selected-window)))
+ (eq window (minibuffer-window)))
(delete-window window)))
(dired-preview--get-windows)))
 



[elpa] externals/dired-preview 3f2588abb3 32/67: Make all preview state be handled by the trigger

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 3f2588abb3124ecb12b280261cc1985d4cd8d285
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Make all preview state be handled by the trigger

This way we simplify other functions, while making the open/close
behaviour predictable.

Thanks to Bruno Boal for taking a look into this with me:
.  This was done in a private channel and
the information is shared with permission.
---
 dired-preview.el | 83 +---
 1 file changed, 37 insertions(+), 46 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index b61f5ded41..81adeee873 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -181,14 +181,6 @@ See user option `dired-preview-ignored-extensions-regexp'."
   (window (get-buffer-window buffer)))
 (window-live-p window)))
 
-(defun dired-preview--preview-p (file)
-  "Return non-nil if FILE can be previewed."
-  (and (file-exists-p file)
-   (not (file-directory-p file))
-   (not (dired-preview--file-displayed-p file))
-   (not (dired-preview--file-ignored-p file))
-   (not (dired-preview--file-large-p file
-
 (defun dired-preview--delete-windows ()
   "Delete preview windows."
   (mapc
@@ -213,11 +205,8 @@ See user option `dired-preview-ignored-extensions-regexp'."
   (dired-preview--delete-windows))
 
 (defun dired-preview--return-preview-buffer (file)
-  "Return buffer to preview FILE in.
-Determine the propriety of this action by checking that FILE
-conforms with `dired-preview--preview-p'."
-  (when (dired-preview--preview-p file)
-(dired-preview--add-to-previews file)))
+  "Return buffer to preview FILE in."
+  (dired-preview--add-to-previews file))
 
 (defun dired-preview--close-previews-outside-dired ()
   "Call `dired-preview--close-previews' if BUFFER is not in Dired mode."
@@ -234,31 +223,13 @@ conforms with `dired-preview--preview-p'."
 (defun dired-preview--display-buffer (buffer)
   "Call `display-buffer' for BUFFER.
 Only do it with the current major mode is Dired."
-  ;; We check for `dired-mode' because we want to avoid the scenario
-  ;; where the user switches to another buffer/window/frame before the
-  ;; timer elapses.
-  (when-let* (((eq major-mode 'dired-mode))
-  ;; FIXME 2023-06-29: We check again for the file in Dired
-  ;; because this function runs on a timer and we only want
-  ;; it to happen if the file at point is still the one we
-  ;; were about to display.  There probably is a better way
-  ;; of doing things, given that `dired-file-name-at-point'
-  ;; is called by the `dired-preview-display-file' that
-  ;; ultimately calls this one.
-  (file (dired-file-name-at-point))
-  ((eq buffer (get-file-buffer file
-(display-buffer
- buffer
- dired-preview-display-action-alist)
-(dired-preview-set-up-preview-window buffer)))
-
-(defun dired-preview-display-file ()
-  "Display preview of `dired-file-name-at-point' if appropriate.
-Return buffer object of displayed buffer."
-  (if-let* ((file (dired-file-name-at-point))
-(buffer (dired-preview--return-preview-buffer file)))
-(dired-preview--display-buffer buffer)
-(dired-preview--close-previews)))
+  (display-buffer buffer dired-preview-display-action-alist)
+  (dired-preview-set-up-preview-window buffer))
+
+(defun dired-preview-display-file (file)
+  "Display preview of FILE if appropriate."
+  (when-let ((buffer (dired-preview--return-preview-buffer file)))
+(dired-preview--display-buffer buffer)))
 
 (defvar dired-preview-trigger-commands
   '(dired-next-line dired-previous-line dired-mark dired-goto-file)
@@ -272,18 +243,38 @@ Return buffer object of displayed buffer."
   (when (timerp dired-preview--timer)
 (cancel-timer dired-preview--timer)))
 
-(defun dired-preview-trigger ()
-  "Trigger display of file at point after `dired-preview-trigger-commands'."
-  (if (and (eq major-mode 'dired-mode)
+(defun dired-preview--preview-p (file)
+  "Return non-nil if FILE can be previewed."
+  (and (file-exists-p file)
+   (not (file-directory-p file))
+   (not (dired-preview--file-displayed-p file))
+   (not (dired-preview--file-ignored-p file))
+   (not (dired-preview--file-large-p file
+
+(defun dired-preview-trigger (&optional no-delay)
+  "Trigger display of file at point after `dired-preview-trigger-commands'.
+With optional NO-DELAY do not start a timer.  Otherwise produce
+the preview with `dired-preview-delay' of idleness."
+  (dired-preview--cancel-timer)
+  (let* ((file (dired-file-name-at-point)))
+(cond
+ ((and file
+   (dired-preview--preview-p file)
(memq this-command dired-preview-trigger-commands))
-  (progn
-(dired-preview--cancel-timer)
+  (if no-delay
+  (dired-preview-display-file file)
   

[elpa] externals/dired-preview a3dd67d46f 59/67: Refine dired-preview-get-window-size

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit a3dd67d46f30fa84bf0af6e74aa5c172be29f80e
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Refine dired-preview-get-window-size

Thanks to Bruno Boal[1] for testing this with me.  It was done in a
private channel and the information is shared with permission.

[1] 
---
 dired-preview.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index 656fe7a7a7..4ca4efd163 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -217,7 +217,10 @@ DIMENSION is either a `:width' or `:height' keyword.  It is
 checked against `split-width-threshold' or
 `split-height-threshold'"
   (pcase dimension
-(:width fill-column)
+(:width (if-let ((window-width (floor (window-total-width) 2))
+ ((> window-width fill-column)))
+window-width
+  fill-column))
 (:height (floor (window-height) 2
 
 (defun dired-preview-display-action-side ()



[elpa] externals/dired-preview 6673bb1cd3 67/67: Update to version 0.1.0

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 6673bb1cd3f130ecb63641ea2510b38748bfcec3
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update to version 0.1.0
---
 CHANGELOG.org| 151 +++
 README.org   |   2 +-
 dired-preview.el |   2 +-
 3 files changed, 153 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
new file mode 100644
index 00..b89caa5378
--- /dev/null
+++ b/CHANGELOG.org
@@ -0,0 +1,151 @@
+#+TITLE: Change log of dired-preview.el
+#+AUTHOR: Protesilaos Stavrou
+#+EMAIL: i...@protesilaos.com
+#+OPTIONS: ':nil toc:nil num:nil author:nil email:nil
+
+This document contains the release notes for each tagged commit on the
+project's main git repository: .
+
+The newest release is at the top.  For further details, please consult
+the manual: .
+
+* 0.1.0
+:PROPERTIES:
+:CUSTOM_ID: h:99cbb3dd-a0f1-4d2b-a945-58531f4ab189
+:END:
+
+The ~dired-preview~ package was in a public testing phase from DATE
+until today.  In the meantime, lots of changes have been made in the
+interest of usability and robustness.
+
+** Global and buffer-local modes
+:PROPERTIES:
+:CUSTOM_ID: h:598de101-5c1f-4fbd-8f27-709375d8950b
+:END:
+
+The ~dired-preview-mode~ is a local minor mode, while
+~dired-preview-global-mode~ is its global counterpart.  Both only take
+effect in Dired buffers.
+
+The idea for a global and a local mode is to empower the user to
+toggle the functionality on demand, such as when they are in a meeting
+and want to disable/enable previews in a given context.
+
+During the development phase, I had made an error regarding the scope
+of what should be a local minor mode.  Thanks to Christian Tietze for
+pointing it out: 
.
+
+** Preview delay runs on an idle timer
+:PROPERTIES:
+:CUSTOM_ID: h:b80cc550-24ee-4817-be8c-c24c5e98e4c2
+:END:
+
+Originally, previews would run on a timer that would block Emacs.
+Whereas we now arrange to only trigger a preview when Emacs is idle
+for a customisable amount of seconds.  Refer to the user option
+~dired-preview-delay~.
+
+** Trigger a preview in the post-command phase
+:PROPERTIES:
+:CUSTOM_ID: h:c298121a-5ba4-408b-b063-14022c307c47
+:END:
+
+In the original design, previews were triggered by bespoke
+~dired-preview~ commands that were remapped to =n= and =p= in Dired
+buffers.  This had several downsides, namely, (i) the other motions
+would not pick up the trigger, (ii) we would have to remap all
+possible motions, and (iii) the code was needlessly complex.
+
+Currently, we install a local hook in the post-command phase, which
+will trigger a preview if the previous command was a Dired motion.  In
+future versions, we may expand the list of commands that we check for.
+
+Thanks to Peter Prevos for reporting this in issue 1 on the GitHub
+mirror: .
+  
+Thanks to Christian Tietze and Ed Hamilton for discussing this topic
+with me on the mailing list:
+.
+Commit ae93720 by Christian Tietze is based on this discussion,
+although the implementation details have since been redone.
+
+During the development phase, I had made the mistake of checking the
+~last-command~, whereas I should be testing against the
+~this-command~.  Thanks to Karthik Chikmagalur for pointing out my
+error:
+.
+
+** The placement of the preview window is customisable
+:PROPERTIES:
+:CUSTOM_ID: h:3033401f-878d-4298-9256-228d6c249b3a
+:END:
+
+We arrange to display previews in a side window.  Due to the inherent
+complexity of the ~display-buffer~ function and its accoutrements, a
+user option is necessarily reserved for experienced users.  To this
+end, we provide the ~dired-preview-display-action-alist-function~.
+Refer to the ~dired-preview-display-action-alist-dwim~ function for
+the implementation details.
+
+Thanks to Karthik Chikmagalur for making an initial suggestion about
+such a feature:
+
+
+Thanks to Bruno Boal for discussing the user option and concomitant
+function with me and for checking the relevant definitions.  This was
+done via a private channel and the information is shared with
+permission.
+
+** Window placement and deletion is more robust
+:PROPERTIES:
+:CUSTOM_ID: h:06e6249d-8755-450e-b65e-b8f999d982a4
+:END:
+
+The idea of "preview" windows is that they are not ordinary windows
+that the user can interact with.  As such, they are to be deleted when
+some non-preview mode of action is taken.
+
+Testing for such cases was extensive and required lots of changes to
+the code base.  Thanks to Brun

[elpa] externals/dired-preview 8d19b43469 66/67: Fix typos

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 8d19b43469ca90d33f8ac2ccc18d5bcd4d92c608
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix typos

Thanks to Bruno Boal for finding those.  This was done via a private
channel and the information is shared with permission.
---
 dired-preview.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index a43bbd6d0a..3e03d6da20 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -113,12 +113,12 @@ details."
 ;; thing.
 (defvar dired-preview--buffers-threshold (* 1000 1024)
   "Maximum cumulative buffer size of previews.
-When the accummulated preview buffers exceed this number and
+When the accumulated preview buffers exceed this number and
 `dired-preview--kill-buffers' is called, it will kill buffers
 until it drops below this number.")
 
-(defun dired-preview--get-buffer-cummulative-size ()
-  "Return cummulative buffer size of `dired-preview--get-buffers'."
+(defun dired-preview--get-buffer-cumulative-size ()
+  "Return cumulative buffer size of `dired-preview--get-buffers'."
   (let ((size 0))
 (mapc
  (lambda (buffer)
@@ -132,7 +132,7 @@ until it drops below this number.")
 (catch 'stop
   (mapc
(lambda (buffer)
- (if (and (>= (dired-preview--get-buffer-cummulative-size)
+ (if (and (>= (dired-preview--get-buffer-cumulative-size)
   dired-preview--buffers-threshold))
  (when (and (buffer-local-value 'delayed-mode-hooks buffer)
 (not (eq buffer (current-buffer



[elpa] externals/dired-preview 4af91a6b7c 57/67: Re-order large portions of the file

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 4af91a6b7c6d64ecbdfcb3b048a4035f9fb49be7
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Re-order large portions of the file
---
 dired-preview.el | 140 +++
 1 file changed, 70 insertions(+), 70 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index c4a0ff8f16..a98282b428 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -101,49 +101,6 @@ details."
 (defvar dired-preview--buffers nil
   "List with buffers of previewed files.")
 
-(defun dired-preview--find-file-no-select (file)
-  "Call `find-file-noselect' on FILE with appropriate settings."
-  ;; NOTE: I learnt about `non-essential' and `delay-mode-hooks' from
-  ;; Daniel Mendler's `consult' package, which imnplements a preview
-  ;; functionality as well (more sophisticated than mine):
-  ;; .
-  (let ((inhibit-message t)
-(enable-dir-local-variables nil)
-(enable-local-variables :safe)
-(non-essential t)
-(delay-mode-hooks t))
-(find-file-noselect file :nowarn)))
-
-(defun dired-preview--set-window-parameters (window value)
-  "Set desired WINDOW parameters to VALUE."
-  (with-selected-window window
-(set-window-parameter window 'dired-preview-window value)
-(set-window-parameter window 'dedicated value)
-(set-window-parameter window 'no-other-window value)))
-
-(defun dired-preview--run-mode-hooks ()
-  "Run mode hooks in current buffer, if `delayed-mode-hooks' is non-nil."
-  (cond
-   ((window-parameter (selected-window) 'dired-preview-window)
-(dired-preview--delete-windows))
-   ((and delay-mode-hooks (current-buffer))
-(dired-preview--set-window-parameters (selected-window) nil)
-(apply #'run-hooks (delete-dups delayed-mode-hooks))
-(kill-local-variable 'delayed-mode-hooks)
-(remove-hook 'post-command-hook #'dired-preview--run-mode-hooks :local
-
-(defun dired-preview--add-to-previews (file)
-  "Add FILE to `dired-preview--buffers', if not already in a buffer.
-Always return FILE buffer."
-  (let ((buffer (find-buffer-visiting file)))
-(if (buffer-live-p buffer)
-buffer
-  (setq buffer (dired-preview--find-file-no-select file)))
-(with-current-buffer buffer
-  (add-hook 'post-command-hook #'dired-preview--run-mode-hooks nil :local))
-(add-to-list 'dired-preview--buffers buffer)
-buffer))
-
 (defun dired-preview--get-buffers ()
   "Return buffers that show previews."
   (seq-filter
@@ -157,10 +114,37 @@ Always return FILE buffer."
   "Return non-nil if WINDOW has `dired-preview-window' parameter."
   (window-parameter window 'dired-preview-window))
 
+;; TODO 2023-07-05: We need a garbage collection function so that we
+;; do not accummulate too many buffers that exceed a given threshold.
+(defun dired-preview--kill-buffers ()
+  "Kill preview buffers."
+  (mapc
+   (lambda (buffer)
+ (let ((window (get-buffer-window buffer)))
+   (cond
+((and (dired-preview--window-parameter-p window)
+  (current-buffer))
+ (delete-window (get-buffer-window buffer)))
+((dired-preview--window-parameter-p window)
+ (ignore-errors
+   (kill-buffer-if-not-modified buffer)
+   (setq dired-preview--buffers (delq buffer 
dired-preview--buffers)))
+ (dired-preview--get-buffers)))
+
 (defun dired-preview--get-windows ()
   "Return windows that show previews."
   (seq-filter #'dired-preview--window-parameter-p (window-list)))
 
+(defun dired-preview--delete-windows ()
+  "Delete preview windows."
+  (mapc
+   (lambda (window)
+ (unless (or (one-window-p)
+ (eq window (minibuffer-window))
+ (eq window (selected-window)))
+   (delete-window window)))
+   (dired-preview--get-windows)))
+
 (defun dired-preview--file-ignored-p (file)
   "Return non-nil if FILE extension is among the ignored extensions.
 See user option `dired-preview-ignored-extensions-regexp'."
@@ -177,6 +161,49 @@ See user option `dired-preview-ignored-extensions-regexp'."
   (window (get-buffer-window buffer)))
 (window-live-p window)))
 
+(defun dired-preview--set-window-parameters (window value)
+  "Set desired WINDOW parameters to VALUE."
+  (with-selected-window window
+(set-window-parameter window 'dired-preview-window value)
+(set-window-parameter window 'dedicated value)
+(set-window-parameter window 'no-other-window value)))
+
+(defun dired-preview--run-mode-hooks ()
+  "Run mode hooks in current buffer, if `delayed-mode-hooks' is non-nil."
+  (cond
+   ((window-parameter (selected-window) 'dired-preview-window)
+(dired-preview--delete-windows))
+   ((and delay-mode-hooks (current-buffer))
+(dired-preview--set-window-parameters (selected-window) nil)
+(apply #'run-hooks (delete-dups delayed-mode-hooks))
+(kill-local-variable 'delayed-mode-hooks)
+(remove-hook 'post-command-hook #

[elpa] externals/dired-preview 75f1b11e99 29/67: Add FIXME for the scope of dired-preview--close-previews-outside-dired

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 75f1b11e99dbdfd1ec88f7bf30daf954afba9514
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add FIXME for the scope of dired-preview--close-previews-outside-dired
---
 dired-preview.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index d276374d7e..3df6f85005 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -241,6 +241,9 @@ Use this as the `body-function' in the user option
 `dired-preview-display-action-alist'."
   (set-window-parameter window 'dired-preview-window :preview)
   (with-current-buffer (window-buffer window)
+;; FIXME 2023-06-30: This is the wrong scope, because it will not
+;; be relevant when using `switch-to-buffer', `previous-buffer',
+;; etc.  Basically, it assumes we are in a Dired-only environment.
 (add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)))
 
 (defun dired-preview--display-buffer (buffer)



[elpa] externals/dired-preview 98815455cb 65/67: Simplify README.md, pointing to the manual instead (per 33a27a6)

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 98815455cb82b4b2557ce7ab46dcc0e48d29823e
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Simplify README.md, pointing to the manual instead (per 33a27a6)
---
 README.md | 38 +-
 1 file changed, 1 insertion(+), 37 deletions(-)

diff --git a/README.md b/README.md
index 93f36f7513..ea658ef287 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,7 @@
 
 + Package name (GNU ELPA): `dired-preview` (⚠️ not available yet;
   public testing phase as of 2023-06-25)
++ Official manual: 
 + Git repo on SourceHut: 
   - Mirrors:
 + GitHub: 
@@ -9,40 +10,3 @@
 + Mailing list: 
 + Backronym: Directories Invariably Render Everything Decently; PDFs
   Require Extra Viewing Instructions for Emacs to Work.
-
-* * *
-
-This is a simple package to automatically preview in a side window the
-file at point in Dired buffers.  Preview windows are closed when they
-are no longer relevant, while preview buffers are killed if they have
-not been used for other purposes beside previewing.
-
-Enable the `dired-preview-mode` in the current Dired buffer and then
-perform the regular up/down motions.  Those will trigger the preview.
-
-The previewed file is displayed in a side window if its size is below
-the number specified in the user option `dired-preview-max-size`.
-Previews are shown subject to a small delay, per ther user option
-`dired-preview-delay`.
-
-Files matching the `dired-preview-ignored-extensions-regexp` are not
-previewed.  The default value of that user option includes multimedia,
-PDFs, and EPUBs.
-
-[ In the future, we may find ways to quickly preview any file type
-  without affecting the performance of Emacs.  Though `dired-preview`
-  is designed to have no external dependencies, so such an ambition
-  may not be realisable (e.g. produce a thumbnail out of a video). ]
-
-To set up `dired-preview-mode` in every Dired buffer, set it up thus:
-
-```elisp
-(add-hook 'dired-mode-hook #'dired-preview-mode)
-```
-
-I took inspiration for `dired-preview` from the now unmaintained
-`peep-dired` package by Adam Sokolnicki: .
-My original plan was to volunteer to maintain `peep-dired` but I
-decided to write it my own way: it was easier for me, plus I can
-implement only what I consider necessary without upsetting existing
-users.



[elpa] externals/dired-preview f52ed4774c 48/67: Remove 'dedicated' parameter from selected window

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit f52ed4774c452e9fe10bc68b77e9df0a19db43be
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Remove 'dedicated' parameter from selected window

This ensures that if the user focuses the preview window, they will
get something useful, instead of being surprised by the limitations of
the window.
---
 dired-preview.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dired-preview.el b/dired-preview.el
index e5a133a551..0761ae2194 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -118,6 +118,7 @@ details."
   "Run mode hooks in current buffer, if `delayed-mode-hooks' is non-nil."
   (when (and delay-mode-hooks (current-buffer))
 (set-window-parameter (selected-window) 'dired-preview-window nil)
+(set-window-parameter (selected-window) 'dedicated nil)
 (apply #'run-hooks (delete-dups delayed-mode-hooks))
 (kill-local-variable 'delayed-mode-hooks)
 (remove-hook 'post-command-hook #'dired-preview--run-mode-hooks :local)))



[elpa] externals/dired-preview 24bf5bce79 50/67: Add FIXME for dired-preview-display-action-alist-dwim

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 24bf5bce791133d489b469b13f96f6bb7ce76715
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add FIXME for dired-preview-display-action-alist-dwim
---
 dired-preview.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index a5cc28de0b..e5843b75f9 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -202,6 +202,9 @@ checked against `split-width-threshold' or
 Return a `display-buffer' action alist, as described in the
 aforementioned user option."
   (let ((properties (dired-preview-display-action-side)))
+;; FIXME 2023-07-05: This can distort the size of the Dired
+;; window, making it difficult to see what the next file on the
+;; list is.
 `((display-buffer-in-direction)
   (direction . ,(plist-get properties :side))
   (,(plist-get properties :dimension) . ,(plist-get properties :size))



[elpa] externals/dired-preview 29829a63c8 56/67: Refactor how parameters are set

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 29829a63c8cdb4f5e9b131f95116e7ccbfe2
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Refactor how parameters are set

This should fix inconsistencies with how preview windows are treated.
I want them to be deleted at all times as soon as we are out of Dired.

Before, this was not working with mouse clicking to focus a window, so
I tried to generally not close previews.  That caused effects that I
would consider counter-intuitive.  I prefer preview windows to be
"ephemeral" and thus be treated specially.
---
 dired-preview.el | 58 
 1 file changed, 33 insertions(+), 25 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 3d58a0e003..c4a0ff8f16 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -114,17 +114,23 @@ details."
 (delay-mode-hooks t))
 (find-file-noselect file :nowarn)))
 
+(defun dired-preview--set-window-parameters (window value)
+  "Set desired WINDOW parameters to VALUE."
+  (with-selected-window window
+(set-window-parameter window 'dired-preview-window value)
+(set-window-parameter window 'dedicated value)
+(set-window-parameter window 'no-other-window value)))
+
 (defun dired-preview--run-mode-hooks ()
   "Run mode hooks in current buffer, if `delayed-mode-hooks' is non-nil."
-  (when (and delay-mode-hooks (current-buffer))
-;; FIXME 2023-07-05: When we remove the window parameters, we
-;; disconnect the window from the preview.  Then what is the point
-;; of trying to close previews outside of Dired?  Which previews?
-(set-window-parameter (selected-window) 'dired-preview-window nil)
-(set-window-parameter (selected-window) 'dedicated nil)
+  (cond
+   ((window-parameter (selected-window) 'dired-preview-window)
+(dired-preview--delete-windows))
+   ((and delay-mode-hooks (current-buffer))
+(dired-preview--set-window-parameters (selected-window) nil)
 (apply #'run-hooks (delete-dups delayed-mode-hooks))
 (kill-local-variable 'delayed-mode-hooks)
-(remove-hook 'post-command-hook #'dired-preview--run-mode-hooks :local)))
+(remove-hook 'post-command-hook #'dired-preview--run-mode-hooks :local
 
 (defun dired-preview--add-to-previews (file)
   "Add FILE to `dired-preview--buffers', if not already in a buffer.
@@ -132,11 +138,11 @@ Always return FILE buffer."
   (let ((buffer (find-buffer-visiting file)))
 (if (buffer-live-p buffer)
 buffer
-  (setq buffer (dired-preview--find-file-no-select file))
-  (with-current-buffer buffer
-(add-hook 'post-command-hook #'dired-preview--run-mode-hooks nil 
:local))
-  (add-to-list 'dired-preview--buffers buffer)
-  buffer)))
+  (setq buffer (dired-preview--find-file-no-select file)))
+(with-current-buffer buffer
+  (add-hook 'post-command-hook #'dired-preview--run-mode-hooks nil :local))
+(add-to-list 'dired-preview--buffers buffer)
+buffer))
 
 (defun dired-preview--get-buffers ()
   "Return buffers that show previews."
@@ -193,17 +199,16 @@ checked against `split-width-threshold' or
 ((>= width (window-body-height)))
 ((>= width split-width-threshold)))
   `(:side right :dimension window-width :size 
,(dired-preview-return-window-size :width))
-`(:side below :dimension window-height :size 
,(dired-preview-return-window-size :height
+`(:side bottom :dimension window-height :size 
,(dired-preview-return-window-size :height
 
 (defun dired-preview-display-action-alist-dwim ()
   "Reference function for `dired-preview-display-action-alist-function'.
 Return a `display-buffer' action alist, as described in the
 aforementioned user option."
   (let ((properties (dired-preview-display-action-side)))
-`((display-buffer-in-direction)
-  (direction . ,(plist-get properties :side))
-  (,(plist-get properties :dimension) . ,(plist-get properties :size))
-  (dedicated . t
+`((display-buffer-in-side-window)
+  (side . ,(plist-get properties :side))
+  (,(plist-get properties :dimension) . ,(plist-get properties :size)
 
 (defvar dired-preview-trigger-commands
   '(dired-next-line dired-previous-line dired-mark dired-goto-file)
@@ -233,12 +238,16 @@ aforementioned user option."
   "Kill preview buffers."
   (mapc
(lambda (buffer)
- (when (and (not (eq buffer (current-buffer)))
-(dired-preview--window-parameter-p (get-buffer-window buffer)))
-   (ignore-errors
- (kill-buffer-if-not-modified buffer
-   (dired-preview--get-buffers))
-  (setq dired-preview--buffers nil))
+ (let ((window (get-buffer-window buffer)))
+   (cond
+((and (dired-preview--window-parameter-p window)
+  (current-buffer))
+ (delete-window (get-buffer-window buffer)))
+((dired-preview--window-parameter-p window)
+ (ignore-errors
+   (ki

[elpa] externals/dired-preview ec09d4b856 27/67: Fix how delayed-mode-hooks are handled

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit ec09d4b8566906884a2cfee6dfa385f6aa703803
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix how delayed-mode-hooks are handled

Before, the 'dired-preview--run-mode-hooks' would only be installed if
the preview was shown in a window.  This, however, led to a situation
where the buffer would be prepared for preview but never have time to
be displayed because the user visited the file in the meantime.  The
delayed hooks would never be called in that case.
---
 dired-preview.el | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index a9b92f9615..b59dcd2dd5 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -96,10 +96,7 @@ Used by the default value of 
`dired-preview-display-action-alist'."
 (dedicated . t)
 ;; FIXME 2023-06-29: Should `dired-preview-set-up-preview-window'
 ;; be part of the `body-function'?  It seems wrong as the user may
-;; omit this entry from the alist, thus breaking the preview. It
-;; is better to handle the `delayed-mode-hooks' in
-;; `dired-preview--find-file-no-select' and then find out another
-;; place to set the window parameter.
+;; omit this entry from the alist, thus breaking the preview.
 (body-function . dired-preview-set-up-preview-window)
 (window-parameters . ((no-other-window . t)
   (mode-line-format . ("%e"
@@ -155,6 +152,8 @@ Always return FILE buffer."
 (if (buffer-live-p buffer)
 buffer
   (setq buffer (dired-preview--find-file-no-select file))
+  (with-current-buffer buffer
+(add-hook 'post-command-hook #'dired-preview--run-mode-hooks nil 
:local))
   (add-to-list 'dired-preview--buffers buffer)
   buffer)))
 
@@ -242,8 +241,7 @@ Use this as the `body-function' in the user option
 `dired-preview-display-action-alist'."
   (set-window-parameter window 'dired-preview-window :preview)
   (with-current-buffer (window-buffer window)
-(add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)
-(add-hook 'post-command-hook #'dired-preview--run-mode-hooks nil :local)))
+(add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)))
 
 (defun dired-preview--display-buffer (buffer)
   "Call `display-buffer' for BUFFER.



[elpa] externals/dired-preview 1d3befd70c 20/67: Make sure to unset delayed-mode-hooks after they are ran

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 1d3befd70c8d4308ca7c57995358af14329ca35a
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Make sure to unset delayed-mode-hooks after they are ran
---
 dired-preview.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dired-preview.el b/dired-preview.el
index 6e918e95dc..2f693f3421 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -139,6 +139,7 @@ is used."
   (when (and delay-mode-hooks (current-buffer))
 (apply #'run-hooks (delete-dups delayed-mode-hooks))
 (set-window-parameter (selected-window) 'dired-preview-window nil)
+(kill-local-variable 'delayed-mode-hooks)
 (remove-hook 'post-command-hook #'dired-preview--run-mode-hooks :local)))
 
 (defun dired-preview--add-to-previews (file)



[elpa] externals/dired-preview 077f24db3c 45/67: Tweak how window size is calculated

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 077f24db3c363c9d50771acb26300dd9f4bdda21
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Tweak how window size is calculated
---
 dired-preview.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 99c2b3785c..b672b8342f 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -181,11 +181,14 @@ checked against `split-width-threshold' or
 `split-height-threshold'"
   (pcase dimension
 (:width (if (and (numberp split-width-threshold)
- (> (window-width) split-width-threshold)
+ (> (window-total-width) split-width-threshold)
  (> split-width-threshold fill-column))
 split-width-threshold
   fill-column))
-(:height (floor split-height-threshold 2
+(:height (if (and (numberp split-height-threshold)
+  (> (window-total-height) split-height-threshold))
+ split-height-threshold
+   (floor (window-height) 2)
 
 (defun dired-preview-display-action-side ()
   "Pick a side window that is appropriate for the given frame."



[elpa] externals/dired-preview b3ef9a2595 43/67: Define predicate function to check for window parameter

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit b3ef9a2595cd62968d6ffe8d2839d6dac13f5ff2
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Define predicate function to check for window parameter
---
 dired-preview.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 29745c19df..01d962c2b9 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -143,12 +143,13 @@ Always return FILE buffer."
buffer))
dired-preview--buffers))
 
+(defun dired-preview--window-parameter-p (window)
+  "Return non-nil if WINDOW has `dired-preview-window' parameter."
+  (window-parameter window 'dired-preview-window))
+
 (defun dired-preview--get-windows ()
   "Return windows that show previews."
-  (seq-filter
-   (lambda (window)
- (window-parameter window 'dired-preview-window))
-   (window-list)))
+  (seq-filter #'dired-preview--window-parameter-p (window-list)))
 
 (defun dired-preview--file-ignored-p (file)
   "Return non-nil if FILE extension is among the ignored extensions.
@@ -230,7 +231,7 @@ aforementioned user option."
   (mapc
(lambda (buffer)
  (when (and (not (eq buffer (current-buffer)))
-(window-parameter (get-buffer-window buffer) 
'dired-preview-window))
+(dired-preview--window-parameter-p (get-buffer-window buffer)))
(ignore-errors
  (kill-buffer-if-not-modified buffer
(dired-preview--get-buffers))



[elpa] branch externals/dired-preview created (now 6673bb1cd3)

2023-07-08 Thread ELPA Syncer
elpasync pushed a change to branch externals/dired-preview.

at  6673bb1cd3 Update to version 0.1.0

This branch includes the following new commits:

   new  36afd90371 Add initial version of dired-preview
   new  5dd110bea6 Fix typo in backronym
   new  ae937209cc add advice to dired-mark to preview the current file
   new  3304286c17 Use an advice instead of defining new commands; delete 
our keymap
   new  8d545491d4 Update documentation to match commit 3304286 
(command+keymap removal)
   new  4dc5a9f430 Reorganise a couple of functions
   new  f422a2e2d9 Check if file exists for previewing
   new  c89b7ceb32 Delete negative space
   new  a653299672 Do not preview already visible file
   new  22f44d083c Clear previewed buffers after they are killed
   new  d8ba2d0884 Simplify value of dired-preview-ignored-extensions-regexp
   new  4da6ee04bf Make the display-buffer action alist customisable
   new  f2a720ca8f Update dired-preview-set-up-preview-window doc to 
reference user option
   new  837d3c7e94 Rename private function
   new  caec7a973e Add FIXME for the advice and minor mode setup
   new  80a2233cca Update a couple of doc strings
   new  8f23847768 Remove the advice system to restore buffer-local mode
   new  16a2e9e835 Fix test for current command in dired-preview-trigger
   new  6e10fd0381 Fix how delayed-mode-hooks are called
   new  1d3befd70c Make sure to unset delayed-mode-hooks after they are ran
   new  bf30367ffe Add FIXME for dired-preview-set-up-preview-window
   new  04bfb749c7 Move two forms closer to where they are used
   new  bf25ef53e1 Run the preview on an idle timer
   new  5ffcfb0c85 Tweak the format of the timer call
   new  3ba4c3f533 Add FIXME to preview only when it is still the current 
one
   new  5338f5c1a7 Make commit 3ba4c3f more resilient
   new  ec09d4b856 Fix how delayed-mode-hooks are handled
   new  b367550663 Rewrite how the timer is started
   new  75f1b11e99 Add FIXME for the scope of 
dired-preview--close-previews-outside-dired
   new  e2da14de12 Fix scope of action to close preview upon buffer switch
   new  c20af9c9eb Fix how the window is set up and closed outside Dired
   new  3f2588abb3 Make all preview state be handled by the trigger
   new  4857868357 Harden dired-preview--close-previews-outside-dired 
conditionality
   new  49bea8f6d4 Delete windows, then kill buffers
   new  0dceaef04d Use a function to return the display-buffer action
   new  ca176e11e4 Simplify dired-preview--run-mode-hooks
   new  8c1c73716e Tighten the event loop to avoid inconsistencies
   new  38fab3d419 Use 'file-regular-p' instead of 'file-exists-p'
   new  959299b18a Add FIXME for dired-preview-return-window-size
   new  18b607fc48 Simplify dired-preview-return-window-size
   new  86e11c105b Make dired-preview-display-file delete windows eagerly
   new  070f02a1b0 Stop changing the mode-line-format
   new  b3ef9a2595 Define predicate function to check for window parameter
   new  f6bb0e3271 Add TODO to only accummulate a fixed size of buffers
   new  077f24db3c Tweak how window size is calculated
   new  00ab2337ca Stop adding 'no-other-window' parameter
   new  11bb038063 Do not try to delete selected preview window
   new  f52ed4774c Remove 'dedicated' parameter from selected window
   new  91fc74d122 Stop using a side window for previews
   new  24bf5bce79 Add FIXME for dired-preview-display-action-alist-dwim
   new  53ebf5d655 Change how window size is determined (fix 24bf5bc)
   new  6bdcc34f68 Use "below" instead of "bottom" for direction
   new  0fa9aab1df Add FIXME for how/why window parameters are unset
   new  ea643a8912 Simplify dired-preview-trigger
   new  bac80501c8 Use 'unless' in 
dired-preview--close-previews-outside-dired
   new  29829a63c8 Refactor how parameters are set
   new  4af91a6b7c Re-order large portions of the file
   new  d9b779e2da Use "-get" instead of "-return" in function symbols
   new  a3dd67d46f Refine dired-preview-get-window-size
   new  4010cc9987 Implement garbage collection for buffer killing
   new  4b89363599 Delete preview windows, including the selected one
   new  7413c6f59a Define dired-preview-global-mode
   new  9d44584802 Update package commentary; mention 
dired-preview-global-mode
   new  33a27a68dc Add README.org, which GNU ELPA converts into the Info 
manual
   new  98815455cb Simplify README.md, pointing to the manual instead (per 
33a27a6)
   new  8d19b43469 Fix typos
   new  6673bb1cd3 Update to version 0.1.0




[elpa] externals/dired-preview 36afd90371 01/67: Add initial version of dired-preview

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 36afd903712042317d0dd4f9034537895e102d7a
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add initial version of dired-preview
---
 .gitignore   |   5 +
 COPYING  | 674 +++
 README.md|  50 +
 dired-preview.el | 300 +
 4 files changed, 1029 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00..0b7f5b7d92
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*.elc
+*-autoloads.el
+*-pkg.el
+dired-preview.info
+dired-preview.texi
diff --git a/COPYING b/COPYING
new file mode 100644
index 00..fc389822e7
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+   TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permiss

[elpa] externals/dired-preview 16a2e9e835 18/67: Fix test for current command in dired-preview-trigger

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 16a2e9e8359424854b4b9ab9a304d079bf18df38
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix test for current command in dired-preview-trigger

I mistakenly had the check for the 'last-command' while
'dired-preview-trigger' is meant to work in the 'post-command-hook'
where we only care about 'this-command'.

Thanks to Karthik Chikmagalur for pointing out my error:

.
---
 dired-preview.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index cea218a573..2bb40d5655 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -277,7 +277,7 @@ Return buffer object of displayed buffer."
 
 (defun dired-preview-trigger ()
   "Trigger display of file at point after `dired-preview-trigger-commands'."
-  (when (memq last-command dired-preview-trigger-commands)
+  (when (memq this-command dired-preview-trigger-commands)
 (dired-preview-display-file)))
 
 (defun dired-preview-disable-preview ()



[elpa] externals/dired-preview 11bb038063 47/67: Do not try to delete selected preview window

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 11bb038063bb6232c210933081c088070c5e4585
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Do not try to delete selected preview window
---
 dired-preview.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 7e6aefb6f1..e5a133a551 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -223,8 +223,9 @@ aforementioned user option."
   "Delete preview windows."
   (mapc
(lambda (window)
- (unless (or (eq window (minibuffer-window))
- (one-window-p))
+ (unless (or (one-window-p)
+ (eq window (minibuffer-window))
+ (eq window (selected-window)))
(delete-window window)))
(dired-preview--get-windows)))
 



[elpa] externals/dired-preview 53ebf5d655 51/67: Change how window size is determined (fix 24bf5bc)

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 53ebf5d6558c1b639c0ef6c94f1606403a8320a5
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Change how window size is determined (fix 24bf5bc)
---
 dired-preview.el | 18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index e5843b75f9..4183080a14 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -181,19 +181,14 @@ DIMENSION is either a `:width' or `:height' keyword.  It 
is
 checked against `split-width-threshold' or
 `split-height-threshold'"
   (pcase dimension
-(:width (if (and (numberp split-width-threshold)
- (> (window-total-width) split-width-threshold)
- (> split-width-threshold fill-column))
-split-width-threshold
-  fill-column))
-(:height (if (and (numberp split-height-threshold)
-  (> (window-total-height) split-height-threshold))
- split-height-threshold
-   (floor (window-height) 2)
+(:width fill-column)
+(:height (floor (window-height) 2
 
 (defun dired-preview-display-action-side ()
   "Pick a side window that is appropriate for the given frame."
-  (if (>= (frame-pixel-width) (frame-pixel-height))
+  (if-let* ((width (window-body-width))
+((>= width (window-body-height)))
+((>= width split-width-threshold)))
   `(:side right :dimension window-width :size 
,(dired-preview-return-window-size :width))
 `(:side bottom :dimension window-height :size 
,(dired-preview-return-window-size :height
 
@@ -202,9 +197,6 @@ checked against `split-width-threshold' or
 Return a `display-buffer' action alist, as described in the
 aforementioned user option."
   (let ((properties (dired-preview-display-action-side)))
-;; FIXME 2023-07-05: This can distort the size of the Dired
-;; window, making it difficult to see what the next file on the
-;; list is.
 `((display-buffer-in-direction)
   (direction . ,(plist-get properties :side))
   (,(plist-get properties :dimension) . ,(plist-get properties :size))



[elpa] externals/dired-preview f422a2e2d9 07/67: Check if file exists for previewing

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit f422a2e2d94ee864a6ff89a12fe7260ada852958
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Check if file exists for previewing
---
 dired-preview.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index 5cd2b755e2..02245caeae 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -152,7 +152,8 @@ See user option `dired-preview-ignored-extensions-regexp'."
 
 (defun dired-preview--preview-p (file)
   "Return non-nil if FILE can be previewed."
-  (and (not (file-directory-p file))
+  (and (file-exists-p file)
+   (not (file-directory-p file))
(not (dired-preview--file-ignored-p file))
(not (dired-preview--file-large-p file
 



[elpa] externals/dired-preview f2a720ca8f 13/67: Update dired-preview-set-up-preview-window doc to reference user option

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit f2a720ca8f46aa409ccd4c69c5deab100e69cecf
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update dired-preview-set-up-preview-window doc to reference user option

See commit 4da6ee0.
---
 dired-preview.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index 41bd7fba88..e72104a26c 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -232,7 +232,9 @@ conforms with `dired-preview--preview-p'."
 (dired-preview--close-previews)))
 
 (defun dired-preview-set-up-preview-window (window &rest _)
-  "Set WINDOW `:preview' parameter."
+  "Set WINDOW `:preview' parameter.
+Use this as the `body-function' in the user option
+`dired-preview-display-action-alist'."
   (set-window-parameter window 'dired-preview-window :preview)
   (with-current-buffer (window-buffer window)
 (add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)



[elpa] externals/dired-preview ca176e11e4 36/67: Simplify dired-preview--run-mode-hooks

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit ca176e11e4859e3edffc0d5d05b746318cf90cd9
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Simplify dired-preview--run-mode-hooks
---
 dired-preview.el | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 34074cc5a6..68ceaa5460 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -115,13 +115,10 @@ details."
 (find-file-noselect file :nowarn)))
 
 (defun dired-preview--run-mode-hooks ()
-  "Run mode hooks in current buffer, if `delayed-mode-hooks' is non-nil.
-See `dired-preview--find-file-no-select' for how hooks are
-delayed and `dired-preview-set-up-preview-window' for how this function
-is used."
+  "Run mode hooks in current buffer, if `delayed-mode-hooks' is non-nil."
   (when (and delay-mode-hooks (current-buffer))
-(apply #'run-hooks (delete-dups delayed-mode-hooks))
 (set-window-parameter (selected-window) 'dired-preview-window nil)
+(apply #'run-hooks (delete-dups delayed-mode-hooks))
 (kill-local-variable 'delayed-mode-hooks)
 (remove-hook 'post-command-hook #'dired-preview--run-mode-hooks :local)))
 



[elpa] externals/dired-preview 6e10fd0381 19/67: Fix how delayed-mode-hooks are called

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 6e10fd0381f6f2d8bc3c6b98d7e2dc6cf15ea8d7
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix how delayed-mode-hooks are called
---
 dired-preview.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index 2bb40d5655..6e918e95dc 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -137,7 +137,7 @@ See `dired-preview--find-file-no-select' for how hooks are
 delayed and `dired-preview-set-up-preview-window' for how this function
 is used."
   (when (and delay-mode-hooks (current-buffer))
-(run-mode-hooks delayed-mode-hooks)
+(apply #'run-hooks (delete-dups delayed-mode-hooks))
 (set-window-parameter (selected-window) 'dired-preview-window nil)
 (remove-hook 'post-command-hook #'dired-preview--run-mode-hooks :local)))
 



[elpa] externals/dired-preview bf25ef53e1 23/67: Run the preview on an idle timer

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit bf25ef53e12b7b958e61c4098de134cf23b51243
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Run the preview on an idle timer

Doing it eagerly can slow down Emacs when we quickly move between
files to find something further away from the starting position.
---
 dired-preview.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 195f35194b..dfd8f5c79e 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -268,8 +268,8 @@ Only do it with the current major mode is Dired."
   "Display BUFFER with `dired-preview-delay'."
   (dired-preview--cancel-timer)
   (setq dired-preview--timer
-(run-with-timer dired-preview-delay nil
-#'dired-preview--display-buffer buffer)))
+(run-with-idle-timer dired-preview-delay
+ nil #'dired-preview--display-buffer buffer)))
 
 (defun dired-preview-display-file ()
   "Display preview of `dired-file-name-at-point' if appropriate.



[elpa] externals/dired-preview c89b7ceb32 08/67: Delete negative space

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit c89b7ceb3285b490d473ea0a5dc9a19b5b0024f0
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Delete negative space
---
 dired-preview.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 02245caeae..3b4c2fddba 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -30,29 +30,29 @@
 ;; file at point in Dired buffers.  Preview windows are closed when they
 ;; are no longer relevant, while preview buffers are killed if they have
 ;; not been used for other purposes beside previewing.
-;; 
+;;
 ;; Enable the `dired-preview-mode' in the current Dired buffer and
 ;; then perform the regular up/down motions.  Those will trigger the
 ;; preview.
-;; 
+;;
 ;; The previewed file is displayed in a side window if its size is below
 ;; the number specified in the user option `dired-preview-max-size'.
 ;; Previews are shown subject to a small delay, per ther user option
 ;; `dired-preview-delay'.
-;; 
+;;
 ;; Files matching the `dired-preview-ignored-extensions-regexp' are not
 ;; previewed.  The default value of that user option includes multimedia,
 ;; PDFs, and EPUBs.
-;; 
+;;
 ;; [ In the future, we may find ways to quickly preview any file type
 ;;   without affecting the performance of Emacs.  Though `dired-preview'
 ;;   is designed to have no external dependencies, so such an ambition
 ;;   may not be realisable (e.g. produce a thumbnail out of a video).  ]
-;; 
+;;
 ;; To set up `dired-preview-mode' in every Dired buffer, set it up thus:
-;; 
+;;
 ;; (add-hook 'dired-mode-hook #'dired-preview-mode)
-;; 
+;;
 ;; I took inspiration for `dired-preview' from the now unmaintained
 ;; `peep-dired' package by Adam Sokolnicki: 
.
 ;; My original plan was to volunteer to maintain `peep-dired` but I



[elpa] externals/dired-preview caec7a973e 15/67: Add FIXME for the advice and minor mode setup

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit caec7a973eb24dd0dabe5b968d29840b562443b2
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add FIXME for the advice and minor mode setup

We discussed this with Christian Tietze and I think the buffer-local
mode is a nice feature to have.  I can imagine cases where I want to
explicitly disable the preview in a given Dired buffer.

The discussion with Christian:

.
---
 dired-preview.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index 9fd2ec9bd0..000e43f050 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -291,6 +291,9 @@ Use this as advice after relevant Dired commands (see
   (add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)
   (dired-preview-display-file))
 
+;; FIXME 2023-06-28: The :global nil and the `advice-add' contradict
+;; each other.  I still prefer a buffer-local mode and must thus
+;; arrange for the same job via the `post-command-hook'.
 ;;;###autoload
 (define-minor-mode dired-preview-mode
   "Buffer-local mode to preview file at point in Dired."



[elpa] externals/dired-preview 8d545491d4 05/67: Update documentation to match commit 3304286 (command+keymap removal)

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 8d545491d4e01c5a67824b4806c703b86e983f7e
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update documentation to match commit 3304286 (command+keymap removal)
---
 README.md| 4 +---
 dired-preview.el | 7 +++
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index 16c6e84806..93f36f7513 100644
--- a/README.md
+++ b/README.md
@@ -18,9 +18,7 @@ are no longer relevant, while preview buffers are killed if 
they have
 not been used for other purposes beside previewing.
 
 Enable the `dired-preview-mode` in the current Dired buffer and then
-perform the regular up/down motions (`n` or `p` with default key
-bindings) to call the commands `dired-preview-next-file`,
-`dired-preview-previous-file`.  Those will trigger the preview.
+perform the regular up/down motions.  Those will trigger the preview.
 
 The previewed file is displayed in a side window if its size is below
 the number specified in the user option `dired-preview-max-size`.
diff --git a/dired-preview.el b/dired-preview.el
index 8c2e57bea9..7c0296b43f 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -31,10 +31,9 @@
 ;; are no longer relevant, while preview buffers are killed if they have
 ;; not been used for other purposes beside previewing.
 ;; 
-;; Enable the `dired-preview-mode' in the current Dired buffer and then
-;; perform the regular up/down motions (`n' or `p' with default key
-;; bindings) to call the commands `dired-preview-next-file',
-;; `dired-preview-previous-file'.  Those will trigger the preview.
+;; Enable the `dired-preview-mode' in the current Dired buffer and
+;; then perform the regular up/down motions.  Those will trigger the
+;; preview.
 ;; 
 ;; The previewed file is displayed in a side window if its size is below
 ;; the number specified in the user option `dired-preview-max-size'.



[elpa] externals/dired-preview 070f02a1b0 42/67: Stop changing the mode-line-format

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 070f02a1b0a8c121c9ad891a792d8b80fcf5d68f
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Stop changing the mode-line-format
---
 dired-preview.el | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 6c56d69144..29745c19df 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -202,10 +202,7 @@ aforementioned user option."
   (slot . -1)
   (,(plist-get properties :dimension) . ,(plist-get properties :size))
   (dedicated . t)
-  (window-parameters . ((no-other-window . t)
-(mode-line-format . ("%e"
- mode-line-front-space
- 
,dired-preview-buffer-name)))
+  (window-parameters . ((no-other-window . t))
 
 (defvar dired-preview-trigger-commands
   '(dired-next-line dired-previous-line dired-mark dired-goto-file)



[elpa] externals/dired-preview bac80501c8 55/67: Use 'unless' in dired-preview--close-previews-outside-dired

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit bac80501c81d703a9e39b9b4af5a501321c96d5c
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Use 'unless' in dired-preview--close-previews-outside-dired
---
 dired-preview.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index 653dd758eb..3d58a0e003 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -248,7 +248,7 @@ aforementioned user option."
 
 (defun dired-preview--close-previews-outside-dired ()
   "Call `dired-preview--close-previews' if BUFFER is not in Dired mode."
-  (when (not (eq major-mode 'dired-mode))
+  (unless (eq major-mode 'dired-mode)
 (dired-preview--close-previews)
 (remove-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
 



[elpa] externals/dired-preview 80a2233cca 16/67: Update a couple of doc strings

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 80a2233cca88f0cce393288b53c571ac112c65fe
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update a couple of doc strings
---
 dired-preview.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 000e43f050..5171596ce2 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -275,7 +275,7 @@ Use this as advice after relevant Dired commands (see
 (dired-preview--close-previews)))
 
 (defun dired-preview-disable-preview ()
-  "Disable preview."
+  "Disable Dired preview."
   (unless (eq major-mode 'dired-mode)
 (error "Can only use `dired-preview' in Dired"))
   (dolist (command '(dired-next-line dired-previous-line dired-mark 
dired-goto-file))
@@ -283,7 +283,7 @@ Use this as advice after relevant Dired commands (see
   (dired-preview--close-previews))
 
 (defun dired-preview-enable-preview ()
-  "Enable preview and store window configuration."
+  "Enable Dired preview."
   (unless (eq major-mode 'dired-mode)
 (error "Can only use `dired-preview' in Dired"))
   (dolist (command '(dired-next-line dired-previous-line dired-mark 
dired-goto-file))



[elpa] externals/dired-preview bf30367ffe 21/67: Add FIXME for dired-preview-set-up-preview-window

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit bf30367ffed81b222939ac9caadc300fa0b78702
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add FIXME for dired-preview-set-up-preview-window
---
 dired-preview.el | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index 2f693f3421..c9403eee99 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -94,6 +94,12 @@ Used by the default value of 
`dired-preview-display-action-alist'."
 (slot . -1)
 (window-width . 0.3)
 (dedicated . t)
+;; FIXME 2023-06-29: Should `dired-preview-set-up-preview-window'
+;; be part of the `body-function'?  It seems wrong as the user may
+;; omit this entry from the alist, thus breaking the preview. It
+;; is better to handle the `delayed-mode-hooks' in
+;; `dired-preview--find-file-no-select' and then find out another
+;; place to set the window parameter.
 (body-function . dired-preview-set-up-preview-window)
 (window-parameters . ((no-other-window . t)
   (mode-line-format . ("%e"
@@ -232,6 +238,7 @@ conforms with `dired-preview--preview-p'."
   (when (not (eq major-mode 'dired-mode))
 (dired-preview--close-previews)))
 
+;; NOTE 2023-06-29: See the FIXME for `dired-preview-display-action-alist'.
 (defun dired-preview-set-up-preview-window (window &rest _)
   "Set WINDOW `:preview' parameter.
 Use this as the `body-function' in the user option



[elpa] externals/dired-preview 0dceaef04d 35/67: Use a function to return the display-buffer action

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 0dceaef04debd0543bf80080c03beedb39d9c721
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Use a function to return the display-buffer action

This gives the user maximum control over the behaviour of the
display-buffer mechanism.

Thanks to Bruno Boal for taking a look into this with me:
.  This was done in a private channel and
the information is shared with permission.
---
 dired-preview.el | 70 +++-
 1 file changed, 49 insertions(+), 21 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index c13a5f2b08..34074cc5a6 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -82,28 +82,16 @@
   :group 'dired-preview
   :type 'integer)
 
-(defcustom dired-preview-buffer-name "*dired-preview*"
-  "Name of preview buffer.
-Used by the default value of `dired-preview-display-action-alist'."
-  :group 'dired-preview
-  :type 'string)
-
-(defcustom dired-preview-display-action-alist
-  `((display-buffer-in-side-window)
-(side . right)
-(slot . -1)
-(window-width . 0.3)
-(dedicated . t)
-(window-parameters . ((no-other-window . t)
-  (mode-line-format . ("%e"
-   mode-line-front-space
-   ,dired-preview-buffer-name)
-  "The `display-buffer' action for the preview.
+(defcustom dired-preview-display-action-alist-function
+  #'dired-preview-display-action-alist-dwim
+  "Function to return the `display-buffer' action for the preview.
 This is the same data that is passed to `display-buffer-alist'.
 Read Info node `(elisp) Displaying Buffers'.  As such, it is
-meant for experienced users."
+meant for experienced users.  See the reference function
+`dired-preview-display-action-alist-dwim' for the implementation
+details."
   :group 'dired-preview
-  :type 'alist)
+  :type 'function)
 
 (defcustom dired-preview-delay 0.7
   "Time in seconds to wait before previewing."
@@ -222,11 +210,51 @@ See user option 
`dired-preview-ignored-extensions-regexp'."
 (set-window-parameter window 'dired-preview-window :preview)
 (add-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
 
+(defvar dired-preview-buffer-name "*dired-preview*"
+  "Name of preview buffer.")
+
+(defun dired-preview-return-window-size (dimension)
+  "Return window size by checking for DIMENSION.
+DIMENSION is either a `:width' or `:height' keyword.  It is
+checked against `split-width-threshold' or
+`split-height-threshold'"
+  (pcase dimension
+(:width (if (>= (* fill-column 2) split-width-threshold)
+fill-column
+  (- (window-body-width) fill-column)))
+(:height (let ((height (frame-height)))
+   (if (>= (* height 2) split-height-threshold)
+   height
+ (- (window-body-height) height))
+
+(defun dired-preview-display-action-side ()
+  "Pick a side window that is appropriate for the given frame."
+  (if (>= (frame-pixel-width) (frame-pixel-height))
+  `(:side right :dimension window-width :size 
,(dired-preview-return-window-size :width))
+`(:side bottom :dimension window-height :size 
,(dired-preview-return-window-size :height
+
+(defun dired-preview-display-action-alist-dwim ()
+  "Reference function for `dired-preview-display-action-alist-function'.
+Return a `display-buffer' action alist, as described in the
+aforementioned user option."
+  (let ((properties (dired-preview-display-action-side)))
+`((display-buffer-in-side-window)
+  (side . ,(plist-get properties :side))
+  (slot . -1)
+  (,(plist-get properties :dimension) . ,(plist-get properties :size))
+  (dedicated . t)
+  (window-parameters . ((no-other-window . t)
+(mode-line-format . ("%e"
+ mode-line-front-space
+ 
,dired-preview-buffer-name)))
+
 (defun dired-preview--display-buffer (buffer)
   "Call `display-buffer' for BUFFER.
 Only do it with the current major mode is Dired."
-  (display-buffer buffer dired-preview-display-action-alist)
-  (dired-preview-set-up-preview-window buffer))
+  (display-buffer buffer (funcall (or 
dired-preview-display-action-alist-function
+  
#'dired-preview-display-action-alist-dwim)))
+  (when (window-live-p (get-buffer-window buffer))
+(dired-preview-set-up-preview-window buffer)))
 
 (defun dired-preview-display-file (file)
   "Display preview of FILE if appropriate."



[elpa] externals/dired-preview d8ba2d0884 11/67: Simplify value of dired-preview-ignored-extensions-regexp

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit d8ba2d08840b345ccd63cfc71de6429056c79177
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Simplify value of dired-preview-ignored-extensions-regexp
---
 dired-preview.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index d05e1c0ed0..e780a084b4 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -70,9 +70,9 @@
 
 (defcustom dired-preview-ignored-extensions-regexp
   (concat "\\."
-  "\\(mkv\\|" "webm\\|" "mp4\\|" "mp3\\|" "ogg\\|" "m4a\\|"
-  "gz\\|" "zst\\|" "tar\\|" "xz\\|" "rar\\|" "zip\\|"
-  "iso\\|" "epub\\|" "pdf\\)")
+  "\\(mkv\\|webm\\|mp4\\|mp3\\|ogg\\|m4a"
+  "\\|gz\\|zst\\|tar\\|xz\\|rar\\|zip"
+  "\\|iso\\|epub\\|pdf\\)")
   "Regular expression of file type extensions to not preview."
   :group 'dired-preview
   :type 'string)



[elpa] externals/dired-preview b367550663 28/67: Rewrite how the timer is started

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit b3675506632db37a51fec6bc4dcf31d5d6cf8d45
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Rewrite how the timer is started

This is the right place to put it.  It does not block Emacs while
moving quickly between files.  The old design would eagerly do
find-file on the file at point and only delay the 'display-buffer'
part.
---
 dired-preview.el | 33 +++--
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index b59dcd2dd5..d276374d7e 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -263,38 +263,35 @@ Only do it with the current major mode is Dired."
  buffer
  dired-preview-display-action-alist)))
 
-(defvar dired-preview--timer nil
-  "Most recent timer object to display a preview.")
-
-(defun dired-preview--cancel-timer ()
-  "Cancel `dired-preview--timer' if it is a timer object."
-  (when (timerp dired-preview--timer)
-(cancel-timer dired-preview--timer)))
-
-(defun dired-preview--display-buffer-with-delay (buffer)
-  "Display BUFFER with `dired-preview-delay'."
-  (dired-preview--cancel-timer)
-  (setq dired-preview--timer
-(run-with-idle-timer
- dired-preview-delay
- nil #'dired-preview--display-buffer buffer)))
-
 (defun dired-preview-display-file ()
   "Display preview of `dired-file-name-at-point' if appropriate.
 Return buffer object of displayed buffer."
   (if-let* ((file (dired-file-name-at-point))
 (buffer (dired-preview--return-preview-buffer file)))
-(dired-preview--display-buffer-with-delay buffer)
+(dired-preview--display-buffer buffer)
 (dired-preview--close-previews)))
 
 (defvar dired-preview-trigger-commands
   '(dired-next-line dired-previous-line dired-mark dired-goto-file)
   "List of Dired commands that trigger a preview.")
 
+(defvar dired-preview--timer nil
+  "Most recent timer object to display a preview.")
+
+(defun dired-preview--cancel-timer ()
+  "Cancel `dired-preview--timer' if it is a timer object."
+  (when (timerp dired-preview--timer)
+(cancel-timer dired-preview--timer)))
+
 (defun dired-preview-trigger ()
   "Trigger display of file at point after `dired-preview-trigger-commands'."
   (when (memq this-command dired-preview-trigger-commands)
-(dired-preview-display-file)))
+(dired-preview--cancel-timer)
+(setq dired-preview--timer
+  (run-with-idle-timer
+   dired-preview-delay
+   nil
+   #'dired-preview-display-file
 
 (defun dired-preview-disable-preview ()
   "Disable Dired preview."



[elpa] externals/dired-preview 837d3c7e94 14/67: Rename private function

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 837d3c7e945a86579a098ae887c05fc2a8f68b69
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Rename private function
---
 dired-preview.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index e72104a26c..9fd2ec9bd0 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -240,7 +240,7 @@ Use this as the `body-function' in the user option
 (add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)
 (add-hook 'post-command-hook #'dired-preview--run-mode-hooks nil :local)))
 
-(defun dired-preview--display-buffer-action (buffer)
+(defun dired-preview--display-buffer (buffer)
   "Call `display-buffer' for BUFFER.
 Only do it with the current major mode is Dired."
   ;; We check for `dired-mode' because we want to avoid the scenario
@@ -261,7 +261,7 @@ Only do it with the current major mode is Dired."
   (dired-preview--cancel-timer)
   (setq dired-preview--timer
 (run-with-timer dired-preview-delay nil
-#'dired-preview--display-buffer-action buffer)))
+#'dired-preview--display-buffer buffer)))
 
 (defun dired-preview-display-file (&rest _)
   "Display preview of `dired-file-name-at-point' if appropriate.



[elpa] externals/dired-preview 04bfb749c7 22/67: Move two forms closer to where they are used

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 04bfb749c7182250821a604bcac0ce8331bd2805
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Move two forms closer to where they are used
---
 dired-preview.el | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index c9403eee99..195f35194b 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -199,13 +199,6 @@ See user option `dired-preview-ignored-extensions-regexp'."
(not (dired-preview--file-ignored-p file))
(not (dired-preview--file-large-p file
 
-(defun dired-preview--return-preview-buffer (file)
-  "Return buffer to preview FILE in.
-Determine the propriety of this action by checking that FILE
-conforms with `dired-preview--preview-p'."
-  (when (dired-preview--preview-p file)
-(dired-preview--add-to-previews file)))
-
 (defun dired-preview--delete-windows ()
   "Delete preview windows."
   (mapc
@@ -225,14 +218,18 @@ conforms with `dired-preview--preview-p'."
(dired-preview--get-buffers))
   (setq dired-preview--buffers nil))
 
-(defvar dired-preview--timer nil
-  "Most recent timer object to display a preview.")
-
 (defun dired-preview--close-previews ()
   "Kill preview buffers and delete their windows."
   (dired-preview--delete-windows)
   (dired-preview--kill-buffers))
 
+(defun dired-preview--return-preview-buffer (file)
+  "Return buffer to preview FILE in.
+Determine the propriety of this action by checking that FILE
+conforms with `dired-preview--preview-p'."
+  (when (dired-preview--preview-p file)
+(dired-preview--add-to-previews file)))
+
 (defun dired-preview--close-previews-outside-dired ()
   "Call `dired-preview--close-previews' if BUFFER is not in Dired mode."
   (when (not (eq major-mode 'dired-mode))
@@ -259,6 +256,9 @@ Only do it with the current major mode is Dired."
  buffer
  dired-preview-display-action-alist)))
 
+(defvar dired-preview--timer nil
+  "Most recent timer object to display a preview.")
+
 (defun dired-preview--cancel-timer ()
   "Cancel `dired-preview--timer' if it is a timer object."
   (when (timerp dired-preview--timer)



[elpa] externals/dired-preview f6bb0e3271 44/67: Add TODO to only accummulate a fixed size of buffers

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit f6bb0e32719492b1f2ab6b2aa77973ace7d67098
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add TODO to only accummulate a fixed size of buffers

Thanks to Bruno Boal for bringing this matter to my attention and for
checking the workaround with me: .  This was
done in a private channel and the information is shared with
permission.
---
 dired-preview.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index 01d962c2b9..99c2b3785c 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -226,6 +226,8 @@ aforementioned user option."
(delete-window window)))
(dired-preview--get-windows)))
 
+;; TODO 2023-07-05: We need a garbage collection function so that we
+;; do not accummulate too many buffers that exceed a given threshold.
 (defun dired-preview--kill-buffers ()
   "Kill preview buffers."
   (mapc



[elpa] externals/dired-preview e2da14de12 30/67: Fix scope of action to close preview upon buffer switch

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit e2da14de126e6ac281b5ef13aec6f74fadec2a43
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix scope of action to close preview upon buffer switch

Thanks to Bruno Boal for taking a look into this with me:
.  This was done in a private channel and
the information is shared with permission.
---
 dired-preview.el | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 3df6f85005..4ccaa827c9 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -232,7 +232,8 @@ conforms with `dired-preview--preview-p'."
 (defun dired-preview--close-previews-outside-dired ()
   "Call `dired-preview--close-previews' if BUFFER is not in Dired mode."
   (when (not (eq major-mode 'dired-mode))
-(dired-preview--close-previews)))
+(dired-preview--close-previews)
+(remove-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
 
 ;; NOTE 2023-06-29: See the FIXME for `dired-preview-display-action-alist'.
 (defun dired-preview-set-up-preview-window (window &rest _)
@@ -241,10 +242,7 @@ Use this as the `body-function' in the user option
 `dired-preview-display-action-alist'."
   (set-window-parameter window 'dired-preview-window :preview)
   (with-current-buffer (window-buffer window)
-;; FIXME 2023-06-30: This is the wrong scope, because it will not
-;; be relevant when using `switch-to-buffer', `previous-buffer',
-;; etc.  Basically, it assumes we are in a Dired-only environment.
-(add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)))
+(add-hook 'window-state-change-hook 
#'dired-preview--close-previews-outside-dired)))
 
 (defun dired-preview--display-buffer (buffer)
   "Call `display-buffer' for BUFFER.



[elpa] externals/dired-preview 6bdcc34f68 52/67: Use "below" instead of "bottom" for direction

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 6bdcc34f68a9a58113458c089a1838fcc219cb6a
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Use "below" instead of "bottom" for direction

We want to show the preview below its Dired buffer, not at the bottom
of the frame.  The latter is more confusing, such as when we have
three windows side-by-side and the preview appears in a fourth window
that cuts all three on the horizontal axis.
---
 dired-preview.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index 4183080a14..303fbcc84b 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -190,7 +190,7 @@ checked against `split-width-threshold' or
 ((>= width (window-body-height)))
 ((>= width split-width-threshold)))
   `(:side right :dimension window-width :size 
,(dired-preview-return-window-size :width))
-`(:side bottom :dimension window-height :size 
,(dired-preview-return-window-size :height
+`(:side below :dimension window-height :size 
,(dired-preview-return-window-size :height
 
 (defun dired-preview-display-action-alist-dwim ()
   "Reference function for `dired-preview-display-action-alist-function'.



[elpa] externals/dired-preview 8f23847768 17/67: Remove the advice system to restore buffer-local mode

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 8f238477686ad94ad8978e634a6f3d690ca4017c
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Remove the advice system to restore buffer-local mode

This commit changes the approach that was followed for commit 3304286.
The intention is to still get the same result, but do it in a way that
preserves the original design of a buffer-local minor mode.

This follows from the discussion with Christian Tietze:

.
---
 dired-preview.el | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 5171596ce2..cea218a573 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -263,37 +263,38 @@ Only do it with the current major mode is Dired."
 (run-with-timer dired-preview-delay nil
 #'dired-preview--display-buffer buffer)))
 
-(defun dired-preview-display-file (&rest _)
+(defun dired-preview-display-file ()
   "Display preview of `dired-file-name-at-point' if appropriate.
-Return buffer object of displayed buffer.  Ignore any arguments.
-
-Use this as advice after relevant Dired commands (see
-`dired-preview-enable-preview', `dired-preview-disable-preview')."
+Return buffer object of displayed buffer."
   (if-let* ((file (dired-file-name-at-point))
 (buffer (dired-preview--return-preview-buffer file)))
 (dired-preview--display-buffer-with-delay buffer)
 (dired-preview--close-previews)))
 
+(defvar dired-preview-trigger-commands
+  '(dired-next-line dired-previous-line dired-mark dired-goto-file)
+  "List of Dired commands that trigger a preview.")
+
+(defun dired-preview-trigger ()
+  "Trigger display of file at point after `dired-preview-trigger-commands'."
+  (when (memq last-command dired-preview-trigger-commands)
+(dired-preview-display-file)))
+
 (defun dired-preview-disable-preview ()
   "Disable Dired preview."
   (unless (eq major-mode 'dired-mode)
 (error "Can only use `dired-preview' in Dired"))
-  (dolist (command '(dired-next-line dired-previous-line dired-mark 
dired-goto-file))
-(advice-remove command #'dired-preview-display-file))
+  (remove-hook 'post-command-hook #'dired-preview-trigger :local)
   (dired-preview--close-previews))
 
 (defun dired-preview-enable-preview ()
   "Enable Dired preview."
   (unless (eq major-mode 'dired-mode)
 (error "Can only use `dired-preview' in Dired"))
-  (dolist (command '(dired-next-line dired-previous-line dired-mark 
dired-goto-file))
-(advice-add command :after #'dired-preview-display-file))
+  (add-hook 'post-command-hook #'dired-preview-trigger nil :local)
   (add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)
   (dired-preview-display-file))
 
-;; FIXME 2023-06-28: The :global nil and the `advice-add' contradict
-;; each other.  I still prefer a buffer-local mode and must thus
-;; arrange for the same job via the `post-command-hook'.
 ;;;###autoload
 (define-minor-mode dired-preview-mode
   "Buffer-local mode to preview file at point in Dired."



[elpa] externals/dired-preview ae937209cc 03/67: add advice to dired-mark to preview the current file

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit ae937209ccb2310ef336ec27266ea64fc2b4dbe6
Author: Christian Tietze 
Commit: Protesilaos Stavrou 

add advice to dired-mark to preview the current file
---
 dired-preview.el | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/dired-preview.el b/dired-preview.el
index ebdd171314..9e6501c7bc 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -253,16 +253,22 @@ Return buffer object of displayed buffer."
 (dired-preview--display-buffer-with-delay buffer)
 (dired-preview--close-previews)))
 
+(defun dired-preview--display-file-after-mark (&rest args)
+  "Preview file at point in dired buffer after a mark was changed."
+  (dired-preview--display-file))
+
 (defun dired-preview-disable-preview ()
   "Disable preview."
   (unless (eq major-mode 'dired-mode)
 (error "Can only use `dired-preview' in Dired"))
+  (advice-remove #'dired-mark #'dired-preview--display-file-after-mark)
   (dired-preview--close-previews))
 
 (defun dired-preview-enable-preview ()
   "Enable preview and store window configuration."
   (unless (eq major-mode 'dired-mode)
 (error "Can only use `dired-preview' in Dired"))
+  (advice-add #'dired-mark :after #'dired-preview--display-file-after-mark)
   (add-hook 'post-command-hook #'dired-preview--close-previews-outside-dired 
nil :local)
   (dired-preview--display-file))
 



[elpa] externals/dired-preview d9b779e2da 58/67: Use "-get" instead of "-return" in function symbols

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit d9b779e2daf86eb0d231a8d62c49736234a34950
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Use "-get" instead of "-return" in function symbols
---
 dired-preview.el | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index a98282b428..656fe7a7a7 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -204,14 +204,14 @@ Always return FILE buffer."
 (add-to-list 'dired-preview--buffers buffer)
 buffer))
 
-(defun dired-preview--return-preview-buffer (file)
+(defun dired-preview--get-preview-buffer (file)
   "Return buffer to preview FILE in."
   (dired-preview--add-to-previews file))
 
 (defvar dired-preview-buffer-name "*dired-preview*"
   "Name of preview buffer.")
 
-(defun dired-preview-return-window-size (dimension)
+(defun dired-preview-get-window-size (dimension)
   "Return window size by checking for DIMENSION.
 DIMENSION is either a `:width' or `:height' keyword.  It is
 checked against `split-width-threshold' or
@@ -225,8 +225,8 @@ checked against `split-width-threshold' or
   (if-let* ((width (window-body-width))
 ((>= width (window-body-height)))
 ((>= width split-width-threshold)))
-  `(:side right :dimension window-width :size 
,(dired-preview-return-window-size :width))
-`(:side bottom :dimension window-height :size 
,(dired-preview-return-window-size :height
+  `(:side right :dimension window-width :size 
,(dired-preview-get-window-size :width))
+`(:side bottom :dimension window-height :size 
,(dired-preview-get-window-size :height
 
 (defun dired-preview-display-action-alist-dwim ()
   "Reference function for `dired-preview-display-action-alist-function'.
@@ -272,7 +272,7 @@ Only do it with the current major mode is Dired."
 (defun dired-preview-display-file (file)
   "Display preview of FILE if appropriate."
   (dired-preview--delete-windows)
-  (when-let ((buffer (dired-preview--return-preview-buffer file)))
+  (when-let ((buffer (dired-preview--get-preview-buffer file)))
 (dired-preview--display-buffer buffer)
 (when-let ((window (get-buffer-window buffer)))
   (dired-preview--set-window-parameters window t



[elpa] externals/dired-preview 00ab2337ca 46/67: Stop adding 'no-other-window' parameter

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 00ab2337ca8beccb9cdd9f0582b87d9023c7f910
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Stop adding 'no-other-window' parameter

The 'no-other-window' creates problems when the user selects the
window using the mouse, because Emacs disregards that setting.  As
such, we have inconsistent behaviour when we try to focus a preview
with the mouse versus the keyboard.

Thanks to Bruno Boal for bringing this matter to my attention:
.  This was done in a private channel and
the information is shared with permission.
---
 dired-preview.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index b672b8342f..7e6aefb6f1 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -205,8 +205,7 @@ aforementioned user option."
   (side . ,(plist-get properties :side))
   (slot . -1)
   (,(plist-get properties :dimension) . ,(plist-get properties :size))
-  (dedicated . t)
-  (window-parameters . ((no-other-window . t))
+  (dedicated . t
 
 (defvar dired-preview-trigger-commands
   '(dired-next-line dired-previous-line dired-mark dired-goto-file)



[elpa] externals/dired-preview 38fab3d419 38/67: Use 'file-regular-p' instead of 'file-exists-p'

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 38fab3d4198e5df2e469ddf3dfd6f0c9945b55ac
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Use 'file-regular-p' instead of 'file-exists-p'

This way we do not try to preview named pipes and sockets.

Thanks to Karthik Chikmagalur for bringing this matter to my
attention: 
.
---
 dired-preview.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index de0417098c..97bbf86545 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -271,7 +271,7 @@ Only do it with the current major mode is Dired."
 
 (defun dired-preview--preview-p (file)
   "Return non-nil if FILE can be previewed."
-  (and (file-exists-p file)
+  (and (file-regular-p file)
(not (file-directory-p file))
(not (dired-preview--file-displayed-p file))
(not (dired-preview--file-ignored-p file))



[elpa] externals/hyperbole 7bbd133144 8/9: Merge branch 'rsw'

2023-07-08 Thread ELPA Syncer
branch: externals/hyperbole
commit 7bbd1331448c9407c38c7c033144f23fb82ea29a
Merge: ac6e50e3ec 5999198ba6
Author: Robert Weiner 
Commit: Robert Weiner 

Merge branch 'rsw'
---
 ChangeLog  | 116 +++
 DEMO   |  23 +++--
 hact.el|  36 ---
 hactypes.el|   6 +-
 hargs.el   | 147 ++---
 hbut.el| 206 ++--
 hib-social.el  |  25 ++---
 hibtypes.el|  17 ++--
 hload-path.el  |   6 +-
 hmouse-drv.el  |  28 +++---
 hmouse-sh.el   |  17 +++-
 hpath.el   |   8 +-
 hui-menu.el|   5 +-
 hui-mini.el|   3 +-
 hui-mouse.el   |  24 ++---
 hui.el | 251 +++--
 hypb.el|   4 +-
 hyperbole.el   |   9 +-
 man/hkey-help.txt  |   3 +-
 man/hyperbole.texi |  94 +-
 man/version.texi   |   4 +-
 test/demo-tests.el |   6 +-
 test/hactypes-tests.el |   6 +-
 test/hbut-tests.el | 140 +--
 24 files changed, 834 insertions(+), 350 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d1f7eecebb..a230e0e6e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,104 @@
+2023-07-08  Bob Weiner  
+
+* test/demo-tests.el 
(demo-implicit-button-action-button-boolean-function-call-test):
+Rename to 'demo-implicit-button-action-button-display-boolean-test' so can
+find when search for use of 'display-boolean'.
+
+* hactypes.el (display-boolean): Improve clarity of output message.
+  test/hactypes-tests.el (display-boolean-true-test, 
display-boolean-false-test):
+Update to new output message format.
+
+* hpath.el (hpath:absolute-arguments): Fix to process only string arguments.
+
+* hibtypes.el (action): Fix 'args' not being set right after add display-* 
actypes.
+Stop storing unneeded ibutton 'action attribute.
+
+* hact.el (actype:action): Fix doc to say may return actype's fboundp symbol.
+Use 'actype:action-body' if always need the body of the function.
+  (symtable:actype-p): Fix to return Elisp function symbols as well
+since 'actype:elisp-symbol' is an alias to this defsubst.
+  (symtable:hyperbole-actype-p): Add to exclude Elisp function symbols.
+  (actype:act): Use above new function.
+
+* DEMO (Completion Selection):
+  man/hkey-help.txt:
+  man/hyperbole.texi (Smart Key Argument Selection): Update to new minibuffer
+argument handling including Vertico support.
+
+2023-07-05  Bob Weiner  
+
+* hpath.el (hpath:markdown-section-pattern, hpath:outline-section-pattern): Fix
+to allow for opening pair chars after matching anchor (previously had to 
be a
+:punct: character only).
+
+2023-07-04  Bob Weiner  
+
+* hyperbole.el (hyperb:init): Activate 'vertico-mouse-mode' when
+'vertico-mode' is used so that the Action Key properly selects completions
+from the candidate list.  Since Vertico displays completions automatically,
+must initialize this before Vertico is invoked so cannot wait until a Smart
+Mouse Key is first pressed.
+  hargs.el (hargs:select-p):
+   (hargs:at-p): When 'hargs:reading-type' is nil, rather than a
+string, return a list of (completion-so-far exact-completion-match),
+for consumption by 'hargs:select-p'.  Add feature to kill to end of
+minibuffer line and refresh completions when not inserting a fully
+matching completion (works for regular and vertico completions if
+'vertico-mouse-mode' has been enabled prior to using).
+
+* hmouse-sh.el (hmouse-posn-set-point): Avoid setting point to a read-only
+location when vertico-mode is active.
+
+2023-07-03  Bob Weiner  
+
+* hmouse-drv.el (hkey-help): Remove ref to XEmacs 'help-selects-help-window'.
+
+* hargs.el (hargs:select-p): Add vertico and ivy completion support.
+   (hargs:at-p): Add vertico support.
+  hui-mouse.el (hkey-alist): Remove ivy support; move above.
+
+* hact.el (actype:act): Fix error when 'args' are null.
+
+* hbut.el (hbut:action): Fix error when 'atype' is not a symbol.
+
+* hmouse-sh.el (hmouse-drag-region): Disable Hyperbole-specific functionality
+when hyperbole-mode is nil.
+
+2023-07-02  Bob Weiner  
+
+* hui.el (hui:ibut-create):
+  hbut.el (ibut:program): Prevent from creating a new ibut within a named
+or labeled Hyperbole button.
+
+* hui.el (hui:ibut-create): Call (hattr:clear 'hbut:current) before creating
+in-memory button.
+
+* hib-social.el (hibtypes-social-default-service): Pluralize defgroup name to
+'hyperbole-buttons' to match other files.  Remove duplicate unneeded
+:group from each defcustom.
+
+2023-07-01  Bob Weiner  
+
+* hui.el (hui:link-possible-types): If in a .texi but not within a node, don't
+raise error, just use a link-to-file-line instead.
+
+* hui-menu.el (infodock-hyperbole-menu):
+  hui-min

[elpa] externals/hyperbole 987433ee1d 6/9: Update doc to new minibuffer argument handling including Vertico

2023-07-08 Thread ELPA Syncer
branch: externals/hyperbole
commit 987433ee1d697eb9ebf8a12870207b0f1e8e234d
Author: Bob Weiner 
Commit: Bob Weiner 

Update doc to new minibuffer argument handling including Vertico
---
 ChangeLog  |  9 -
 DEMO   | 23 +++--
 man/hkey-help.txt  |  3 ++-
 man/hyperbole.texi | 59 --
 4 files changed, 67 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f5fdf1595c..4bcc0b5c87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+* DEMO (Completion Selection):
+  man/hkey-help.txt:
+  man/hyperbole.texi (Smart Key Argument Selection): Update to new minibuffer
+argument handling including Vertico support.
+
 2023-07-05  Bob Weiner  
 
 * hpath.el (hpath:markdown-section-pattern, hpath:outline-section-pattern): Fix
@@ -8,7 +13,9 @@
 
 * hyperbole.el (hyperb:init): Activate 'vertico-mouse-mode' when
 'vertico-mode' is used so that the Action Key properly selects completions
-from the candidate list.
+from the candidate list.  Since Vertico displays completions automatically,
+must initialize this before Vertico is invoked so cannot wait until a Smart
+Mouse Key is first pressed.
   hargs.el (hargs:select-p):
(hargs:at-p): When 'hargs:reading-type' is nil, rather than a
 string, return a list of (completion-so-far exact-completion-match),
diff --git a/DEMO b/DEMO
index 5c6191fd2f..d09fa39973 100644
--- a/DEMO
+++ b/DEMO
@@ -1060,12 +1060,23 @@ Try that one by pressing between the square brackets.
 
 ** Completion Selection
 
-Often when Emacs or Hyperbole prompts for an argument in the minibuffer, a
-list of possible argument completions is available by pressing {?}.  A single
-Action Key press on any of these completions inserts it into the minibuffer
-for your inspection.  A second press on the same completion causes it to be
-used as the argument value and any succeeding argument prompt is then
-displayed.  Test this technique with a {C-x C-f} (find-file) and then a {?}.
+Often when Emacs or Hyperbole prompts for an argument in the
+minibuffer, a list of possible argument completions is available by
+pressing {?} or automatically displayed.  A single Action Key press on
+any of these completions inserts it into the minibuffer for your
+inspection.  A second press on the same completion uses it as the
+argument value and moves on to any next minibuffer argument prompt.
+Test this technique with a {C-x C-f} (find-file) and then a {?}.
+
+Within the minibuffer itself, the Smart Keys are also
+context-sensitive.  A press of the Action Key at the end of the
+argument line tries to accept the argument and when successful, exits
+the minibuffer.  A press of the Assist Key at the end of the argument
+line displays matching completions for times when they are not
+automatically displayed or need updating.  A press of the Action or
+Assist Key on part of the argument, deletes from point to the end of
+the line, expanding the set of available completions and redisplaying
+them.
 
 ** Hyperbole Source Buttons
 
diff --git a/man/hkey-help.txt b/man/hkey-help.txt
index f32ae91bed..bac0b5aef9 100644
--- a/man/hkey-help.txt
+++ b/man/hkey-help.txt
@@ -8,7 +8,8 @@ Hyperbole
   Reading argument
 1st press at an arg value   Copies value to minibuffer <- same
 2nd press at an arg value   Uses value as argument <- same
-In minibuffer   Accepts minibuffer arg Completion help
+In minibuffer at eolAccepts minibuffer arg List completions
+In minibuffer before eolDeletes rest of argDeletes rest of arg
   On an implicit button/pathActivates button   Button help
   Within a koutline cellCollapses and expands  Shows tree props
   Left of a koutline cell   Creates a klinkMoves a tree
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index 28c7f0ba41..2ffa6fbe3a 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -7,7 +7,7 @@
 @c Author:   Bob Weiner
 @c
 @c Orig-Date: 6-Nov-91 at 11:18:03
-@c Last-Mod:  1-Jul-23 at 16:32:29 by Bob Weiner
+@c Last-Mod:  8-Jul-23 at 10:31:40 by Bob Weiner
 
 @c %**start of header (This is for running Texinfo on a region.)
 @setfilename hyperbole.info
@@ -156,7 +156,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
 Edition 8.0.1pre
-Printed July 1, 2023.
+Printed July 8, 2023.
 
   Published by the Free Software Foundation, Inc.
   Author:Bob Weiner
@@ -198,7 +198,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 @example
 Edition 8.0.1pre
-July 1, 2023
+July 8, 2023
 
   Published by the Free Software Foundation, Inc.
   Author:Bob Weiner
@@ -1223,24 +1223,45 @@ Hyperbole user interface has an extensive core of 
argument types that
 it recognizes.  Whenever Hyperbole is prompting you for an argument,
 it knows the type that it needs and provides some error checking to
 help you get it rig

[elpa] externals/hyperbole updated (ac6e50e3ec -> 5d94882558)

2023-07-08 Thread ELPA Syncer
elpasync pushed a change to branch externals/hyperbole.

  from  ac6e50e3ec Align header fields consistently (#356)
   new  f064c18be6 Add hui:gbut-link-directly and Gbut/Link menu item
   new  679da10588 hib-social.el - Pluralize defgroup to 'hyperbole-buttons'
   new  3715ff4077 Smart Key support for vertico-mode and interactive 
completion filter
   new  78aad8eee8 Initial work toward finishing ibut:operate
   new  1df728ec81 Fix anchored hpath recognition when followed by an 
opening pair char
   new  987433ee1d Update doc to new minibuffer argument handling including 
Vertico
   new  5999198ba6 Fix issues with Action Buttons; don't add 'action' to 
button attrs
   new  7bbd133144 Merge branch 'rsw'
   new  5d94882558 Merge pull request #360 from rswgnu/rsw


Summary of changes:
 ChangeLog  | 116 +++
 DEMO   |  23 +++--
 hact.el|  36 ---
 hactypes.el|   6 +-
 hargs.el   | 147 ++---
 hbut.el| 206 ++--
 hib-social.el  |  25 ++---
 hibtypes.el|  17 ++--
 hload-path.el  |   6 +-
 hmouse-drv.el  |  28 +++---
 hmouse-sh.el   |  17 +++-
 hpath.el   |   8 +-
 hui-menu.el|   5 +-
 hui-mini.el|   3 +-
 hui-mouse.el   |  24 ++---
 hui.el | 251 +++--
 hypb.el|   4 +-
 hyperbole.el   |   9 +-
 man/hkey-help.txt  |   3 +-
 man/hyperbole.texi |  94 +-
 man/version.texi   |   4 +-
 test/demo-tests.el |   6 +-
 test/hactypes-tests.el |   6 +-
 test/hbut-tests.el | 140 +--
 24 files changed, 834 insertions(+), 350 deletions(-)



[elpa] externals/hyperbole f064c18be6 1/9: Add hui:gbut-link-directly and Gbut/Link menu item

2023-07-08 Thread ELPA Syncer
branch: externals/hyperbole
commit f064c18be6d6098b2881dfac86612953572e3351
Author: Bob Weiner 
Commit: Bob Weiner 

Add hui:gbut-link-directly and Gbut/Link menu item

hui:link-possible-types - In a .texi if not in a node, link-to-file-line.
hui:*but-link-directly - Clear Smart Key vars when called non-interactively.
hui:*but-edit - Fix to not allow blank labels.
---
 ChangeLog  |  37 +
 hbut.el|  13 ++--
 hload-path.el  |   4 +-
 hmouse-drv.el  |  12 +--
 hui-menu.el|   5 +-
 hui-mini.el|   3 +-
 hui.el | 223 +
 hypb.el|   4 +-
 man/hyperbole.texi |  41 --
 man/version.texi   |   4 +-
 test/hbut-tests.el |  10 +--
 11 files changed, 234 insertions(+), 122 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5420334362..6e06ce37a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,40 @@
+2023-07-01  Bob Weiner  
+
+* hui.el (hui:link-possible-types): If in a .texi but not within a node, don't
+raise error, just use a link-to-file-line instead.
+
+* hui-menu.el (infodock-hyperbole-menu):
+  hui-mini.el (hui:menus): Add Link item calling 'hui:gbut-link-directly'.
+  man/hyperbole.texi (Global Buttons): Add doc for new Gbut/Link item.
+  hui.el (hui:gbut-link-directly): Add to create named global link buttons 
based on
+current windows.
+ (hui:gbut-create): Update to prompt for ibut name when called 
interactively.
+Also, prompt if 'lbl' arg is nil and prompt for ibut text when called with 
a
+prefix argument, 'ibut-flag'.  Also check that start and end buffers are 
the same
+when creating an ibut.
+ (hui:ebut-edit, hui:gbut-edit, hui:hbut-label): Fix to not allow 
blank labels.
+ (hui:ebut-link-directly, hui:ibut-link-directly): In body, clear 
Smart Key
+variables if not called interactively (since interactive clause also 
clears these
+variables).  Also, if a button already exists at point, return t else nil. 
 This
+lets the caller know what type of create/edit msg to display.  If not 
editing
+an existing button, when prompting for a name or label, use any active and
+highlighted region as the name or label.
+
+2023-06-30  Bob Weiner  
+
+* hmouse-drv.el (hkey-window-link): Move action/assist-key-clear-varriables
+calls into hui:*but-link-directly calls so happens every time they are
+called.
+
+* man/hyperbole.texi (Glossary): Fix to note gbut:file is a function, not
+a variable.
+
+2023-06-27  Bob Weiner  
+
+* test/hbut-tests.el (hbut-tests:should-match-tmp-folder): Change to use
+a regexp 'string-match-p' to a string input rather than a 'member' test
+to a list of lists.
+
 2023-06-25  Bob Weiner  
 * hbut.el (ibut:to-name, ibut:at-p, ibut:to-text): Remove test call to
 'hbut:outside-comment-p' since ibuts don't have to be within programming
diff --git a/hbut.el b/hbut.el
index a5b737f6db..1771269e29 100644
--- a/hbut.el
+++ b/hbut.el
@@ -3,7 +3,7 @@
 ;; Author:   Bob Weiner
 ;;
 ;; Orig-Date:18-Sep-91 at 02:57:09
-;; Last-Mod: 26-Jun-23 at 00:04:54 by Bob Weiner
+;; Last-Mod:  2-Jul-23 at 00:22:53 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -219,7 +219,7 @@ Return nil if no matching button is found."
 (defalias 'ebut:key-src-fmt#'hbut:key-src-fmt)
 (defalias 'ebut:key-to-label   #'hbut:key-to-label)
 
-(defvar hbut:max-len)
+(defvar   hbut:max-len)
 
 (defunebut:label-p (&optional as-label start-delim end-delim pos-flag 
two-lines-flag)
   "Return key for the explicit button label that point is within, else nil.
@@ -807,7 +807,7 @@ Return TO-HBUT."
   (setplist to-hbut (copy-sequence (symbol-plist from-hbut)))
   to-hbut)
 
-(defun hattr:emacs-button-attributes (button)
+(defunhattr:emacs-button-attributes (button)
   "Return a property list of an Emacs BUTTON."
   (if (markerp button)
   ;; If on a text property button, button-at will
@@ -820,7 +820,7 @@ Return TO-HBUT."
   (when category
(symbol-plist category)
 
-(defun hattr:emacs-button-is-p (button)
+(defunhattr:emacs-button-is-p (button)
   "If BUTTON is a valid Emacs button, return its category, else return nil."
   (let* ((type (when (or (overlayp button) (markerp button))
 (button-get button 'type)))
@@ -2357,8 +2357,7 @@ Summary of operations based on inputs:
 (args   (hattr:get ibut 'args))
 (arg1   (nth 0 args))
 (arg2   (nth 1 args))
-(arg3   (nth 2 args))
-(arg4   (nth 3 args)))
+(arg3   (nth 2 args)))
 (pcase actype
   ('actypes::kbd-key
(cond ((and (stringp arg1) (string-match "\\s-*{.+}\\s-*" arg1))
@@ -2717,7 +2716,7 @@ type for ibtype is presently undefined."
 
 (defalias 'ibtype:create #'defib)
 
-(defun ibtype:activate-link (referent)
+(defunibtype:activate-link (referent)
   "Activate an implicit link REFERENT, either

[elpa] externals/hyperbole 679da10588 2/9: hib-social.el - Pluralize defgroup to 'hyperbole-buttons'

2023-07-08 Thread ELPA Syncer
branch: externals/hyperbole
commit 679da10588a1c1bb953c9afa9bb33b5eae1568a1
Author: Bob Weiner 
Commit: Bob Weiner 

hib-social.el - Pluralize defgroup to 'hyperbole-buttons'
---
 ChangeLog |  6 ++
 hib-social.el | 25 +
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6e06ce37a5..5b991816f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-07-02  Bob Weiner  
+
+* hib-social.el (hibtypes-social-default-service): Pluralize defgroup name to
+'hyperbole-buttons' to match other files.  Remove duplicate unneeded
+:group from each defcustom.
+
 2023-07-01  Bob Weiner  
 
 * hui.el (hui:link-possible-types): If in a .texi but not within a node, don't
diff --git a/hib-social.el b/hib-social.el
index 74c4bb1fd9..55d38d3531 100644
--- a/hib-social.el
+++ b/hib-social.el
@@ -3,7 +3,7 @@
 ;; Author:   Bob Weiner
 ;;
 ;; Orig-Date:20-Jul-16 at 22:41:34
-;; Last-Mod: 28-May-23 at 10:06:20 by Mats Lidell
+;; Last-Mod:  2-Jul-23 at 04:19:57 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -189,42 +189,35 @@
(const "gitlab")
(const "instagram")
(const "twitter"))
-  :group 'hyperbole-button)
+  :group 'hyperbole-buttons)
 
 (defcustom hibtypes-social-display-function #'browse-url
   "Function of one arg, url, to display when activating a social media 
reference."
-  :type 'function
-  :group 'hyperbole-button)
+  :type 'function)
 
 (defcustom hibtypes-git-default-project nil
   "Default project name to associate with any local git commit link."
-  :type 'string
-  :group 'hyperbole-button)
+  :type 'string)
 
 (defcustom hibtypes-git-use-magit-flag nil
   "Non-nil means use `magit' rather than `dired' for a git directory button."
-  :type 'boolean
-  :group 'hyperbole-button)
+  :type 'boolean)
 
 (defcustom hibtypes-github-default-project nil
   "Default project name to associate with any Github commit link."
-  :type 'string
-  :group 'hyperbole-button)
+  :type 'string)
 
 (defcustom hibtypes-github-default-user nil
   "Default user name to associate with any Github commit link."
-  :type 'string
-  :group 'hyperbole-button)
+  :type 'string)
 
 (defcustom hibtypes-gitlab-default-project nil
   "Default project name to associate with any Github commit link."
-  :type 'string
-  :group 'hyperbole-button)
+  :type 'string)
 
 (defcustom hibtypes-gitlab-default-user nil
   "Default user name to associate with any Github commit link."
-  :type 'string
-  :group 'hyperbole-button)
+  :type 'string)
 
 ;;; 
 ;;; Public declarations



[elpa] externals/hyperbole 78aad8eee8 4/9: Initial work toward finishing ibut:operate

2023-07-08 Thread ELPA Syncer
branch: externals/hyperbole
commit 78aad8eee8da74eb55c1a7ed519d9878d1d3698d
Author: Bob Weiner 
Commit: Bob Weiner 

Initial work toward finishing ibut:operate

Add and update some ibut:operate tests
---
 hbut.el| 195 ++---
 test/hbut-tests.el | 132 +++-
 2 files changed, 240 insertions(+), 87 deletions(-)

diff --git a/hbut.el b/hbut.el
index 1771269e29..2ce10b2df4 100644
--- a/hbut.el
+++ b/hbut.el
@@ -3,7 +3,7 @@
 ;; Author:   Bob Weiner
 ;;
 ;; Orig-Date:18-Sep-91 at 02:57:09
-;; Last-Mod:  2-Jul-23 at 00:22:53 by Bob Weiner
+;; Last-Mod:  3-Jul-23 at 23:57:18 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -470,12 +470,12 @@ For interactive creation, use `hui:ebut-create' instead."
 (if (or (and actype-sym (fboundp actype-sym))
(functionp actype))
(hattr:set 'hbut:current 'actype actype)
- (error (format "(%s)" actype)))
+ (error "(%s)" actype))
(hattr:set 'hbut:current 'args args)
(ebut:operate label nil))
(error (hattr:clear 'hbut:current)
   (if (and (listp (cdr err)) (= (length (cdr err)) 1))
-  (error (format "(ebut:program): actype arg must be a bound 
symbol (not a string): %S" actype))
+  (error "(ebut:program): actype arg must be a bound symbol 
(not a string): %S" actype)
 (error "(ebut:program): %S" err)))
 
 (defunebut:search (string out-buf &optional match-part)
@@ -982,7 +982,8 @@ Default is the symbol hbut:current."
action)
 (setq action (car (hattr:get hbut 'action))
  atype  (hattr:get hbut 'actype))
-(if (= (length (symbol-name atype)) 2)
+(if (and (symbolp atype)
+(= (length (symbol-name atype)) 2))
atype
   (or action (actype:action atype)
 
@@ -2171,7 +2172,7 @@ move to the first occurrence of the button."
 
 (defunibut:operate (&optional new-name edit-flag)
   "Insert/modify an ibutton based on `hbut:current' in current buffer.
-Optional non-nil NEW-NAME is name to give button.  With optional
+Optional non-nil NEW-NAME is new name to give button.  With optional
 EDIT-FLAG non-nil, modify an existing in-buffer ibutton rather
 than creating a new one.
 
@@ -2182,20 +2183,28 @@ Return instance string appended to name to form a 
per-buffer unique
 name; nil if name is already unique or no name.  Signal an error when no
 such button is found in the current buffer.
 
-Summary of operations based on inputs:
-|---+--++|
-| name  | new-name | region | operation  |
-|---+--++|
-| nil   | nil  | nil| create: unnamed ibut   |
-| aname | nil  | nil| create/update: aname named ibut|
-| aname | nil  | region | create/update: aname named ibut (skip region)  |
-| nil   | nil  | region | create/update: region named ibut   |
-| aname | newname  | nil| mod: rename aname to newname   |
-| aname | newname  | region | mod: rename aname to newname (skip region) |
-| nil   | newname  | nil| mod: add newname to lbl-key ibut at point  |
-| nil   | newname  | region | mod: add newname to lbl-key ibut (skip region) |
-|---+--++|"
-  ;; !! TODO: Code does not yet fully match what is in docstring table
+Summary of operations based on inputs (name arg comes from \\='hbut:current 
attrs):
+|+--+--++--+---|
+|  # | name | new-name | region | edit | operation 
|
+|+--+--++--+---|
+|  1 | nil  | nil  | nil| nil  | create: unnamed ibut from 
hbut:current attrs  |
+|  2 | nil  | new-name | nil| nil  | create: new-name named ibut   
|
+|  3 | name | nil  | nil| nil  | create: aname named ibut  
|
+|  4 | name | new-name | nil| nil  | ERROR: create can't have name and 
new-name|
+|  5 | name | new-name | region | nil  | ERROR: create can't have name and 
new-name|
+|  6 | name | nil  | region | nil  | create: aname named ibut (skip 
region)|
+|  7 | nil  | nil  | region | nil  | create: region named ibut 
|
+|  8 | nil  | new-name | region | nil  | create: new-name named ibut (skip 
region) |
+|+--+--++--+---|
+|  9 | nil  | nil  | nil| t| mod: unnamed ibut from hbut:current 
attrs |
+| 10 | nil  | new-name | nil| t| mod: add new-nam

[elpa] externals/hyperbole 1df728ec81 5/9: Fix anchored hpath recognition when followed by an opening pair char

2023-07-08 Thread ELPA Syncer
branch: externals/hyperbole
commit 1df728ec81857140d67b6cc0ee0c16e40f712906
Author: Bob Weiner 
Commit: Bob Weiner 

Fix anchored hpath recognition when followed by an opening pair char
---
 ChangeLog | 6 ++
 hpath.el  | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f3c61ea9aa..f5fdf1595c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-07-05  Bob Weiner  
+
+* hpath.el (hpath:markdown-section-pattern, hpath:outline-section-pattern): Fix
+to allow for opening pair chars after matching anchor (previously had to 
be a
+:punct: character only).
+
 2023-07-04  Bob Weiner  
 
 * hyperbole.el (hyperb:init): Activate 'vertico-mouse-mode' when
diff --git a/hpath.el b/hpath.el
index 55da0c140f..e79fd29d59 100644
--- a/hpath.el
+++ b/hpath.el
@@ -660,14 +660,14 @@ Contains a %s for replacement of a specific anchor id.")
   "Regexp matching a Markdown anchor id definition.
 Contains a %s for replacement of a specific anchor id.")
 
-(defconst hpath:markdown-section-pattern "^[ \t]*\\(#+\\|\\*+\\)[ \t]+%s\\([ 
\t[:punct:]]*\\)$"
+(defconst hpath:markdown-section-pattern "^[ \t]*\\(#+\\|\\*+\\)[ 
\t]+%s\\([\[<\({ \t[:punct:]]*\\)$"
   "Regexp matching a Markdown section header.
 Contains a %s for replacement of a specific section name.")
 
 (defconst hpath:markdown-suffix-regexp "\\.[mM][dD]"
   "Regexp that matches to a Markdown file suffix.")
 
-(defconst hpath:outline-section-pattern "^\\*+[ \t]+%s[ 
\t]*\\([:punct:]+\\|$\\)"
+(defconst hpath:outline-section-pattern "^\\*+[ \t]+%s[ 
\t]*\\([\[<\({[:punct:]]+\\|$\\)"
   "Bol-anchored, no leading spaces regexp matching an Emacs outline section 
header.
 Contains a %s for replacement of a specific section name.")
 



[elpa] externals/hyperbole 5d94882558 9/9: Merge pull request #360 from rswgnu/rsw

2023-07-08 Thread ELPA Syncer
branch: externals/hyperbole
commit 5d9488255895dbff1b2abc821106210ed14632c7
Merge: ac6e50e3ec 7bbd133144
Author: Robert Weiner 
Commit: GitHub 

Merge pull request #360 from rswgnu/rsw

Latest updates from rsw branch
---
 ChangeLog  | 116 +++
 DEMO   |  23 +++--
 hact.el|  36 ---
 hactypes.el|   6 +-
 hargs.el   | 147 ++---
 hbut.el| 206 ++--
 hib-social.el  |  25 ++---
 hibtypes.el|  17 ++--
 hload-path.el  |   6 +-
 hmouse-drv.el  |  28 +++---
 hmouse-sh.el   |  17 +++-
 hpath.el   |   8 +-
 hui-menu.el|   5 +-
 hui-mini.el|   3 +-
 hui-mouse.el   |  24 ++---
 hui.el | 251 +++--
 hypb.el|   4 +-
 hyperbole.el   |   9 +-
 man/hkey-help.txt  |   3 +-
 man/hyperbole.texi |  94 +-
 man/version.texi   |   4 +-
 test/demo-tests.el |   6 +-
 test/hactypes-tests.el |   6 +-
 test/hbut-tests.el | 140 +--
 24 files changed, 834 insertions(+), 350 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d1f7eecebb..a230e0e6e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,104 @@
+2023-07-08  Bob Weiner  
+
+* test/demo-tests.el 
(demo-implicit-button-action-button-boolean-function-call-test):
+Rename to 'demo-implicit-button-action-button-display-boolean-test' so can
+find when search for use of 'display-boolean'.
+
+* hactypes.el (display-boolean): Improve clarity of output message.
+  test/hactypes-tests.el (display-boolean-true-test, 
display-boolean-false-test):
+Update to new output message format.
+
+* hpath.el (hpath:absolute-arguments): Fix to process only string arguments.
+
+* hibtypes.el (action): Fix 'args' not being set right after add display-* 
actypes.
+Stop storing unneeded ibutton 'action attribute.
+
+* hact.el (actype:action): Fix doc to say may return actype's fboundp symbol.
+Use 'actype:action-body' if always need the body of the function.
+  (symtable:actype-p): Fix to return Elisp function symbols as well
+since 'actype:elisp-symbol' is an alias to this defsubst.
+  (symtable:hyperbole-actype-p): Add to exclude Elisp function symbols.
+  (actype:act): Use above new function.
+
+* DEMO (Completion Selection):
+  man/hkey-help.txt:
+  man/hyperbole.texi (Smart Key Argument Selection): Update to new minibuffer
+argument handling including Vertico support.
+
+2023-07-05  Bob Weiner  
+
+* hpath.el (hpath:markdown-section-pattern, hpath:outline-section-pattern): Fix
+to allow for opening pair chars after matching anchor (previously had to 
be a
+:punct: character only).
+
+2023-07-04  Bob Weiner  
+
+* hyperbole.el (hyperb:init): Activate 'vertico-mouse-mode' when
+'vertico-mode' is used so that the Action Key properly selects completions
+from the candidate list.  Since Vertico displays completions automatically,
+must initialize this before Vertico is invoked so cannot wait until a Smart
+Mouse Key is first pressed.
+  hargs.el (hargs:select-p):
+   (hargs:at-p): When 'hargs:reading-type' is nil, rather than a
+string, return a list of (completion-so-far exact-completion-match),
+for consumption by 'hargs:select-p'.  Add feature to kill to end of
+minibuffer line and refresh completions when not inserting a fully
+matching completion (works for regular and vertico completions if
+'vertico-mouse-mode' has been enabled prior to using).
+
+* hmouse-sh.el (hmouse-posn-set-point): Avoid setting point to a read-only
+location when vertico-mode is active.
+
+2023-07-03  Bob Weiner  
+
+* hmouse-drv.el (hkey-help): Remove ref to XEmacs 'help-selects-help-window'.
+
+* hargs.el (hargs:select-p): Add vertico and ivy completion support.
+   (hargs:at-p): Add vertico support.
+  hui-mouse.el (hkey-alist): Remove ivy support; move above.
+
+* hact.el (actype:act): Fix error when 'args' are null.
+
+* hbut.el (hbut:action): Fix error when 'atype' is not a symbol.
+
+* hmouse-sh.el (hmouse-drag-region): Disable Hyperbole-specific functionality
+when hyperbole-mode is nil.
+
+2023-07-02  Bob Weiner  
+
+* hui.el (hui:ibut-create):
+  hbut.el (ibut:program): Prevent from creating a new ibut within a named
+or labeled Hyperbole button.
+
+* hui.el (hui:ibut-create): Call (hattr:clear 'hbut:current) before creating
+in-memory button.
+
+* hib-social.el (hibtypes-social-default-service): Pluralize defgroup name to
+'hyperbole-buttons' to match other files.  Remove duplicate unneeded
+:group from each defcustom.
+
+2023-07-01  Bob Weiner  
+
+* hui.el (hui:link-possible-types): If in a .texi but not within a node, don't
+raise error, just use a link-to-file-line instead.

[elpa] externals/hyperbole 5999198ba6 7/9: Fix issues with Action Buttons; don't add 'action' to button attrs

2023-07-08 Thread ELPA Syncer
branch: externals/hyperbole
commit 5999198ba65fc991839e18841d5b68a94a9df718
Author: Bob Weiner 
Commit: Bob Weiner 

Fix issues with Action Buttons; don't add 'action' to button attrs
---
 ChangeLog  | 22 ++
 hact.el| 47 ++-
 hactypes.el|  6 +++---
 hibtypes.el| 17 +++--
 hpath.el   |  4 ++--
 test/demo-tests.el |  6 +++---
 test/hactypes-tests.el |  6 +++---
 7 files changed, 70 insertions(+), 38 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4bcc0b5c87..3540e73886 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2023-07-08  Bob Weiner  
+
+* test/demo-tests.el 
(demo-implicit-button-action-button-boolean-function-call-test):
+Rename to 'demo-implicit-button-action-button-display-boolean-test' so can
+find when search for use of 'display-boolean'.
+
+* hactypes.el (display-boolean): Improve clarity of output message.
+  test/hactypes-tests.el (display-boolean-true-test, 
display-boolean-false-test):
+Update to new output message format.
+
+* hpath.el (hpath:absolute-arguments): Fix to process only string arguments.
+
+* hibtypes.el (action): Fix 'args' not being set right after add display-* 
actypes.
+Stop storing unneeded ibutton 'action attribute.
+
+* hact.el (actype:action): Fix doc to say may return actype's fboundp symbol.
+Use 'actype:action-body' if always need the body of the function.
+  (symtable:actype-p): Fix to return Elisp function symbols as well
+since 'actype:elisp-symbol' is an alias to this defsubst.
+  (symtable:hyperbole-actype-p): Add to exclude Elisp function symbols.
+  (actype:act): Use above new function.
+
 * DEMO (Completion Selection):
   man/hkey-help.txt:
   man/hyperbole.texi (Smart Key Argument Selection): Update to new minibuffer
diff --git a/hact.el b/hact.el
index 3465e9fa2e..3fc3bfaff8 100644
--- a/hact.el
+++ b/hact.el
@@ -3,7 +3,7 @@
 ;; Author:   Bob Weiner
 ;;
 ;; Orig-Date:18-Sep-91 at 02:57:09
-;; Last-Mod:  3-Jul-23 at 18:43:27 by Bob Weiner
+;; Last-Mod:  8-Jul-23 at 13:19:37 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -115,9 +115,19 @@ with the `ibtypes::' prefix and one without.  The value 
for both
 keys is the Elisp symbol for the type, which includes the prefix.")
 
 (defsubst symtable:actype-p (symbol-or-name)
-  "Return SYMBOL-OR-NAME if it is a Hyperbole action type, else nil."
+  "Return SYMBOL-OR-NAME if a Hyperbole action type or Elisp function, else 
nil."
   (when (or (symbolp symbol-or-name) (stringp symbol-or-name))
-(symtable:get symbol-or-name symtable:actypes)))
+(or (symtable:get symbol-or-name symtable:actypes)
+   (and (stringp symbol-or-name) (fboundp (intern-soft symbol-or-name))
+(intern-soft symbol-or-name))
+   (and (functionp symbol-or-name) symbol-or-name
+
+(defsubst symtable:hyperbole-actype-p (symbol-or-name)
+  "Return SYMBOL-OR-NAME if a Hyperbole action type, else nil.
+This excludes Emacs Lisp functions which may be used as action types.
+Use `actype:elisp-symbol' to include these."
+  (when (or (symbolp symbol-or-name) (stringp symbol-or-name))
+(or (symtable:get symbol-or-name symtable:actypes
 
 (defsubst symtable:ibtype-p (symbol-or-name)
   "Return SYMBOL-OR-NAME if it is a Hyperbole implicit button type, else nil."
@@ -384,16 +394,15 @@ performing ACTION."
   ;; being used as a path.  So do this only if actype is a defact
   ;; and not a defun to limit any potential impact. RSW - 9/22/2017
   (and (symbolp action)
-  (symtable:actype-p action)
+  (symtable:hyperbole-actype-p action)
   (setq args (hpath:absolute-arguments actype args)))
   (let ((hist-elt (hhist:element)))
(run-hooks 'action-act-hook)
-   (prog1 (or (if (and args
-   (or (symbolp action) (listp action)
-   (byte-code-function-p action)
-   (subrp action)
-   (and (stringp action) (not (integerp action))
-(setq action (key-binding action)
+   (prog1 (or (if (or (symbolp action) (listp action)
+  (byte-code-function-p action)
+  (subrp action)
+  (and (stringp action) (not (integerp action))
+   (setq action (key-binding action
   (eval (cons action args))
 (eval action))
   t)
@@ -414,6 +423,9 @@ is returned."
 
 (defunactype:eval (actype &rest args)
   "Perform action formed from ACTYPE and rest of ARGS and return value.
+This differs from `actype:act' in that it can return nil and does not
+expand relative pathname ARGS.
+
 ACTYPE may be a string containing a Lisp expression from which ACTYPE
 and ARG

[elpa] externals/hyperbole 3715ff4077 3/9: Smart Key support for vertico-mode and interactive completion filter

2023-07-08 Thread ELPA Syncer
branch: externals/hyperbole
commit 3715ff40770577be9dc8166b14004e022c75f51f
Author: Bob Weiner 
Commit: Bob Weiner 

Smart Key support for vertico-mode and interactive completion filter

A number of small fixes.
---
 ChangeLog |  38 +++
 hact.el   |  13 +++---
 hargs.el  | 147 +-
 hload-path.el |   4 +-
 hmouse-drv.el |  18 ---
 hmouse-sh.el  |  17 +--
 hui-mouse.el  |  24 +-
 hui.el|  36 --
 hyperbole.el  |   9 +++-
 9 files changed, 224 insertions(+), 82 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5b991816f6..f3c61ea9aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,43 @@
+2023-07-04  Bob Weiner  
+
+* hyperbole.el (hyperb:init): Activate 'vertico-mouse-mode' when
+'vertico-mode' is used so that the Action Key properly selects completions
+from the candidate list.
+  hargs.el (hargs:select-p):
+   (hargs:at-p): When 'hargs:reading-type' is nil, rather than a
+string, return a list of (completion-so-far exact-completion-match),
+for consumption by 'hargs:select-p'.  Add feature to kill to end of
+minibuffer line and refresh completions when not inserting a fully
+matching completion (works for regular and vertico completions if
+'vertico-mouse-mode' has been enabled prior to using).
+
+* hmouse-sh.el (hmouse-posn-set-point): Avoid setting point to a read-only
+location when vertico-mode is active.
+
+2023-07-03  Bob Weiner  
+
+* hmouse-drv.el (hkey-help): Remove ref to XEmacs 'help-selects-help-window'.
+
+* hargs.el (hargs:select-p): Add vertico and ivy completion support.
+   (hargs:at-p): Add vertico support.
+  hui-mouse.el (hkey-alist): Remove ivy support; move above.
+
+* hact.el (actype:act): Fix error when 'args' are null.
+
+* hbut.el (hbut:action): Fix error when 'atype' is not a symbol.
+
+* hmouse-sh.el (hmouse-drag-region): Disable Hyperbole-specific functionality
+when hyperbole-mode is nil.
+
 2023-07-02  Bob Weiner  
 
+* hui.el (hui:ibut-create):
+  hbut.el (ibut:program): Prevent from creating a new ibut within a named
+or labeled Hyperbole button.
+
+* hui.el (hui:ibut-create): Call (hattr:clear 'hbut:current) before creating
+in-memory button.
+
 * hib-social.el (hibtypes-social-default-service): Pluralize defgroup name to
 'hyperbole-buttons' to match other files.  Remove duplicate unneeded
 :group from each defcustom.
diff --git a/hact.el b/hact.el
index 3d215beaf0..3465e9fa2e 100644
--- a/hact.el
+++ b/hact.el
@@ -3,7 +3,7 @@
 ;; Author:   Bob Weiner
 ;;
 ;; Orig-Date:18-Sep-91 at 02:57:09
-;; Last-Mod: 29-May-23 at 21:50:42 by Bob Weiner
+;; Last-Mod:  3-Jul-23 at 18:43:27 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -388,11 +388,12 @@ performing ACTION."
   (setq args (hpath:absolute-arguments actype args)))
   (let ((hist-elt (hhist:element)))
(run-hooks 'action-act-hook)
-   (prog1 (or (if (or (symbolp action) (listp action)
-  (byte-code-function-p action)
-  (subrp action)
-  (and (stringp action) (not (integerp action))
-   (setq action (key-binding action
+   (prog1 (or (if (and args
+   (or (symbolp action) (listp action)
+   (byte-code-function-p action)
+   (subrp action)
+   (and (stringp action) (not (integerp action))
+(setq action (key-binding action)
   (eval (cons action args))
 (eval action))
   t)
diff --git a/hargs.el b/hargs.el
index 4cee338726..ca1ab5a866 100644
--- a/hargs.el
+++ b/hargs.el
@@ -3,7 +3,7 @@
 ;; Author:   Bob Weiner
 ;;
 ;; Orig-Date:31-Oct-91 at 23:17:35
-;; Last-Mod: 17-Jun-23 at 13:05:33 by Bob Weiner
+;; Last-Mod:  5-Jul-23 at 00:45:15 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -328,7 +328,47 @@ default values.
 Caller should have checked whether an argument is presently being read
 and has set `hargs:reading-type' to an appropriate argument type.
 Handles all of the interactive argument types that `hargs:iform-read' does."
-  (cond ((and (eq hargs:reading-type 'kcell)
+  (cond ;; vertico-mode
+   ((and (null hargs:reading-type)
+ (bound-and-true-p vertico-mode)
+ ;; Ensure vertico is prompting for an argument
+ (vertico--command-p nil (current-buffer))
+ (active-minibuffer-window))
+(if (and action-key-release-args
+ (fboundp #'vertico-mouse--index)
+ (eq (posn-window (event-end action-key-release-args))
+ (active-minibuffer-window)))
+(with-selected-window (active-minibuffer-window)
+ 

[elpa] externals/denote d34af36ef1 1/2: Add denote-dired-rename-marked-files optional arg to skip front matter prompt

2023-07-08 Thread ELPA Syncer
branch: externals/denote
commit d34af36ef158caa6d16d7f227f69cd5e30dcfb12
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add denote-dired-rename-marked-files optional arg to skip front matter 
prompt

Thanks to Jay Rajput for asking the question that inspired me to
implement this.  It was done in issue 155 on the GitHub mirror:
.
---
 README.org | 34 --
 denote.el  | 25 ++---
 2 files changed, 34 insertions(+), 25 deletions(-)

diff --git a/README.org b/README.org
index 939921a1d8..ad2ec20244 100644
--- a/README.org
+++ b/README.org
@@ -1059,14 +1059,19 @@ following:
   applied to all file names;
 
 - if the file is recognized as a Denote note, this command adds or
-  rewrites front matter to include the new keywords.  A confirmation to
-  carry out this step is performed once at the outset.  Note that the
-  affected buffers are not saved.  The user can thus check them to
-  confirm that the new front matter does not cause any problems
-  (e.g. with the command ~diff-buffer-with-file~).  Multiple buffers can
-  be saved with ~save-some-buffers~ (read its doc string).  The addition
-  of front matter takes place only if the given file has the appropriate
-  file type extension (per the user option ~denote-file-type~).
+  rewrites front matter to include the new keywords.  A confirmation
+  to carry out this step is performed once at the outset, unless
+  optional =SKIP-FRONT-MATTER-PROMPT= is non-nil (such as with a
+  universal prefix argument).  Note that the affected buffers are not
+  saved.  The user can thus check them to confirm that the new front
+  matter does not cause any problems (e.g. with the command
+  ~diff-buffer-with-file~).  Multiple buffers can be saved with
+  ~save-some-buffers~ (read its doc string).  The addition of front
+  matter takes place only if the given file has the appropriate file
+  type extension (per the user option ~denote-file-type~).
+
+[ The optional =SKIP-FRONT-MATTER-PROMPT= is added to
+  ~denote-dired-rename-marked-files~ as part of {{{development-version}}}. ]
 
 ** Rename a single file based on its front matter
 :PROPERTIES:
@@ -4423,12 +4428,13 @@ Denote is meant to be a collective effort.  Every bit 
of help matters.
 + Ideas and/or user feedback :: Abin Simon, Aditya Yadav, Alan
   Schmitt, Alfredo Borrás, Benjamin Kästner, Colin McLear, Damien
   Cassou, Elias Storms, Federico Stilman, Florian, Frank Ehmsen, Guo
-  Yong, Hanspeter Gisler, Jack Baty, Jeremy Friesen, Jonathan Sahar,
-  Juanjo Presa, Johan Bolmsjö, Kai von Fintel, Kaushal Modi, M. Hadi
-  Timachi, Mirko Hernandez, Niall Dooley, Paul van Gelder, Peter
-  Prevos, Shreyas Ragavan, Stefan Thesing, Summer Emacs, Sven Seebeck,
-  Taoufik, Viktor Haag, Wade Mealing, Yi Liu, Ypot, atanasj, doolio,
-  drcxd, hpgisler, pRot0ta1p, rbenit68, relict007, sienic, sundar bp.
+  Yong, Hanspeter Gisler, Jack Baty, Jay Rajput, Jeremy Friesen,
+  Jonathan Sahar, Juanjo Presa, Johan Bolmsjö, Kai von Fintel, Kaushal
+  Modi, M. Hadi Timachi, Mirko Hernandez, Niall Dooley, Paul van
+  Gelder, Peter Prevos, Shreyas Ragavan, Stefan Thesing, Summer Emacs,
+  Sven Seebeck, Taoufik, Viktor Haag, Wade Mealing, Yi Liu, Ypot,
+  atanasj, doolio, drcxd, hpgisler, pRot0ta1p, rbenit68, relict007,
+  sienic, sundar bp.
 
 Special thanks to Peter Povinec who helped refine the file-naming
 scheme, which is the cornerstone of this project.
diff --git a/denote.el b/denote.el
index dcad07aa29..3053d8de1c 100644
--- a/denote.el
+++ b/denote.el
@@ -2341,7 +2341,7 @@ of the file.  This needs to be done manually."
 (denote--add-front-matter new-name title keywords id new-file-type)
 
 ;;;###autoload
-(defun denote-dired-rename-marked-files ()
+(defun denote-dired-rename-marked-files (&optional skip-front-matter-prompt)
   "Rename marked files in Dired to Denote file name.
 
 The operation does the following:
@@ -2360,18 +2360,21 @@ The operation does the following:
 
 - if the file is recognized as a Denote note, add a front matter
   or rewrite it to include the new keywords.  A confirmation to
-  carry out this step is performed once at the outset.  Note that
-  the affected buffers are not saved.  The user can thus check
-  them to confirm that the new front matter does not cause any
-  problems (e.g. with the command `diff-buffer-with-file').
-  Multiple buffers can be saved with `save-some-buffers' (read
-  its doc string).  The addition of front matter takes place only
-  if the given file has the appropriate file type extension (per
-  the user option `denote-file-type')."
-  (interactive nil dired-mode)
+  carry out this step is performed once at the outset, unless
+  optional SKIP-FRONT-MATTER-PROMPT is non-nil (such as with a
+  universal prefix argument).  Note that the affected buffers are
+  not saved.  The user can thus check them to confirm that the
+  new front matter does not 

[elpa] externals/denote fa26bd17b2 2/2: Reorder A-Z a name in the manual's acknowledgements

2023-07-08 Thread ELPA Syncer
branch: externals/denote
commit fa26bd17b251ac62dc2e908f0a5aaa28a600a996
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Reorder A-Z a name in the manual's acknowledgements
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index ad2ec20244..a93f16a9a5 100644
--- a/README.org
+++ b/README.org
@@ -4429,7 +4429,7 @@ Denote is meant to be a collective effort.  Every bit of 
help matters.
   Schmitt, Alfredo Borrás, Benjamin Kästner, Colin McLear, Damien
   Cassou, Elias Storms, Federico Stilman, Florian, Frank Ehmsen, Guo
   Yong, Hanspeter Gisler, Jack Baty, Jay Rajput, Jeremy Friesen,
-  Jonathan Sahar, Juanjo Presa, Johan Bolmsjö, Kai von Fintel, Kaushal
+  Jonathan Sahar, Johan Bolmsjö, Juanjo Presa, Kai von Fintel, Kaushal
   Modi, M. Hadi Timachi, Mirko Hernandez, Niall Dooley, Paul van
   Gelder, Peter Prevos, Shreyas Ragavan, Stefan Thesing, Summer Emacs,
   Sven Seebeck, Taoufik, Viktor Haag, Wade Mealing, Yi Liu, Ypot,



[elpa] externals/dired-preview updated (6673bb1cd3 -> 364fab84a3)

2023-07-08 Thread ELPA Syncer
elpasync pushed a change to branch externals/dired-preview.

  from  6673bb1cd3 Update to version 0.1.0
   new  882b976e77 Add missing date in the changelog
   new  364fab84a3 Update README.md to include package name and description


Summary of changes:
 CHANGELOG.org |  6 +++---
 README.md | 10 --
 2 files changed, 11 insertions(+), 5 deletions(-)



[elpa] externals/denote updated (d33afd4347 -> fa26bd17b2)

2023-07-08 Thread ELPA Syncer
elpasync pushed a change to branch externals/denote.

  from  d33afd4347 Rename lots of "link" commands for simplicity
   new  d34af36ef1 Add denote-dired-rename-marked-files optional arg to 
skip front matter prompt
   new  fa26bd17b2 Reorder A-Z a name in the manual's acknowledgements


Summary of changes:
 README.org | 34 --
 denote.el  | 25 ++---
 2 files changed, 34 insertions(+), 25 deletions(-)



[elpa] externals/dired-preview 882b976e77 1/2: Add missing date in the changelog

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 882b976e77ded2b67e72e936c1777adf2b4f51d3
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add missing date in the changelog
---
 CHANGELOG.org | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
index b89caa5378..ce960ca961 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -14,9 +14,9 @@ the manual: .
 :CUSTOM_ID: h:99cbb3dd-a0f1-4d2b-a945-58531f4ab189
 :END:
 
-The ~dired-preview~ package was in a public testing phase from DATE
-until today.  In the meantime, lots of changes have been made in the
-interest of usability and robustness.
+The ~dired-preview~ package was in a public testing phase from
+2023-06-25 until today.  In the meantime, lots of changes have been
+made in the interest of usability and robustness.
 
 ** Global and buffer-local modes
 :PROPERTIES:



[elpa] externals/dired-preview 364fab84a3 2/2: Update README.md to include package name and description

2023-07-08 Thread ELPA Syncer
branch: externals/dired-preview
commit 364fab84a3f634106864b52fe54b55e819d4e024
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update README.md to include package name and description
---
 README.md | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index ea658ef287..a3de8fef9a 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,13 @@
 # dired-preview for Emacs
 
-+ Package name (GNU ELPA): `dired-preview` (⚠️ not available yet;
-  public testing phase as of 2023-06-25)
+This is a simple and robust package to automatically preview in a side
+window the file at point in Dired buffers.  Preview windows are closed
+when they are no longer relevant, while preview buffers are killed if
+they have not been used for other purposes beside previewing.  The
+package provides several customisation options to control its
+behaviour.
+
++ Package name (GNU ELPA): `dired-preview`
 + Official manual: 
 + Git repo on SourceHut: 
   - Mirrors: