Commit 24f9f45f authored by David Byers's avatar David Byers
Browse files

Further MULE-ification of name completion

Fix who-list formatting on wide windows
Fix some compiler warnings
Tweak login/logoff display
parent e20e028e
2000-05-23 David Byers <>
* lyskom-rest.el (lyskom-w3-region): Remove compiler warning about
unreferenced variable.
(lyskom-do-insert): Same here.
* flags.el (lyskom-save-options): Remove compiler warning about
unreferenced variable.
* utilities.el (lyskom-unicase-char): Use
* compatibility.el (lyskom-encode-coding-char): New function/macro.
* async.el (lyskom-show-logged-in-person): Print server name, not
KOM if the server is not in kom-server-aliases.
(lyskom-show-logged-out-person): Same here.
* commands1.el (lyskom-info-line-format-string): Compute field
widths correctly, even for very wide windows.
2000-05-22 David Byers <>
* completing-read.el (lyskom-complete-string): Construct the final
string by using concat rather than filling the chars of a vector
by hand. The losing MULE implementation will fail if you say
something like (aset string 0 ?) because is multibyte and aset
will only set one *byte*.
2000-05-19 David Byers <>
* startup.el (lyskom): Get the collate table from the
server. Note: thie needs to be protected so it isn't called on
servers that don't have the call!
* utilities.el (lyskom-unicase-char): Encode the char using server
default coding system. Otherwise this will not work with multibyte
latin1 chars in Gnu Emacs. ELUM wercS.
2000-05-19 David Byers <>
* Reinstated changes lost between 44.98 and 44.99.
......@@ -30,10 +30,15 @@ till funktionen, helst ocks
** Buggar i completion. (lyskom-complete-string '("Björn" "Bjørn"))
returnerar "Bj", inte "Björn". I Gnu Emacs ger "Väderd" TAB TAB
inte en lista. Det verkar bli så om completion innehåller svenska
tecken. Det blir rätt om man startar med --unibyte.
** I startup.el så görs en get-collate-table. Skydda anropet från
servrar som inte har get-collate-table.
** Defaultcollatetabellen verkar vara trasig. Den mappar inte om ø och
vänner rätt.
** I XEmacs (minst) blir historielistan i addera mottagare
uppercasead. Någonstans verkar det göras en destruktiv
lyskom-unicasing eller upcase av strängen.
** Martin, hade vissa problem med inställningarna. User-arean såg OK
ut och han säger att problemen försvann när han skrev en
......@@ -75,9 +80,6 @@ till funktionen, helst ocks
** In completing-read.el, MULEify the character comparisons.
** In completing-read.el, end of lyskom-complete-string, check how the
result of make-string is used and modified.
** The definition of lyskom-line-start-chars is not really kosher.
This should be MULEified. Perhaps a hash table of characters
instead of a vector. Problem is, speed is of the essence. Perhaps a
......@@ -346,7 +346,7 @@ according to the value of FLAG."
"Visa p} kommandoraden vem som loggat in."
(let ((server (or (cdr (lyskom-string-assoc lyskom-server-name
((lyskom-show-presence (conf-stat->conf-no conf-stat)
......@@ -378,7 +378,7 @@ according to the value of FLAG."
"Visa p} kommandoraden vem som loggat ut."
(let ((server (or (cdr (lyskom-string-assoc lyskom-server-name
((lyskom-show-presence (conf-stat->conf-no conf-stat)
......@@ -2259,7 +2259,7 @@ Uses Protocol A version 8 calls"
(lyskom-get-string 'is-doing)))
(concat (make-string (- (lyskom-window-width) 2) ?-) "\n"))
(concat (make-string (- (lyskom-window-width) 1) ?-) "\n"))
(while who-list
(let* ((who-info (car who-list))
......@@ -2282,7 +2282,7 @@ Uses Protocol A version 8 calls"
(concat "(" (who-info->doing-what who-info) ")"))))
(setq who-list (cdr who-list)))
(lyskom-insert (concat (make-string (- (lyskom-window-width) 2) ?-)
(lyskom-insert (concat (make-string (- (lyskom-window-width) 1) ?-)
(lyskom-insert (lyskom-format 'total-visible-users total-users
......@@ -2350,7 +2350,7 @@ Uses Protocol A version 9 calls"
(lyskom-get-string 'active-last)))
(concat (make-string (- (lyskom-window-width) 2) ?-) "\n"))
(concat (make-string (- (lyskom-window-width) 1) ?-) "\n"))
(while who-list
(let* ((who-info (car who-list))
......@@ -2435,7 +2435,7 @@ Uses Protocol A version 9 calls"
(setq who-list (cdr who-list))))
(lyskom-insert (concat (make-string (- (lyskom-window-width) 2) ?-)
(lyskom-insert (concat (make-string (- (lyskom-window-width) 1) ?-)
(lyskom-insert (lyskom-format
(cond ((and wants-invisibles (zerop idle-hide))
......@@ -2579,14 +2579,13 @@ Uses Protocol A version 9 calls"
(defun lyskom-info-line-format-string (prefixlen type1 type2)
"Return a format string suitable for inserting who-info lines etc."
(let* ((plen (or prefixlen 7))
(adj1 (+ plen 2))
(adj2 (+ adj1 1)))
(width (- (lyskom-window-width) plen 2)))
(concat "%" (int-to-string plen) "#1s"
(int-to-string (/ (* 37 (- (lyskom-window-width) adj1)) 73))
(int-to-string (/ width 2))
"#2" type1
" %=-"
(int-to-string (/ (* 37 (- (lyskom-window-width) adj2)) 73))
(int-to-string (+ (/ width 2) (% width 2)))
"#3" type2
......@@ -318,6 +318,16 @@ string to search in."
(lyskom-provide-function string-make-multibyte (str) str)
(lyskom-provide-function multibyte-string-p (str) nil)
(defmacro lyskom-encode-coding-char (c system) c)
(defun lyskom-encode-coding-char (c system)
(condition-case nil
(let ((s (encode-coding-char c system)))
(if (and s (= (length s) 1))
(elt s 0)))
(error c)))))
(fset 'lyskom-string-width (symbol-function 'string-width))
......@@ -740,14 +740,10 @@ the LysKOM rules of string matching."
(append (cons ? (make-list (1- backup) 2))
(setq main-accumulator (delq 'HERE main-accumulator))))
(concat (mapcar (lambda (el) (if (eq el 'SPC) ?\ el))
(let ((tmp (make-string (length main-accumulator) 0))
(index 0))
el main-accumulator
(aset tmp index (if (eq el 'SPC) ?\ el))
(setq index (1+ index)))
(defun lyskom-complete-string-accumulate (accumulator char)
(set accumulator (cons char (symbol-value accumulator))))
......@@ -99,6 +99,7 @@
(val (condition-case nil
(encode-coding-string data coding)
(error nil))))
(lyskom-ignore val)
(if (and val nil)
(format "%dC%s%dH%s"
(string-bytes (symbol-name coding))
......@@ -841,7 +841,7 @@ The position lyskom-last-viewed will always remain visible."
(setq start next)
(setq bounds (next-text-property-bounds 1 start
(error nil))))
(error (lyskom-ignore var)))))
......@@ -1701,7 +1701,7 @@ in lyskom-messages."
(w3-region start end)
(add-text-properties (point-min) (point-max) '(end-closed nil))))
(error nil))))
(error (lyskom-ignore var)))))
(defun lyskom-format-html (text)
......@@ -257,6 +257,9 @@ See lyskom-mode for details."
(version-info->software-version lyskom-server-version-info))
;; FIXME: Only do this if we have the required features!
(setq lyskom-collate-table (blocking-do 'get-collate-table))
(if (not (zerop (server-info->motd-of-lyskom
(blocking-do-multiple ((text (get-text
......@@ -815,7 +818,8 @@ to see, set of call."
(setq lyskom-do-when-done (cons kom-do-when-done kom-do-when-done))
(setq lyskom-output-queues (make-vector 10 nil))
(setq lyskom-collate-table lyskom-default-collate-table) (let ((i 0))
(setq lyskom-collate-table lyskom-default-collate-table)
(let ((i 0))
(while (< i 10)
(aset lyskom-output-queues i (lyskom-queue-create))
(setq i (1+ i))))
......@@ -277,7 +277,7 @@ of \(current-time\)."
(defvar lyskom-default-collate-table
"\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[\\]~!AAAA[]ACEEEEIIIINOOOO\\OUUUYYAAAA[]ACEEEEIIIINOOOO\\OUUUYY"
"\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[\\]~!AAAA[]ACEEEEIIIINOOOO\\OUUUYYށAAAA[]ACEEEEIIIINOOOO\\OUUUYY"
"String mapping lowercase to uppercase and equivalents to each others.")
(defsubst lyskom-maybe-recode-string (s)
......@@ -290,9 +290,12 @@ of \(current-time\)."
(defsubst lyskom-unicase-char (c)
"Smash case and diacritical marks on c."
(if (< (char-to-int c) (length lyskom-default-collate-table))
(if (< (char-to-int c) (length lyskom-collate-table))
(aref lyskom-collate-table (char-to-int c))
(setq c (lyskom-encode-coding-char c lyskom-server-coding-system))
(if (and c (< (char-to-int c) (length lyskom-collate-table)))
(aref lyskom-collate-table (char-to-int c))
(defun lyskom-unicase (s)
"Smash case and diacritical marks of all chars in s."
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