1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 15:52:00 -08:00
emacs/doc/misc
F. Jason Park 49bfea4386 Use templates for formatting chat messages in ERC
* doc/misc/erc.texi: Replace option `erc-format-nick-function' with
`erc-show-speaker-membership-status'.
* etc/ERC-NEWS: Mention shift to template-based speaker formatting.
Also mention in-buffer STATUSMSG support and various name changes and
new formatting-related options.
* lisp/erc/erc-backend.el (erc-format-privmessage): Remove forward
declaration.
(erc--determine-speaker-message-format-args): Add forward declaration.
(erc--statusmsg-target): New utility function for detecting whether
the current target is status-prefixed.
(erc-current-message-catalog): Move here from lisp/erc/erc.el.
(erc--message-speaker-catalog): New variable.
(erc--speaker-status-prefix-wanted-p): New variable specifically for
the function `erc-format-@nick' to signal it wants status-prefixes
prepended to the displayed nick.
(erc-server-PRIVMSG): Initialize `let'-bound value of
`erc--msg-prop-overrides' to a dummy `erc--tmp' property with a null
value that `erc-display-message' will "strip" before calling its
hooks.  Move away from the rather blunt symbol `msg' as a useful value
for `erc--msg'.  Instead, allow `erc-display-message' to assign the
most appropriate value based on context.  Also, bind the variable
`erc-current-message-catalog' to whatever the buffer's
`erc--message-speaker-catalog' happens to be.  Future internal modules
can set this to alternative catalogs as needed.  Additionally, detect
STATUSMSG prefixes on targets and inform the formatting logic of the
verdict.  Lastly, and most importantly, use the function
`erc--determine-speaker-message-format-args' instead of
`erc-format-privmessage' for message formatting.  Pass along the
returned "catalog key" and spec parameters to `erc-display-message'.
However, for NOTICEs, continue to render the string, as before, for
the two "echo notice" hooks.
* lisp/erc/erc-common.el (erc--ctcp-response): New "subsclass" of
`erc-response' for smuggling extra information to CTCP query handlers
in a mostly backwards-compatible way.  The same approach could be
taken with the "echo notice" hooks mentioned above.
* lisp/erc/erc-dcc.el (erc-dcc-chat-filter): Add `erc--spkr' and
`erc--speaker' properties even though these chat buffers are not
`erc-mode' buffers.
* lisp/erc/erc-fill.el (erc-fill--wrap-last-msg,
erc-fill--wrap-max-lull): Add doc strings.
(erc-fill--wrap-continued-message-p): Rework to look for `erc--spkr'-
`erc--msg' combinations as indicators of speaker continuity.
(erc-fill--wrap-rejigger-region): Remove reference to the no longer
relevant `erc-stamp-type'.  Instead, use the `erc--msg' property
combined with the `erc-timestamp' field to detect date stamps because
all are currently left-sided.
* lisp/erc/erc-stamp.el (erc-stamp--propertize-left-date-stamp): Don't
add superfluous `erc-stamp-type' property.
* lisp/erc/erc.el (erc--msg-props): Revise purpose and meaning of
`erc--msg' by removing possible value `msg', which was previously
meant to indicate that a message had a "speaker".  Instead, rely on
the separate `erc--spkr' property to convey this information, with
`erc--msg' now expressing a "type" or "role".
(erc--use-language-catalog-for-ctcp-action-p): New variable, a
compatibility switch to help transition from the `ACTION' entry of the
language catalog to the `ctcp-action' family of entries in the new
`-speaker' catalog.
(erc--ensure-spkr-prop): Update to include any passed-in environmental
overrides.
(erc--send-action-display): Restore pre-5.6 behavior when
compatibility flag enabled.  Otherwise, use new `-speaker' catalog for
formatting inserted message.
(erc--send-message-external): Overhaul to behave more faithfully in
mimicking a line submitted at the prompt of the current target buffer.
(erc--own-property-names): Remove `erc-stamp-type'.
(erc-ensure-target-buffer-on-privmsg): Add new choice variant for old
default behavior and change meaning of default to mean "except for
STATUSMSGs".  This option is newly revived for ERC 5.6.
(erc--message-speaker-statusmsg, erc--message-speaker-statusmsg-input,
erc--message-speaker-input, erc--message-speaker-input-chan-privmsg,
erc--message-speaker-input-chan-notice,
erc--message-speaker-input-query-privmsg,
erc--message-speaker-input-query-notice,
erc--message-speaker-chan-privmsg, erc--message-speaker-query-privmsg,
erc--message-speaker-chan-notice, erc--message-speaker-query-notice,
erc--message-speaker-ctcp-action,
erc--message-speaker-ctcp-action-input,
erc--message-speaker-ctcp-action-statusmsg,
erc--message-speaker-ctcp-action-statusmsg-input): New variables for
new `speaker' format-template catalog.
(erc--speakerize-nick): New helper function.
(erc--determine-speaker-message-format-args): New function to find the
appropriate format key from various contextual parameters.  Could
become the default of a function-valued variable for internal use.
(erc-show-speaker-membership-status): New option.
(erc-format-nick-function, erc-speaker-from-channel-member-function):
Declare former as an obsolete alias for the latter, and redefine
purpose slightly.
(erc-format-nick-function, erc-determine-speaker-from-user): Rename
former to latter and obsolete the old name.
(erc-format-nick, erc-determine-speaker-from-user): Rename former to
latter and obsolete old name.
(erc-format-@nick): Deprecate and adapt for use with new
template-based formatting paradigm.
(erc-format-my-nick): Move `erc-speaker' text prop toward head of
list, meaning it will end up beneath `font-lock-face' in the final
output.
(erc--format-speaker-input-message): New function to replace
`erc-format-my-nick' in-tree.
(erc-process-ctcp-query): Don't bind `erc--msg' to `msg'.  Instead,
rely on `erc-display-message' to set it to the current template key.
(erc-ctcp-query-ACTION): Prefer using formatting template, but attempt
to simulate pre-5.6 behavior when compatibility flag enabled.
(erc-display-msg): Use `erc--format-speaker-input-message' instead of
`erc-format-my-nick'.  Ignore `erc--msg-prop-overrides' with null
values.
(erc-current-message-catalog): Move to erc-backend.el.
* test/lisp/erc/erc-scenarios-base-statusmsg.el: New file.
* test/lisp/erc/erc-scenarios-stamp.el
(erc-scenarios-stamp--left/display-margin-mode): Expect format catalog
key instead of unhelpful `msg' as value of `erc--msg' prop.
* test/lisp/erc/erc-tests.el (erc-message): Render format template in
mock function and expect string in assertions.
(erc-tests--format-privmessage): New function, a helper for the
following test.
(erc-format-privmessage, erc--determine-speaker-message-format-args):
Rename former to latter and suppress deprecation warning.
(erc--determine-speaker-message-format-args/queries,
erc--determine-speaker-message-format-args/queries-as-channel): New
tests.
(erc-tests--format-my-nick): New helper function for the following
test.
(erc--format-speaker-input-message): New test.
* test/lisp/erc/resources/base/display-message/statusmsg.eld: New
file.  (Bug#67677)
; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld:
; Update.
; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld:
; Update.
2023-12-17 20:17:55 -08:00
..
auth.texi Replace duplicate text from epa.texi by a reference 2023-07-13 10:51:50 +03:00
autotype.texi Correct many instances of ``allows to'' 2023-09-10 09:33:50 +08:00
bovine.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
calc.texi Merge from origin/emacs-29 2023-12-09 07:25:21 -05:00
cc-mode.texi CC Mode: Add second anchor point to class-open and class-close 2023-11-24 10:03:33 +00:00
ChangeLog.1 Merge from origin/emacs-29 2023-12-10 10:35:54 -05:00
cl.texi Document cl-print.el in cl.texi. 2023-10-11 15:03:43 +00:00
dbus.texi Extend D-Bus doc and test 2023-11-24 16:34:26 +01:00
dired-x.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
doclicense.texi
ebrowse.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ede.texi ; Fix Texinfo warnings 2023-10-22 12:21:08 +03:00
ediff.texi Doc fix; more consistently refer to "text terminals" 2023-10-01 13:58:53 +02:00
edt.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
efaq-w32.texi Doc fixes for obsolete functions and variables 2023-09-02 15:37:08 +02:00
efaq.texi ; Fix last change in the FAQ 2023-11-04 17:29:24 +02:00
eglot.texi Merge from origin/emacs-29 2023-12-09 07:25:21 -05:00
eieio.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
emacs-gnutls.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
emacs-mime.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
epa.texi Merge from origin/emacs-29 2023-12-09 07:25:21 -05:00
erc.texi Use templates for formatting chat messages in ERC 2023-12-17 20:17:55 -08:00
ert.texi ; Fix typos 2023-12-10 13:22:04 +01:00
eshell.texi Add option eshell-history-append 2023-12-07 11:32:29 +00:00
eudc.texi Fix some Texinfo markup in manuals 2023-06-13 15:29:06 +01:00
eww.texi ; Fix documentation of last change 2023-08-20 11:48:03 +03:00
flymake.texi Make obsolete flymake proc less prominent in manual 2023-09-17 15:36:35 +02:00
forms.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
gnus-faq.texi Delete redundant question from Gnus FAQ 2023-02-18 13:35:37 +01:00
gnus.texi ; Remove out-of-date documentation about Gnus delayed articles 2023-12-16 17:29:30 -08:00
gpl.texi
htmlfontify.texi ; Fix last change: remove unused @anchor. 2023-01-15 11:52:46 +02:00
idlwave.texi Correct many instances of ``allows to'' 2023-09-10 09:33:50 +08:00
ido.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
info.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
mairix-el.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Makefile.in ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
message.texi Allow X-Message-SMTP-Method to include more MTAs 2023-05-06 09:05:28 +08:00
mh-e.texi Delete references to gnuserv 2023-09-02 02:47:46 +02:00
modus-themes.org Merge from origin/emacs-29 2023-12-10 10:35:54 -05:00
newsticker.texi Run newsticker's ticker only periodically (bug#59856) 2023-01-16 09:20:11 +01:00
nxml-mode.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
octave-mode.texi Merge from origin/emacs-29 2023-10-28 04:56:22 -04:00
org-setup.org ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
org.org Merge from origin/emacs-29 2023-11-11 05:31:52 -05:00
pcl-cvs.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
pgg.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
rcirc.texi Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
reftex.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
remember.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
sasl.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
sc.texi Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
sem-user.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
semantic.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ses.texi Correct many instances of ``allows to'' 2023-09-10 09:33:50 +08:00
sieve.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
smtpmail.texi ; Improve SMTPmail documentation about OAuth2 2023-08-24 21:06:26 +03:00
speedbar.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
srecode.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
texinfo.tex Update from Gnulib by running admin/merge-gnulib 2023-08-12 12:57:35 -07:00
todo-mode.texi Fix and improve setting priority of todo-mode items (bug#64433) 2023-07-03 14:19:41 +02:00
tramp.texi dired-listing-switches handles connection-local values if exist 2023-12-10 12:26:38 +01:00
trampver.texi Update Tramp version (don't merge with master) 2023-10-19 16:28:26 +02:00
transient.texi Introduce menus beneath new chapters in the Transient menu 2023-12-11 11:39:00 +08:00
url.texi Never send user email address in HTTP requests 2023-12-17 10:00:22 +01:00
use-package.texi Correct typos in the manuals 2023-10-26 19:46:32 +08:00
vhdl-mode.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
vip.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
viper.texi Doc fix; more consistently refer to "text terminals" 2023-10-01 13:58:53 +02:00
vtable.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
widget.texi ; Fix typos 2023-12-03 23:31:30 +01:00
wisent.texi ; Fix Texinfo warnings 2023-10-22 12:21:08 +03:00
woman.texi ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00