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

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

[elpa] externals/hyperbole 7d25b9a5ff 2/2: Extend eobp checks to allow a


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 7d25b9a5ff 2/2: Extend eobp checks to allow anywhere in blank lines before eob
Date: Mon, 6 Jun 2022 03:57:40 -0400 (EDT)

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

    Extend eobp checks to allow anywhere in blank lines before eob
---
 ChangeLog         |  5 +++++
 hactypes.el       |  4 ++--
 hrmail.el         |  4 ++--
 hui-mouse.el      | 35 +++++++++++++++++++++++------------
 hui-select.el     |  8 ++++----
 hui-window.el     |  4 ++--
 hypb.el           |  4 ++--
 kotl/kfile.el     |  4 ++--
 kotl/kotl-mode.el |  6 +++---
 9 files changed, 45 insertions(+), 29 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1fe56a96eb..b75e61a9ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-06-05  Bob Weiner  <rsw@gnu.org>
+
+* hui-mouse.el (smart-eolp): Exclude when on blank line and nothing but 
whitespace until eob.
+               (smart-eobp): Add and replace 'eolp' calls with this, including 
in 'smart-eolp'.
+
 2022-06-05  Mats Lidell  <matsl@gnu.org>
 
 * Makefile (eln): Target for native byte compilation.
diff --git a/hactypes.el b/hactypes.el
index 097f0e8119..f78e204620 100644
--- a/hactypes.el
+++ b/hactypes.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    23-Sep-91 at 20:34:36
-;; Last-Mod:     28-May-22 at 10:23:19 by Bob Weiner
+;; Last-Mod:      5-Jun-22 at 17:59:19 by Bob Weiner
 ;;
 ;; Copyright (C) 1991-2022  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -48,7 +48,7 @@
 Unless point is at the end of the buffer or if a completion has already been
 inserted, delete the completions window."
   (interactive)
-  (if (eobp)
+  (if (smart-eobp)
       (progn (bury-buffer nil)
             (delete-window))
     (hargs:completion)))
