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

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

[elpa] externals/hyperbole f98ce2a 29/51: Fix colorized display of HyRol


From: Stefan Monnier
Subject: [elpa] externals/hyperbole f98ce2a 29/51: Fix colorized display of HyRolo match terms on initial use.
Date: Sun, 12 Jul 2020 18:10:14 -0400 (EDT)

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

    Fix colorized display of HyRolo match terms on initial use.
---
 .hypb             | Bin 3430 -> 3248 bytes
 Changes           |  11 ++++++++++-
 hbut.el           |  12 ++++++++++++
 hui-em-but.el     |  11 +++++++----
 hyrolo.el         |  24 ++++++++++++------------
 man/hkey-help.txt |   4 ++++
 6 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/.hypb b/.hypb
index a10260c..3075990 100644
Binary files a/.hypb and b/.hypb differ
diff --git a/Changes b/Changes
index 985ebd8..59ead9b 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,14 @@
+2020-02-23  Bob Weiner  <rsw@gnu.org>
+
+* hbut.el (ibut:act): Added to interactively prompt for and activate named 
implicit buttons,
+    <[name]>.
+
 2020-02-22  Bob Weiner  <rsw@gnu.org>
 
+* hui-em-but.el (after-init-time): Added setting of hyrolo-highlight-face used 
in HyRolo matches
+   so text is highlighted and readable by default (foreground and background 
colors of matched
+   text has been the same for some unknown reason.  This may affect user 
customizations however.
+
 * man/hyperbole.texi (Smart Key - Bookmark Mode): Added.
 
 * hpath.el (hpath:file-line-and-column): Added.
@@ -75,7 +84,7 @@ V7.1.0 test release changes ^^^^:
 * hui-menu.el (hyperbole-menubar-menu): Removed set-menubar-dirty-flag call.
               (hmouse-release-left-edge, hmouse-release-right-edge): Removed 
XEmacs code.
 
-* hkey-help.txt:
+* man/hkey-help.txt:
   hmouse-drv.el (action-key-depress, assist-key-depress):
   hui-window.el (action-key-modeline, assist-key-modeline):
      Modeline window resizing is now handled in action/assist-key-depress via 
a call to
diff --git a/hbut.el b/hbut.el
index 6630ebb..054b619 100644
--- a/hbut.el
+++ b/hbut.el
@@ -1226,6 +1226,18 @@ source file for the buttons in the menu, if any.")
 ;;; ibut class - Implicit Hyperbole Buttons
 ;;; ========================================================================
 
+
+(defun    ibut:act (label)
+  "Activates Hyperbole implicit button with <[LABEL]> from the current buffer."
+  (interactive (list (hargs:read-match "Activate implicit button labeled: "
+                                      (ibut:alist)
+                                      nil t nil 'ibut)))
+  (let* ((lbl-key (hbut:label-to-key label))
+        (but (ibut:get lbl-key)))
+    (if but
+       (hbut:act but)
+      (error "(ibut:act): No implicit button labeled: %s" label))))
+
 (defun    ibut:alist (&optional file)
   "Return alist of labeled ibuts in FILE or the current buffer.
 Each element is a list of just an implicit button label.  For use
diff --git a/hui-em-but.el b/hui-em-but.el
index 62db858..4700f11 100644
--- a/hui-em-but.el
+++ b/hui-em-but.el
@@ -101,7 +101,7 @@ If `hproperty:but-emphasize-flag' is non-nil when this is 
called, emphasize
 that button is selectable whenever the mouse cursor moves over it."
   (let ((but (make-overlay start end)))
     (overlay-put but 'face face)
-    (if hproperty:but-emphasize-flag (overlay-put but 'mouse-face 
'highlight))))
+    (when hproperty:but-emphasize-flag (overlay-put but 'mouse-face 
'highlight))))
 
 (defun hproperty:but-color ()
   "Return current color of buffer's buttons."
@@ -115,8 +115,8 @@ that button is selectable whenever the mouse cursor moves 
over it."
   (let ((start (point-min)))
     (while (< start (point-max))
       (mapc (lambda (props)
-             (if (eq (overlay-get props 'face) hproperty:but-face)
-                 (delete-overlay props)))
+             (when (eq (overlay-get props 'face) hproperty:but-face)
+               (delete-overlay props)))
            (overlays-at start))
       (setq start (next-overlay-change start)))))
 
@@ -468,7 +468,10 @@ highlighted."
 (provide 'hui-em-but)
 
 (if after-init-time
-    (hproperty:set-face-after-init)
+    (progn
+      ;; Reverse foreground and background colors for default block-style 
highlighting.
+      (hproperty:set-item-highlight (hproperty:foreground) 
(hproperty:background))
+      (hproperty:set-face-after-init))
   (add-hook 'after-init-hook #'hproperty:set-face-after-init))
 
 ;;; hui-em-but.el ends here
diff --git a/hyrolo.el b/hyrolo.el
index a3d1af0..934d33d 100644
--- a/hyrolo.el
+++ b/hyrolo.el
@@ -1216,21 +1216,21 @@ HYROLO-BUF may be a file-name, `buffer-name', or 
buffer."
 
 (defun hyrolo-format-name (name-str first last)
   "Reverse order of NAME-STR field given my regexp match field FIRST and LAST."
-  (if (match-beginning last)
-      (concat (substring name-str (match-beginning last) (match-end last))
-             ", "
-             (substring name-str (match-beginning first) (match-end first)))))
+  (when (match-beginning last)
+    (concat (substring name-str (match-beginning last) (match-end last))
+           ", "
+           (substring name-str (match-beginning first) (match-end first)))))
 
 (defun hyrolo-highlight-matches (regexp start end)
   "Highlight matches for REGEXP in region from START to END."
-  (if (fboundp 'hproperty:but-add)
-      (let ((hproperty:but-emphasize-flag))
-       (save-excursion
-         (goto-char start)
-         (while (re-search-forward regexp nil t)
-           (hproperty:but-add (match-beginning 0) (match-end 0)
-                              (or hyrolo-highlight-face
-                                  hproperty:highlight-face)))))))
+  (when (fboundp 'hproperty:but-add)
+    (let ((hproperty:but-emphasize-flag))
+      (save-excursion
+       (goto-char start)
+       (while (re-search-forward regexp nil t)
+         (hproperty:but-add (match-beginning 0) (match-end 0)
+                            (or hyrolo-highlight-face
+                                hproperty:highlight-face)))))))
 
 (defun hyrolo-isearch-for-regexp (regexp)
   "Interactively search forward for the next occurrence of current match 
REGEXP.
diff --git a/man/hkey-help.txt b/man/hkey-help.txt
index c567c6d..17ae28c 100644
--- a/man/hkey-help.txt
+++ b/man/hkey-help.txt
@@ -29,6 +29,10 @@ Mouse-only Control
     string, list or markup
     language tag pair
 
+  Drag from bottom Modeline     Reposition frame as        <- same
+  in frame with non-nil         drag happens
+  drag-with-mode-line param
+
   Drag from shared window side
     or from left of scroll bar  Resizes window width       <- same
   Modeline vertical drag        Resizes window height      <- same



reply via email to

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