unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Cc: emacs-erc@gnu.org,ding@gnus.org
Subject: do use `this' syntax
Date: Sat, 24 Jun 2023 00:42:18 +0200	[thread overview]
Message-ID: <87a5wpx0l1.fsf@dataswamp.org> (raw)

Made a little improvement to `erc-cmd-SM' and wondered, is
there a canonical way to transform something into `something'?

And, does that syntax have a name?

It is used here and there in the Emacs world and at the very
least should get a pretty face, in ERC and some other places -
but notably not Gnus it would seem - it even turns into
a button which leads to documentation, if available.

So it is an Emacs-to-Emacs integration thing, and we should
care about those, since they are like bonus features
(easter eggs), a small reward to the brave people who use
Emacs for web browsing, mail, IRC, and all other such stuff,
because that's what makes Emacs exciting and fun, just as must
as the editing features makes it useful, the base.

Also see in this regard:

  https://dataswamp.org/~incal/emacs-init/erc/erc-man.el

But regardless of whatever, the main reason to do it is
obviously: it is actually cool and useful as well.

This command is tested and operational, but I thought I'd ask
about any existing convention before trying to push it to
replace the original `erc-cmd-SM' God willing ...

;;; -*- lexical-binding: t -*-
;;
;; this file:
;;   https://dataswamp.org/~incal/emacs-init/erc/erc-show-modes.el

(require 'erc)

(defun erc-modes-string ()
  (let ((modes '())
        (case-fold-search nil) )
    (dolist (var (apropos-internal "^erc-.*mode$"))
      (when (and (boundp var)
                 (symbol-value var) )
        (setq modes (cons (format "`%s'" (symbol-name var)) modes)) ))
    (mapconcat #'identity (sort modes #'string<) ", ") ))

(defun erc-cmd-SMO ()
  (erc-send-message (format "ERC modes: %s" (erc-modes-string)))
  t)

(provide 'erc-show-modes)

-- 
underground experts united
https://dataswamp.org/~incal




             reply	other threads:[~2023-06-23 22:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23 22:42 Emanuel Berg [this message]
2023-06-26 17:34 ` do use `this' syntax Andreas Schwab
2023-06-30 15:32   ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5wpx0l1.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=ding@gnus.org \
    --cc=emacs-erc@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).