gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / patches / emacs-hyperbole-toggle-messaging.patch
CommitLineData
7d80d795
LJ
1From 6d5c587ec719e3309077c7d637b03b13db65c047 Mon Sep 17 00:00:00 2001
2From: Joseph LaFreniere <joseph@lafreniere.xyz>
3Date: Fri, 12 Jul 2019 12:43:46 -0500
4Subject: [PATCH] Move definition of hyperbole-toggle-messaging to hsettings
5
6---
7 hsettings.el | 25 +++++++++++++++++++++++++
8 hyperbole.el | 26 --------------------------
9 2 files changed, 25 insertions(+), 26 deletions(-)
10
11diff --git a/hsettings.el b/hsettings.el
12index 6cdd1b8..9632067 100644
13--- a/hsettings.el
14+++ b/hsettings.el
15@@ -163,6 +163,31 @@ package to display search results."
16 search-term)))
17 (user-error "(Hyperbole): Invalid web search service `%s'" service-name))))
18
19+;;;###autoload
20+(defun hyperbole-toggle-messaging (&optional arg)
21+ "Toggle Hyperbole support for explicit buttons in mail and news buffers.
22+Toggles the boolean variable `inhibit-hyperbole-messaging’ and either
23+adds hooks (nil value) or removes them (t value).
24+
25+With optional prefix ARG > 0, enables support. If ARG <= 0,
26+disables/inhibits support."
27+ (interactive "P")
28+ (setq inhibit-hyperbole-messaging (if (null arg)
29+ (not inhibit-hyperbole-messaging)
30+ (<= (prefix-numeric-value arg) 0)))
31+ (if inhibit-hyperbole-messaging
32+ (var:remove-all)
33+ (var:append-all)
34+ ;; Add any hooks that were skipped when inhibit-hyperbole-messaging
35+ ;; was nil.
36+ (cond ((boundp 'hyperbole-loading))
37+ ((not after-init-time)
38+ (add-hook 'after-init-hook (lambda () (load "hyperbole"))))
39+ (t (load "hyperbole"))))
40+ (if (called-interactively-p 'interactive)
41+ (message "Hyperbole messaging button support is %s"
42+ (if inhibit-hyperbole-messaging "disabled" "enabled"))))
43+
44 (defcustom inhibit-hyperbole-messaging t
45 "*Determines whether Hyperbole supports explicit buttons in mail and news buffers.
46 The default of t means disable such support (work remains to
47diff --git a/hyperbole.el b/hyperbole.el
48index 4aa427d..872dbaf 100644
49--- a/hyperbole.el
50+++ b/hyperbole.el
51@@ -121,32 +121,6 @@
52 t)))
53 (error "(Hyperbole): Startup failure: `hyperb:dir' must be manually added to `load-path' to fix.")))
54
55-;; This must be defined before the defcustom `inhbit-hyperbole-messaging'.
56-;;;###autoload
57-(defun hyperbole-toggle-messaging (&optional arg)
58- "Toggle Hyperbole support for explicit buttons in mail and news buffers.
59-Toggles the boolean variable `inhibit-hyperbole-messaging’ and either
60-adds hooks (nil value) or removes them (t value).
61-
62-With optional prefix ARG > 0, enables support. If ARG <= 0,
63-disables/inhibits support."
64- (interactive "P")
65- (setq inhibit-hyperbole-messaging (if (null arg)
66- (not inhibit-hyperbole-messaging)
67- (<= (prefix-numeric-value arg) 0)))
68- (if inhibit-hyperbole-messaging
69- (var:remove-all)
70- (var:append-all)
71- ;; Add any hooks that were skipped when inhibit-hyperbole-messaging
72- ;; was nil.
73- (cond ((boundp 'hyperbole-loading))
74- ((not after-init-time)
75- (add-hook 'after-init-hook (lambda () (load "hyperbole"))))
76- (t (load "hyperbole"))))
77- (if (called-interactively-p 'interactive)
78- (message "Hyperbole messaging button support is %s"
79- (if inhibit-hyperbole-messaging "disabled" "enabled"))))
80-
81 (defgroup hyperbole-koutliner nil
82 "Hyperbole multi-level autonumbered outliner customizations."
83 :group 'hyperbole)
84--
852.22.0
86