branch: externals/hyperbole
commit cbff24ec7dea10dbae876fdc46013945971e16fe
Author: Mats Lidell <[email protected]>
Commit: GitHub <[email protected]>

    Cleanup patch, use old functions (#303)
    
    From Stefan Monnier. Thanks.
---
 ChangeLog |  8 +++++++-
 hgnus.el  | 20 ++++++++------------
 hypb.el   |  9 ++-------
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b97bb1cd74..9c5405c6aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-06  Mats Lidell  <[email protected]>
+
+* Cleanup from Stefan Monnier. Thanks Stefan.
+* hypb.el (hypb:indirect-function): Use indirect-function directly.
+* hgnus.el: Use add-hook directly.
+
 2023-02-06  Bob Weiner  <[email protected]>
 
 * set.el (set:member): Optimize for common equality operators.
@@ -7,7 +13,7 @@
          (set:members): Keep members in stable order; previously returned in
     reverse order.
 
-2023-02-05  Bob Weiner  <[email protected]>
+2023-02-05  Mats Lidell  <[email protected]>-02-05  Bob Weiner  <[email protected]>
 
 * hsys-org.el (hsys-org-mode-function): Improve doc string.
 
diff --git a/hgnus.el b/hgnus.el
index 1610e6a718..5cba961b72 100644
--- a/hgnus.el
+++ b/hgnus.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    24-Dec-91 at 22:29:28
-;; Last-Mod:      9-May-22 at 00:01:49 by Bob Weiner
+;; Last-Mod:      5-Feb-23 at 23:40:25 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -107,17 +107,13 @@ as ARG means don't indent and don't delete any header 
fields."
 (if (fboundp 'hproperty:but-create)
     (var:append 'gnus-summary-prepare-hook '(hproperty:but-create)))
 
-;;; Try to setup comment addition as the first element of these hooks.
-(if (fboundp 'add-hook)
-    ;; Called from 'news-post-news' if prev unsent article exists and user
-    ;; says erase it.  Add a comment on Hyperbole button support.
-    (progn
-      (add-hook 'news-setup-hook #'smail:comment-add)
-      ;; Called from 'news-post-news' if no prev unsent article exists.
-      ;; Add a comment on Hyperbole button support.
-      (add-hook 'news-reply-mode-hook #'smail:comment-add))
-  (var:append 'news-setup-hook '(smail:comment-add))
-  (var:append 'news-reply-mode-hook '(smail:comment-add)))
+;; Try to setup comment addition as the first element of these hooks.
+;; Called from 'news-post-news' if prev unsent article exists and user
+;; says erase it.  Add a comment on Hyperbole button support.
+(add-hook 'news-setup-hook #'smail:comment-add)
+;; Called from 'news-post-news' if no prev unsent article exists.
+;; Add a comment on Hyperbole button support.
+(add-hook 'news-reply-mode-hook #'smail:comment-add)
 
 (provide 'hgnus)
 
diff --git a/hypb.el b/hypb.el
index 6f62074d1d..253a9545bb 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:     29-Jan-23 at 10:30:14 by Bob Weiner
+;; Last-Mod:      5-Feb-23 at 23:44:24 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -611,12 +611,7 @@ This will this install the Emacs helm package when needed."
 (defun hypb:indirect-function (obj)
   "Return the function at the end of OBJ's function chain.
 Resolves autoloadable function symbols properly."
-  (let ((func
-        (if (fboundp 'indirect-function)
-            (indirect-function obj)
-          (while (symbolp obj)
-            (setq obj (symbol-function obj)))
-          obj)))
+  (let ((func (indirect-function obj)))
     ;; Handle functions with autoload bodies.
     (if (and (symbolp obj) (listp func) (eq (car func) 'autoload))
        (let ((load-file (car (cdr func))))

Reply via email to