diff --git a/hrmail.el b/hrmail.el
index c5281b1480..a7bbc210b8 100644
--- a/hrmail.el
+++ b/hrmail.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     9-May-91 at 04:22:02
-;; Last-Mod:      9-May-22 at 22:37:10 by Bob Weiner
+;; Last-Mod:      5-Jun-22 at 17:59:19 by Bob Weiner
 ;;
 ;; Copyright (C) 1991-2016  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -103,7 +103,7 @@ This includes Hyperbole button data."
   (interactive)
   (let ((count 0) opoint)
     (save-excursion
-     (while (and (not (eobp))
+     (while (and (not (smart-eobp))
                 (progn (setq opoint (point))
                        (re-search-backward "^\^_" nil t)))
        (if (= opoint (point))
diff --git a/hui-mouse.el b/hui-mouse.el
index 08eb283187..b4224922fa 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    04-Feb-89
-;; Last-Mod:     22-May-22 at 15:05:45 by Bob Weiner
+;; Last-Mod:      5-Jun-22 at 17:59:48 by Bob Weiner
 ;;
 ;; Copyright (C) 1991-2022  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -521,7 +521,7 @@ smart keyboard keys.")
 
 (defun last-line-p ()
   "Return true if point is on the last line of the buffer."
-  (save-excursion (end-of-line) (eobp)))
+  (save-excursion (end-of-line) (smart-eobp)))
 
 (defun smart-completion-help ()
   "Offer completion help for current minibuffer argument, if any."
@@ -744,7 +744,7 @@ If key is pressed:
  (3) on a date, the diary entries for the date, if any, are displayed."
 
   (interactive)
-  (cond ((eobp) (calendar-cursor-to-nearest-date)
+  (cond ((smart-eobp) (calendar-cursor-to-nearest-date)
         (calendar-scroll-left-three-months 1))
        ((< (current-column) 5) (calendar-cursor-to-nearest-date)
         (calendar-scroll-right-three-months 1))
@@ -766,7 +766,7 @@ If assist-key is pressed:
      calendar window."
 
   (interactive)
-  (cond ((eobp) (calendar-cursor-to-nearest-date)
+  (cond ((smart-eobp) (calendar-cursor-to-nearest-date)
         (calendar-scroll-right-three-months 1))
        ((< (current-column) 5) (calendar-cursor-to-nearest-date)
         (calendar-scroll-left-three-months 1))
@@ -1057,7 +1057,7 @@ Assume Hyperbole has already checked that helm is active."
        (setq cursor-type hkey-debug) ; For testing where mouse presses set 
point.
        (and (eventp action-key-depress-args)
             (goto-char (posn-point (event-start action-key-depress-args))))
-       (when (not (or (eobp)
+       (when (not (or (smart-eobp)
                       (smart-helm-at-header)
                       (helm-pos-candidate-separator-p)))
          (let ((helm-selection-point (point)))
@@ -1095,7 +1095,7 @@ Assume Hyperbole has already checked that helm is active."
           (mouse-set-point depress-event)
           (setq things (list 'section-header (helm-pos-header-line-p)
                              'separator (helm-pos-candidate-separator-p)
-                             'eob (eobp)
+                             'eob (smart-eobp)
                              'eol (eolp)))
           (cond ((or (plist-get things 'section-header) (plist-get things 
'separator))
                  (helm-next-line 1)
@@ -1773,7 +1773,7 @@ If key is pressed:
   (interactive)
   (cond (smart-outline-cut
         (setq smart-outline-cut nil) (yank))
-       ((eobp) (outline-show-all))
+       ((smart-eobp) (outline-show-all))
        ((and (bolp) (looking-at outline-regexp))
         (setq smart-outline-cut t)
         (kill-region
@@ -1811,7 +1811,7 @@ If assist-key is pressed:
 
   (interactive)
   (cond (smart-outline-cut (yank))
-       ((eobp) (outline-hide-body))
+       ((smart-eobp) (outline-hide-body))
        ((and (bolp) (looking-at outline-regexp))
         (setq smart-outline-cut t)
         (kill-region (point)
@@ -1870,7 +1870,7 @@ If key is pressed:
  (1) at the end of buffer, bury buffer
  (2) on a todo item, toggle the completion"
   (interactive)
-  (cond ((eobp) (todotxt-bury))
+  (cond ((smart-eobp) (todotxt-bury))
        (t (todotxt-complete-toggle))))
 
 (defun smart-todotxt-assist ()
@@ -1881,15 +1881,26 @@ If key is pressed:
  (2) on a todo item, edit it"
 
   (interactive)
-  (cond ((eobp) (todotxt-archive))
+  (cond ((smart-eobp) (todotxt-archive))
        (t (todotxt-edit-item))))
 
+(defun smart-eobp ()
+  "Return t if point is past the last visible buffer line with text."
+  (and (or (eobp)
+          ;; On a blank line and nothing but whitespace until eob
+          (save-excursion
+            (beginning-of-line)
+            (looking-at "[ \t\n\r\f]+\\'")))
+       (or (not (smart-outline-char-invisible-p))
+          (not (smart-outline-char-invisible-p (1- (point)))))))
+
 (defun smart-eolp ()
   "Return t if point is at the end of a visible line but not the end of the 
buffer."
   ;; smart-helm handles eol for helm buffers
   (unless (and (smart-helm-alive-p) (equal (helm-buffer-get) (buffer-name)))
-    (and (not (eobp)) (eolp) (or (not (smart-outline-char-invisible-p))
-                                (not (smart-outline-char-invisible-p (1- 
(point))))))))
+    (and (not (smart-eobp)) (eolp)
+        (or (not (smart-outline-char-invisible-p))
+            (not (smart-outline-char-invisible-p (1- (point))))))))
 
 ;;; ************************************************************************
 ;;; smart-push-button functions
diff --git a/hui-select.el b/hui-select.el
index 75f4254d18..710e1beef2 100644
--- a/hui-select.el
+++ b/hui-select.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    19-Oct-96 at 02:25:27
-;; Last-Mod:     15-May-22 at 22:30:57 by Bob Weiner
+;; Last-Mod:      5-Jun-22 at 17:59:19 by Bob Weiner
 ;;
 ;; Copyright (C) 1996-2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -285,7 +285,7 @@ region (start . end) defining the boundaries of the thing 
at that position."
   "Return non-nil if the character after optional POS (or point) matches a 
syntax entry in `hui-select-syntax-alist'.
 The non-nil value returned is the function to call to select that syntactic 
unit."
   (interactive "d")
-  (unless (eobp)
+  (unless (smart-eobp)
     (or (numberp pos) (setq pos (point)))
     (setq hui-select-previous 'char)
     (let* ((syntax (char-syntax (or (char-after pos) (char-before pos))))
@@ -1066,7 +1066,7 @@ list, hui-select-indent-modes."
       ;; an outline entry, in which case we mark entries as indented blocks.
       (hui-select-indent-def pos)
       (save-excursion
-        (when (memq (char-syntax (if (eobp) (preceding-char) (char-after pos)))
+        (when (memq (char-syntax (if (smart-eobp) (preceding-char) (char-after 
pos)))
                  '(?w ?_))
          (setq hui-select-previous 'symbol)
          (condition-case ()
@@ -1337,7 +1337,7 @@ list, hui-select-markup-modes."
                          (throw 'done opoint))
                        (setq count (1- count))
                        (when (= count 0)
-                          (cond ((eobp)
+                          (cond ((smart-eobp)
                                  (if bolp
                                     ;; Include leading space since the
                                     ;; start and end tags begin and end
diff --git a/hui-window.el b/hui-window.el
index 6c8e5e5885..aa7d943cfc 100644
--- a/hui-window.el
+++ b/hui-window.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    21-Sep-92
-;; Last-Mod:     17-Apr-22 at 11:39:16 by Bob Weiner
+;; Last-Mod:      5-Jun-22 at 17:59:19 by Bob Weiner
 ;;
 ;; Copyright (C) 1992-2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -812,7 +812,7 @@ With optional boolean NEW-WINDOW non-nil, sensibly split 
the release window befo
   "Save a mark, then insert at point the text from `hkey-region' and indent 
it."
   (indent-for-tab-command)
   (push-mark nil t)
-  (if (eobp) (insert "\n"))
+  (if (smart-eobp) (insert "\n"))
   (insert hkey-region)
   (indent-region (point) (mark))
   (message "") ;; Clear any indenting message.
diff --git a/hypb.el b/hypb.el
index 7b36ad5cfb..32d9724cc7 100644
--- a/hypb.el
+++ b/hypb.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     6-Oct-91 at 03:42:38
-;; Last-Mod:      4-Jun-22 at 01:29:24 by Bob Weiner
+;; Last-Mod:      5-Jun-22 at 17:59:19 by Bob Weiner
 ;;
 ;; Copyright (C) 1991-2022  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -452,7 +452,7 @@ If EVENT, use EVENT's position to determine the starting 
position."
       (goto-char (posn-point (event-start event)))
       (let (beg end)
         (cond
-         ((and (not (eobp)) (get-text-property (point) 'mouse-face))
+         ((and (not (smart-eobp)) (get-text-property (point) 'mouse-face))
           (setq end (point) beg (1+ (point))))
          ((and (not (bobp))
                (get-text-property (1- (point)) 'mouse-face))
diff --git a/kotl/kfile.el b/kotl/kfile.el
index 952baa91c9..da3348d6f4 100644
--- a/kotl/kfile.el
+++ b/kotl/kfile.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    10/31/93
-;; Last-Mod:     17-Apr-22 at 12:17:44 by Bob Weiner
+;; Last-Mod:      5-Jun-22 at 17:59:19 by Bob Weiner
 ;;
 ;; Copyright (C) 1993-2021  Free Software Foundation, Inc.
 ;; See the "../HY-COPY" file for license information.
@@ -470,7 +470,7 @@ handle, whenever this is possible."
            (let ((print-escape-newlines kfile:escape-newlines))
              (prin1 object (current-buffer)))
            (goto-char (point-min))
-           (while (not (eobp))
+           (while (not (smart-eobp))
              ;; (message "%06d" (- (point-max) (point)))
              (cond
               ((looking-at "\\s\(")
diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el
index d75681849d..e1e8b269ce 100644
--- a/kotl/kotl-mode.el
+++ b/kotl/kotl-mode.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    6/30/93
-;; Last-Mod:     14-May-22 at 11:55:40 by Bob Weiner
+;; Last-Mod:      5-Jun-22 at 17:59:19 by Bob Weiner
 ;;
 ;; Copyright (C) 1993-2021  Free Software Foundation, Inc.
 ;; See the "../HY-COPY" file for license information.
@@ -2064,7 +2064,7 @@ If at tail cell already, do nothing and return nil."
 
 (defun kotl-mode:eocp ()
   "Return point if in a visible position at the end of a kview cell, else nil."
-  (when (or (eobp)
+  (when (or (smart-eobp)
            (looking-at "[\n\r]+\\'")
            (when (kotl-mode:eolp)
              (save-excursion
@@ -2076,7 +2076,7 @@ If at tail cell already, do nothing and return nil."
 (defun kotl-mode:eolp (&optional next-char-visible)
   "Return t if point is at the end of a visible line or the end of the buffer.
 With optional NEXT-CHAR-VISIBLE, return t only if the following char is 
visible."
-  (or (eobp)
+  (or (smart-eobp)
       (and (eolp)
           (if next-char-visible
               (not (kview:char-invisible-p))



reply via email to

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