Commit 393a3693 authored by David Byers's avatar David Byers
Browse files

Yet additional Gnu Emacs MULE fixes

parent 9e85692c
1999-11-21 David Byers <davby@ida.liu.se>
* edit-text.el (lyskom-edit-insert-miscs): Use lyskom-princ to
insert subject.
* slow.el (kom-expand-slow-command): Use lyskom-string=
* flags.el (lyskom-read-options-eval): Use lyskom-string=
* edit-text.el (kom-ispell-message): Use lyskom-string=
(lyskom-send-enriched): Same here.
* completing-read.el (lyskom-completing-member): Same here.
* commands1.el (kom-change-password): Use lyskom-string=
(lyskom-return-username): Same here.
* utilities.el (lyskom-string=): New function.
(lyskom-string-assoc): Use it.
* language.el (lyskom-language-coding): New function.
(lyskom-define-language): Added argument CODING.
* lyskom-rest.el (lyskom-update-prompt): Set rear-nonsticky on
prompt text properties.
......
......@@ -52,6 +52,9 @@ EMACS-BATCH = $(EMACS) -batch
GENERIC-CLEAN = *~ *.o core
GENERIC-DIST-CLEAN = TAGS
TARGET=lyskom.elc
TARGET-EL=$(TARGET:%.elc=%.el)
LANGUAGE-EL=$(LANGUAGES:=-strings.el)
EMACS-BATCH=$(EMACS) -batch
SOURCES = $(LANGUAGE-EL) \
......@@ -110,7 +113,7 @@ HEADER-ELC = $(HEADER:%.el=%.elc)
SOURCES-ELC = $(SOURCES:%.el=%.elc)
all: lyskom.elc
all: $(TARGET)
vars.el: vars.el.in Makefile
rm -f vars.el
......@@ -124,13 +127,15 @@ header.el: $(HEADER)
cat $(HEADER) > header.el
fast: $(HEADER-ELC) $(SOURCES-ELC)
cat $(HEADER-ELC) $(SOURCES-ELC) > lyskom.elc
cat $(HEADER-ELC) $(SOURCES-ELC) > $(TARGET)
lyskom.el: $(HEADER) $(SOURCES)
cat $(HEADER) $(SOURCES) > lyskom.el
lyskom.elc: lyskom.el
$(EMACS-BATCH) -l ./lpath.el -f batch-byte-compile lyskom.el
$(TARGET): lyskom.el
cp lyskom.el $(TARGET-EL)
$(EMACS-BATCH) -l ./lpath.el -f batch-byte-compile $(TARGET-EL)
rm $(TARGET-EL)
check: lyskom.el
$(EMACS-BATCH) -l ./lpath.el -l ./lyskom.el -l ./check-strings.el \
......@@ -139,7 +144,7 @@ check: lyskom.el
.PHONY: verbose
.PHONY: verbose-el
verbose: verbose-el lyskom.elc
verbose: verbose-el $(TARGET)
verbose-el: $(HEADER) $(SOURCES)
@echo "Building lyskom.el"
......@@ -154,8 +159,8 @@ verbose-el: $(HEADER) $(SOURCES)
TAGS: $(HEADER) $(SOURCES)
etags $(HEADER) $(SOURCES)
install: lyskom.elc lyskom.el
cp lyskom.el lyskom.elc $(LISPDIR)
install: $(TARGET) lyskom.el
cp lyskom.el $(TARGET) $(LISPDIR)
release: release-files release-cleanup release-move
......
......@@ -1666,7 +1666,7 @@ If MARK-NO is nil, review all marked texts."
(new-pw1 (silent-read (lyskom-get-string 'new-passwd)))
(new-pw2 (silent-read (lyskom-get-string 'new-passwd-again))))
(if (string= new-pw1 new-pw2)
(if (lyskom-string= new-pw1 new-pw2)
(progn
(lyskom-insert-string 'changing-passwd)
(lyskom-report-command-answer
......@@ -2620,8 +2620,8 @@ Uses Protocol A version 9 calls"
(match-end 2))))
(rest (substring username (match-end 0))))
(if (or (not sent)
(string= (downcase sent) (downcase gott))
(string= (downcase sent)
(lyskom-string= (downcase sent) (downcase gott))
(lyskom-string= (downcase sent)
(downcase (concat gott rest))))
(concat name "@" gott rest)
(concat name "@" sent " (" gott rest ")")))
......@@ -2634,7 +2634,7 @@ Uses Protocol A version 9 calls"
(if (string-match "\\(.*\\)%\\(.*\\)" username)
(let ((user (substring username (match-beginning 1) (match-end 1)))
(uhost (substring username (match-beginning 2) (match-end 2))))
(if (string= uhost hostname)
(if (lyskom-string= uhost hostname)
(concat user "@" hostname)
(concat username "@" hostname)))
(concat username "@" hostname)))
......
......@@ -500,7 +500,7 @@ function work as a name-to-conf-stat translator."
(let ((string (lyskom-unicase (lyskom-completing-strip-name string)))
(result nil))
(while (and list (not result))
(if (string= string (lyskom-unicase
(if (lyskom-string= string (lyskom-unicase
(lyskom-completing-strip-name (car list))))
(setq result list)
(setq list (cdr list))))
......
......@@ -218,12 +218,12 @@ footn-to -> Fotnot till text %d."
(concat (lyskom-get-string 'aux-item-prefix) data "\n")
where-put-misc)))))
aux-list)
(princ (lyskom-format 'text-mass subject
(substitute-command-keys
(lyskom-get-string 'header-separator))
body
(lyskom-get-string 'header-subject))
where-put-misc)
(lyskom-princ (lyskom-format 'text-mass subject
(substitute-command-keys
(lyskom-get-string 'header-separator))
body
(lyskom-get-string 'header-subject))
where-put-misc)
(set-buffer edit-buffer)
(goto-char where-put-misc)
))
......@@ -665,7 +665,7 @@ Based on ispell-message."
(require 'ispell)
(let ((ispell-dictionary (or kom-ispell-dictionary ispell-dictionary))
(kill-ispell (or (not (boundp 'ispell-dictionary))
(not (string= kom-ispell-dictionary
(not (lyskom-string= kom-ispell-dictionary
ispell-dictionary))))
(result nil))
(when kill-ispell (ispell-kill-ispell t))
......@@ -966,8 +966,8 @@ Cannot be called from a callback."
(format-encode-buffer 'text/enriched)
(goto-char (point-min))
(search-forward "\n\n")
(if (and (not (string= (buffer-substring (point)
(point-max)) message))
(if (and (not (lyskom-string= (buffer-substring (point)
(point-max)) message))
(save-excursion
(set-buffer lyskom-buffer)
(lyskom-j-or-n-p
......@@ -1234,10 +1234,11 @@ RECPT-TYPE is the type of recipient to add."
(let ((win-config (current-window-configuration)))
;;(set-buffer buffer)
(with-output-to-temp-buffer "*Motd*"
(princ (lyskom-format 'conf-has-motd-no
(text->text-no text)
(text->decoded-text-mass text
text-stat))))
(lyskom-princ
(lyskom-format 'conf-has-motd-no
(text->text-no text)
(text->decoded-text-mass text
text-stat))))
(and (j-or-n-p (lyskom-get-string 'still-want-to-add))
(if what-to-do
(funcall what-to-do conf-stat insert-at edit-buffer)
......
......@@ -47,7 +47,10 @@
;;; ================================================================
;;; The language definition
(lyskom-define-language 'en "English" "Engelska")
(lyskom-define-language 'en
'iso-8859-1
"English"
"Engelska")
;;; ================================================================
......
......@@ -364,9 +364,9 @@ If successful then set the buffer not-modified. Else print a warning."
(while (> (length lyskom-options-text) 2)
(setq word (lyskom-read-options-eval-get-holerith))
(cond
((string= word "common")
((lyskom-string= word "common")
(setq common-no r))
((string= word "elisp")
((lyskom-string= word "elisp")
(setq elisp-no r))
(t
;; Build up lyskom-other-clients-user-areas so that it
......
......@@ -227,7 +227,7 @@ if 'lyskom-menu is not found."
(get category 'lyskom-language-symbols)))
(defun lyskom-define-language (language &rest names)
(defun lyskom-define-language (language coding &rest names)
(let ((match (assq language lyskom-languages)))
(if match
(setcdr match names)
......@@ -235,7 +235,12 @@ if 'lyskom-menu is not found."
(unless (and lyskom-language
kom-default-language)
(setq lyskom-language language)
(setq kom-default-language language)))
(setq kom-default-language language))
(put language 'lyskom-language-coding coding))
(defun lyskom-language-coding (language)
(or (get language 'lyskom-language-coding)
'raw-text))
(defun lyskom-language-name (language)
"Return the name of language code LANGUAGE in the current language."
......
......@@ -134,7 +134,7 @@ on the value of PLACE. If PLACE is nil, 'after is assumed."
(defun lyskom-info-request-handler (message-type sender recipient text)
(if (string= text "\011\016\006\017")
(if (lyskom-string= text "\011\016\006\017")
(progn
(initiate-send-message
'follow
......
......@@ -104,7 +104,7 @@ If the completion was not exact it returns nil."
(delete-region (point) (point-max))
(insert (car completes)))
((stringp longest)
(if (string= (upcase longest) (upcase text))
(if (lyskom-string= (upcase longest) (upcase text))
(lyskom-format-insert-before-prompt
'command-completions
(mapconcat 'identity completes "\n ")))
......
......@@ -47,6 +47,7 @@
(lyskom-define-language
'sv
'iso-8859-1
"Svenska")
......
......@@ -367,13 +367,28 @@ the resulting string may be narrower than END-COLUMN."
str))))
(eval-and-compile
(lyskom-xemacs-or-gnu
(fset 'lyskom-string= (symbol-function 'string=))
(if (< emacs-major-version 20)
(fset 'lyskom-string= (symbol-function 'string=))
(defun lyskom-string= (s1 s2)
(string= (if (multibyte-string-p s1)
s1
(decode-coding-string s1 (lyskom-language-coding
lyskom-language)))
(if (multibyte-string-p s2)
s2
(decode-coding-string s2 (lyskom-language-coding
lyskom-language))))))))
(defun lyskom-string-assoc (key list)
"Return non-nil if KEY is the same string as the car of an element of LIST.
The value is actually the element of LIST whose car equals KEY."
(let ((s (downcase key))
(result nil))
(while list
(when (string= s (downcase (car (car list))))
(when (lyskom-string= s (downcase (car (car list))))
(setq result (car list))
(setq list nil))
(setq list (cdr list)))
......
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