Commit 062a84e3 authored by David Byers's avatar David Byers
Browse files

Emacs 20.3 patches

parent 6b26336d
Fri Nov 19 15:00:32 1999 David Byers <davby@sen2.ida.liu.se>
1999-11-19 David Byers <davby@anton9.ida.liu.se>
* Release av 0.46-BETA-C
* utilities.el (lyskom-looking-at): New function (Gnu Emacs 20.3
bug workaround.)
* edit-text.el (kom-ispell-message): Use lyskom-looking-at.
(lyskom-edit-parse-headers): Same here.
(lyskom-edit-extract-aux-item-flags): Same here.
(lyskom-edit-extract-text): Same here.
(lyskom-edit-on-aux-item): Same here.
* lyskom-rest.el (lyskom-prot-a-format-string): string-as-unibyte
the string or concat may convert us to multibyte later.
(lyskom-prot-a-format-raw-string): Same here.
1999-11-19 David Byers <davby@ida.liu.se>
* compatibility.el (check-coding-system): Throw an error instead
of returning nil.
* parse.el (lyskom-init-parse): Turn off multibyte chars in the
parse buffer.
......
......@@ -285,7 +285,7 @@ string to search in."
(lyskom-provide-function encode-coding-string (str coding-system) str)
(lyskom-provide-function decode-coding-string (str coding-system) str)
(lyskom-provide-function string-bytes (str) (length str))
(lyskom-provide-function check-coding-system (name) nil)
(lyskom-provide-function check-coding-system (name) (error "No such coding system"))
(lyskom-provide-function string-width (str) (length str))
(lyskom-provide-function char-width (c) 1)
(lyskom-provide-function find-charset-string (str) '(ascii))
......
......@@ -706,7 +706,7 @@ Based on ispell-message."
(while (if internal-messagep
(< (point) internal-messagep)
(not (eobp)))
(if (looking-at subject-string)
(if (lyskom-looking-at subject-string)
(progn (goto-char (match-end 0))
(let ((case-fold-search old-case-fold-search))
(ispell-region (point)
......@@ -716,7 +716,7 @@ Based on ispell-message."
(forward-line 1)))
(while (< (point) limit)
(while (and (looking-at cite-regexp-start)
(while (and (lyskom-looking-at cite-regexp-start)
(< (point) limit)
(zerop (forward-line 1))))
......@@ -1475,7 +1475,7 @@ to lyskom-edit-replace-headers"
"Check if point is at the beginning of a header of type HEADER.
Return the corresponding number (conf no etc.) if MATCH-NUMBER is
non-nil. If MATCH-NUMBER is 'angled, only match a number inside <>."
(if (looking-at
(if (lyskom-looking-at
(concat (lyskom-get-string header)
(cond ((eq match-number 'angled)
"[^0-9]*<\\([0-9]+\\)>")
......@@ -1524,7 +1524,7 @@ easy to use the result in a call to `lyskom-create-misc-list'."
((lyskom-looking-at-header 'header-subject nil)
(setq subject (lyskom-edit-extract-subject)))
((looking-at (lyskom-get-string 'aux-item-prefix))
((lyskom-looking-at (lyskom-get-string 'aux-item-prefix))
(goto-char (match-end 0))
(let ((item (lyskom-edit-parse-aux-item)))
(if item
......@@ -1550,7 +1550,7 @@ easy to use the result in a call to `lyskom-create-misc-list'."
data))))
(defun lyskom-edit-extract-aux-item-flags ()
(if (looking-at ".*\\[\\([^]]*\\)\\]\\s-*$")
(if (lyskom-looking-at ".*\\[\\([^]]*\\)\\]\\s-*$")
(let ((flag-strings (match-string 1))
(start 0)
(flag nil)
......@@ -1591,7 +1591,7 @@ Point must be located on the line where the subject is."
(buffer-substring (1+ (point))
(progn
(goto-char (1- (point-max)))
(while (looking-at "\\s-") ; remove trailing
(while (lyskom-looking-at "\\s-") ; remove trailing
(backward-char 1)) ; whitespace
(forward-char 1)
(point))))))
......@@ -1601,7 +1601,7 @@ Point must be located on the line where the subject is."
"Return non-nil if point is on the same line as an aux-item"
(save-excursion
(beginning-of-line)
(and (looking-at (lyskom-get-string 'aux-item-prefix))
(and (lyskom-looking-at (lyskom-get-string 'aux-item-prefix))
(search-forward
(substitute-command-keys
(lyskom-get-string 'header-separator))
......
......@@ -103,7 +103,7 @@
"Internal LysKOM error")
(put 'lyskom-format-error 'error-conditions
'(error lyskom-error lyskom-format-error))
'(error lyskom-error lyskom-format-error))
(put 'lyskom-internal-error 'error-message
"Internal LysKOM format error")
......@@ -3287,10 +3287,11 @@ Other objects are converted correctly."
(defun lyskom-prot-a-format-string (string)
(let ((tmp (encode-coding-string string lyskom-server-coding-system)))
(format "%dH%s" (string-bytes tmp) tmp)))
(string-as-unibyte (format "%dH%s" (string-bytes tmp) tmp))))
(defun lyskom-prot-a-format-raw-string (string)
(format "%dH%s" (string-bytes (cdr string)) (cdr string)))
(string-as-unibyte (format "%dH%s" (string-bytes (cdr string))
(cdr string))))
......
......@@ -86,6 +86,8 @@ from being called in the wrong buffer."
(set-buffer initiate-something-saved-buffer)))))
(put 'lyskom-server-call 'lisp-indent-function 0)
(put 'lyskom-server-call 'edebug-form-spec t)
;;; ================================================================
;;; Requests for services
......
......@@ -294,6 +294,24 @@ of \(current-time\)."
(aset s2 l (lyskom-unicase-char (aref s2 l))))
s2)))
(defun lyskom-looking-at (s)
"Version of looking-at that will work in Gnu Emacs 20.3"
(save-excursion
(let ((start (point)))
(and (re-search-forward s nil t)
(eq (match-beginning 0) start)))))
;; Don't slow things down with our own looking-at unless we have to
(eval-and-compile
(condition-case nil
(if (and (eq emacs-major-version 20)
(eq emacs-minor-version 3))
nil
(fset 'lyskom-looking-at (symbol-function 'looking-at)))
(error nil)))
;; Stolen from Gnu Emacs
......@@ -867,12 +885,3 @@ Cannot be called from a callback."
collector)
(lyskom-wait-queue (or queue 'background))
(car (collector->value collector)))))
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