]> git.eshelyaron.com Git - emacs.git/commitdiff
Reserve negative depth range for ERC's insert hooks
authorF. Jason Park <jp@neverwas.me>
Fri, 19 Jan 2024 17:11:37 +0000 (09:11 -0800)
committerEshel Yaron <me@eshelyaron.com>
Thu, 25 Jan 2024 18:04:46 +0000 (19:04 +0100)
* etc/ERC-NEWS: Mention additional reserved depth range of -80 to -20.
Also mention possibly having to cycle module activation state after
updating options.
* lisp/erc/erc-goodies.el (erc-irccontrols-mode,
erc-irccontrols-enable): Add `erc-controls-highlight' to
`erc-insert-modify-hook' at depth -50.
* lisp/erc/erc.el (erc-insert-modify-hook): Mention negative
hook-depth range in doc string.

(cherry picked from commit d85f561da03cd4705341a5a73f5c643f778e0f35)

etc/ERC-NEWS
lisp/erc/erc-goodies.el
lisp/erc/erc.el

index 6cfa704d995d403377777cc5034a7470ea7f8068..b673d36220ac876746248d1145de5e8b5f9e2013 100644 (file)
@@ -325,6 +325,15 @@ to enable the displaying of status prefixes on the speaker nicks of
 incoming chat messages.  Prefixes on your speaker nick for outgoing
 chat messages continue to always be present.
 
+** Updating user options requires cycling associated minor modes.
+During a live ERC session, you may need to disable and re-enable a
+module's minor mode via 'M-x erc-foo-mode RET' or similar before an
+option's updated value takes effect.  This primarily impacts new
+options introduced by this release and existing ones whose behavior
+has changed in some way.  At present, ERC does not perform this step
+automatically on your behalf, even if a change was made in a
+'Custom-mode' buffer or via 'setopt'.
+
 ** Miscellaneous UX changes.
 Some minor quality-of-life niceties have finally made their way to
 ERC.  For example, fool visibility has become togglable with the new
@@ -387,8 +396,10 @@ when present, at depths beginning at 20 and ending below 80.  Of most
 interest to module authors is the new relative positioning of the
 first three, which have been rotated leftward with respect to their
 previous places in recent ERC versions (fill, button, match ,stamp).
+A similar designated range from -80 to -20 also exists and is home to
+the function 'erc-controls-highlight'.
 
-ERC also provisionally reserves the same depth interval for
+ERC also provisionally reserves the same depth intervals for
 'erc-insert-pre-hook' and possibly other, similar hooks, but will
 continue to modify non-ERC hooks locally whenever possible, especially
 in new code.
index 23589657b2df50b20bfd8b0fda66af7f6b656abc..bf361ff91fb9456b6e4b24fd22bb90845ed4a14d 100644 (file)
@@ -822,7 +822,7 @@ The value `erc-interpret-controls-p' must also be t for this to work."
 ;;;###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)
+  ((add-hook 'erc-insert-modify-hook #'erc-controls-highlight -50)
    (add-hook 'erc-send-modify-hook #'erc-controls-highlight)
    (erc--modify-local-map t "C-c C-c" #'erc-toggle-interpret-controls))
   ((remove-hook 'erc-insert-modify-hook #'erc-controls-highlight)
index 767a693a52e028d33fe4d6a49ac6b6cb3d4abb5a..e9d6099317f39a5346d3761776b21dbafd3c07f3 100644 (file)
@@ -1278,8 +1278,8 @@ of `erc-insert-this' is t.
 
 ERC runs this hook with the buffer narrowed to the bounds of the
 inserted message plus a trailing newline.  Built-in modules place
-their hook members at depths between 20 and 80, with those from
-the stamp module always running last.  Use the functions
+their hook members in two depth ranges: the first between -80 and
+-20 and the second between 20 and 80.  Use the functions
 `erc-find-parsed-property' and `erc-get-parsed-vector' to locate
 and extract the `erc-response' object for the inserted message."
   :group 'erc-hooks