Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interactive command, circe-send-command #50

Open
retroj opened this issue Mar 6, 2013 · 2 comments
Open

interactive command, circe-send-command #50

retroj opened this issue Mar 6, 2013 · 2 comments
Assignees
Milestone

Comments

@retroj
Copy link
Collaborator

retroj commented Mar 6, 2013

It would be nice to have an interactive command that prompts for a circe command in the minibuffer and executes it. Its purpose would be to protect the user from accidentally sending command text to irc channels due to typos, unwittingly broadcasting sensitive information like passwords and ignore/fool settings to the world. A good name for the command might be circe-send-command and a good key bindings might be C-c /. (Note that that key binding is in a group intended for use by minor modes, but it is not prohibited to bind it in a major mode, and doesn't seem to be used by any common minor modes.)

@ghost ghost assigned retroj Mar 6, 2013
@retroj
Copy link
Collaborator Author

retroj commented Mar 9, 2013

How do we like this?

(defun circe-send-command (command)
  (interactive "sCommand: ")
  (if (string-match "\\`[/ ]*\\(.+\\)\\'" command)
      (circe-chat-input (concat "/" (match-string 1 command)))
    (message "no command")))

(define-key circe-channel-mode-map (kbd "C-c /") 'circe-send-command)
(define-key circe-query-mode-map (kbd "C-c /") 'circe-send-command)
(define-key circe-server-mode-map (kbd "C-c /") 'circe-send-command)

@jorgenschaefer
Copy link
Collaborator

Looks good.

This somehow feels like we need a circe-general-map that's a parent of the three maps there.

@jorgenschaefer jorgenschaefer modified the milestones: Release v1.4, Release 1.5 Aug 26, 2014
@jorgenschaefer jorgenschaefer modified the milestones: Release v1.5, v1.6 Dec 12, 2014
jorgenschaefer added a commit that referenced this issue Feb 21, 2015
Circe now provides two new key maps. circe-base-mode-map is used by
all modes, server, channel and query, while circe-chat-mode-map is
used by both channel and query modes. This makes it easier for users
to define key bindings that work in all Circe buffers, or just in
channels and queries.

Addresses part of #50.
@jorgenschaefer jorgenschaefer modified the milestones: v1.7, v1.6 Feb 21, 2015
@jorgenschaefer jorgenschaefer modified the milestones: Backlog, v1.7 Apr 4, 2015
@jorgenschaefer jorgenschaefer modified the milestones: Backlog, v2.4 Aug 12, 2016
@jorgenschaefer jorgenschaefer modified the milestones: v2.4, v2.5 Feb 25, 2017
@jorgenschaefer jorgenschaefer modified the milestones: v2.5, v2.6 May 28, 2017
@jorgenschaefer jorgenschaefer modified the milestones: v2.6, v2.7 Sep 29, 2017
@jorgenschaefer jorgenschaefer modified the milestones: v2.7, v2.8 Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants