Commit 3c6f9e2a authored by David Byers's avatar David Byers
Browse files

First set of fixes for Gnu Emacs 22.1

parent db2b9968
2007-06-08 <David Byers@TAMIZDAT>
* lyskom-rest.el (lyskom-sentinel): Check that proc is a process
before using it as such. Call lyskom-remove-unread-buffer with the
right argument (the buffer, not the process).
(lyskom-session-nickname): Don't croak if the process is nil.
* language.el (lyskom-get-menu-string): Decode menu string from
latin-1 rather than encoding it.
* compatibility.el (lyskom-frame-width): Dummy definition of
lyskom-frame-width to suppress compilation warning.
* view-text.el: Replaced string-to-int with
lyskom-string-to-number.
* aux-items.el: Same.
* commands1.el: Same.
* compatibility.el: Same.
* completing-read.el: Same.
* edit-text.el: Same.
* faqs.el: Same.
* filter-edit.el: Same.
* flags.el: Same.
* lyskom-buttons.el: Same.
* lyskom-rest.el: Same.
* option-edit.el: Same.
* parse.el: Same.
* regexp.el: Same.
* review.el: Same.
* startup.el: Same.
* utilities.el: Same.
* utilities.el: Fix for Emacs 22.1 (should also improve
performance on XEmacs).
(lyskom-string-to-int): Clarifyig comment in docstring.
2007-04-26 Hans Eric Svensson <eric+lyskom@lysator.liu.se> 2007-04-26 Hans Eric Svensson <eric+lyskom@lysator.liu.se>
* lyskom-rest.el (lyskom-cache-all-memberships): New function * lyskom-rest.el (lyskom-cache-all-memberships): New function
......
...@@ -452,19 +452,19 @@ Invalid tests are silently ignored." ...@@ -452,19 +452,19 @@ Invalid tests are silently ignored."
(concat (concat
(cond ((string-match "^P\\([0-9]+\\)" (aux-item->data item)) (cond ((string-match "^P\\([0-9]+\\)" (aux-item->data item))
(lyskom-format 'cross-reference-pers-aux (lyskom-format 'cross-reference-pers-aux
(string-to-int (lyskom-string-to-number
(match-string 1 (aux-item->data item))) (match-string 1 (aux-item->data item)))
pers pers
)) ))
((string-match "^C\\([0-9]+\\)" (aux-item->data item)) ((string-match "^C\\([0-9]+\\)" (aux-item->data item))
(lyskom-format 'cross-reference-conf-aux (lyskom-format 'cross-reference-conf-aux
(string-to-int (lyskom-string-to-number
(match-string 1 (aux-item->data item))) (match-string 1 (aux-item->data item)))
pers pers
)) ))
((string-match "^T\\([0-9]+\\)" (aux-item->data item)) ((string-match "^T\\([0-9]+\\)" (aux-item->data item))
(lyskom-format 'cross-reference-text-aux (lyskom-format 'cross-reference-text-aux
(string-to-int (lyskom-string-to-number
(match-string 1 (aux-item->data item))) (match-string 1 (aux-item->data item)))
pers pers
)) ))
...@@ -482,19 +482,19 @@ Invalid tests are silently ignored." ...@@ -482,19 +482,19 @@ Invalid tests are silently ignored."
(concat (concat
(cond ((string-match "^P\\([0-9]+\\)" (aux-item->data item)) (cond ((string-match "^P\\([0-9]+\\)" (aux-item->data item))
(lyskom-format 'cross-reference-pers-status-aux (lyskom-format 'cross-reference-pers-status-aux
(string-to-int (lyskom-string-to-number
(match-string 1 (aux-item->data item))) (match-string 1 (aux-item->data item)))
(aux-item->creator pers) (aux-item->creator pers)
)) ))
((string-match "^C\\([0-9]+\\)" (aux-item->data item)) ((string-match "^C\\([0-9]+\\)" (aux-item->data item))
(lyskom-format 'cross-reference-conf-status-aux (lyskom-format 'cross-reference-conf-status-aux
(string-to-int (lyskom-string-to-number
(match-string 1 (aux-item->data item))) (match-string 1 (aux-item->data item)))
pers pers
)) ))
((string-match "^T\\([0-9]+\\)" (aux-item->data item)) ((string-match "^T\\([0-9]+\\)" (aux-item->data item))
(lyskom-format 'cross-reference-text-status-aux (lyskom-format 'cross-reference-text-status-aux
(string-to-int (lyskom-string-to-number
(match-string 1 (aux-item->data item))) (match-string 1 (aux-item->data item)))
(aux-item->creator pers) (aux-item->creator pers)
)) ))
...@@ -597,7 +597,7 @@ Invalid tests are silently ignored." ...@@ -597,7 +597,7 @@ Invalid tests are silently ignored."
(match-string 1 (aux-item->data item)))) (match-string 1 (aux-item->data item))))
((string-match "^LysKOM:\\(.*\\)$" (aux-item->data item)) ((string-match "^LysKOM:\\(.*\\)$" (aux-item->data item))
(lyskom-format 'redirect-lyskom-aux (lyskom-format 'redirect-lyskom-aux
(string-to-int (lyskom-string-to-number
(match-string 1 (aux-item->data item)))))) (match-string 1 (aux-item->data item))))))
(lyskom-aux-item-terminating-button item obj))) (lyskom-aux-item-terminating-button item obj)))
...@@ -666,7 +666,7 @@ Invalid tests are silently ignored." ...@@ -666,7 +666,7 @@ Invalid tests are silently ignored."
(defun lyskom-status-print-faq-text (item &optional obj) (defun lyskom-status-print-faq-text (item &optional obj)
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int) (if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let* ((text-no (string-to-int (aux-item->data item))) (let* ((text-no (lyskom-string-to-number (aux-item->data item)))
(subject (if kom-deferred-printing (subject (if kom-deferred-printing
(lyskom-create-defer-info 'get-text-stat (lyskom-create-defer-info 'get-text-stat
text-no text-no
...@@ -688,7 +688,7 @@ Invalid tests are silently ignored." ...@@ -688,7 +688,7 @@ Invalid tests are silently ignored."
(defun lyskom-print-faq-for-conf (item &optional obj) (defun lyskom-print-faq-for-conf (item &optional obj)
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int) (if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let ((conf-no (string-to-int (aux-item->data item)))) (let ((conf-no (lyskom-string-to-number (aux-item->data item))))
(concat (concat
(cond ((zerop conf-no) (lyskom-get-string 'faq-for-server-aux)) (cond ((zerop conf-no) (lyskom-get-string 'faq-for-server-aux))
(t (lyskom-format 'faq-for-conf-aux conf-no))) (t (lyskom-format 'faq-for-conf-aux conf-no)))
...@@ -707,7 +707,7 @@ Invalid tests are silently ignored." ...@@ -707,7 +707,7 @@ Invalid tests are silently ignored."
(defun lyskom-print-send-comments-to (item &optional obj) (defun lyskom-print-send-comments-to (item &optional obj)
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int) (if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let ((conf-no (string-to-int (aux-item->data item)))) (let ((conf-no (lyskom-string-to-number (aux-item->data item))))
(lyskom-format-insert 'status-send-comments-to (lyskom-format-insert 'status-send-comments-to
conf-no conf-no
(lyskom-aux-item-terminating-button item obj))) (lyskom-aux-item-terminating-button item obj)))
...@@ -746,7 +746,7 @@ Invalid tests are silently ignored." ...@@ -746,7 +746,7 @@ Invalid tests are silently ignored."
(defun lyskom-print-recommended-conf (item &optional obj) (defun lyskom-print-recommended-conf (item &optional obj)
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int) (if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let ((conf-no (string-to-int (aux-item->data item)))) (let ((conf-no (lyskom-string-to-number (aux-item->data item))))
(lyskom-format-insert 'recommended-conf-aux (lyskom-format-insert 'recommended-conf-aux
conf-no conf-no
(lyskom-aux-item-terminating-button item obj))) (lyskom-aux-item-terminating-button item obj)))
...@@ -773,7 +773,7 @@ Invalid tests are silently ignored." ...@@ -773,7 +773,7 @@ Invalid tests are silently ignored."
(defun lyskom-print-elisp-client-rejected-invitation (item &optional obj) (defun lyskom-print-elisp-client-rejected-invitation (item &optional obj)
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int) (if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let ((conf-no (string-to-int (aux-item->data item)))) (let ((conf-no (lyskom-string-to-number (aux-item->data item))))
(lyskom-format-insert 'status-rejected-recommendation-aux-item (lyskom-format-insert 'status-rejected-recommendation-aux-item
conf-no conf-no
(lyskom-aux-item-terminating-button item obj))) (lyskom-aux-item-terminating-button item obj)))
......
...@@ -240,7 +240,7 @@ This command accepts text number prefix arguments (see ...@@ -240,7 +240,7 @@ This command accepts text number prefix arguments (see
(defun lyskom-print-comment-like-aux (item object) (defun lyskom-print-comment-like-aux (item object)
(when (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int) (when (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let* ((text-no (string-to-int (aux-item->data item))) (let* ((text-no (lyskom-string-to-number (aux-item->data item)))
(text-stat nil) (text-stat nil)
(text nil)) (text nil))
(unless kom-deferred-printing (unless kom-deferred-printing
...@@ -2269,7 +2269,7 @@ exist." ...@@ -2269,7 +2269,7 @@ exist."
;; Incorrect completion, integer entered. ;; Incorrect completion, integer entered.
((string-match "\\`\\s-*[0-9]+\\s-*\\'" mark) ((string-match "\\`\\s-*[0-9]+\\s-*\\'" mark)
(setq mark-type (string-to-int mark))) (setq mark-type (lyskom-string-to-number mark)))
;; Incorrect completion; create new symbolic mark type. ;; Incorrect completion; create new symbolic mark type.
((and create-nonexistent ((and create-nonexistent
......
...@@ -134,6 +134,7 @@ KEYS should be a string in the format used for saving keyboard macros ...@@ -134,6 +134,7 @@ KEYS should be a string in the format used for saving keyboard macros
;; If we use lyskom-function-alias here we'll get an obsolecense ;; If we use lyskom-function-alias here we'll get an obsolecense
;; warning about screen-width. This way the compiler won't notice :-) ;; warning about screen-width. This way the compiler won't notice :-)
(defun lyskom-frame-width ())
(if (fboundp 'frame-width) (if (fboundp 'frame-width)
(defalias 'lyskom-frame-width 'frame-width) (defalias 'lyskom-frame-width 'frame-width)
(fset 'lyskom-frame-width 'screen-width)) (fset 'lyskom-frame-width 'screen-width))
...@@ -677,6 +678,13 @@ Emacsen." ...@@ -677,6 +678,13 @@ Emacsen."
(defun lyskom-make-local-hook (hook)) (defun lyskom-make-local-hook (hook))
(fset 'lyskom-make-local-hook 'make-local-hook))) (fset 'lyskom-make-local-hook 'make-local-hook)))
;;; ================================================================
;;; Emacs 22.1 stuff
(defun lyskom-string-to-number(string &optional base))
(if (fboundp 'string-to-number)
(defalias 'lyskom-string-to-number 'string-to-number)
(defalias 'lyskom-string-to-number 'string-to-int))
;;; ================================================================ ;;; ================================================================
......
...@@ -407,7 +407,7 @@ persons who are logged on." ...@@ -407,7 +407,7 @@ persons who are logged on."
"Used internally by lyskom-read-conf-internal to expand person and "Used internally by lyskom-read-conf-internal to expand person and
conference number specifications to something useful." conference number specifications to something useful."
(cond ((string-match (lyskom-get-string 'person-or-conf-no-regexp) string) (cond ((string-match (lyskom-get-string 'person-or-conf-no-regexp) string)
(let* ((no (string-to-int (match-string 1 string))) (let* ((no (lyskom-string-to-number (match-string 1 string)))
(cs (blocking-do 'get-uconf-stat no))) (cs (blocking-do 'get-uconf-stat no)))
(if (and cs (if (and cs
(lyskom-read-conf-internal-verify-type (lyskom-read-conf-internal-verify-type
...@@ -420,7 +420,7 @@ conference number specifications to something useful." ...@@ -420,7 +420,7 @@ conference number specifications to something useful."
cs cs
(list string))))) (list string)))))
((string-match (lyskom-get-string 'session-no-regexp) string) ((string-match (lyskom-get-string 'session-no-regexp) string)
(let* ((no (string-to-int (match-string 1 string))) (let* ((no (lyskom-string-to-number (match-string 1 string)))
(si (blocking-do 'get-session-info no)) (si (blocking-do 'get-session-info no))
(cs (and si (cs (and si
(blocking-do 'get-uconf-stat (blocking-do 'get-uconf-stat
......
...@@ -1670,7 +1670,7 @@ non-nil. If MATCH-NUMBER is 'angled, only match a number inside <>." ...@@ -1670,7 +1670,7 @@ non-nil. If MATCH-NUMBER is 'angled, only match a number inside <>."
(nil (nil
"")))) ""))))
(if match-number (if match-number
(string-to-int (buffer-substring (match-beginning 2) (lyskom-string-to-number (buffer-substring (match-beginning 2)
(match-end 2))) (match-end 2)))
t) t)
nil)) nil))
......
...@@ -68,8 +68,8 @@ ...@@ -68,8 +68,8 @@
(lyskom-traverse item aux-list (lyskom-traverse item aux-list
(when (string-match "^\\([0-9]+\\) \\([0-9]+\\)" (aux-item->data item)) (when (string-match "^\\([0-9]+\\) \\([0-9]+\\)" (aux-item->data item))
(setq lyskom-read-faqs (setq lyskom-read-faqs
(cons (cons (string-to-int (match-string 1 (aux-item->data item))) (cons (cons (lyskom-string-to-number (match-string 1 (aux-item->data item)))
(string-to-int (match-string 2 (aux-item->data item)))) (lyskom-string-to-number (match-string 2 (aux-item->data item))))
lyskom-read-faqs)))))) lyskom-read-faqs))))))
;;; ====================================================================== ;;; ======================================================================
...@@ -170,9 +170,9 @@ do this. To add a FAQ, use `kom-add-server-faq'." ...@@ -170,9 +170,9 @@ do this. To add a FAQ, use `kom-add-server-faq'."
nil t))) nil t)))
(when text-no (when text-no
(lyskom-format-insert 'deleting-faq (lyskom-format-insert 'deleting-faq
(string-to-int text-no) (lyskom-string-to-number text-no)
conf-stat) conf-stat)
(cache-del-text-stat (string-to-int text-no)) (cache-del-text-stat (lyskom-string-to-number text-no))
(when conf-stat (when conf-stat
(cache-del-conf-stat (conf-stat->conf-no conf-stat))) (cache-del-conf-stat (conf-stat->conf-no conf-stat)))
(lyskom-report-command-answer (lyskom-report-command-answer
...@@ -310,7 +310,7 @@ create a new FAQ." ...@@ -310,7 +310,7 @@ create a new FAQ."
faq-list) faq-list)
nil t) nil t)
faq-list)))) faq-list))))
(text-no (and text-no-aux (string-to-int (car text-no-aux)))) (text-no (and text-no-aux (lyskom-string-to-number (car text-no-aux))))
(aux-no (and text-no-aux (cdr text-no-aux)))) (aux-no (and text-no-aux (cdr text-no-aux))))
(cond (cond
......
...@@ -499,7 +499,7 @@ If NEWLINE is non-nil, insert a newline after the header." ...@@ -499,7 +499,7 @@ If NEWLINE is non-nil, insert a newline after the header."
(cond ((memq what '(author subject text recipient)) (cond ((memq what '(author subject text recipient))
(setq arg argstring)) (setq arg argstring))
((memq what '(author-no recipient-no)) ((memq what '(author-no recipient-no))
(setq arg (string-to-int argstring))) (setq arg (lyskom-string-to-number argstring)))
((memq what '(author-re subject-re text-re recipient-re)) ((memq what '(author-re subject-re text-re recipient-re))
(setq arg argstring) (setq arg argstring)
(lyskom-filter-verify-regexp arg)))) (lyskom-filter-verify-regexp arg))))
......
...@@ -391,7 +391,7 @@ for more information." ...@@ -391,7 +391,7 @@ for more information."
;; Read the explicit coding, if any ;; Read the explicit coding, if any
(when (string-match "^[0-9]+C" lyskom-options-text) (when (string-match "^[0-9]+C" lyskom-options-text)
(let ((len (string-to-int lyskom-options-text))) (let ((len (lyskom-string-to-number lyskom-options-text)))
(setq coding (intern (setq coding (intern
(substring lyskom-options-text (substring lyskom-options-text
(match-end 0) (match-end 0)
...@@ -401,7 +401,7 @@ for more information." ...@@ -401,7 +401,7 @@ for more information."
;; Read the string ;; Read the string
(let ((len (string-to-int lyskom-options-text)) (let ((len (lyskom-string-to-number lyskom-options-text))
(start (progn (string-match "[0-9]+H" lyskom-options-text) (start (progn (string-match "[0-9]+H" lyskom-options-text)
(match-end 0)))) (match-end 0))))
(let ((name (substring lyskom-options-text start (+ start len)))) (let ((name (substring lyskom-options-text start (+ start len))))
...@@ -424,7 +424,7 @@ If optional NO-CODING is set, assume the string has internal coding." ...@@ -424,7 +424,7 @@ If optional NO-CODING is set, assume the string has internal coding."
;; Read the explicit coding, if any ;; Read the explicit coding, if any
(when (string-match "^[0-9]+C" string) (when (string-match "^[0-9]+C" string)
(let ((len (string-to-int string))) (let ((len (lyskom-string-to-number string)))
(setq coding (intern (setq coding (intern
(substring string (substring string
(match-end 0) (match-end 0)
...@@ -433,7 +433,7 @@ If optional NO-CODING is set, assume the string has internal coding." ...@@ -433,7 +433,7 @@ If optional NO-CODING is set, assume the string has internal coding."
;; Read the string ;; Read the string
(let ((len (string-to-int string)) (let ((len (lyskom-string-to-number string))
(start (progn (string-match "[0-9]+H" string) (start (progn (string-match "[0-9]+H" string)
(match-end 0)))) (match-end 0))))
(let ((name (substring string start (+ start len)))) (let ((name (substring string start (+ start len))))
...@@ -514,7 +514,7 @@ elisp variable VAR." ...@@ -514,7 +514,7 @@ elisp variable VAR."
(defun lyskom-flag-read-integer (str) (defun lyskom-flag-read-integer (str)
(cond ((equal str "nil") nil) (cond ((equal str "nil") nil)
(t (string-to-int str)))) (t (lyskom-string-to-number str))))
(defun lyskom-flag-write-integer (val) (defun lyskom-flag-write-integer (val)
(cond ((integerp val) (prin1-to-string val)) (cond ((integerp val) (prin1-to-string val))
......
...@@ -1429,7 +1429,7 @@ ARG may be a conf-stat, pers-stat, uconf-stat, conf-z-info, integer or string." ...@@ -1429,7 +1429,7 @@ ARG may be a conf-stat, pers-stat, uconf-stat, conf-z-info, integer or string."
((lyskom-uconf-stat-p arg) (uconf-stat->conf-no arg)) ((lyskom-uconf-stat-p arg) (uconf-stat->conf-no arg))
((numberp arg) arg) ((numberp arg) arg)
((lyskom-conf-z-info-p arg) (conf-z-info->conf-no arg)) ((lyskom-conf-z-info-p arg) (conf-z-info->conf-no arg))
((stringp arg) (string-to-int arg))))) ((stringp arg) (lyskom-string-to-number arg)))))
(when conf-no (when conf-no
(cond ((cache-get-conf-stat conf-no)) (cond ((cache-get-conf-stat conf-no))
(conf-no (initiate-get-conf-stat 'background nil conf-no) (conf-no (initiate-get-conf-stat 'background nil conf-no)
......
...@@ -948,7 +948,7 @@ by PERS-NO" ...@@ -948,7 +948,7 @@ by PERS-NO"
(lyskom-traverse item aux-list (lyskom-traverse item aux-list
(when (string-match "^\\([0-9]+\\)" (aux-item->data item)) (when (string-match "^\\([0-9]+\\)" (aux-item->data item))
(setq lyskom-rejected-recommendations (setq lyskom-rejected-recommendations
(cons (string-to-int (match-string 1 (aux-item->data item))) (cons (lyskom-string-to-number (match-string 1 (aux-item->data item)))
lyskom-rejected-recommendations)))))) lyskom-rejected-recommendations))))))
(defun lyskom-startup-check-recommended-memberships () (defun lyskom-startup-check-recommended-memberships ()
...@@ -959,8 +959,8 @@ by PERS-NO" ...@@ -959,8 +959,8 @@ by PERS-NO"
(not (lyskom-recommendation-already-rejected (car rec)))) (not (lyskom-recommendation-already-rejected (car rec))))
(mapcar (lambda (aux) (mapcar (lambda (aux)
(when (string-match "^\\([0-9]+\\)\\( [0-9]+\\)?\\( [01]+\\)?" (aux-item->data aux)) (when (string-match "^\\([0-9]+\\)\\( [0-9]+\\)?\\( [01]+\\)?" (aux-item->data aux))
(let* ((conf-no (string-to-int (match-string 1 (aux-item->data aux)))) (let* ((conf-no (lyskom-string-to-number (match-string 1 (aux-item->data aux))))
(priority (and conf-no (match-string 2) (string-to-int (match-string 2 (aux-item->data aux))))) (priority (and conf-no (match-string 2) (lyskom-string-to-number (match-string 2 (aux-item->data aux)))))
(mship-type (and priority (match-string 3) (match-string 3 (aux-item->data aux))))) (mship-type (and priority (match-string 3) (match-string 3 (aux-item->data aux)))))
(list conf-no priority mship-type (aux-item->creator aux))))) (list conf-no priority mship-type (aux-item->creator aux)))))
(lyskom-get-aux-item (server-info->aux-item-list (lyskom-get-aux-item (server-info->aux-item-list
...@@ -1011,8 +1011,8 @@ that are no longer FAQs or are missing." ...@@ -1011,8 +1011,8 @@ that are no longer FAQs or are missing."
(lyskom-traverse item (lyskom-get-aux-item (conf-stat->aux-items conf-stat) (lyskom-traverse item (lyskom-get-aux-item (conf-stat->aux-items conf-stat)
10000) 10000)
(when (string-match "^\\([0-9]+\\) \\([0-9]+\\)" (aux-item->data item)) (when (string-match "^\\([0-9]+\\) \\([0-9]+\\)" (aux-item->data item))
(let ((conf-no (string-to-int (match-string 1 (aux-item->data item)))) (let ((conf-no (lyskom-string-to-number (match-string 1 (aux-item->data item))))
(text-no (string-to-int (match-string 2 (aux-item->data item))))) (text-no (lyskom-string-to-number (match-string 2 (aux-item->data item)))))
(initiate-get-text-stat 'background (initiate-get-text-stat 'background
'lyskom-clean-read-faqs-1 'lyskom-clean-read-faqs-1
text-no text-no
...@@ -1581,10 +1581,10 @@ Deferred insertions are not supported." ...@@ -1581,10 +1581,10 @@ Deferred insertions are not supported."
(let* ((s (match-string 2 (format-state->format-string format-state)))) (let* ((s (match-string 2 (format-state->format-string format-state))))
(cond ((or (string-match "\\(-?[0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" s) (cond ((or (string-match "\\(-?[0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" s)
(string-match "\\(-?[0-9]+\\)\\.\\([0-9]+\\)" s)) (string-match "\\(-?[0-9]+\\)\\.\\([0-9]+\\)" s))
(setq pad-length (string-to-int (match-string 1 s))) (setq pad-length (lyskom-string-to-number (match-string 1 s)))
(setq frac-min (string-to-int (match-string 2 s))) (setq frac-min (lyskom-string-to-number (match-string 2 s)))
(setq frac-max (string-to-int (or (match-string 3 s) (match-string 2 s))))) (setq frac-max (lyskom-string-to-number (or (match-string 3 s) (match-string 2 s)))))
(t (setq pad-length (string-to-int s)))))) (t (setq pad-length (lyskom-string-to-number s))))))
(setq pad-length nil)) (setq pad-length nil))
(setq equals-flag (and (match-beginning 1) (setq equals-flag (and (match-beginning 1)
...@@ -1592,7 +1592,7 @@ Deferred insertions are not supported." ...@@ -1592,7 +1592,7 @@ Deferred insertions are not supported."
(format-state->format-string (format-state->format-string
format-state)) 0)) format-state)) 0))
arg-no (if (match-beginning 6) arg-no (if (match-beginning 6)
(string-to-int (lyskom-string-to-number
(match-string 6 (format-state->format-string (match-string 6 (format-state->format-string
format-state))) format-state)))
nil) nil)
...@@ -3132,7 +3132,7 @@ See `kom-save-text-body' for an alternative to this command." ...@@ -3132,7 +3132,7 @@ See `kom-save-text-body' for an alternative to this command."
(while (and arg (> arg 0)) (while (and arg (> arg 0))
(backward-text 1) (backward-text 1)
(if (looking-at "\\([0-9]+\\)\\s-") (if (looking-at "\\([0-9]+\\)\\s-")
(setq list-of-texts (cons (string-to-int (match-string 1)) (setq list-of-texts (cons (lyskom-string-to-number (match-string 1))
list-of-texts) list-of-texts)
arg (1- arg)) arg (1- arg))
(setq arg 0))) (setq arg 0)))
...@@ -3788,7 +3788,7 @@ The result will be a number or a list of (YEAR MONTH DATE)." ...@@ -3788,7 +3788,7 @@ The result will be a number or a list of (YEAR MONTH DATE)."
(lambda (val) (lambda (val)
(cond (cond
((string-match "^\\s-*[0-9]+\\s-*$" val) ((string-match "^\\s-*[0-9]+\\s-*$" val)
(let ((num (string-to-int val))) (let ((num (lyskom-string-to-number val)))
(unless (and (>= num low) (<= num high)) (unless (and (>= num low) (<= num high))
(lyskom-get-string 'number-out-of-range)))) (lyskom-get-string 'number-out-of-range))))
((and empty (string-match "^\\s-*$" val)) nil) ((and empty (string-match "^\\s-*$" val)) nil)
...@@ -3797,7 +3797,7 @@ The result will be a number or a list of (YEAR MONTH DATE)." ...@@ -3797,7 +3797,7 @@ The result will be a number or a list of (YEAR MONTH DATE)."
(progn (lyskom-parse-date val) nil) (progn (lyskom-parse-date val) nil)
(lyskom-error (lyskom-get-string 'invalid-date-entry)))))))) (lyskom-error (lyskom-get-string 'invalid-date-entry))))))))
(cond ((string-match "^\\s-*[0-9]+\\s-*$" val) (cond ((string-match "^\\s-*[0-9]+\\s-*$" val)
(let ((num (string-to-int val))) (let ((num (lyskom-string-to-number val)))
(when (and (>= num low) (<= num high)) (when (and (>= num low) (<= num high))
(setq result num)))) (setq result num))))
((and empty (string-match "^\\s-*$" val)) ((and empty (string-match "^\\s-*$" val))
...@@ -4171,8 +4171,9 @@ If MEMBERSHIPs prioriy is 0, it always returns nil." ...@@ -4171,8 +4171,9 @@ If MEMBERSHIPs prioriy is 0, it always returns nil."
(defun lyskom-sentinel (proc sentinel) (defun lyskom-sentinel (proc sentinel)
"Handles changes in the lyskom-process." "Handles changes in the lyskom-process."
(lyskom-remove-unread-buffer proc) (when (processp proc)
(set-buffer (process-buffer proc)) (lyskom-remove-unread-buffer (process-buffer proc))
(set-buffer (process-buffer proc)))
(lyskom-start-of-command (lyskom-get-string 'process-signal) t t) (lyskom-start-of-command (lyskom-get-string 'process-signal) t t)
(lyskom-format-insert 'closed-connection (lyskom-format-insert 'closed-connection
sentinel sentinel
...@@ -4470,7 +4471,8 @@ One parameter - the prompt string." ...@@ -4470,7 +4471,8 @@ One parameter - the prompt string."
"Return the nickname to use for this LysKOM session." "Return the nickname to use for this LysKOM session."
(if kom-session-nickname (if kom-session-nickname
kom-session-nickname kom-session-nickname
(let ((server (process-name (get-buffer-process (current-buffer))))) (let* ((proc (get-buffer-process (current-buffer)))
(server (if proc (process-name proc) lyskom-server-name)))
(or (cdr (assoc server (or (cdr (assoc server
(append kom-server-aliases (append kom-server-aliases
kom-builtin-server-aliases))) kom-builtin-server-aliases)))
......
...@@ -1733,7 +1733,7 @@ All key bindings: ...@@ -1733,7 +1733,7 @@ All key bindings:
(widget-setup))) (widget-setup)))
(defun lyskom-widget-number-value-to-external (widget value) (defun lyskom-widget-number-value-to-external (widget value)
(cond ((stringp value) (string-to-int value)) (cond ((stringp value) (lyskom-string-to-number value))
((numberp value) value) ((numberp valu