emacs-diffs
[Top][All Lists]
Advanced

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

feature/rcirc-update 1e13786 5/7: Restore rcirc-target if possible


From: Philip Kaludercic
Subject: feature/rcirc-update 1e13786 5/7: Restore rcirc-target if possible
Date: Tue, 14 Sep 2021 16:10:32 -0400 (EDT)

branch: feature/rcirc-update
commit 1e1378699c9cc7f2de0fd679149379522bcc3c6d
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Restore rcirc-target if possible
    
    * rcirc.el (rcirc-process-message): Extract target from buffer name
---
 lisp/net/rcirc.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 579a350..5537ddc 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1620,6 +1620,11 @@ The argument JUSTIFY is passed on to `fill-region'."
 
 (defun rcirc-process-message (line)
   "Process LINE as a message to be sent."
+  (when (and (null rcirc-target)
+             (string-match
+              (rx bos (group (+? nonl)) "@" (+ nonl) eos)
+              (buffer-name)))
+    (setq rcirc-target (match-string 1 (buffer-name))))
   (if (not rcirc-target)
       (message "Not joined (no target)")
     (delete-region rcirc-prompt-end-marker (point))



reply via email to

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