all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 29.2; ERC 5.6-git: Add a new customizable variable controlling how Erc displays spoilers
@ 2024-03-06 19:26 Fadi Moukayed
  2024-03-07 20:29 ` bug#69597: " J.P.
       [not found] ` <87v85xn5uv.fsf@neverwas.me>
  0 siblings, 2 replies; 10+ messages in thread
From: Fadi Moukayed @ 2024-03-06 19:26 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: emacs-erc

[-- Attachment #1: Type: text/plain, Size: 7090 bytes --]

Tags: patch
Severity: wishlist

Hi all,

I am submitting a trivial patch adding a simple customizable variable
(erc-format-spoilers) to Erc, allowing the user to control how Erc
displays spoiler text when mIRC formatting code interpretation is
enabled.
This idea for this patch was discussed with the Erc maintainers on
#erc, and was deemed to be useful enough to warrant a submission.

Note that this is my first attempt to contribute to GNU Emacs.

In GNU Emacs 29.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
 cairo version 1.16.0) of 2024-02-27 built on lcy02-amd64-095
Repository revision: ac89b1141a261b40ab5607f8d74209ede4c164cc
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12201001
System Description: Ubuntu 22.04.4 LTS

Configured using:
 'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
 --without-xaw3d --with-modules --with-cairo
 --with-native-compilation=aot --without-pgtk --with-xinput2
 --with-tree-sitter --with-json
 'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
 -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
 -isystem/build/emacs/stage/usr/include -O2'
 'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
 -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
 -isystem/build/emacs/stage/usr/include'
 'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
 -L/build/emacs/parts/emacs/install/usr/lib
 -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
 -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
 -L/build/emacs/stage/usr/lib''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM
GTK3 ZLIB

Important settings:
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: ERC

Minor modes in effect:
  erc-ring-mode: t
  erc-notifications-mode: t
  erc-nicks-mode: t
  erc-netsplit-mode: t
  erc-menu-mode: t
  erc-list-mode: t
  erc-irccontrols-mode: t
  erc-keep-place-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  erc-scrolltobottom-mode: t
  erc-imenu-mode: t
  erc-pcomplete-mode: t
  erc-button--phantom-users-mode: t
  erc-button-mode: t
  erc-fill-wrap-mode: t
  erc-fill-mode: t
  erc-stamp--date-mode: t
  erc-stamp--display-margin-mode: t
  erc-stamp-mode: t
  erc-bufbar-mode: t
  erc-track-mode: (t erc-nicks--setup-track-integration)
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-autojoin-mode: t
  erc-autoaway-mode: t
  recentf-mode: t
  pixel-scroll-precision-mode: t
  minibuffer-depth-indicate-mode: t
  global-whitespace-mode: t
  global-goto-address-mode: t
  goto-address-mode: t
  global-auto-revert-mode: t
  fido-vertical-mode: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  fido-mode: t
  erc-networks-mode: t
  desktop-save-mode: t
  windmove-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-mode: t
  line-number-mode: t
  visual-line-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Features:
(shadow sort mail-extr emacsbug mule-util hl-line network-stream nsm
transient edmacro kmacro display-line-numbers org-element org-persist
org-id org-refile avl-tree generator oc-basic ol-eww eww xdg url-queue
mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu
mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill
kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus
gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec
gnus-int gnus-range message sendmail yank-media puny rfc822 mml mml-sec
epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils
mailheader gnus-win gnus nnheader gnus-util text-property-search
mail-utils range mm-util mail-prsvr ol-docview doc-view jka-compr
image-mode exif dired dired-loaddefs ol-bibtex bibtex iso8601 ol-bbdb
ol-w3m ol-doi org-link-doi org ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote
org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval
org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs
find-func cal-menu calendar cal-loaddefs org-version org-compat org-macs
disp-table erc-ring erc-desktop-notifications notifications dbus xml
erc-nicks color erc-netsplit erc-menu erc-list erc-goodies erc-imenu
imenu erc-pcomplete time-date pcomplete comint ansi-osc ansi-color
erc-button erc-fill erc-stamp erc-status-sidebar erc-track erc-match
erc-join erc-autoaway leuven-dark-theme recentf tree-widget wid-edit
pixel-scroll cua-base ring mb-depth whitespace goto-addr thingatpt
autorevert filenotify icomplete erc format-spec erc-backend erc-networks
erc-common erc-compat compat erc-loaddefs desktop frameset cus-load
windmove site-start comp comp-cstr warnings icons rx cl-extra help-mode
erc-autoloads info compat-autoloads markdown-mode-autoloads package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache
json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs
cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 397463 44016)
 (symbols 48 27808 0)
 (strings 32 98182 4397)
 (string-bytes 1 3015974)
 (vectors 16 52846)
 (vector-slots 8 919020 87741)
 (floats 8 532 941)
 (intervals 56 4698 372)
 (buffers 984 16))

