all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "andrés ramírez" <rrandresf@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 40914@debbugs.gnu.org
Subject: bug#40914: 27.0.91; erc send is failing on pretest
Date: Tue, 28 Apr 2020 15:48:32 +0000	[thread overview]
Message-ID: <86wo5z1ui7.fsf@gmail.com> (raw)
In-Reply-To: <83blnc2cy8.fsf@gnu.org>

Hi Eli.
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:


[...]


    Eli> I cannot reproduce this, so I guess this is triggered by
    Eli> something specific in your environment.

My enviroment is going to be shared below.

    Eli> What does the following yield in a session that fails like
    Eli> this?

    Eli>   M-: (erc-coding-system-for-target nil) RET

--8<---------------cut here---------------start------------->8---
utf-8
--8<---------------cut here---------------end--------------->8---

It is needed a couple of files. file 1:
--8<---------------cut here---------------start------------->8---
;-*- mode: emacs-lisp; encoding: utf-8; -*-
(require 'erc nil 'nonil4noerror)

(when (fboundp 'erc)
  (require 'erc-fill)
  (require 'erc-join)             ; autojoin support is implemented by erc-join.el
  (require 'erc-menu)
					;(require 'erc-sasl)
  (require 'erc-sasl "~/.emacs.d/lisp/erc-sasl.el" 'nonil4noerror)

  (when (boundp 'erc-sasl-server-regexp-list)
    (add-to-list 'erc-sasl-server-regexp-list "irc\\.freenode\\.net")
    )
  (erc-fill-mode t)
 
 (erc-autojoin-enable)           ; enable channel autojoin support, by default
  (setq
   erc-autojoin-channels-alist '(("freenode.net"
                                  ))
   erc-autojoin-timing 'ident
   erc-fill-function 'erc-fill-static
   erc-lurker-hide-list '("JOIN" "PART" "QUIT")
   erc-lurker-threshold-time 43200
                                        ;erc-prompt-for-nickserv-password nil)
   erc-server-reconnect-attempts 5
   erc-server-reconnect-timeout 3
   )

  (setq
   erc-nick-uniquifier "_"
   erc-kill-queries-on-quit t
   erc-server-coding-system (quote utf-8)
   )

  ;; check channels
  (erc-track-mode t)
  (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE" ))

  ;; don't show any of this
  (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))

  (require 'erc-services)

					; http://emacswiki.org/emacs/ErcChannelTracking
  (setq erc-format-query-as-channel-p t
        erc-track-priority-faces-only 'all
        erc-track-faces-priority-list '(erc-error-face
                                        erc-current-nick-face
                                        erc-keyword-face
                                        erc-nick-msg-face
                                        erc-direct-msg-face
                                        erc-dangerous-host-face
                                        erc-notice-face
                                        erc-prompt-face))
  (defun chacrape/erc-connect ()
    "Connect to IM networks using sasl on n800 do this from terminal."
    (interactive)
    (progn
					; could not connect to here cos of sasl
      (erc-select :server "irc.freenode.net" :port 6667 :nick "inka" :password "mypwd")
      )
    )

  ;; notify me when someone mentions me (4 now just 4 maemo n800)
  (require 'erc-match)
  (setq erc-keywords '("n800" "n900" "emacs" "h3" "mesa" "lima" "mali"))
  (setq erc-pals '("pal1" "pal1"))
	
  (erc-match-mode 1)
  (defun erc-global-notify (matched-type nick msg)
    (interactive)
    (let (
          (previous-content)
          )    

      (when (and (eq matched-type 'current-nick)
                 (not (string-match "^NickServ" nick))
                 (not (string-match "^[sS]erver" nick))
                                        ;(not (string-match "^.*has changed mode for .*" nick)) ;this line is not working
                 (not (string-match (format "^%s!" (erc-current-nick)) nick)))
                                        ;(pushover-notify (concat "ERC: " (buffer-name)) (concat "<" (car (split-string nick "!")) "> " message))
        
        (if (string-match "arm" system-configuration)
            (shell-command-to-string  "if  which espeak  > /dev/null 2>&1 ; then espeak -v es --stdout message\ message | gst-launch-1.0 -v fdsrc ! wavparse ! audioconvert ! autoaudiosink; fi")
          (noemacswiki/espeak "new message "))
        (setq previous-content (with-temp-buffer "ERC Notifications"
                                                 (buffer-string)))
        (display-message-or-buffer (concat "ERC: " (buffer-name) ": <" (car (split-string nick "!")) "> " previous-content msg) "ERC Notifications")
        )
      )
    )
  (add-hook 'erc-text-matched-hook 'erc-global-notify)

  ;;overwrite for sasl
  (defun erc-login ()
    "Perform user authentication at the IRC server."
    (erc-log (format "login: nick: %s, user: %s %s %s :%s"
		     (erc-current-nick)
		     (user-login-name)
		     (or erc-system-name (system-name))
		     erc-session-server
		     erc-session-user-full-name))
    (if erc-session-password
	(erc-server-send (format "PASS %s" erc-session-password))
      (message "Logging in without password"))
    (when (and (featurep 'erc-sasl) (erc-sasl-use-sasl-p))
      (erc-server-send "CAP REQ :sasl"))
    (erc-server-send (format "NICK %s" (erc-current-nick)))
    (erc-server-send
     (format "USER %s %s %s :%s"
	     ;; hacked - S.B.
	     (if erc-anonymous-login erc-email-userid (user-login-name))
	     "0" "*"
	     erc-session-user-full-name))
    (erc-update-mode-line))

  (provide 'my-erc-setup)
  )
--8<---------------cut here---------------end--------------->8---

file 2 comes from
{https://gitlab.com/psachin/erc-sasl/-/blob/master/erc-sasl.el}. It is
the one referenced by emacswiki.

Launch emacs with:
emacs -Q
M-x load-file erc-sasl.el
M-x find-file  file 1. 
 Change user and password on funct chacrape/erc-connect
M-x eval-buffer  from file 1. 
M-x toggle-debug-on-error
M-x chacrape/erc-connect
M-x erc-join-channel "any". type hi and press Return key; *Backtrace* should appear.

Best Regards







  reply	other threads:[~2020-04-28 15:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 22:22 bug#40914: 27.0.91; erc send is failing on pretest Andrés Ramírez
2020-04-28  9:10 ` Eli Zaretskii
2020-04-28 15:48   ` andrés ramírez [this message]
2020-04-28 16:10     ` Eli Zaretskii
2020-04-28 17:03       ` andrés ramírez
2020-04-28 17:25         ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=86wo5z1ui7.fsf@gmail.com \
    --to=rrandresf@gmail.com \
    --cc=40914@debbugs.gnu.org \
    --cc=eliz@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.
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.