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

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

[elpa] externals/hyperbole 454804c 3/3: Change hypb:mark calls to mark


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 454804c 3/3: Change hypb:mark calls to mark
Date: Sun, 7 Nov 2021 23:57:31 -0500 (EST)

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

    Change hypb:mark calls to mark
---
 ChangeLog         |  2 ++
 hargs.el          |  4 ++--
 hsmail.el         | 15 ++++++++-------
 hui.el            | 16 ++++++++--------
 hypb.el           |  2 --
 kotl/kotl-mode.el |  8 ++++----
 6 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4871e3e..b31f37c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2021-11-07  Bob Weiner  <rsw@gnu.org>
 
+* hypb.el (hypb:mark): Remove and use builtin mark function.
+
 * hui-mini.el (hyperbole-set-key): Rename parameters.
 
 * man/hyperbole.texi (Default Hyperbole Bindings):
diff --git a/hargs.el b/hargs.el
index ddf100f..fe7e43b 100644
--- a/hargs.el
+++ b/hargs.el
@@ -752,8 +752,8 @@ help when appropriate."
          ;; Get region, point and mark as 2 args.  No I/O
          (?r . (region .
                 (if (marker-position (mark-marker))
-                    (list 'args (min (point) (hypb:mark t))
-                          (max (point) (hypb:mark t)))
+                    (list 'args (min (point) (mark t))
+                          (max (point) (mark t)))
                   (list 'args nil nil))))
          ;; Get string.
          (?s . (string . (read-string prompt default)))
diff --git a/hsmail.el b/hsmail.el
index 8db2230..c25c60e 100644
--- a/hsmail.el
+++ b/hsmail.el
@@ -41,7 +41,7 @@ for a comment.")
     ;; For compatibility with rsw-modified sendmail.el.
     (defvar mail-yank-hook
       ;; Set off original message.
-      (lambda () (mail-prefix-region (hypb:mark t) (point)))
+      (lambda () (mail-prefix-region (mark t) (point)))
       "*Hook to run mail yank preface function.
 Expects point and mark to be set to the region to preface.")
   ;;
@@ -176,9 +176,9 @@ Use (setq sc-nuke-mail-headers 'all) to have them removed."
                                 buffer-file-coding-system))))))
                (set-text-properties (point) (mark t) nil))
                (hmail:msg-narrow)
