emacs-circe / circe

Circe, a Client for IRC in Emacs
GNU General Public License v3.0
391 stars 51 forks source link

Moving between channels/servers #360

Closed 0x4d6165 closed 1 year ago

0x4d6165 commented 4 years ago

Hi! There doesn't seem to be instructions for basic operation of the client (keyboard shortcuts I mean)? Namely, I'm not sure how to move between channel/server buffers.

ghost commented 4 years ago

I use standard Emacs keyboard shortcuts. You can switch to another channel or server buffer with C-x b, or you can list all your active buffers with C-x C-b.

neeasade commented 4 years ago

Hello -- This is a function I have for jumping between channel and query buffers that might serve as inspo:

(defun ns/buffers-by-mode (&rest modes)
  (remove-if-not
    (fn (-contains-p modes (buffer-local-value 'major-mode <>)))
    (buffer-list)))

(defun ns/jump-irc ()
  (interactive)
  (let* ((irc-channels
           (mapcar 'buffer-name
             (ns/buffers-by-mode 'circe-channel-mode 'circe-query-mode)))
          (irc-nicks
            (if (-contains-p irc-channels (buffer-name))
              (circe-channel-nicks) '())))
    (if (eq (length irc-channels) 0)
      (message "connect to irc first!")
      (ivy-read "channel: " (append irc-channels irc-nicks)
        :action (lambda (option)
                  (interactive)
                  (if (-contains-p irc-nicks option)
                    (circe-command-QUERY option)
                    (when (get-buffer option)
                      (switch-to-buffer option)
                      (evil-goto-line)
                      (evil-scroll-line-to-bottom nil) ; nil -> the current line
                      )))))))

NB This is using:

Thaodan commented 4 years ago

Or use helm-circe https://github.com/lesharris/helm-circe

wasamasa commented 1 year ago

Closing since the question has been answered.