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

Nytt försök till stöd för unibyte-mode i Gnu Emacs.

parent 6a8d51b2
2000-08-21 David Byers <davby@ida.liu.se>
* Reworked some MULE details. Hopefully things will work better in
unibyte mode now.
* lyskom-buttons.el (lyskom-make-button-menu): Use
lyskom-maybe-recode-string, not encode-coding-string.
* vars.el.in (lyskom-mule-compiled): Redefined to catch multibyte
strings in multibyte-capable but disabled Emacsen (i.e. all Gnu
Emacs).
* compatibility.el: Never set coding system of server process to
raw-text.
* buffers.el (lyskom-fix-buffer-name): Removed.
* utilities.el (lyskom-maybe-recode-string): Test agains
multibyte-string-p not enable-multibyte-characters since we may
have multibyte strings in a unibyte environment.
* vars.el.in (lyskom-button-actions): Fixed typo.
(lyskom-text-buttons): Fixed email regexp to combat very slow
matching of long words.
......
......@@ -343,14 +343,6 @@ categories")
(add-hook 'kill-buffer-query-functions 'lyskom-quit-query)
(add-hook 'kill-emacs-query-functions 'lyskom-quit-query)
(defun lyskom-fix-buffer-name (name)
"Encode NAME according to the language coding system if we have
no multibyte character support"
(if enable-multibyte-characters
name
(encode-coding-string name (or (lyskom-language-coding lyskom-language)
'raw-text))))
(defun lyskom-generate-new-buffer (name)
(setq name (lyskom-maybe-recode-string name))
(let ((buf (generate-new-buffer name)))
......
......@@ -318,13 +318,8 @@ string to search in."
(lyskom-provide-function string-make-multibyte (str) str)
(lyskom-provide-function multibyte-string-p (str) nil)
(lyskom-xemacs-or-gnu nil
(and (null enable-multibyte-characters)
(setq-default lyskom-server-coding-system 'raw-text)
(setq lyskom-server-coding-system 'raw-text)))
;;; Decode buggy versions of encode-coding-string and decode-coding-string
;;; Detect buggy versions of encode-coding-string and decode-coding-string
;;; such as those provided by APEL (part of TM and often included in XEmacs)
(defun lyskom-buggy-encode-coding-string (str coding-system) str)
......
......@@ -161,14 +161,14 @@ 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 (encode-coding-string title 'iso-8859-1)))
(let ((title (lyskom-maybe-recode-string title 'iso-8859-1)))
(when (> (length title) 44) (setq title (concat (substring title 0 40)
" ...")))
(cond ((string-match "XEmacs" (emacs-version))
(cons (encode-coding-string title 'iso-8859-1)
(cons (lyskom-maybe-recode-string title 'iso-8859-1)
(mapcar (function
(lambda (entry)
(vector (encode-coding-string
(vector (lyskom-maybe-recode-string
(lyskom-get-string (car entry)) 'iso-8859-1)
(list (cdr entry)
buf
......@@ -181,7 +181,7 @@ If there is no active area, then do something else."
(t (append (list 'keymap title)
(mapcar (function (lambda (entry)
(let ((tmp (copy-tree entry)))
(setcar tmp (encode-coding-string
(setcar tmp (lyskom-maybe-recode-string
(lyskom-get-string (car tmp))
'iso-8859-1))
(cons (` ((, (cdr entry))
......
......@@ -3575,8 +3575,8 @@ One parameter - the prompt string."
`(kom-show-unread-in-frame-title
(lyskom-session-has-unreads
(" ("
((lyskom-session-has-unreads (encode-coding-string ,(lyskom-get-string 'frame-title-unread) 'iso-8859-1))
(lyskom-session-has-unread-letters (encode-coding-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))
(lyskom-session-has-unread-letters ,(lyskom-maybe-recode-string (lyskom-get-string 'frame-title-letters) 'iso-8859-1)))
")"))))
(add-hook 'kill-buffer-hook 'lyskom-remove-buffer-from-lists)
......@@ -3594,7 +3594,7 @@ One parameter - the prompt string."
(function
(lambda (x)
(aset tmp (char-to-int x) t)))
(encode-coding-string lyskom-line-start-chars-string 'iso-8859-1))
(lyskom-maybe-recode-string lyskom-line-start-chars-string 'iso-8859-1))
tmp))
......
......@@ -1237,20 +1237,7 @@ functions and variables that are connected with the lyskom-buffer."
(format " Current string: ")
(buffer-substring lyskom-parse-pos (point-max))))
(lyskom-message "Saving debugging information...")
(setq lyskom-backtrace-list (cons (list (current-time-string)
(let* ((buffer (generate-new-buffer " *Backtrace*"))
(standard-output buffer))
(backtrace)
(prog1 (save-excursion
(set-buffer buffer)
(buffer-string))
(kill-buffer buffer)))
(lyskom-string-to-parse))
lyskom-backtrace-list))
(lyskom-message "Saving debugging information...done")
(lyskom-save-backtrace (lyskom-string-to-parse))
(signal 'lyskom-protocol-error
(format "Protocol error in %S: %s"
function
......
......@@ -172,6 +172,7 @@ See lyskom-mode for details."
(setq proc (open-network-stream name buffer
proxy-host
proxy-port))
;; We do explicit coding
(set-process-coding-system proc 'no-conversion 'no-conversion)
;; Install our filter.
......@@ -207,6 +208,7 @@ See lyskom-mode for details."
)
(t (setq proc (open-network-stream name buffer
host port))
;; We do explicit coding
(set-process-coding-system proc 'no-conversion 'no-conversion))))
(switch-to-buffer buffer)
(lyskom-mode) ;Clearing lyskom-default...
......
......@@ -307,13 +307,14 @@ 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[\\]~!AAAA[]ACEEEEIIIINOOOO\\OUUUYYAAAA[]ACEEEEIIIINOOOO\\OUUUYY"
"String mapping lowercase to uppercase and equivalents to each others.")
(defsubst lyskom-maybe-recode-string (s)
(defsubst lyskom-maybe-recode-string (s &optional coding)
"Change the encoding of S when multibyte characters are not supported"
(if enable-multibyte-characters
s
(encode-coding-string s (or (and lyskom-language
(lyskom-language-coding lyskom-language))
'raw-text))))
(if (multibyte-string-p s)
(encode-coding-string s (or coding
(and lyskom-language
(lyskom-language-coding lyskom-language))
'raw-text))
s))
(defsubst lyskom-unicase-char (c)
"Smash case and diacritical marks on c."
......
......@@ -36,8 +36,8 @@
"$Id$\n"))
(defvar lyskom-mule-compiled
(eval-when-compile (and (boundp 'enable-multibyte-characters)
enable-multibyte-characters))
(eval-when-compile (and (fboundp 'multibyte-string-p)
(multibyte-string-p "ÅÄÖ")))
"Non-nil if the client was compiled with multibyte characters enabled")
(provide 'lyskom)
......
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