Futzing about trying to see what's wrong with my hooks
[website] / SYinits / 16-riece.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <!-- Created by htmlize-1.34 in css mode. -->
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5   <head>
6     <title>16-riece.el</title>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8     <meta name="author" content="Steve Youngs" />
9     <meta name="owner" content="steve@sxemacs.org" />
10     <style type="text/css">
11     <!--
12       body {
13         color: #ffffff;
14         background-color: #000000;
15       }
16       .comment {
17         /* font-lock-comment-face */
18         color: #87ceeb;
19       }
20       .doc-string {
21         /* font-lock-doc-string-face */
22         color: #32cd32;
23       }
24       .function-name {
25         /* font-lock-function-name-face */
26         color: #ffff00;
27         font-weight: bold;
28       }
29       .keyword {
30         /* font-lock-keyword-face */
31         color: #fa8072;
32       }
33       .reference {
34         /* font-lock-reference-face */
35         color: #40e0d0;
36       }
37       .string {
38         /* font-lock-string-face */
39         color: #00cd00;
40       }
41       .type {
42         /* font-lock-type-face */
43         color: #1e90ff;
44       }
45       .variable-name {
46         /* font-lock-variable-name-face */
47         color: #ffdab9;
48       }
49       .warning {
50         /* font-lock-warning-face */
51         color: #ff0000;
52         font-weight: bold;
53       }
54
55       a {
56         color: #FF0000;
57         background-color: inherit;
58         font: inherit;
59         font-weight: bold;
60         text-decoration: underline;
61       }
62       a:hover {
63         color: #FFFFFF;
64         background-color: #FD00FD;
65         text-decoration: underline;
66       }
67       .img a:hover {
68         background-color: #000000;
69         text-decoration: none;
70       }
71     -->
72     </style>
73   </head>
74   <body>
75     <pre>
76 <span class="comment">;; 16-riece.el --- Riece (IRC) Settings
77 </span>
78 <span class="comment">;; Copyright (C) 2007 - 2020 Steve Youngs
79 </span>
80 <span class="comment">;;     Author: Steve Youngs &lt;<a href="mailto:steve&#64;sxemacs.org">steve&#64;sxemacs.org</a>&gt;
81 ;; Maintainer: Steve Youngs &lt;<a href="mailto:steve&#64;sxemacs.org">steve&#64;sxemacs.org</a>&gt;
82 ;;    Created: &lt;2007-12-02&gt;
83 ;; Time-stamp: &lt;Thursday Apr  9, 2020 19:11:39 steve&gt;
84 ;;   Download: &lt;<a href="https://downloads.sxemacs.org/SYinits">https://downloads.sxemacs.org/SYinits</a>&gt;
85 ;;   HTMLised: &lt;<a href="https://www.sxemacs.org/SYinits/16-riece.html">https://www.sxemacs.org/SYinits/16-riece.html</a>&gt;
86 ;;   Git Repo: git clone https://git.sxemacs.org/syinit
87 ;;   Keywords: init, compile
88 </span>
89 <span class="comment">;; This file is part of SYinit
90 </span>
91 <span class="comment">;; Redistribution and use in source and binary forms, with or without
92 ;; modification, are permitted provided that the following conditions
93 ;; are met:
94 ;;
95 ;; 1. Redistributions of source code must retain the above copyright
96 ;;    notice, this list of conditions and the following disclaimer.
97 ;;
98 ;; 2. Redistributions in binary form must reproduce the above copyright
99 ;;    notice, this list of conditions and the following disclaimer in the
100 ;;    documentation and/or other materials provided with the distribution.
101 ;;
102 ;; 3. Neither the name of the author nor the names of any contributors
103 ;;    may be used to endorse or promote products derived from this
104 ;;    software without specific prior written permission.
105 ;;
106 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
107 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
108 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
109 ;; DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
110 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
111 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
112 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
113 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
114 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
115 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
116 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
117 </span>
118 <span class="comment">;;; Commentary:
119 ;;
120 ;;   My Riece settings.
121 ;;
122 ;;   Riece is a very nice IRC client for emacs.  Unlike ERC which
123 ;;   tries to be like "traditional" IRC clients, Riece is much more
124 ;;   emacs like.
125 ;;
126 </span>
127 <span class="comment">;;; Credits:
128 ;;
129 ;;   The HTML version of this file was created with Hrvoje Niksic's
130 ;;   htmlize.el which is part of the XEmacs "text-modes" package.
131 ;;
132 </span>
133 <span class="comment">;;; Todo:
134 ;;
135 ;;     
136 </span>
137 <span class="comment">;;; Code:
138 </span>(<span class="keyword">require</span> '<span class="reference">riece-options</span>)
139 (<span class="keyword">require</span> '<span class="reference">riece-biff</span>)
140 (<span class="keyword">require</span> '<span class="reference">riece-log</span>)
141 (<span class="keyword">require</span> '<span class="reference">riece</span>)
142
143 <span class="comment">;; For flyspell in the command buffer.  See `</span><span class="comment"><span class="reference">sy-riece-command-mode-hooks</span></span><span class="comment">'.
144 </span>(or (<span class="keyword">featurep</span> '<span class="reference">overlay</span>)
145     (ignore-errors (<span class="keyword">require</span> '<span class="reference">overlay</span>)))
146 (or (<span class="keyword">featurep</span> '<span class="reference">flyspell</span>)
147     (ignore-errors (<span class="keyword">require</span> '<span class="reference">flyspell</span>)))
148
149 <span class="comment">;; Misc setq's
150 </span>(setq riece-alias-percent-hack-mask "<span class="doc-string">*.net</span>"
151       riece-biff-check-channels '("<span class="string">#sxemacs</span>"
152                                   "<span class="string">#emchat</span>"
153                                   "<span class="string">#xemacs</span>")
154       riece-channel-buffer-mode t
155       riece-ctlseq-colors
156             '("<span class="string">white</span>" "<span class="string">black</span>" "<span class="string">blue</span>" "<span class="string">green</span>" "<span class="string">red</span>" "<span class="string">brown</span>"
157               "<span class="string">purple</span>" "<span class="string">orange</span>" "<span class="string">yellow</span>" "<span class="string">lightgreen</span>" "<span class="string">darkcyan</span>"
158               "<span class="string">cyan</span>" "<span class="string">lightblue</span>" "<span class="string">HotPink</span>" "<span class="string">grey35</span>" "<span class="string">grey</span>")
159       riece-default-channel-binding nil
160       riece-default-coding-system 'utf-8
161       riece-desktop-notify-always t
162       riece-gather-channel-modes t
163       riece-hide-list '(joins parts quits)
164       riece-ignore-discard-message nil
165       riece-keywords
166       '("<span class="string">Bastard</span>" "<span class="string">EMchat</span>" "<span class="string">eMoney</span>" "<span class="string">Gnus</span>" "<span class="string">LFS</span>" "<span class="string">LinuxFromScratch</span>"
167         "<span class="string">LineageOS</span>" "<span class="string">Lineage</span>" "<span class="string">Linux From Scratch</span>" "<span class="string">Riece</span>" "<span class="string">SteveYoungs</span>"
168         "<span class="string">SXEmacs</span>" "<span class="string">XEmacs</span>" "<span class="string">Youngs</span>" "<span class="string">Steve Youngs</span>" "<span class="string">SYWriting</span>"
169         "<span class="string">SY Writing</span>" "<span class="string">Gaiman</span>" "<span class="string">Neil Gaiman</span>" "<span class="string">xwem</span>")
170       riece-layout '"<span class="doc-string">bottom-right</span>"
171       riece-retry-with-new-nickname t
172       riece-server-alist
173       '(("<span class="string">roddenberry.freenode.net</span>" <span class="reference">:host</span> "<span class="string">roddenberry.freenode.net</span>")
174         ("<span class="string">irc.sxemacs.org</span>" <span class="reference">:host</span> "<span class="string">irc.sxemacs.org</span>")
175         ("<span class="string">irc.freenode.net</span>" <span class="reference">:host</span> "<span class="string">irc.freenode.net</span>")
176         ("<span class="string">irc.au.freenode.net</span>" <span class="reference">:host</span> "<span class="string">irc.au.freenode.net</span>")
177         ("<span class="string">irc.nac.net</span>" <span class="reference">:host</span> "<span class="string">irc.nac.net</span>")
178         ("<span class="string">irc.efnet.org</span>" <span class="reference">:host</span> "<span class="string">irc.efnet.org</span>")
179         ("<span class="string">irc.efnet.net</span>" <span class="reference">:host</span> "<span class="string">irc.efnet.net</span>"))
180       riece-user-agent 'emacs-riece-config
181       riece-user-list-buffer-mode t)
182
183 <span class="comment">;; Addons
184 </span>(riece-command-insinuate-addon 'riece-yank)
185 (riece-command-insinuate-addon 'riece-hangman)
186 (riece-command-insinuate-addon 'riece-keepalive)
187 (riece-command-insinuate-addon 'riece-shrink-buffer)
188 (riece-command-insinuate-addon 'riece-xfaceb)
189 (riece-command-insinuate-addon 'riece-button)
190 (riece-command-insinuate-addon 'riece-epg)
191
192 (riece-command-enable-addon 'riece-hangman)
193
194 <span class="comment">;; Leave this OFF it is too annoying.  Fun, but annoying.
195 ;; (riece-command-insinuate-addon 'riece-doctor)
196 ;; (riece-command-enable-addon 'riece-doctor)
197 </span>
198 <span class="comment">;; A few handy functions that extend Riece's features a bit.
199 </span>(<span class="keyword">defvar</span> <span class="variable-name">riece-unread-channels</span>)
200 (<span class="keyword">defun</span> <span class="function-name">sy-riece-clear-unread-chans</span> ()
201   "<span class="doc-string">Get rid of the unread mark on all channels.</span>"
202   (interactive)
203   (<span class="keyword">let</span> ((current riece-current-channel))
204     (setq riece-unread-channels nil)
205     (riece-switch-to-channel current)))
206
207 (<span class="keyword">defun</span> <span class="function-name">sy-riece-relist-chans-clear-blanks</span> ()
208   "<span class="doc-string">Relist the channel buffer removing any blanks in the sequence.
209
210 When you part from a channel/user you are left with a gap in the
211 sequence of channel numbers in the channels buffer.  This removes
212 those gaps.</span>"
213   (interactive)
214   (<span class="keyword">let</span> ((current riece-current-channel))
215     (setq riece-current-channels
216           (remove-if #'null riece-current-channels))
217     (riece-switch-to-channel current)))
218
219 (<span class="keyword">defun</span> <span class="function-name">sy-riece-command-memoserv</span> (command)
220   "<span class="doc-string">Send COMMAND, a string, to MEMOSERV.
221
222 With prefix arg, also /join.</span>"
223   (interactive "<span class="string">sMemoserv: </span>")
224   (<span class="keyword">when</span> current-prefix-arg
225     (riece-command-join (list ["<span class="string">MemoServ</span>" ""])))
226   (riece-send-string (format "<span class="string">MEMOSERV %s\r\n</span>" command)))
227
228 (<span class="keyword">defun</span> <span class="function-name">sy-riece-command-chanserv</span> (command)
229   "<span class="doc-string">Send COMMAND, a string, to CHANSERV.
230
231 With prefix arg, also /join.</span>"
232   (interactive "<span class="string">sChanserv: </span>")
233   (<span class="keyword">when</span> current-prefix-arg
234     (riece-command-join (list ["<span class="string">ChanServ</span>" ""])))
235   (riece-send-string (format "<span class="string">CHANSERV %s\r\n</span>" command)))
236
237 (<span class="keyword">defun</span> <span class="function-name">sy-riece-command-nickserv</span> (command)
238   "<span class="doc-string">Send COMMAND, a string, to NICKSERV.
239
240 With prefix arg, also /join.</span>"
241   (interactive "<span class="string">sNickserv: </span>")
242   (<span class="keyword">when</span> current-prefix-arg
243     (riece-command-join (list ["<span class="string">NickServ</span>" ""])))
244   (riece-send-string (format "<span class="string">NICKSERV %s\r\n</span>" command)))
245
246 <span class="comment">;; Seems to not exist anymore. </span><span class="comment"><span class="reference">:-</span></span><span class="comment">(
247 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-command-seenserv</span> (command)
248   "<span class="doc-string">Send COMMAND, a string, to SEENSERV.
249
250 SeenServ doesn't actually exist anymore, so this sends `info nick' to
251 NickServ which gives us the same info.
252
253 With prefix arg, also /join.</span>"
254   (interactive "<span class="string">sLast saw who (nick): </span>")
255   (<span class="keyword">when</span> current-prefix-arg
256     (riece-command-join (list ["<span class="string">NickServ</span>" ""])))
257   (riece-send-string (format "<span class="string">NICKSERV info %s\r\n</span>" command)))
258
259 (<span class="keyword">defun</span> <span class="function-name">sy-riece-command-quick-op</span> ()
260   "<span class="doc-string">Request Ops from ChanServ in the current channel.</span>"
261   (interactive)
262   (<span class="keyword">let</span> ((chan (riece-identity-prefix riece-current-channel)))
263     (sy-riece-command-chanserv (format "<span class="string">OP %s</span>" chan))))
264
265 (<span class="keyword">defun</span> <span class="function-name">sy-riece-command-mute-user</span> (<span class="type">&amp;optional</span> user unmute)
266   "<span class="doc-string">Set mode +q on USER, effectively muting them.
267
268 Optional prefix arg, UNMUTE to let them speak again.</span>"
269   (interactive "<span class="string">i\nP</span>")
270   (<span class="keyword">let</span> ((user (or user
271                   (completing-read
272                    "<span class="string">(Un)Mute user: </span>"
273                    (riece-with-server-buffer
274                        (riece-identity-server riece-current-channel)
275                      (riece-channel-get-users (riece-identity-prefix
276                                                riece-current-channel)))))))
277     (riece-send-string 
278      (format "<span class="string">MODE %s %sq %s\r\n</span>"
279              (riece-identity-prefix riece-current-channel)
280              (<span class="keyword">if</span> (or unmute
281                      current-prefix-arg)
282                  "<span class="string">-</span>"
283                "<span class="string">+</span>")
284              user))))
285
286 (<span class="keyword">defun</span> <span class="function-name">sy-riece-list-banned</span> (channel)
287   "<span class="doc-string">List the banned users on CHANNEL, current if omitted.</span>"
288   (interactive "<span class="string">P</span>")
289   (<span class="keyword">let</span> ((channel (<span class="keyword">if</span> current-prefix-arg
290                      (vector (read-string "<span class="string">Channel: </span>") "")
291                    riece-current-channel)))
292     (riece-send-string
293      (format "<span class="string">MODE %s b\r\n</span>" (riece-identity-prefix channel)))))
294
295 (<span class="keyword">defun</span> <span class="function-name">sy-riece-command-ban-user</span> (<span class="type">&amp;optional</span> user unban)
296   "<span class="doc-string">Ban USER from current channel.
297
298 Optional prefix arg, UNBAN removes the ban.</span>"
299   (interactive "<span class="string">i\nP</span>")
300   (<span class="keyword">let</span> ((user (or user
301                   (completing-read
302                    "<span class="string">(Un)Ban user: </span>"
303                    (riece-with-server-buffer
304                        (riece-identity-server riece-current-channel)
305                      (riece-channel-get-users (riece-identity-prefix
306                                                riece-current-channel))))))
307         reason)
308     (<span class="keyword">if</span> (or unban
309             current-prefix-arg)
310         (riece-send-string
311          (format "<span class="string">MODE %s -b %s\r\n</span>"
312                  (riece-identity-prefix riece-current-channel)
313                  user))
314       (setq reason (read-string "<span class="string">Reason: </span>" nil nil
315                                 "<span class="string">Need a reason?  Look in a mirror!</span>"))
316       (riece-send-string
317        (format "<span class="string">MODE %s +b %s\r\n</span>"
318                (riece-identity-prefix riece-current-channel)
319                user))
320       (riece-command-kick user reason))))
321
322 <span class="comment">;; Share the muzak!
323 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-say-now-playing</span> (<span class="type">&amp;optional</span> notice)
324   "<span class="doc-string">Say into the current channel what mp3 is playing.
325
326 With non-nil optional prefix arg, NOTICE, send it as a notice.</span>"
327   (interactive "<span class="string">P</span>")
328   (riece-command-send-message
329    (format "<span class="string">NP: %s</span>" (mpd-now-playing)) 
330    (and current-prefix-arg
331         'notice)))
332
333 (<span class="keyword">defun</span> <span class="function-name">sy-riece-say-all-purpose</span> (<span class="type">&amp;optional</span> notice)
334   "<span class="doc-string">Send the all-purpose answer to everything.</span>"
335   (interactive "<span class="string">P</span>")
336   (riece-command-send-message "<span class="string">Adolf Hitler in fishnets</span>"
337                               (<span class="keyword">if</span> current-prefix-arg
338                                   'notice
339                                 nil)))
340   
341
342 <span class="comment">;; Tell the world what we're using.
343 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-say-version</span> (<span class="type">&amp;optional</span> notice)
344   "<span class="doc-string">Say the version of Riece we are running.
345
346 With non-nil prefix arg, NOTICE, send as a notice.</span>"
347   (interactive "<span class="string">P</span>")
348   (riece-command-send-message
349    (format "<span class="string">I'm using: %s</span>" (riece-extended-version))
350    (<span class="keyword">if</span> current-prefix-arg
351        'notice
352      nil)))
353
354 <span class="comment">;; say (foo) =&gt; bar
355 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-send-form</span> ()
356   "<span class="doc-string">Sends a form and it's eval</span>"
357   (interactive)
358   (<span class="keyword">let*</span> ((form (read-string "<span class="string">sexp: </span>"))
359          (value (eval (read form))))
360     (riece-command-send-message (format "<span class="string">%s =&gt; %s</span>" form value)
361                                 (<span class="keyword">if</span> current-prefix-arg
362                                     'notice
363                                   nil))))
364
365 (<span class="keyword">defun</span> <span class="function-name">sy-make-rot13-translation-table</span> ()
366   "<span class="doc-string">Create a rot13 table.</span>"
367   (<span class="keyword">let</span> ((i -1)
368         (table (make-string 256 0))
369         (a (char-to-int ?a))
370         (A (char-to-int ?A)))
371     (<span class="keyword">while</span> (&lt; (incf i) 256)
372       (aset table i i))
373     (concat
374      (substring table 0 A)
375      (substring table (+ A 13) (+ A 13 (- 26 13)))
376      (substring table A (+ A 13))
377      (substring table (+ A 26) a)
378      (substring table (+ a 13) (+ a 13 (- 26 13)))
379      (substring table a (+ a 13))
380      (substring table (+ a 26) 255))))
381
382 (<span class="keyword">defun</span> <span class="function-name">sy-rot13-string</span> (string)
383   "<span class="doc-string">Convert TEXT to rot13-ese.</span>"
384   (<span class="keyword">let</span> ((table (sy-make-rot13-translation-table)))
385     (<span class="keyword">with-temp-buffer</span>
386       (insert string)
387       (translate-region (point-min) (point-max) table)
388       (buffer-string))))
389
390 (<span class="keyword">defun</span> <span class="function-name">sy-riece-send-rot13</span> (text)
391   "<span class="doc-string">Talk in rot13-ese.</span>"
392   (interactive "<span class="string">srot13: </span>")
393   (riece-command-send-message
394    (sy-rot13-string text)
395    (<span class="keyword">if</span> current-prefix-arg
396        'notice
397      nil)))
398
399 (<span class="keyword">defun</span> <span class="function-name">sy-morse-string</span> (string)
400   "<span class="doc-string">Return STRING in morse code.</span>"
401   (<span class="keyword">with-temp-buffer</span>
402     (insert string)
403     (morse-region (point-min) (point-max))
404     (goto-char (point-min))
405     (<span class="keyword">while</span> (re-search-forward "<span class="string">/</span>" nil t)
406       (replace-match "<span class="string"> </span>"))
407     (buffer-string)))
408
409 (<span class="keyword">defun</span> <span class="function-name">sy-riece-send-morse</span> (text)
410   "<span class="doc-string">Talk in morse code.</span>"
411   (interactive "<span class="string">sMorse: </span>")
412   (riece-command-send-message
413    (sy-morse-string text)
414    (<span class="keyword">if</span> current-prefix-arg
415        'notice
416      nil)))
417
418 <span class="comment">;; Show off!
419 </span>(<span class="keyword">autoload</span> 'riece-command-ctcp-action "<span class="doc-string">riece-ctcp</span>" nil t)
420 (<span class="keyword">defun</span> <span class="function-name">sy-riece-show-off</span> ()
421   "<span class="doc-string">Brag about how many channels/people we're talking to.</span>"
422   (interactive)
423   (sy-riece-relist-chans-clear-blanks)
424   (<span class="keyword">let*</span> ((channels riece-current-channels)
425          (numchans (length channels))
426          (numppl 0)
427          currchan)
428     (<span class="keyword">while</span> channels
429       (setq currchan (car channels))
430       (setq numppl (+ numppl
431                       (length (riece-with-server-buffer
432                                   (riece-identity-server currchan)
433                                 (riece-channel-get-users 
434                                  (riece-identity-prefix currchan))))))
435       (setq channels (cdr channels)))
436     (riece-command-ctcp-action
437      riece-current-channel
438      (format
439       "<span class="string">is in %d channels, talking to %d people </span><span class="string"><span class="reference">:-P</span></span>"
440       numchans numppl))))
441
442 <span class="comment">;; Brag about how long SXEmacs has been up
443 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-sxe-uptime</span> ()
444   "<span class="doc-string">Display as action SXEmacs uptime.</span>"
445   (interactive)
446   (<span class="keyword">let*</span> ((ut (uptime))
447          (days (car ut))
448          (hours (cadr ut))
449          (minutes (caddr ut))
450          (seconds (cadddr ut)))
451     (riece-command-ctcp-action
452      riece-current-channel
453      (concat "<span class="string">-=[ SXEmacs Uptime: </span>"
454              (<span class="keyword">unless</span> (zerop days)
455                (<span class="keyword">if</span> (eq days 1)
456                    "<span class="string">1 day, </span>"
457                  (concat (number-to-string days) "<span class="string"> days, </span>")))
458              (<span class="keyword">unless</span> (zerop hours)
459                (<span class="keyword">if</span> (eq hours 1)
460                    "<span class="string">1 hour, </span>"
461                  (concat (number-to-string hours) "<span class="string"> hours, </span>")))
462              (<span class="keyword">unless</span> (zerop minutes)
463                (<span class="keyword">if</span> (eq minutes 1)
464                    "<span class="string">1 minute, </span>"
465                  (concat (number-to-string minutes) "<span class="string"> minutes, </span>")))
466              (<span class="keyword">if</span> (zerop seconds)
467                  "<span class="string">and 0 seconds</span>"
468                (<span class="keyword">if</span> (eq seconds 1)
469                    "<span class="string">and 1 second.</span>"
470                  (concat "<span class="string">and </span>"
471                          (number-to-string seconds)
472                          "<span class="string"> seconds</span>")))
473              "<span class="string"> ]=-</span>"))))
474       
475
476 <span class="comment">;; segassem desrever eikeeg ylbirreT
477 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-reverse</span> ()
478   "<span class="doc-string">.sdrawkcab kaepS</span>"
479   (interactive)
480   (<span class="keyword">let</span> ((str (read-string "<span class="string">Say backwards: </span>")))
481     (riece-command-send-message
482      (concat (nreverse (string-to-list str))) nil)))
483
484 <span class="comment">;; .oO0{ what's he thinking? }
485 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-think</span> ()
486   "<span class="doc-string">Send a .oO0{ think balloon action }.</span>"
487   (interactive)
488   (<span class="keyword">let</span> ((think (read-string "<span class="string">What are you thinking? </span>")))
489     (riece-command-ctcp-action
490      riece-current-channel
491      (format "<span class="string">.oO0{ %s }</span>" think))))
492
493 <span class="comment">;; When pictures speak louder than words...
494 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-fuck-you</span> (<span class="type">&amp;optional</span> upyours)
495   "<span class="doc-string">For those occasions where... you know what I mean.</span>"
496   (interactive "<span class="string">P</span>")
497   (<span class="keyword">let</span> ((fuckyou "<span class="string">
498      _                         _
499     |_|                       |_|
500     | |         /^^^\\         | |
501    _| |_      (| \"o\" |)      _| |_
502  _| | | | _    (_---_)    _ | | | |_
503 | | | | |' |    _| |_    | `| | | | |
504 |          |   /     \\   |          |
505  \\        /  / /(. .)\\ \\  \\        /
506    \\    /  / /  | . |  \\ \\  \\    /
507      \\  \\/ /    ||Y||    \\ \\/  /
508       \\__/      || ||      \\__/
509                 () ()
510                 || ||
511                ooO Ooo</span>")
512         (upyours "<span class="string">
513     .-.    
514     |U|    
515     | |    
516     | |    
517    _| |_   
518   | | | |-.
519  /|     ` |
520 | |       |
521 |         |
522 \\         /
523  |       | 
524  |       |</span>")
525         (riece-yank-tick 0.1))
526     (<span class="keyword">with-temp-buffer</span>
527       (<span class="keyword">if</span> current-prefix-arg 
528           (insert upyours)
529         (insert fuckyou))
530       (kill-region (point-min) (point-max)))
531     (riece-command-yank nil nil)))
532
533 <span class="comment">;; Nick completion.  Lets face it, compared to other IRC clients like
534 ;; BitchX or even ERC, Riece's nick completion is pretty sucky. </span><span class="comment"><span class="reference">:-</span></span><span class="comment">(
535 ;; This is my vain attempt to improve it.
536 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-command-complete-user</span> ()
537   "<span class="doc-string">Like `</span><span class="doc-string"><span class="reference">riece-command-complete-user</span></span><span class="doc-string">' but restrict to current chan.
538
539 This version of nick completion maintains the original case of the
540 nick being completed.  The version in Riece downcases the completion
541 \(could be a bug\).
542
543 If the completion is being inserted at column zero, `: ' is appended,
544 otherwise ` ' is added.
545
546 The following is not yet implemented, but I'd also like to be able to
547 complete from the middle of a nick...
548
549   Nickname     User Types      Expands To
550   --------     ----------      ----------
551   MyNick        nic&lt;TAB&gt;       MyNick:&lt;SPC&gt;</span>"
552   (interactive)
553   (<span class="keyword">let*</span> ((completion-ignore-case t)
554          (table (riece-with-server-buffer
555                     (riece-identity-server riece-current-channel)
556                   (riece-channel-get-users (riece-identity-prefix
557                                             riece-current-channel))))
558          (current (or (current-word) ""))
559          (completion (try-completion current table))
560          (all (all-completions current table)))
561     (<span class="keyword">if</span> (eq completion t)
562         nil
563       (<span class="keyword">if</span> (null completion)
564           (message "<span class="string">Can't find completion for \"%s\"</span>" current)
565         (<span class="keyword">if</span> (equal current completion)
566             (with-output-to-temp-buffer "<span class="string">*Help*</span>"
567               (display-completion-list all))
568           (re-search-forward "<span class="string">\\&gt;</span>" nil t)
569           (delete-region (point) (- (point) (length current)))
570           (<span class="keyword">if</span> (eq (point) (point-at-bol))
571               (insert completion "<span class="string">: </span>")
572             (insert completion "<span class="string"> </span>")))))))
573
574 <span class="comment">;(defalias 'riece-command-complete-user 'sy-riece-command-complete-user)
575 </span>
576 <span class="comment">;; "schme" &lt;<a href="mailto:marcus&#64;sxemacs.org">marcus&#64;sxemacs.org</a>&gt; funky cycling completion
577 ;; Reworked to support cycling in both directions using dllists, plus
578 ;; other misc improvements by me. </span><span class="comment"><span class="warning">--SY.</span></span><span class="comment">
579 </span>(<span class="keyword">defvar</span> <span class="variable-name">riece-me:completion-time</span> 3
580   "<span class="doc-string">Time in seconds before completion list is reset.</span>")
581 (<span class="keyword">defvar</span> <span class="variable-name">riece-me:*completion-timer*</span> (make-itimer)
582   "<span class="doc-string">Completion timer.</span>")
583 (<span class="keyword">defvar</span> <span class="variable-name">riece-me:*completion-list*</span> nil
584   "<span class="doc-string">Completion list.</span>")
585
586 (<span class="keyword">defvar</span> <span class="variable-name">sy-riece-nick-syntax-table</span>
587   (<span class="keyword">let</span> ((table (copy-syntax-table text-mode-syntax-table)))
588     (modify-syntax-entry ?~  "<span class="string">w </span>" table)
589     (modify-syntax-entry ?`  "<span class="string">w </span>" table)
590     (modify-syntax-entry ?-  "<span class="string">w </span>" table)
591     (modify-syntax-entry ?_  "<span class="string">w </span>" table)
592     (modify-syntax-entry ?+  "<span class="string">w </span>" table)
593     (modify-syntax-entry ?{  "<span class="string">w </span>" table)
594     (modify-syntax-entry ?[  "<span class="string">w </span>" table)
595     (modify-syntax-entry ?}  "<span class="string">w </span>" table)
596     (modify-syntax-entry ?]  "<span class="string">w </span>" table)
597     (modify-syntax-entry ?\\ "<span class="string">w </span>" table)
598     (modify-syntax-entry ?|  "<span class="string">w </span>" table)
599     (modify-syntax-entry ?:  "<span class="string">w </span>" table)
600     (modify-syntax-entry ?\; "<span class="string">w </span>" table)
601     (modify-syntax-entry ?'  "<span class="string">w </span>" table)
602     (modify-syntax-entry ?&lt;  "<span class="string">w </span>" table)
603     (modify-syntax-entry ?,  "<span class="string">w </span>" table)
604     (modify-syntax-entry ?&gt;  "<span class="string">w </span>" table)
605     table)
606   "<span class="doc-string">Syntax table used in funky nick cycling completion.</span>")
607
608 (<span class="keyword">defun</span> <span class="function-name">sy-riece-init-completion-timer</span> ()
609   "<span class="doc-string">Initialise the completion timer.</span>"
610   (<span class="keyword">let</span> ((timer riece-me:*completion-timer*))
611     (set-itimer-function timer #'(<span class="keyword">lambda</span> ()
612                                    (setq riece-me:*completion-list* nil)))
613     (set-itimer-value timer riece-me:completion-time)))
614 (add-hook 'riece-after-login-hook #'sy-riece-init-completion-timer)
615
616 (<span class="keyword">defsubst</span> <span class="function-name">sy-riece-cycle-list</span> (list <span class="type">&amp;optional</span> reverse)
617   "<span class="doc-string">Return a list of head of LIST, and LIST rotated 1 place forward.
618
619 If optional argument, REVERSE is non-nil, rotate the list in the other
620 direction.</span>"
621   (<span class="keyword">let</span> ((list (apply #'dllist list))
622         name)
623     (<span class="keyword">if</span> reverse
624         (dllist-rrotate list)
625       (dllist-lrotate list))
626     (setq name (dllist-car list))
627     (list name (dllist-to-list list))))
628
629 (<span class="keyword">defsubst</span> <span class="function-name">sy-riece-set-completion-timer</span> ()
630   "<span class="doc-string">(Re)set completion timer's value.</span>"
631   (<span class="keyword">let</span> ((timer riece-me:*completion-timer*))
632     (and (itimerp timer)
633          (set-itimer-value timer riece-me:completion-time))))
634
635 (<span class="keyword">defun</span> <span class="function-name">sy-riece-complete-user-backwards</span> ()
636   "<span class="doc-string">Complete nick, cycling backwards.
637 See `</span><span class="doc-string"><span class="reference">riece-me:command-complete-user</span></span><span class="doc-string">'.</span>"
638   (interactive)
639   (riece-me:command-complete-user 'reverse))
640
641 (<span class="keyword">defun</span> <span class="function-name">sy-riece-command-mode-hooks</span> ()
642   "<span class="doc-string">Add some nice stuff in Riece's command buffer.</span>"
643   (<span class="keyword">when</span> (eq major-mode 'riece-command-mode)
644     <span class="comment">;; Define a few keys here so they don't have the `</span><span class="comment"><span class="reference">C-c</span></span><span class="comment">' prefix
645 </span>    (local-set-key [iso-left-tab] #'sy-riece-complete-user-backwards)
646     (local-set-key [(super next)] #'riece-command-user-list-scroll-up)
647     (local-set-key [(super prior)] #'riece-command-user-list-scroll-down)
648     (local-set-key [(hyper next)] #'riece-command-scroll-up)
649     (local-set-key [(hyper prior)] #'riece-command-scroll-down)
650     <span class="comment">;; Turn on flyspell mode if available
651 </span>    (and (<span class="keyword">featurep</span> (and 'overlay 'flyspell))
652          (flyspell-mode 1))))
653
654 (add-hook 'riece-command-mode-hook #'sy-riece-command-mode-hooks)
655
656
657 (<span class="keyword">defun</span> <span class="function-name">riece-me:command-complete-user</span> (<span class="type">&amp;optional</span> reverse)
658   "<span class="doc-string">Like `</span><span class="doc-string"><span class="reference">riece-command-complete-user</span></span><span class="doc-string">' but restrict to current chan.
659
660 This completion does not pop up any completion buffers, instead it
661 cycles through the user names \"in-place\" with each successive TAB.
662
663 With non-nil optional argument, REVERSE, the cycling goes in the other
664 direction.
665
666 If the completion is being inserted at column zero, \": \" is appended,
667 otherwise \" \" is added. </span>"
668   (interactive)
669   (<span class="keyword">unless</span> riece-me:*completion-list*
670     (<span class="keyword">unless</span> (itimer-live-p riece-me:*completion-timer*)
671       (sy-riece-set-completion-timer)
672       (activate-itimer riece-me:*completion-timer*))
673     (<span class="keyword">let*</span> ((completion-ignore-case t)
674            (table (riece-with-server-buffer
675                       (riece-identity-server riece-current-channel)
676                     (riece-channel-get-users (riece-identity-prefix
677                                               riece-current-channel))))
678            (current (current-word))
679            (completion (try-completion current table))
680            (all (all-completions current table)))
681       (<span class="keyword">if</span> (null completion)
682           (message "<span class="string">Can't find completion for \"%s\"</span>" current)
683         (setq riece-me:*completion-list* all))))
684   (<span class="keyword">when</span> riece-me:*completion-list*
685     (multiple-value-bind (completion newlist)
686         (sy-riece-cycle-list riece-me:*completion-list* reverse)
687       (setq riece-me:*completion-list* newlist)
688       (with-syntax-table sy-riece-nick-syntax-table
689         (<span class="keyword">unless</span> (string= "" (current-word))
690           (backward-delete-word))
691         (insert completion)
692         (<span class="keyword">let</span> ((nicksuffix "<span class="string"> </span>"))
693           (<span class="keyword">save-excursion</span>
694             (backward-word)
695             (and (bolp)
696                  (setq nicksuffix "<span class="string">: </span>")))
697           (insert nicksuffix)))
698       (sy-riece-set-completion-timer))))
699
700 (<span class="keyword">defalias</span> '<span class="function-name">riece-command-complete-user</span> 'riece-me:command-complete-user)
701 <span class="comment">;;;
702 </span>
703 (<span class="keyword">defun</span> <span class="function-name">sy-riece-add-rem-biff-channel</span> (<span class="type">&amp;optional</span> remove)
704   "<span class="doc-string">Add the current channel to the list of channels for riece-biff.
705
706 With optional prefix arg, REMOVE, remove the current channel from the
707 biff list.</span>"
708   (interactive "<span class="string">P</span>")
709   (<span class="keyword">if</span> (or current-prefix-arg
710           remove)
711       <span class="comment">;; Remove chan.
712 </span>      (<span class="keyword">progn</span>
713         (setq riece-biff-check-channels
714               (remove (riece-identity-prefix riece-current-channel)
715                       riece-biff-check-channels))
716         (message "<span class="string">Channel: %s removed from riece-biff channel list.</span>"
717                  (riece-identity-prefix riece-current-channel)))
718     <span class="comment">;; Add chan.
719 </span>    (add-to-list 'riece-biff-check-channels
720                  (riece-identity-prefix riece-current-channel))
721     (message "<span class="string">Channel: %s added to riece-biff channel list.</span>"
722              (riece-identity-prefix riece-current-channel))))
723
724 (<span class="keyword">defun</span> <span class="function-name">sy-riece-get-sxemacs-topic-version</span> ()
725   "<span class="doc-string">Return the \"version\" section of #sxemacs topic.</span>"
726   (<span class="keyword">let*</span> ((topic (riece-with-server-buffer
727                     (riece-identity-server riece-current-channel)
728                   (riece-channel-get-topic "<span class="string">#sxemacs</span>")))
729          (ver (third (split-string-by-char topic ?\ ))))
730     ver))
731
732 (<span class="keyword">defun</span> <span class="function-name">sy-riece-sxemacs-topic-version-update</span> (<span class="type">&amp;optional</span> newver)
733   "<span class="doc-string">*Updates the \"version\" section of #sxemacs topic with NEWVER.
734 With a prefix arg, prompt for the new version string.</span>"
735   (interactive "<span class="string">P</span>")
736   (<span class="keyword">let*</span> ((oldver (sy-riece-get-sxemacs-topic-version))
737          (gitver (substring (shell-command-to-string
738                              "<span class="string">( cd ${SXEWD}; git describe master )</span>")
739                             0 -1))
740          (newver (or (and current-prefix-arg
741                           (read-string "<span class="string">New Version: </span>"
742                                        sxemacs-git-version nil
743                                        sxemacs-git-version))
744                      gitver))
745         (chan (riece-identity-prefix riece-current-channel)))
746     (<span class="keyword">unless</span> (string= chan "<span class="string">#sxemacs</span>")
747       (error 'invalid-argument "<span class="string">Wrong channel</span>" chan))
748     (riece-command-send-message
749      (format "<span class="string">,topic change 1 s/%s/%s/</span>" oldver newver) nil)))
750
751 <span class="comment">;; Define keys for those functions.
752 </span>(<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c C</span>") #'sy-riece-clear-unread-chans)
753 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c r</span>")
754   #'sy-riece-relist-chans-clear-blanks)
755 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c m</span>") #'sy-riece-command-mute-user)
756 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-b</span>") #'sy-riece-command-ban-user)
757 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-o</span>") #'sy-riece-command-quick-op)
758 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c n</span>") #'sy-riece-say-now-playing)
759 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c V</span>") #'sy-riece-say-version)
760 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c s</span>") #'sy-riece-show-off)
761 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c f</span>") #'sy-riece-fuck-you)
762 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c b</span>") #'sy-riece-add-rem-biff-channel)
763 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c ?</span>") #'sy-riece-think)
764 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c R</span>") #'sy-riece-reverse)
765 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c T</span>") #'sy-riece-sxemacs-topic-version-update)
766 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c U</span>") #'sy-riece-sxe-uptime)
767 (<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> [a] #'sy-riece-say-all-purpose)
768
769 <span class="comment">;; So I can start Riece in a new frame
770 </span>(<span class="keyword">defvar</span> <span class="variable-name">riece-frame</span> nil
771   "<span class="doc-string">Frame for Riece.</span>")
772
773 (<span class="keyword">defun</span> <span class="function-name">sy-riece</span> (<span class="type">&amp;optional</span> ask)
774   "<span class="doc-string">Run Riece in a new frame.
775
776 With non-nil optional prefix ASK Riece will prompt for a server to
777 connect to.</span>"
778   (interactive "<span class="string">P</span>")
779   (<span class="keyword">let</span> ((riece-server (<span class="keyword">if</span> current-prefix-arg
780                           nil
781                         "<span class="string">irc.sxemacs.org</span>")))
782     (setq riece-frame (new-frame '((name . "<span class="string">RieceFrame</span>")
783                                    (width . 110))))
784     (select-frame riece-frame)
785     (call-interactively 'riece)
786     (focus-frame riece-frame)))
787
788 (<span class="keyword">defun</span> <span class="function-name">sy-riece-exit-hook</span> ()
789   (<span class="keyword">when</span> (frame-live-p riece-frame)
790     (delete-frame riece-frame))
791   (setq riece-frame nil))
792
793 (add-hook 'riece-exit-hook #'sy-riece-exit-hook)
794
795 <span class="comment">;; riece-startup-channel-list doesn't fit in with the way I do things
796 ;; and the way freenode functions.  It gets called too damned early.
797 ;; What follows is my attempt to make Riece behave better with logging
798 ;; into freenode, registering to nickserv, joining initial channels,
799 ;; and getting ops with chanserv.
800 </span>(<span class="keyword">defvar</span> <span class="variable-name">sy-riece-startup-channel-list</span>
801   '("<span class="string">#sxemacs</span>"
802     "<span class="string">#emchat</span>"
803     "<span class="string">#xemacs</span>"
804     "<span class="string">#emacs</span>"
805     <span class="comment">;"#kde"
806 </span>    <span class="comment">;"#kde-devel"
807 </span>    "<span class="string">#LineageOS</span>"
808     <span class="comment">;"#LineageOS-dev"
809 </span>    "<span class="string">#lxqt</span>"
810     <span class="comment">;"#postgresql"
811 </span>    <span class="comment">;"#systemd"
812 </span>    "<span class="string">#zsh</span>"
813     )
814   "<span class="doc-string">List of channels to join after logging in and identifying to nickserv.</span>")
815
816 <span class="comment">;; Set up channel coding systems
817 ;;
818 ;; This is a PITA... turn on utf and can't read iso-8859-1 special
819 ;; chars, turn it off and can't read utf.  Have I mentioned how much I
820 ;; hate this crap? </span><span class="comment"><span class="warning">--SY.</span></span><span class="comment">
821 </span>(mapcar
822  #'(<span class="keyword">lambda</span> (chan)
823      (<span class="keyword">if</span> (string-match #r"<span class="string">#\(sxemacs\|emchat\)</span>" chan)
824          (push (cons chan 'iso-8859-1) riece-channel-coding-system-alist)
825        (push (cons chan 'utf-8) riece-channel-coding-system-alist)))
826  sy-riece-startup-channel-list)
827
828 (<span class="keyword">defun</span> <span class="function-name">sy-riece-login</span> ()
829   (<span class="keyword">progn</span>
830     (riece-send-string (format "<span class="string">PRIVMSG NickServ </span><span class="string"><span class="reference">:identify</span></span><span class="string"> %s\r\n</span>"
831                                (getenv "<span class="string">IRCPASSWD</span>")))
832     (sleep-for 15))
833   (<span class="keyword">let</span> ((channel-list sy-riece-startup-channel-list)
834         entry identity)
835     (<span class="keyword">while</span> channel-list
836       (<span class="keyword">unless</span> (listp (setq entry (car channel-list)))
837         (setq entry (list (car channel-list))))
838       (<span class="keyword">if</span> (equal (riece-identity-server
839                   (setq identity (riece-parse-identity (car entry))))
840                  riece-server-name)
841           (riece-command-join-channel identity (nth 1 entry)))
842       (setq channel-list (cdr channel-list))))
843   (riece-send-string "<span class="string">PRIVMSG ChanServ </span><span class="string"><span class="reference">:op</span></span><span class="string"> #sxemacs\r\n</span>")
844   (riece-send-string "<span class="string">PRIVMSG ChanServ </span><span class="string"><span class="reference">:op</span></span><span class="string"> #emchat\r\n</span>")
845   (riece-send-string "<span class="string">PRIVMSG ChanServ </span><span class="string"><span class="reference">:op</span></span><span class="string"> #xemacs\r\n</span>")
846   (riece-send-string
847    (format "<span class="string">PRIVMSG SXEbot </span><span class="string"><span class="reference">:identify</span></span><span class="string"> SteveYoungs %s\r\n</span>"
848            (getenv "<span class="string">BOTPASSWD</span>"))))
849
850 (add-hook 'riece-after-login-hook #'sy-riece-login)
851
852 <span class="comment">;; Until I can find a solution to my hook problem (login hook not
853 ;; running to completion) I use this to finish the job
854 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-cleanup-login</span> ()
855   (interactive)
856   (<span class="keyword">let</span> ((metachans
857          #r"<span class="string">.*\.freenode\.net\|\(Chan\|Nick\|Memo\|Seen\)Serv\|SXEbot\|freenode-connect</span>"))
858     (mapcar
859      #'(<span class="keyword">lambda</span> (chan-vect)
860          (mapcar
861           #'(<span class="keyword">lambda</span> (chan)
862               (and (string-match metachans chan)
863                    (riece-part-channel chan-vect)))
864           chan-vect))
865      riece-current-channels)
866     (sy-riece-relist-chans-clear-blanks)
867     (riece-command-switch-to-channel-by-number 1)))
868
869 <span class="comment">;; CANNOT get this to work from the hook.  I suspect it is a
870 ;; networking/async/timing thing.  I have it bound to a key
871 ;; seq... `C-c C-c l', a PITA though.
872 ;(add-hook 'riece-after-login-hook #'sy-riece-cleanup-login 'append)
873 </span>(<span class="keyword">define-key</span> <span class="variable-name">riece-command-map</span> (kbd "<span class="string">C-c l</span>") 'sy-riece-cleanup-login)
874
875 <span class="comment">;; Automatically clear Riece Biff indicator by switching to the right
876 ;; window/frame
877 </span>(<span class="keyword">defun</span> <span class="function-name">sy-riece-check-command-buffer</span> ()
878   (and (get-buffer-window (or riece-command-buffer "<span class="string">*Command*</span>"))
879        (riece-biff-clear)))
880
881 (<span class="keyword">defadvice</span> <span class="function-name">switch-to-buffer</span> (after riece-update (<span class="type">&amp;rest</span> args) activate)
882   "<span class="doc-string">After switching buffers, check to see if riece-biff should be cleared.
883 The riece-biff modeline indicator will only be cleared if
884 `</span><span class="doc-string"><span class="reference">riece-command-buffer</span></span><span class="doc-string">' is visible in the selected frame.</span>"
885   (sy-riece-check-command-buffer))
886
887 (add-hook 'select-frame-hook #'sy-riece-check-command-buffer)
888
889 <span class="comment">;; Easier switch to Riece when running on TTY.
890 </span>(<span class="keyword">defun</span> <span class="function-name">sy-switch-to-riece</span> ()
891   "<span class="doc-string">I use this to switch to Riece when I'm on a tty.</span>"
892   (interactive)
893   (<span class="keyword">when</span> (buffer-live-p riece-command-buffer)
894     (pop-to-buffer riece-command-buffer)
895     (riece-command-configure-windows)))
896
897 (<span class="keyword">define-key</span> <span class="variable-name">global-tty-map</span> [(control ?c) ?r] #'sy-switch-to-riece)
898
899 <span class="comment">;</span><span class="comment"><span class="reference">:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::</span></span><span class="comment">
900 </span>(message "<span class="doc-string">Riece settings loaded successfully</span>")
901
902 </pre>
903   <!--  SXEmacs Logo -->
904     <div class="img">
905       <a href="https://www.sxemacs.org/" target="_parent">
906         <img style="padding:0px 5px 0px 0px;border:0;width:88px;height:31px"
907           src="/Images/cbsx.png"
908           title="This page was created entirely in SXEmacs"
909           alt="Created with SXEmacs" />
910       </a>
911 <!--  End SXEmacs Logo -->
912 <!--  Valid XHTML 1.0 -->
913       <a href="http://validator.w3.org/check?uri=https%3a%2f%2fwww.sxemacs.org%2fSYinits%2f16-riece.html" target="_blank">
914        <img style="padding:0px 5px 0px 10px;border:0;width:88px;height:31px"
915           src="/Images/valid-xhtml10.png"
916           title="Valid XHTML 1.0 Transitional!"
917           alt="Valid XHTML 1.0 Transitional!" />
918       </a>
919     </div>
920 <!--  End Valid XHTML 1.0 -->
921
922     <h6>Copyright &#169; 2020 Steve Youngs<br />
923      Verbatim copying and distribution is permitted in any medium,
924     providing this notice is preserved.<br />
925 <!-- hhmts start -->
926 Last modified: Wed Apr 15 18:15:57 AEST 2020
927 <!-- hhmts end -->
928    </h6>
929
930 </body>
931 </html>