[-- Attachment #2: 0001-erc-format-spoilers-Add-a-new-custom.patch --]
[-- Type: text/x-patch, Size: 1378 bytes --]

From 4d3b8fa17a975d6f04ba2a6ef4865d3938a76315 Mon Sep 17 00:00:00 2001
From: "F. Moukayed" <smfadi+emacs@gmail.com>
Date: Wed, 6 Mar 2024 18:33:46 +0000
Subject: [PATCH] * lisp/erc/erc.el: (erc-format-spoilers): Add a new
 customizable variable controling how Erc displays spoilers

---
 lisp/erc/erc-goodies.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 7e30b10..211d704 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -645,6 +645,11 @@ emergency (message flood) it can be turned off to save processing time.  See
 
 (defcustom erc-interpret-mirc-color nil
   "If non-nil, ERC will interpret mIRC color codes."
+  :type 'boolean
+  :group 'erc-control-characters)
+
+(defcustom erc-format-spoilers nil
+  "If non-nil, ERC will format spoilers with `erc-spoiler-face'."
   :type 'boolean)
 
 (defcustom erc-beep-p nil
@@ -968,7 +973,7 @@ Also see `erc-interpret-controls-p' and `erc-interpret-mirc-color'."
   "Prepend properties from IRC control characters between FROM and TO.
 If optional argument STR is provided, apply to STR, otherwise prepend properties
 to a region in the current buffer."
-  (if (and fg bg (equal fg bg))
+  (if (and fg bg (equal fg bg) erc-format-spoilers)
       (progn
         (setq fg 'erc-spoiler-face
               bg nil)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-03-14  2:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-06 19:26 29.2; ERC 5.6-git: Add a new customizable variable controlling how Erc displays spoilers Fadi Moukayed
2024-03-07 20:29 ` bug#69597: " J.P.
     [not found] ` <87v85xn5uv.fsf@neverwas.me>
2024-03-08  9:07   ` Fadi Moukayed
     [not found]   ` <CAG_cVu_41w7VufKhJdaWEinQ-fyB22SULmyS0Gx9y+VgjGfYAQ@mail.gmail.com>
2024-03-08 15:05     ` J.P.
     [not found]     ` <87y1askbmr.fsf@neverwas.me>
2024-03-08 16:47       ` Fadi Moukayed
     [not found]       ` <CAG_cVu_Jcgk2KRbx7g_dZzsWjE-PQHJwCQuZGSYMV7ZFLZ4qEw@mail.gmail.com>
2024-03-09  4:43         ` J.P.
     [not found]         ` <87edckc8x2.fsf@neverwas.me>
2024-03-09 10:34           ` Fadi Moukayed
     [not found]           ` <CAG_cVu_gmo0Oc50y7pMTH8Nw_7JkWSMnOD9oZjYWLBiZa-GRfA@mail.gmail.com>
2024-03-09 16:06             ` J.P.
     [not found]             ` <87bk7n8k5k.fsf@neverwas.me>
2024-03-09 17:19               ` Fadi Moukayed
     [not found]               ` <CAG_cVu93JZ=Cx=io3BeYgarXT7FE5Mi5d+Js2Ju89uztgnKnLg@mail.gmail.com>
2024-03-14  2:17                 ` J.P.

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.