help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

with-no-display-updates?


From: Emanuel Berg
Subject: with-no-display-updates?
Date: Sat, 14 May 2022 00:14:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

This is about ERC but actual question general Elisp so
gmane.emacs.help and not gmane.emacs.erc.general.

When I connect a lot of ERC buffers flickers by.
Sometime I think, ah, done, and type a couple of words "we're
in! OK, listen up everyone" and then it switches to another
buffer etc. Annoying ... and worse - unstylish!

Do everything in the background then show onee buffer of your
choise! Like when you eat a burger at zero-time downtime, you
always say first if the toothpicks should be oak or
mahogny, right?

As you see, I tried with `inhibit-redisplay' but didn't work.

(re-search-forward "DNC")

?

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

(require 'cl-lib)
(require 'erc)
(require 'erc-incal)
(require 'erc-kill)
(require 'erc-scroll)
(require 'string)

(defun erc-connect-to-server (&optional srv passwd)
  (interactive "sserver: \nspassword: ")
  (let ((inhibit-redisplay t)) ; DNC?
    (if (string-data-p srv)
        (if (string-data-p passwd)
            (erc-tls :server srv :passwd passwd)
          (erc-tls :server srv))
      (cl-loop for s in (erc-get-connect-servers) do
               (let ((server (car   s))
                     (pass   (cadr  s))
                     (conn   (caddr s)) )
                 (when conn
                   (if pass
                       (erc-tls :server server :password pass)
                     (erc-tls :server server) )))))))

(defun erc-goto-irc (&optional connect)
  (interactive "P")
  (let ((irc-buffer (car (erc-buffer-list))))
    (if (not irc-buffer)
      (if connect
          (erc-connect-to-server)
        (message "%s %s to connect"
         (substitute-command-keys "\\[universal-argument]")
         (substitute-command-keys (format "\\[%s]" this-command)) ))
      (switch-to-erc-buffer irc-buffer) )))

(provide 'erc-connect)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]