-               (if (fboundp 'hproperty:but-create) (hproperty:but-create))
-               (if (consp arg)
-                   nil
+               (when (fboundp 'hproperty:but-create)
+                 (hproperty:but-create))
+               (unless (consp arg)
                  ;; Don't ever remove headers if user uses Supercite package,
                  ;; since he can set an option in that package to do
                  ;; the removal.
@@ -209,7 +209,7 @@ Use (setq sc-nuke-mail-headers 'all) to have them removed."
                          ((and (boundp 'mail-yank-hooks) mail-yank-hooks)
                           (run-hooks 'mail-yank-hooks))
                          (t (mail-indent-citation))))
-                 (goto-char (min (point-max) (hypb:mark t)))
+                 (goto-char (min (point-max) (mark t)))
                  (set-mark opoint)
                  (delete-region (point) ; Remove trailing blank lines.
                                 (progn (re-search-backward "[^ \t\n\r\f]")
@@ -219,10 +219,11 @@ Use (setq sc-nuke-mail-headers 'all) to have them 
removed."
                  ;; This is like exchange-point-and-mark, but doesn't activate 
the mark.
                  ;; It is cleaner to avoid activation, even though the command
                  ;; loop would deactivate the mark because we inserted text.
-                 (goto-char (prog1 (hypb:mark t)
+                 (goto-char (prog1 (mark t)
                               (set-marker (mark-marker)
                                           (point) (current-buffer))))
-                 (if (not (eolp)) (insert ?\n))))
+                 (unless (eolp)
+                   (insert ?\n))))
          (with-current-buffer mail-reply-buffer
            (hmail:msg-narrow))))))
 
diff --git a/hui.el b/hui.el
index 82cf5ad..23ac2a6 100644
--- a/hui.el
+++ b/hui.el
@@ -83,7 +83,8 @@
         (echo-keystrokes 1)
         old-key-text
         new-key-text)
-    (when old-key (setq old-key-text (key-description old-key)))
+    (when old-key
+      (setq old-key-text (key-description old-key)))
     (when (null new-key)
       (setq new-key
            (with-selected-window (minibuffer-window)
@@ -120,15 +121,14 @@ Default is the current button."
 Indicate button creation by delimiting and adding any necessary instance 
number to the button label.
 
 For programmatic creation, use `ebut:program' instead."
-  (interactive (list (and (marker-position (mark-marker))
-                         (region-beginning))
-                    (and (marker-position (mark-marker))
-                         (region-end))))
+  (interactive (list (when (use-region-p) (region-beginning))
+                    (when (use-region-p) (region-end))))
   (let ((default-lbl) lbl but-buf actype)
     (save-excursion
       (setq default-lbl (hui:hbut-label-default start end (not 
(called-interactively-p 'interactive)))
            lbl (hui:hbut-label default-lbl "ebut-create"))
-      (if (not (equal lbl default-lbl)) (setq default-lbl nil))
+      (unless (equal lbl default-lbl)
+       (setq default-lbl nil))
 
       (setq but-buf (if default-lbl (current-buffer) (hui:ebut-buf)))
       (hui:buf-writable-err but-buf "ebut-create")
@@ -179,7 +179,7 @@ be entirely within or entirely outside of an existing 
explicit button.  When
 region is within the button, the button is interactively modified.  Otherwise,
 a new button is created interactively with the region as the default label."
   (interactive)
-  (let ((m (marker-position (mark-marker)))
+  (let ((m (mark))
        (op action-key-depress-prev-point) (p (point)) (lbl-key))
     (if (and m (eq (marker-buffer m) (marker-buffer op))
             (< op m) (<= (- m op) (hbut:max-len))
@@ -602,7 +602,7 @@ Optional PROMPT string replaces the standard prompt of 
'Button label: '."
              'string))
 
 (defun hui:hbut-label-default (start end &optional skip-len-test)
-  "Return default label based on START and END region markers or points.
+  "Return default label based on START and END region markers or positions.
 Optional SKIP-LEN-TEST means don't limit label to (hbut:max-len) length.
 Return nil if START or END are invalid or if region fails length test.
 
diff --git a/hypb.el b/hypb.el
index 40f0147..0796ba0 100644
--- a/hypb.el
+++ b/hypb.el
@@ -512,8 +512,6 @@ then `locate-post-command-hook'."
                     current-prefix-arg))
   (locate search-string filter arg))
 
-(defalias 'hypb:mark #'mark)
-
 ;;;###autoload
 (defun hypb:map-plist (func plist)
   "Return result of applying FUNC of two args, key and value, to key-value 
pairs in PLIST, a property list."
diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el
index e56611b..3fa6bff 100644
--- a/kotl/kotl-mode.el
+++ b/kotl/kotl-mode.el
@@ -1540,7 +1540,7 @@ Leave point at the start of the cell."
       ;; Signal an error if couldn't move down at least 1 child level.
       (or child
          (progn
-           (goto-char (hypb:mark t))
+           (goto-char (mark t))
            (pop-mark)
            (error "(kotl-mode:down-level): No child level to which to 
move"))))))
 
@@ -1970,7 +1970,7 @@ If at tail cell already, do nothing and return nil."
       ;; Signal an error if couldn't move up at least 1 parent level.
       (or (and parent (not (eq parent 0)))
          (progn
-           (goto-char (hypb:mark t))
+           (goto-char (mark t))
            (pop-mark)
            (error "(kotl-mode:up-level): No parent level to which to move")
            )))))
@@ -2838,7 +2838,7 @@ Optionally, INDENT and region START and END may be given."
   (or (integerp indent) (setq indent (kcell-view:indent)))
   (save-excursion
     (save-restriction
-      (narrow-to-region (or start (point)) (or end (hypb:mark t)))
+      (narrow-to-region (or start (point)) (or end (mark t)))
       (goto-char (point-min))
       (let ((indent-str (concat "\n" (make-string indent ?\ ))))
        (while (search-forward "\n" t t)
@@ -2861,7 +2861,7 @@ Does not delete newline at end of line."
 (defun kotl-mode:exchange-point-and-mark ()
   "Put the mark where point is now, and point where the mark is now.
 This is like `exchange-point-and-mark', but doesn't activate the mark."
-  (goto-char (prog1 (hypb:mark t)
+  (goto-char (prog1 (mark t)
               (set-marker (mark-marker) (point) (current-buffer)))))
 
 (defun kotl-mode:indent-line (&optional arg)



reply via email to

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