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

Fixed regexp in help-compile.el so we can compile in Emacs 19 and 20 again.

parent 51062535
2002-05-28 David Byers <david.byers@swipnet.se>
* help-compile.el (lyskom-help-parse-string): Fixed search for end
tag so it doesn't cause a stack overflow in the 20.7 regexp
mathcher.
2002-05-27 David Byers <david.byers@swipnet.se>
* commands2.el (kom-change-language): Show which language we just
set.
Fix bug 491:
* swedish-strings.el (lyskom-messages): Use downcase in
language-set-to.
* lyskom-rest.el (lyskom-format-aux-help): Added support for
downcasing from the format string.
(lyskom-format-aux): Same.
(lyskom-format-format): Added _ as downcase flag.
* check-strings.el: Added checking of matching sections for all
languages in new help.
......
......@@ -2040,7 +2040,10 @@ global effect, including changes to key binding."
'lyskom-language-history)))
(when (lyskom-string-assoc language table)
(lyskom-set-language (cdr (lyskom-string-assoc language table))
(if global 'global 'local)))))
(if global 'global 'local))
(lyskom-format-insert
'language-set-to
(lyskom-language-name (cdr (lyskom-string-assoc language table)))))))
......
......@@ -223,8 +223,8 @@ CONTAINING-SYNTAX is the syntax specification for the containing tag."
(let ((re (concat (lyskom-non-matching-regexp
(concat "</" tag ">"))
"\\(</" tag ">\\)")))
(if (eq tag-end (string-match re string tag-end))
(setq end-tag-start (match-beginning 1)
(if (string-match (concat "</" tag ">") string tag-end)
(setq end-tag-start (match-beginning 0)
end-tag-end (match-end 0))
(error "Unterminated tag: %s %s" tag string))))
......@@ -238,7 +238,7 @@ CONTAINING-SYNTAX is the syntax specification for the containing tag."
(if (eq end-tag-start tag-end)
nil
(lyskom-help-parse-string
(substring string tag-end (1+ end-tag-start))
(substring string tag-end end-tag-start)
syntax)))
result)
start end-tag-end)
......@@ -254,7 +254,8 @@ CONTAINING-SYNTAX is the syntax specification for the containing tag."
(let ((text (substring string start)))
(cond (collect-data (setq result (cons (cons 'TEXT text) result)))
((string-match "\\`\\s-*\\'" text))
(t (error "Unexpected text \"%s\" at end of document" text)))))
(t (error "Unexpected text \"%s\" at %d in document %s"
text start string)))))
;; Done. The result is, as usual, in reverse order.
......
......@@ -1127,7 +1127,7 @@ Args: FORMAT-STRING &rest ARGS"
(defvar lyskom-format-format
"%\\(=\\)?\\(-?[0-9]+\\)?\\(#\\([0-9]+\\)\\)?\\(:\\)?\\(&\\)?\\([][$@MmPpnrtsdoxcCSDF?]\\)"
"%\\(=\\)?\\(-?[0-9]+\\)?\\(#\\([0-9]+\\)\\)?\\(_\\)?\\(:\\)?\\(&\\)?\\([][$@MmPpnrtsdoxcCSDF?]\\)"
"regexp matching format string parts.")
(defun lyskom-insert-string (atom)
......@@ -1277,6 +1277,7 @@ Deferred insertions are not supported."
(format-letter nil)
(colon-flag nil)
(equals-flag nil)
(downcase-flag nil)
(face-flag nil)
(abort-format nil))
......@@ -1334,12 +1335,13 @@ Deferred insertions are not supported."
(match-beginning 4)
(match-end 4)))
nil)
colon-flag (match-beginning 5)
face-flag (match-beginning 6)
format-letter (if (match-beginning 7)
downcase-flag (match-beginning 5)
colon-flag (match-beginning 6)
face-flag (match-beginning 7)
format-letter (if (match-beginning 8)
(aref (format-state->format-string
format-state)
(match-beginning 7))
(match-beginning 8))
(signal 'lyskom-internal-error
(list 'lyskom-format-aux
(format-state->format-string
......@@ -1365,6 +1367,7 @@ Deferred insertions are not supported."
equals-flag
colon-flag
face-flag
downcase-flag
(if (and (match-beginning 2)
(eq (aref (format-state->format-string format-state)
(match-beginning 2))
......@@ -1385,6 +1388,7 @@ Deferred insertions are not supported."
equals-flag
colon-flag
face-flag
downcase-flag
pad-letter
allow-defer)
(let ((arg nil)
......@@ -1417,7 +1421,8 @@ Deferred insertions are not supported."
((symbolp arg) (symbol-name arg))
(t (signal 'lyskom-format-error
(list 'lyskom-format
": argument error (expected string)"))))))
": argument error (expected string)")))))
(when downcase-flag (setq result (downcase result))))
;;
;; Format a number by conferting it to a string and inserting
;; it into the result list
......@@ -1466,7 +1471,8 @@ Deferred insertions are not supported."
;; Format a sexp by princing it. Sort of.
;;
((= format-letter ?S)
(setq result (format "%S" arg)))
(setq result (format "%S" arg))
(when downcase-flag (setq result (downcase result))))
;;
;; Format a text property array indicator by retrieving the
......
......@@ -1388,8 +1388,8 @@ Uppkopplad sedan %#8s%#9s")
(command-completions . "Du kan mena ngon av fljande:\n %#1s\n")
(which-language . "ndra sprk till: ")
(send-formatted . "Skicka in som formatterad text? ")
(changing-language-to . "Byter till %#1s.\n")
(language-set-to . "Sprket r %#1s.\n")
(changing-language-to . "Byter till %#1_s.\n")
(language-set-to . "Sprket r %#1_s.\n")
(language-not-loaded . "%#1s finns inte tillgngligt.\n")
;; (reformat-generic . "(%#1s)")
......
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