summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-goodies.el
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2023-01-19 21:07:27 -0800
committerF. Jason Park <jp@neverwas.me>2023-04-08 14:23:51 -0700
commit5011554529bb874390edfc3060aee960b38e5aff (patch)
treee4b2d72b6c29abe645005b05a10fd8e022f3f96b /lisp/erc/erc-goodies.el
parent3d81ecf0a95374793f70a19da81ea75da84d0be1 (diff)
downloademacs-5011554529bb874390edfc3060aee960b38e5aff.tar.gz
Don't require erc-goodies in erc.el
* lisp/erc/erc-goodies.el: Obviate the need for forward declarations by requiring `erc'. Add minor-mode autoloads for `scrolltobottom', `readonly', `move-to-prompt', `keep-place', `noncommands', `irccontrols', `smiley', and `unmorse'. Add Local variables footer with `generated-autoload-file'. (erc-controls-strip): Autoload this function. * lisp/erc/erc-ibuffer.el: Require `erc-goodies' for `erc-control-interpret'. The justification for the blanket `require' is this module isn't a member of `erc-modules' by default. * lisp/erc/erc-page.el: (erc-ctcp-query-PAGE): Require `erc-goodies' and put forward declaration for `erc-control-interpret' atop file. * lisp/erc/erc-speedbar.el: Require `erc-goodies' for the same reason as erc-ibuffer.el. * lisp/erc/erc.el: Remove `require' for `erc-goodies' at end of file and `pp' at top of file because `pp-to-string' is autoloaded on Emacs 27. Also remove `require's for `thingatpt', `time-date', and `iso8601'. They're all used sparingly and the latter two have only been around for one major release, so their removal likely won't cause much churn. And `thingatpt' already has a call-site `require', so the top-level one is redundant, but autoload `word-at-point' anyway for the benefit of third-party libraries like `hl-nicks'. Also wrap local loaddefs `require' call in `eval-and-compile'. (erc--read-time-period): Require dependencies. (Bug#60954.)
Diffstat (limited to 'lisp/erc/erc-goodies.el')
-rw-r--r--lisp/erc/erc-goodies.el28
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 05a21019042..7ca155ef9d0 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -29,23 +29,10 @@
;;; Code:
-;;; Imenu support
-
(eval-when-compile (require 'cl-lib))
-(require 'erc-common)
-
(defvar erc-controls-highlight-regexp)
(defvar erc-controls-remove-regexp)
-(defvar erc-input-marker)
-(defvar erc-insert-marker)
-(defvar erc-server-process)
-(defvar erc-modules)
-(defvar erc-log-p)
-
-(declare-function erc-buffer-list "erc" (&optional predicate proc))
-(declare-function erc-error "erc" (&rest args))
-(declare-function erc-extract-command-from-line "erc" (line))
-(declare-function erc-beg-of-input-line "erc" nil)
+(require 'erc)
(defun erc-imenu-setup ()
"Setup Imenu support in an ERC buffer."
@@ -65,6 +52,7 @@ argument to `recenter'."
:group 'erc-display
:type '(choice integer (const nil)))
+;;;###autoload(autoload 'erc-scrolltobottom-mode "erc-goodies" nil t)
(define-erc-module scrolltobottom nil
"This mode causes the prompt to stay at the end of the window."
((add-hook 'erc-mode-hook #'erc-add-scroll-to-bottom)
@@ -116,6 +104,7 @@ variable `erc-input-line-position'."
(recenter (or erc-input-line-position -1)))))))
;;; Make read only
+;;;###autoload(autoload 'erc-readonly-mode "erc-goodies" nil t)
(define-erc-module readonly nil
"This mode causes all inserted text to be read-only."
((add-hook 'erc-insert-post-hook #'erc-make-read-only)
@@ -131,6 +120,7 @@ Put this function on `erc-insert-post-hook' and/or `erc-send-post-hook'."
(put-text-property (point-min) (point-max) 'rear-nonsticky t))
;;; Move to prompt when typing text
+;;;###autoload(autoload 'erc-move-to-prompt-mode "erc-goodies" nil t)
(define-erc-module move-to-prompt nil
"This mode causes the point to be moved to the prompt when typing text."
((add-hook 'erc-mode-hook #'erc-move-to-prompt-setup)
@@ -155,6 +145,7 @@ Put this function on `erc-insert-post-hook' and/or `erc-send-post-hook'."
(add-hook 'pre-command-hook #'erc-move-to-prompt nil t))
;;; Keep place in unvisited channels
+;;;###autoload(autoload 'erc-keep-place-mode "erc-goodies" nil t)
(define-erc-module keep-place nil
"Leave point above un-viewed text in other channels."
((add-hook 'erc-insert-pre-hook #'erc-keep-place))
@@ -193,6 +184,7 @@ Put this function on `erc-insert-post-hook' and/or `erc-send-post-hook'."
If a command's function symbol is in this list, the typed command
does not appear in the ERC buffer after the user presses ENTER.")
+;;;###autoload(autoload 'erc-noncommands-mode "erc-goodies" nil t)
(define-erc-module noncommands nil
"This mode distinguishes non-commands.
Commands listed in `erc-insert-this' know how to display
@@ -381,6 +373,7 @@ The value `erc-interpret-controls-p' must also be t for this to work."
(intern (concat "fg:erc-color-face" (number-to-string n))))
(t (erc-log (format " Wrong color: %s" n)) 'default))))
+;;;###autoload(autoload 'erc-irccontrols-mode "erc-goodies" nil t)
(define-erc-module irccontrols nil
"This mode enables the interpretation of IRC control chars."
((add-hook 'erc-insert-modify-hook #'erc-controls-highlight)
@@ -440,6 +433,7 @@ See `erc-interpret-controls-p' and `erc-interpret-mirc-color' for options."
s))
(t s)))))
+;;;###autoload
(defun erc-controls-strip (str)
"Return a copy of STR with all IRC control characters removed."
(when str
@@ -553,6 +547,7 @@ Else interpretation is turned off."
(if erc-interpret-controls-p "ON" "OFF")))
;; Smiley
+;;;###autoload(autoload 'erc-smiley-mode "erc-goodies" nil t)
(define-erc-module smiley nil
"This mode translates text-smileys such as :-) into pictures.
This requires the function `smiley-region', which is defined in
@@ -569,6 +564,7 @@ This function should be used with `erc-insert-modify-hook'."
(smiley-region (point-min) (point-max))))
;; Unmorse
+;;;###autoload(autoload 'erc-unmorse-mode "erc-goodies" nil t)
(define-erc-module unmorse nil
"This mode causes morse code in the current channel to be unmorsed."
((add-hook 'erc-insert-modify-hook #'erc-unmorse))
@@ -611,3 +607,7 @@ servers. If called from a program, PROC specifies the server process."
(provide 'erc-goodies)
;;; erc-goodies.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
+;; End: