all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23438: 24.5; ERC autojoin should use erc-autojoin-domain-only searching channel keys
@ 2016-05-03 21:59 Jim Crossley
  2016-05-03 22:38 ` Lars Ingebrigtsen
  2017-01-11  5:52 ` bug#23438: see also bug#25349 Tom Tromey
  0 siblings, 2 replies; 4+ messages in thread
From: Jim Crossley @ 2016-05-03 21:59 UTC (permalink / raw)
  To: 23438

[-- Attachment #1: Type: text/plain, Size: 7003 bytes --]

It's impossible to know what round-robin server you'll actually connect
to when connecting to chat.freenode.net, for example. Therefore, it's
impossible to include the correct host lines for channel keys in the
auth-source files. It would be far better to search for the channel keys
using the same name used to query erc-autojoin-channels-alist when
erc-autojoin-domain-only is non-nil. I have a patch that works, but I'm
not sure where to submit it.



In GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.18.9)
 of 2016-04-11 on buildvm-25.phx2.fedoraproject.org
Windowing system distributor `Fedora Project', version 11.0.11803000
System Description: Fedora release 23 (Twenty Three)

Configured using:
 `configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no build_alias=x86_64-redhat-linux-gnu
 host_alias=x86_64-redhat-linux-gnu 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
 -m64 -mtune=generic' LDFLAGS=-Wl,-z,relro'

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  hi-lock-mode: t
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  recentf-mode: t
  erc-log-mode: t
  erc-autoaway-mode: t
  elisp-slime-nav-mode: t
  paredit-mode: t
  idle-highlight-mode: t
  ido-ubiquitous-mode: t
  erc-spelling-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-netsplit-mode: t
  erc-hl-nicks-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-keep-place-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  eldoc-mode: t
  shell-dirtrack-mode: t
  global-auto-complete-mode: t
  auto-complete-mode: t
  global-hl-line-mode: t
  hl-line-mode: t
  delete-selection-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t

Recent messages:
Saving file /usr/share/emacs/24.5/lisp/erc/erc-join.el.gz...
File erc-join.el.gz is write-protected; try to save anyway? (y or n) n
basic-save-buffer-2: Attempt to save to a file which you aren't allowed to
write
Mark set [4 times]
Saving file /home/jim/src/.emacs.d/config/irc.el...
Wrote /home/jim/src/.emacs.d/config/irc.el
Annotating...
Redisplaying annotation...done (Spanned from 9681.2 to 123.8 days old)
Annotating... done
Mark saved where search started

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail vc-annotate log-view vc
vc-dispatcher tabify yasnippet debug eieio-opt speedbar sb-image ezimage
dframe misearch multi-isearch jka-compr view mule-util hi-lock vc-git
find-things-fast ffap url-parse linum magit-blame magit-stash
magit-bisect magit-remote magit-commit magit-sequence magit magit-apply
magit-wip magit-log magit-diff smerge-mode diff-mode magit-core
magit-autorevert autorevert filenotify magit-process magit-popup
magit-mode magit-git crm magit-section magit-utils git-commit log-edit
message idna rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log with-editor async-bytecomp async server
dash dired recentf tree-widget network-stream starttls tls erc-log
erc-autoaway flymake elisp-slime-nav help-mode paredit
idle-highlight-mode ido-ubiquitous ido-completing-read+ cus-edit smex
erc-spelling flyspell ispell notifications dbus xml erc-list erc-menu
erc-join erc-ring erc-networks erc-pcomplete erc-track erc-match
erc-netsplit erc-hl-nicks color erc-button erc-fill erc-stamp wid-edit
erc-goodies erc erc-backend erc-compat pp cl cider tramp-sh cider-debug
cider-browse-ns cider-inspector cider-mode cider-interaction etags
compile arc-mode archive-mode thingatpt cider-repl cider-resolve
cider-test cider-overlays cider-stacktrace cider-doc org-table org
org-macro org-footnote org-pcomplete org-list org-faces org-entities
noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat
org-macs org-loaddefs find-func cal-menu calendar cal-loaddefs
cider-grimoire url-vars cider-popup easy-mmode cider-eldoc eldoc
cider-client cider-common cider-util clojure-mode align imenu
nrepl-client tramp tramp-compat auth-source gnus-util mm-util mail-prsvr
password-cache tramp-loaddefs trampver shell pcomplete comint ansi-color
ring format-spec queue cider-compat seq seq-24 ewoc spinner windmove
epa-file epa derived epg auto-complete-config auto-complete cl-macs gv
popup cyberpunk-theme hl-line delsel cus-start cus-load finder-inf paren
edmacro kmacro saveplace ido eieio byte-opt bytecomp byte-compile
cl-extra cl-loaddefs cl-lib cconv eieio-core advice help-fns info
easymenu package epg-config time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 445819 44140)
 (symbols 48 45274 0)
 (miscs 40 482 2072)
 (strings 32 121056 5951)
 (string-bytes 1 3136335)
 (vectors 16 49396)
 (vector-slots 8 816276 26129)
 (floats 8 524 484)
 (intervals 56 7285 660)
 (buffers 960 62)
 (heap 1024 44605 3132))

[-- Attachment #2: Type: text/html, Size: 9058 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#23438: 24.5; ERC autojoin should use erc-autojoin-domain-only searching channel keys
  2016-05-03 21:59 bug#23438: 24.5; ERC autojoin should use erc-autojoin-domain-only searching channel keys Jim Crossley
@ 2016-05-03 22:38 ` Lars Ingebrigtsen
  2016-05-04 15:10   ` Jim Crossley
  2017-01-11  5:52 ` bug#23438: see also bug#25349 Tom Tromey
  1 sibling, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2016-05-03 22:38 UTC (permalink / raw)
  To: Jim Crossley; +Cc: 23438

Jim Crossley <jim@crossleys.org> writes:

> It's impossible to know what round-robin server you'll actually connect
> to when connecting to chat.freenode.net, for example. Therefore, it's
> impossible to include the correct host lines for channel keys in the
> auth-source files. It would be far better to search for the channel keys
> using the same name used to query erc-autojoin-channels-alist when
> erc-autojoin-domain-only is non-nil. I have a patch that works, but I'm
> not sure where to submit it.

Submit it here, please.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#23438: 24.5; ERC autojoin should use erc-autojoin-domain-only searching channel keys
  2016-05-03 22:38 ` Lars Ingebrigtsen
@ 2016-05-04 15:10   ` Jim Crossley
  0 siblings, 0 replies; 4+ messages in thread
From: Jim Crossley @ 2016-05-04 15:10 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 23438

[-- Attachment #1: Type: text/plain, Size: 3539 bytes --]

Here ya go, thanks!

- Jim

master ef554176256a318ce0bc4d3d3790a66e8ddd1fc0
Author:     Jim Crossley <jim@crossleys.org>
AuthorDate: Wed May 4 11:04:28 2016 -0400
Commit:     Jim Crossley <jim@crossleys.org>
CommitDate: Wed May 4 11:04:28 2016 -0400

Parent:     3d8b29b * lisp/vc/ediff-util.el: Use lexical-binding.
Merged:     master
Containing: master
Follows:    emacs-24.5-rc3-fixed (9210)

Use the domain name for auth-source-search

For the same reason we might use the domain name to query
erc-autojoin-channels-alist, we should use it for auth-source-search.
Otherwise, we'd need to include a line for every possible server to
which chat.freenode.net might redirect us in ~/.authinfo.gpg

1 file changed, 12 insertions(+), 9 deletions(-)
lisp/erc/erc-join.el | 21 ++++++++++++---------

modified   lisp/erc/erc-join.el
@@ -166,10 +166,17 @@ This function is run from
`erc-nickserv-identified-hook'."
   ;; Return nil to avoid stomping on any other hook funcs.
   nil)

+(defun erc-server-name (server)
+  "Use the server's domain name if option set"
+  (if (and erc-autojoin-domain-only
+   (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server))
+      (match-string 1 server)
+    server))
+
 (defun erc-server-join-channel (server channel)
   (let* ((secret (plist-get (nth 0 (auth-source-search
     :max 1
-    :host server
+    :host (erc-server-name server)
     :port "irc"
     :user channel))
     :secret))
@@ -186,11 +193,9 @@ This function is run from
`erc-nickserv-identified-hook'."
   (let* ((chnl (erc-response.contents parsed))
  (nick (car (erc-parse-user (erc-response.sender parsed))))
  (server (with-current-buffer (process-buffer proc)
-   (or erc-server-announced-name erc-session-server))))
+   (erc-server-name
+    (or erc-server-announced-name erc-session-server)))))
     (when (erc-current-nick-p nick)
-      (when (and erc-autojoin-domain-only
- (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server))
- (setq server (match-string 1 server)))
       (let ((elem (assoc server erc-autojoin-channels-alist)))
  (if elem
     (unless (member chnl (cdr elem))
@@ -209,11 +214,9 @@ This function is run from
`erc-nickserv-identified-hook'."
   (let* ((chnl (car (erc-response.command-args parsed)))
  (nick (car (erc-parse-user (erc-response.sender parsed))))
  (server (with-current-buffer (process-buffer proc)
-   (or erc-server-announced-name erc-session-server))))
+   (erc-server-name
+    (or erc-server-announced-name erc-session-server)))))
     (when (erc-current-nick-p nick)
-      (when (and erc-autojoin-domain-only
- (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server))
- (setq server (match-string 1 server)))
       (let ((elem (assoc server erc-autojoin-channels-alist)))
  (when elem
   (setcdr elem (delete chnl (cdr elem)))


On Tue, May 3, 2016 at 6:38 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Jim Crossley <jim@crossleys.org> writes:
>
> > It's impossible to know what round-robin server you'll actually connect
> > to when connecting to chat.freenode.net, for example. Therefore, it's
> > impossible to include the correct host lines for channel keys in the
> > auth-source files. It would be far better to search for the channel keys
> > using the same name used to query erc-autojoin-channels-alist when
> > erc-autojoin-domain-only is non-nil. I have a patch that works, but I'm
> > not sure where to submit it.
>
> Submit it here, please.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

[-- Attachment #2: Type: text/html, Size: 6432 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#23438: see also bug#25349
  2016-05-03 21:59 bug#23438: 24.5; ERC autojoin should use erc-autojoin-domain-only searching channel keys Jim Crossley
  2016-05-03 22:38 ` Lars Ingebrigtsen
@ 2017-01-11  5:52 ` Tom Tromey
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2017-01-11  5:52 UTC (permalink / raw)
  To: 23438

This sounds like bug#25349, which also has a patch and some other
commentary.  I don't know how to merge them, or I would.

Tom





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-11  5:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03 21:59 bug#23438: 24.5; ERC autojoin should use erc-autojoin-domain-only searching channel keys Jim Crossley
2016-05-03 22:38 ` Lars Ingebrigtsen
2016-05-04 15:10   ` Jim Crossley
2017-01-11  5:52 ` bug#23438: see also bug#25349 Tom Tromey

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.