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