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

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

[elpa] externals/hyperbole 7f0ac697a9 2/4: Merge branch 'master' into rs


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 7f0ac697a9 2/4: Merge branch 'master' into rsw
Date: Sun, 17 Nov 2024 15:58:08 -0500 (EST)

branch: externals/hyperbole
commit 7f0ac697a948108bc30c5e0a29f9d5f7e32eedad
Merge: a7aefb122b d9f7c7fb7a
Author: bw <rsw@gnu.org>
Commit: bw <rsw@gnu.org>

    Merge branch 'master' into rsw
---
 ChangeLog              | 12 +++++++++++
 Makefile               |  7 ++++++-
 hui-mouse.el           |  4 +++-
 test/hsys-org-tests.el | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 74 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6cf58b5747..0c1e585926 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,18 @@
     dehighlighting at the start of a WikiWord when the first character
     was deleted.
 
+2024-11-17  Mats Lidell  <matsl@gnu.org>
+
+* Makefile (run-emacs): Run Emacs as a make target for use with docker.
+
+2024-11-16  Mats Lidell  <matsl@gnu.org>
+
+* test/hsys-org-tests.el (hsys-org--meta-return-on-end-of-line): Add test
+    case for eol action in org-mode.
+
+* hui-mouse.el (hkey-alist): Guard action-key-eol-function from acting
+    when we should delegate to org-mode.
+
 2024-11-13  Bob Weiner  <rsw@gnu.org>
 
 * hywiki.el (hywiki-maybe-dehighlight-page-name,
diff --git a/Makefile b/Makefile
index 0998ad1c94..a3c2726386 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 # Author:       Bob Weiner
 #
 # Orig-Date:    15-Jun-94 at 03:42:38
-# Last-Mod:     27-Oct-24 at 21:27:42 by Mats Lidell
+# Last-Mod:     17-Nov-24 at 00:02:09 by Mats Lidell
 #
 # Copyright (C) 1994-2023  Free Software Foundation, Inc.
 # See the file HY-COPY for license information.
@@ -629,6 +629,11 @@ docker-run: docker-update
 docker-update:
        docker pull silex/emacs:${DOCKER_VERSION}
 
+# Target for running emacs in the container with hyperbole loaded.
+# Example: make docker version=29.4 targets="clean bin run-emacs"
+run-emacs:
+       emacs --eval "(progn (add-to-list 'load-path \"/hyperbole\") (require 
'hyperbole) (hyperbole-mode 1))"
+
 # Run with coverage. Run tests given by testspec and monitor the
 # coverage for the specified file.
 #
diff --git a/hui-mouse.el b/hui-mouse.el
index 58ba01fbba..f852e28701 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -298,7 +298,9 @@ Its default value is `smart-scroll-down'.  To disable it, 
set it to
      . ((funcall (key-binding (kbd "RET"))) . (funcall (key-binding (kbd 
"RET")))))
     ;;
     ;; If at the end of a line (eol), invoke the associated Smart Key handler 
EOL handler.
-    ((smart-eolp)
+    ((and (smart-eolp)
+          (not (and (funcall hsys-org-mode-function)
+                    (not (equal hsys-org-enable-smart-keys t)))))
      . ((funcall action-key-eol-function) . (funcall assist-key-eol-function)))
     ;;
     ;; Handle any Org mode-specific contexts but give priority to Hyperbole
diff --git a/test/hsys-org-tests.el b/test/hsys-org-tests.el
index ff4b70864b..79318e3a99 100644
--- a/test/hsys-org-tests.el
+++ b/test/hsys-org-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    23-Apr-21 at 20:55:00
-;; Last-Mod:     31-Jul-24 at 01:46:48 by Bob Weiner
+;; Last-Mod:     16-Nov-24 at 09:45:51 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -225,6 +225,58 @@ This is independent of the setting of 
`hsys-org-enable-smart-keys'."
             (hsys-org--agenda-tags-string => ":tag"))
     (should (string= "agenda-func" (hsys-org-get-agenda-tags #'agenda-func)))))
 
+(ert-deftest hsys-org--meta-return-on-end-of-line ()
+  "Verify end-of-line behaves as `org-mode' when smart keys not enabled."
+  (dolist (v '(nil :buttons))
+    (let ((hsys-org-enable-smart-keys v))
+      ;;; One line no return
+      (with-temp-buffer
+        (org-mode)
+        (insert "* h1")
+        (goto-char 1)
+        (end-of-line)
+        (with-mock
+          (mock (hsys-org-meta-return) => t)
+          (should (equal hsys-org-enable-smart-keys v)) ; Ert traceability
+          (should (action-key))))
+      ;;; Two lines
+      (with-temp-buffer
+        (org-mode)
+        (insert "* h1\n* h2\n")
+        (goto-char 1)
+        (end-of-line)
+        (with-mock
+          (mock (hsys-org-meta-return) => t)
+          (should (equal hsys-org-enable-smart-keys v)) ; Ert traceability
+          (should (action-key))))))
+  (let ((hsys-org-enable-smart-keys t)
+        (v t))
+    ;;; One line no return
+    ;; At end of line is also end of file so smart-eolp filters out
+    ;; this as a Hyperbole context and org instead picks it
+    ;; up. Possibly a confusing behavior!? Should eof only be when
+    ;; action is below last visible line to avoid this case?
+    (with-temp-buffer
+      (org-mode)
+      (insert "* h1")
+      (goto-char 1)
+      (end-of-line)
+      (with-mock
+        (mock (hsys-org-meta-return) => t)
+        (should (equal hsys-org-enable-smart-keys v)) ; Ert traceability
+        (should (action-key))))
+    ;;; Two lines
+    ;; Hyperbole context is active and smart scroll is triggered.
+    (with-temp-buffer
+      (org-mode)
+      (insert "* h1\n* h2\n")
+      (goto-char 1)
+      (end-of-line)
+      (with-mock
+        (mock (smart-scroll-up) => t)
+        (should (equal hsys-org-enable-smart-keys v)) ; Ert traceability
+        (should (action-key))))))
+
 (provide 'hsys-org-tests)
 
 ;; This file can't be byte-compiled without the `el-mock' package



reply via email to

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