Commit dcaab97b authored by David Byers's avatar David Byers
Browse files

Fixed bugs.

Removed obsolete files.
parent 0d319168
Sat Sep 2 14:24:57 2000 David Byers <>
* slow.el (lyskom-expand-slow-command): Use
lyskom-slow-list-completions to sort possible completions.
(lyskom-slow-list-completions): New function.
(kom-slow-list-completions): Use lyskom-slow-list-completions.
* compatibility.el (char-before): New compatibility definition.
2000-09-02 David Byers <>
* utilities.el (lyskom-maybe-frob-completion-table): Add third
argument to lyskom-recode-string.
* lyskom-buttons.el (lyskom-make-button-menu): Add third argument
to lyskom-recode-string.
2000-09-01 David Byers <>
* slow.el (kom-slow-click-or-yank): Fixed typo.
* Release of 0.46-BETA-W
2000-09-01 David Byers <>
......@@ -164,6 +164,22 @@ KEYS should be a string in the format used for saving keyboard macros
(lyskom-provide-macro char-before (&optional pos buffer)
,@(if buffer `((set-buffer ,buffer)))
,(if pos
`(if (or (> ,pos (point-max))
(<= ,pos (point-min)))
(goto-char ,pos)
`(if (<= (point) (point-min))
(lyskom-provide-function characterp (obj)
(integerp obj))
The LysKOM Emacs Lisp Client
LysKOM is a project in progress at the Lysator Academic Computing
......@@ -109,9 +104,8 @@
in a zip file. The archive contains all the files needed to build
the client and a pre-built client.
The client is also available as an RPM (for RedHat, Mandrake,
Gentus and other RedHat-based Linux distributions) and a Debian
package. These assume that you are using Gnu Emacs 20.5 or later.
The client is also available as an RPM and a Debian package. These
assume that you are using Gnu Emacs 20.5 or later.
You can either install manually (see section 3.1) or using the
Makefile (section 3.3). However you install, there are a few
......@@ -161,15 +161,15 @@ If there is no active area, then do something else."
;; Use the command as the event for simplicity. Note that the menu
;; function alters the menu, so we copy the entries to prevent it
;; from fiddling with lyskom-button-actions.
(let ((title (lyskom-maybe-recode-string title 'iso-8859-1)))
(let ((title (lyskom-maybe-recode-string title 'iso-8859-1 t)))
(when (> (length title) 44) (setq title (concat (substring title 0 40)
" ...")))
(cond ((string-match "XEmacs" (emacs-version))
(cons (lyskom-maybe-recode-string title 'iso-8859-1)
(cons (lyskom-maybe-recode-string title 'iso-8859-1 t)
(mapcar (function
(lambda (entry)
(vector (lyskom-maybe-recode-string
(lyskom-get-string (car entry)) 'iso-8859-1)
(lyskom-get-string (car entry)) 'iso-8859-1 t)
(list (cdr entry)
(if (listp arg)
......@@ -183,7 +183,7 @@ If there is no active area, then do something else."
(let ((tmp (copy-tree entry)))
(setcar tmp (lyskom-maybe-recode-string
(lyskom-get-string (car tmp))
'iso-8859-1 t))
(cons (` ((, (cdr entry))
(, buf)
(, arg)
......@@ -3587,8 +3587,8 @@ One parameter - the prompt string."
(" ("
((lyskom-session-has-unreads ,(lyskom-maybe-recode-string (lyskom-get-string 'frame-title-unread) 'iso-8859-1))
(lyskom-session-has-unread-letters ,(lyskom-maybe-recode-string (lyskom-get-string 'frame-title-letters) 'iso-8859-1)))
((lyskom-session-has-unreads ,(lyskom-maybe-recode-string (lyskom-get-string 'frame-title-unread) 'iso-8859-1 t))
(lyskom-session-has-unread-letters ,(lyskom-maybe-recode-string (lyskom-get-string 'frame-title-letters) 'iso-8859-1 t)))
(add-hook 'kill-buffer-hook 'lyskom-remove-buffer-from-lists)
"clientversion \"0."[.0-9]+ { printf("%s.alfa",yytext); }
\ No newline at end of file
......@@ -93,10 +93,10 @@ Currently the prompt is assumed to be on the last line of the buffer."
(interactive "@e")
(let ((pos (event-closest-point event)))
(if (and (lyskom-slow-on-prompt-line pos)
(<= (save-excursion (lyskom-slow-start-of-line) pos)))
(<= (lyskom-slow-start-of-line) pos)))
(let ((fn (lookup-key global-map (this-command-keys))))
(when (commandp fn) (call-interactively fn)))
(kom-button-click event))))
(kom-button-click event)))
(defun kom-slow-button-press ()
"Run kom-button-press unless on the prompt line."
......@@ -160,9 +160,7 @@ Currently the prompt is assumed to be on the last line of the buffer."
(when (lyskom-string= (lyskom-unicase longest) (lyskom-unicase text))
(if (or have-space eager-completion)
(mapconcat 'identity completes "\n ")))
(lyskom-slow-list-completions completes))
(unless (or eager-completion (eq ?\ (char-before (point))) (insert " "))))
(t (signal 'lyskom-internal-error '()))))))
......@@ -210,15 +208,19 @@ If the completion was not exact it returns nil."
(delete-region (cdr command) (point-max))
(call-interactively (car command))))))
(defun lyskom-slow-list-completions (completes)
"List strings in COMPLETES as possible completions for a command."
(cond (completes (lyskom-format-insert-before-prompt
(mapconcat 'identity (sort completes 'string-lessp) "\n ")))
(t (lyskom-insert-before-prompt (lyskom-get-string 'no-such-command)))))
(defun kom-slow-list-completions ()
(let* ((text (lyskom-get-entered-slow-command))
(completes (and text (all-completions text 'lyskom-complete-command))))
(cond (completes (lyskom-format-insert-before-prompt
(mapconcat 'identity completes "\n ")))
(t (lyskom-insert-before-prompt (lyskom-get-string 'no-such-command)))))))
(all-completions (or (lyskom-get-entered-slow-command) "")
(defun kom-slow-mode ()
;;;;; $Id$
;;;;; Copyright (C) 1991 Lysator Academic Computer Association.
;;;;; This file is part of the LysKOM server.
;;;;; LysKOM is free software; you can redistribute it and/or modify it
;;;;; under the terms of the GNU General Public License as published by
;;;;; the Free Software Foundation; either version 1, or (at your option)
;;;;; any later version.
;;;;; LysKOM is distributed in the hope that it will be useful, but WITHOUT
;;;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
;;;;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
;;;;; for more details.
;;;;; You should have received a copy of the GNU General Public License
;;;;; along with LysKOM; see the file COPYING. If not, write to
;;;;; Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
;;;;; or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
;;;;; MA 02139, USA.
;;;;; Please mail bug reports to
(defun lyskom-parse-async (tokens buffer)
"Parse an asynchronous message from the server.
The message consists of TOKENS tokens. Unknown messages are skipped.
Actions are taken to perform the various tasks that is required on reciept of
an asynchronous message.
If variable kom-presence-messages is non-nil or some minibuffer editing is
going on then nothing is printed on the message area.
This function is called with the lyskom-unparsed-buffer as current-buffer.
All calls using the lyskom-variables have to be made using the buffer BUFFER.
Be careful when editing this. All parsing is done with the buffer this
function is called with as the current-buffer, while all calls from
this function shall be with current-buffer the BUFFER."
(let ((msg-no (lyskom-parse-num)))
((eq msg-no 0) ; New text
(let* ((text-no (lyskom-parse-num))
(text-stat (lyskom-parse-text-stat text-no)))
(set-buffer buffer)
(lyskom-call-hook 'lyskom-new-text-hook text-stat)
(lyskom-call-hook 'kom-new-text-hook text-stat)
;;(lyskom-async-new-text text-stat);;OLD-OLD-OLD
))) ;
((eq msg-no 1) ; Logout
(let ((pno (lyskom-parse-num)))
(set-buffer buffer)
(lyskom-call-hook 'lyskom-logout-hook pno)
(lyskom-call-hook 'kom-logout-hook pno)
;;(if (and (not (zerop lyskom-pers-no));;OLD-OLD-OLD
;; (or kom-presence-messages
;; kom-presence-messages-in-buffer))
;; (initiate-get-conf-stat 'follow 'lyskom-show-logged-out-person
;; pno));;OLD-OLD-OLD
((eq msg-no 2) ; Login, obsolete.
(lyskom-skip-tokens tokens))
((eq msg-no 3) ; Conference deleted
(lyskom-skip-tokens tokens))
((eq msg-no 4) ; Conference created
(lyskom-skip-tokens tokens))
((eq msg-no 5) ; A person or conference has changed name.
(let ((conf-no (lyskom-parse-num))
(old-name (lyskom-parse-string))
(new-name (lyskom-parse-string)))
(set-buffer buffer)
(lyskom-call-hook 'lyskom-name-change-hook conf-no old-name new-name)
(lyskom-call-hook 'kom-name-change-hook conf-no old-name new-name)
;;(cache-del-conf-stat conf-no) ;+++Borde {ndra i cachen i st{llet.
;; ((lyskom-is-in-minibuffer))
;; (kom-presence-messages
;; (message (concat old-name " har nu bytt namn till " new-name))))
;; (kom-presence-messages-in-buffer
;; (lyskom-insert-before-prompt
;; (concat old-name " har nu bytt namn till " new-name "\n"))))
((eq msg-no 6) ;i_am_on - something is moving
(let ((info (lyskom-parse-who-info)))
(set-buffer buffer)
(lyskom-call-hook 'lyskom-i-am-on-hook info)
(lyskom-call-hook 'kom-i-am-on-hook info)
;;(if (zerop lyskom-pers-no)
;; nil
;; (if (and (/= (who-info->pers-no info) 0)
;; (/= (who-info->pers-no info) lyskom-pers-no))
;; ;Don't show myself.
;; (initiate-get-conf-stat 'follow
;; 'lyskom-show-changed-person
;; (who-info->pers-no info)
;; (who-info->working-conf info)
;; (who-info->doing-what info)))
;; (if (/= (who-info->working-conf info) 0)
;; (initiate-get-conf-stat 'void nil
;; (who-info->working-conf info))))
((eq msg-no 7) ; Database is syncing.
(set-buffer buffer)
(if (and (not (lyskom-is-in-minibuffer))
(message "Databasen synkas. V{nta ett bra tag!"))
(setq mode-line-process ": saving")
(set-buffer-modified-p (buffer-modified-p))
(sit-for 0)
(if (not lyskom-pending-calls)
(initiate-get-time 'async nil))))
((eq msg-no 8) ; Forced leave conference
(lyskom-skip-tokens tokens))
((eq msg-no 9) ; A person has logged in
(let ((pers-no (lyskom-parse-num))
(session (lyskom-parse-num)))
(set-buffer buffer)
(if (and (/= 0 lyskom-pers-no)
(/= pers-no lyskom-pers-no))
; Don't show myself.
(initiate-get-conf-stat 'follow
(if kom-presence-messages
((eq msg-no 10) ; Broadcast message
(let ((sender (lyskom-parse-num))
(message (lyskom-parse-string)))
(set-buffer buffer)
(initiate-get-conf-stat 'follow
'lyskom-show-broadcast-message sender
((eq msg-no 11)
(set-buffer buffer)
(lyskom-insert-before-prompt "\
Meddelande fr}n LysKOM-systemet: N}gon f|rs|kte koppla upp,
men misslyckades eftersom alla tillg{ngliga f|rbindelser {r
upptagna. Logga ut och kom tillbaks senare om du v{ntar nu.
((eq msg-no 12) ; Message to the user (or everybody)
(let ((recipient (lyskom-parse-num))
(sender (lyskom-parse-num))
(message (lyskom-parse-string)))
(set-buffer buffer)
((string= message "info")
(initiate-send-message 'follow nil sender
(format "emacs-version %s\n%s"
(goto-char (point-min))
(forward-line 3)
(buffer-substring (point-min)
(initiate-get-conf-stat 'follow
'lyskom-show-personal-message sender
(lyskom-skip-tokens tokens)))))
\ No newline at end of file
......@@ -312,9 +312,12 @@ TYPE should be `list' or `vector'."
"\000\001\002\003\004\005\006\007\010 \012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]~\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237!AAAA[]ACEEEEIIIINOOOO\\OUUUYYAAAA[]ACEEEEIIIINOOOO\\OUUUYY"
"String mapping lowercase to uppercase and equivalents to each others.")
(defsubst lyskom-maybe-recode-string (s &optional coding)
"Change the encoding of S when multibyte characters are not supported"
(if (multibyte-string-p s)
(defsubst lyskom-maybe-recode-string (s &optional coding force)
"Change the encoding of S for when multibyte characters are not supported.
Optional second argument CODING is the coding system to use. If optional
third argument FORCE is non-nil, always encode multibyte strings, otherwise
only encode when multibyte strings are not supported."
(if (and (multibyte-string-p s) (or force (not enable-multibyte-characters)))
(encode-coding-string s (or coding
(and lyskom-language
(lyskom-language-coding lyskom-language))
......@@ -327,11 +330,11 @@ characters are enabled. This function is destructive unless optional copy
is non-nil."
(cond (enable-multibyte-characters table)
(copy (mapcar (lambda (el)
(cons (lyskom-maybe-recode-string (car el))
(cons (lyskom-maybe-recode-string (car el) nil t)
(cdr el)))
(t (lyskom-traverse el table
(setcar el (lyskom-maybe-recode-string (car el))))
(setcar el (lyskom-maybe-recode-string (car el) nil t)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment