Commit 652c1d22 authored by David Byers's avatar David Byers
Browse files

Fixed bugs 1229 and 1228.

Detailed changes:
> 2003-12-04  David Byers  <byers@lysator.liu.se>
>
> 	* lyskom-rest.el (lyskom-read-number): Use lyskom-string-to-int so
> 	we never create floats by mistake.
>
> 	More features for padding and truncating formatted strings:
> 	* commands1.el (lyskom-print-comment-like-aux): Don't print FAQ
> 	links if the data in the aux-item is invalid.
>
> 	* utilities.el (lyskom-truncate-string-to-width): New simpler
> 	implementation that only supports the features we use and supports
> 	the TRAILER argument.
>
> 	* lyskom-rest.el (lyskom-format-aux-help): Support < > and = to
> 	specify stuff in pad-length. Support a ... trailer for truncated
> 	strings.
>
> 	Improve handling of invalid numeric data:
> 	* aux-items.el (lyskom-status-print-faq-text): Handle invalid data
> 	in aux item.
> 	(lyskom-faq-for-conf-action): Use lyskom-string-to-int to convert
> 	data and throw an error on invalid format.
> 	(lyskom-aux-item-validate): New function.
> 	(lyskom-status-print-faq-text): Validate aux-item data before
> 	printing.
> 	(lyskom-print-faq-for-conf): Same here.
> 	(lyskom-print-send-comments-to): Same here.
> 	(lyskom-print-recommended-conf): Same here.
>
> 	* utilities.el (lyskom-string-to-int): New function.
> 	(lyskom-integer-conversion-error): New error symbol.
>
> 	Fix bug 1229:
> 	* commands2.el (kom-list-new-conferences): The data got from the
> 	server is a conf-stat, not an uconf-stat. Treat it as such...
> 	(lyskom-list-new-conferences): Same here.
>
parent 6318a10e
2003-12-04 David Byers <byers@lysator.liu.se>
* lyskom-rest.el (lyskom-read-number): Use lyskom-string-to-int so
we never create floats by mistake.
More features for padding and truncating formatted strings:
* commands1.el (lyskom-print-comment-like-aux): Don't print FAQ
links if the data in the aux-item is invalid.
* utilities.el (lyskom-truncate-string-to-width): New simpler
implementation that only supports the features we use and supports
the TRAILER argument.
* lyskom-rest.el (lyskom-format-aux-help): Support < > and = to
specify stuff in pad-length. Support a ... trailer for truncated
strings.
Improve handling of invalid numeric data:
* aux-items.el (lyskom-status-print-faq-text): Handle invalid data
in aux item.
(lyskom-faq-for-conf-action): Use lyskom-string-to-int to convert
data and throw an error on invalid format.
(lyskom-aux-item-validate): New function.
(lyskom-status-print-faq-text): Validate aux-item data before
printing.
(lyskom-print-faq-for-conf): Same here.
(lyskom-print-send-comments-to): Same here.
(lyskom-print-recommended-conf): Same here.
* utilities.el (lyskom-string-to-int): New function.
(lyskom-integer-conversion-error): New error symbol.
Fix bug 1229:
* commands2.el (kom-list-new-conferences): The data got from the
server is a conf-stat, not an uconf-stat. Treat it as such...
(lyskom-list-new-conferences): Same here.
2003-12-03 David Byers <davby@ida-gw.sysinst.ida.liu.se>
* names.el: Changed some names and tpyos.
......
......@@ -144,6 +144,19 @@ in ADDED added."
item-list)
added)))
(defun lyskom-aux-item-validate (data &rest tests)
"Validata aux-item data.
DATA is data to validate. TESTS are the tests to use.
A test can be a function or a regular expression to match.
Invalid tests are silently ignored."
(not (lyskom-traverse test tests
(condition-case nil
(unless
(cond ((stringp test) (string-match test data))
((functionp test) (funcall test data)))
(lyskom-traverse-break t))
(error (lyskom-traverse-break t))))))
;;; ======================================================================
......@@ -430,6 +443,10 @@ in ADDED added."
pers)
pers
(aux-item->creator item))))
;; We use string-to-int here since we handle floats in
;; lyskom-format.
(concat
(cond ((string-match "^P\\([0-9]+\\)" (aux-item->data item))
(lyskom-format 'cross-reference-pers-aux
......@@ -457,6 +474,8 @@ in ADDED added."
)))
(defun lyskom-status-print-cross-reference (item &optional obj pers)
;; We use string-to-int here since we handle floats in
;; lyskom-format.
(lyskom-insert
(concat
(cond ((string-match "^P\\([0-9]+\\)" (aux-item->data item))
......@@ -527,8 +546,11 @@ in ADDED added."
(defun lyskom-faq-for-conf-action (text-stat)
(let ((faqs (text-stat-find-aux text-stat 28)))
(lyskom-traverse aux faqs
(lyskom-register-read-faq (string-to-int (aux-item->data aux))
(text-stat->text-no text-stat)))))
(condition-case nil
(lyskom-register-read-faq (lyskom-string-to-int
(aux-item->data aux) t)
(text-stat->text-no text-stat))
(lyskom-integer-conversion-error nil)))))
(defun lyskom-request-confirmation-action (text-stat)
(let ((confirmations (text-stat-find-aux text-stat 7))
......@@ -565,6 +587,8 @@ in ADDED added."
(defun lyskom-print-redirect (item &optional obj)
;; We use string-to-int here since we handle floats in
;; lyskom-format.
(concat
(cond ((string-match "^E-mail:\\(.*\\)$" (aux-item->data item))
(lyskom-format 'redirect-email-aux
......@@ -639,28 +663,38 @@ in ADDED added."
(lyskom-print-faq-format-subject nil nil (defer-info->data defer-info)))))
(defun lyskom-status-print-faq-text (item &optional obj)
(let* ((text-no (string-to-int (aux-item->data item)))
(subject (if kom-deferred-printing
(lyskom-create-defer-info 'get-text-stat
text-no
'lyskom-deferred-print-faq
nil nil nil
text-no)
(blocking-do-multiple ((text (get-text text-no))
(text-stat (get-text-stat text-no)))
(lyskom-print-faq-format-subject text text-stat text-no)))))
(lyskom-format-insert 'faq-in-text-aux
text-no
subject)
(lyskom-insert (lyskom-aux-item-terminating-button item obj))
(lyskom-insert "\n")))
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let* ((text-no (string-to-int (aux-item->data item)))
(subject (if kom-deferred-printing
(lyskom-create-defer-info 'get-text-stat
text-no
'lyskom-deferred-print-faq
nil nil nil
text-no)
(blocking-do-multiple ((text (get-text text-no))
(text-stat (get-text-stat text-no)))
(lyskom-print-faq-format-subject text text-stat text-no)))))
(lyskom-format-insert 'faq-in-text-aux
text-no
subject)
(lyskom-insert (lyskom-aux-item-terminating-button item obj)))
(lyskom-format-insert 'bad-faq-in-text-aux
(aux-item->data item)
`(face ,kom-warning-face)
(lyskom-aux-item-terminating-button item obj)))
(lyskom-insert "\n"))
(defun lyskom-print-faq-for-conf (item &optional obj)
(let ((conf-no (string-to-int (aux-item->data item))))
(concat
(cond ((zerop conf-no) (lyskom-get-string 'faq-for-server-aux))
(t (lyskom-format 'faq-for-conf-aux conf-no)))
(lyskom-aux-item-terminating-button item obj))))
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let ((conf-no (string-to-int (aux-item->data item))))
(concat
(cond ((zerop conf-no) (lyskom-get-string 'faq-for-server-aux))
(t (lyskom-format 'faq-for-conf-aux conf-no)))
(lyskom-aux-item-terminating-button item obj)))
(lyskom-format 'bad-faq-for-conf-aux
(aux-item->data item)
`(face ,kom-warning-face)
(lyskom-aux-item-terminating-button item obj))))
(defun lyskom-print-creating-software (item &optional obj)
(when (or kom-show-creating-software
......@@ -670,11 +704,15 @@ in ADDED added."
(lyskom-aux-item-terminating-button item obj))))
(defun lyskom-print-send-comments-to (item &optional obj)
(when (string-match "^\\([0-9]+\\)" (aux-item->data item))
(let ((conf-no (string-to-int (match-string 1 (aux-item->data item)))))
(lyskom-format-insert 'status-send-comments-to
conf-no
(lyskom-aux-item-terminating-button item obj)))))
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let ((conf-no (string-to-int (aux-item->data item))))
(lyskom-format-insert 'status-send-comments-to
conf-no
(lyskom-aux-item-terminating-button item obj)))
(lyskom-format-insert 'bad-status-send-comments-to
(aux-item->data item)
`(face ,kom-warning-face)
(lyskom-aux-item-terminating-button item obj))))
......@@ -705,28 +743,41 @@ in ADDED added."
(lyskom-aux-item-terminating-button item obj))))
(defun lyskom-print-recommended-conf (item &optional obj)
(let ((conf-no (string-to-int (if (string-match " " (aux-item->data item))
(substring (aux-item->data item) 0 (match-beginning 0))
(aux-item->data item)))))
(lyskom-format-insert 'recommended-conf-aux
conf-no
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let ((conf-no (string-to-int (aux-item->data item))))
(lyskom-format-insert 'recommended-conf-aux
conf-no
(lyskom-aux-item-terminating-button item obj)))
(lyskom-format-insert 'bad-recommended-conf-aux
(aux-item->data item)
`(face ,kom-warning-face)
(lyskom-aux-item-terminating-button item obj))))
(defun lyskom-print-elisp-client-read-faq (item &optional obj)
(when (lyskom-extended-status-information 'read-faq)
(when (string-match "^\\([0-9]+\\) \\([0-9]+\\)" (aux-item->data item))
(let ((conf-no (string-to-int (match-string 1 (aux-item->data item))))
(text-no (string-to-int (match-string 2 (aux-item->data item)))))
(lyskom-format-insert 'status-read-faq-aux-item
conf-no
text-no
(lyskom-aux-item-terminating-button item obj))))))
(condition-case nil
(let ((conf-no (lyskom-string-to-int (match-string 1 (aux-item->data item)) t))
(text-no (lyskom-string-to-int (match-string 2 (aux-item->data item)) t)))
(lyskom-format-insert 'status-read-faq-aux-item
conf-no
text-no
(lyskom-aux-item-terminating-button item obj)))
(lyskom-integer-conversion-error
(lyskom-format-insert 'bad-status-read-faq-aux-item
(aux-item->data item)
`(face ,kom-warning-face)
(lyskom-aux-item-terminating-button item obj)))))))
(defun lyskom-print-elisp-client-rejected-invitation (item &optional obj)
(when (string-match "^\\([0-9]+\\)" (aux-item->data item))
(let ((conf-no (string-to-int (match-string 1 (aux-item->data item)))))
(lyskom-format-insert 'status-rejected-recommendation-aux-item
conf-no
(lyskom-aux-item-terminating-button item obj)))))
(if (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let ((conf-no (string-to-int (aux-item->data item))))
(lyskom-format-insert 'status-rejected-recommendation-aux-item
conf-no
(lyskom-aux-item-terminating-button item obj)))
(lyskom-format-insert 'bad-status-rejected-recommendation-aux-item
(aux-item->data item)
`(face ,kom-warning-face)
(lyskom-aux-item-terminating-button item obj))))
(provide 'lyskom-aux-items)
......@@ -211,9 +211,9 @@ STRING is the string."
(setq result (cons
(concat
(match-string 1 string)
(match-string 4 string)
(match-string 7 string)
(match-string 9 string))
(match-string 5 string)
(match-string 8 string)
(match-string 19 string))
result))))
result))
......
......@@ -239,26 +239,27 @@ This command accepts text number prefix arguments (see
(lyskom-print-comment-like-aux faq conf-stat))))
(defun lyskom-print-comment-like-aux (item object)
(let* ((text-no (string-to-int (aux-item->data item)))
(text-stat nil)
(text nil))
(unless kom-deferred-printing
(blocking-do-multiple ((x-text (get-text text-no))
(x-text-stat (get-text-stat text-no)))
(setq text-stat x-text-stat text x-text)))
(cond ((or text-stat (not kom-deferred-printing))
(lyskom-insert-comment-like-aux item text-no text-stat text object))
(t (let ((defer-info (lyskom-create-defer-info
'get-text-stat
text-no
'lyskom-insert-deferred-comment-like-aux
(point-max-marker)
(length lyskom-defer-indicator)
nil ; Filled in later
(list item object text-no))))
(lyskom-format-insert "%#1s\n" lyskom-defer-indicator)
(lyskom-defer-insertion defer-info))))))
(when (lyskom-aux-item-validate (aux-item->data item) 'lyskom-string-to-int)
(let* ((text-no (string-to-int (aux-item->data item)))
(text-stat nil)
(text nil))
(unless kom-deferred-printing
(blocking-do-multiple ((x-text (get-text text-no))
(x-text-stat (get-text-stat text-no)))
(setq text-stat x-text-stat text x-text)))
(cond ((or text-stat (not kom-deferred-printing))
(lyskom-insert-comment-like-aux item text-no text-stat text object))
(t (let ((defer-info (lyskom-create-defer-info
'get-text-stat
text-no
'lyskom-insert-deferred-comment-like-aux
(point-max-marker)
(length lyskom-defer-indicator)
nil ; Filled in later
(list item object text-no))))
(lyskom-format-insert "%#1s\n" lyskom-defer-indicator)
(lyskom-defer-insertion defer-info)))))))
(defun lyskom-insert-comment-like-aux (item text-no text-stat text object)
(let* ((author (if text-stat (text-stat->author text-stat) nil))
......
......@@ -3534,7 +3534,7 @@ was given."
'conferences
(lambda (el)
(not (conf-type->letterbox
(uconf-stat->conf-type el))))))
(conf-stat->conf-type el))))))
(def-kom-command kom-list-new-persons ()
"List persons created since the last time this command
......@@ -3544,7 +3544,7 @@ was given."
'persons
(lambda (el)
(conf-type->letterbox
(uconf-stat->conf-type el)))))
(conf-stat->conf-type el)))))
(defun lyskom-list-new-conferences (varsym obj filter)
"List conferences created since the last time this command
......@@ -3573,7 +3573,7 @@ was given."
(lyskom-format-insert "%5#1m %#2c %#1M\n"
conf
(lyskom-list-conf-membership-char
(uconf-stat->conf-no conf)))
(conf-stat->conf-no conf)))
(set-marker (cdr count) (point))))
conf-no filter count time-string)
(setq conf-no (1+ conf-no)))
......@@ -3728,7 +3728,6 @@ get full documentation.
(insert
(lyskom-truncate-string-to-width
(if (string-match "\\(\r\\|\n\\)" doc)
(substring doc 0 (string-match "\\(\r\\|\n\\)" doc))
doc)
......
......@@ -1102,9 +1102,7 @@ given, prepend each line with your commenting prefix (or '>')."
(interactive (list
(cond
((null current-prefix-arg)
(string-to-int
(lyskom-read-from-minibuffer
(format "%s" (lyskom-get-string 'which-text-include)))))
(lyskom-read-number 'which-text-include))
((prefix-numeric-value current-prefix-arg)))))
(let ((buffer (current-buffer))
(window (selected-window)))
......
......@@ -662,9 +662,13 @@ Read all about it at http://www.lysator.liu.se/history/")
(conf-mx-list-name . "Imported mailing list: %#1s %#2s\n")
(conf-mx-refuse-import . "Refuse import of: %#1s %#2s\n")
(recommended-conf-aux . "Recommended conference: %#1M <%#1m> %#2s\n")
(bad-recommended-conf-aux . "Recommended conference: \"%<20...#1s\" %[%#2@[invalid]%] %#3s\n")
(status-read-faq-aux-item . "Read FAQ: %15#2n for %#1?z%[%#1M <%#1m>%]%[the server%] %#3s\n")
(bad-status-read-faq-aux-item . "Read FAQ: \"%<20...#1s\" %[%#2@[invalid]%] %#3s\n")
(status-rejected-recommendation-aux-item . "Rejected recommendation for: %#1M %#2s\n")
(bad-status-rejected-recommendation-aux-item . "Rejected recommendation for: \"%<20...#1s\" %[%#2@[invalid]%] %#3s\n")
(status-send-comments-to . "Redirect comments to: %#1M <%#1m> %#2s\n")
(bad-status-send-comments-to . "Redirect comments to: \"%<20...#1s\" %[%#2@[invalid]%] %#3s\n")
(Everybody . "Everyone")
(show-members-list-also-q . "List members? ")
......@@ -1483,8 +1487,10 @@ On since %#8s%#9s")
(conf-to-list-faqs . "List FAQ for which conference: ")
(faq-for-conf-aux . "FAQ for %#1M <%#1m>")
(bad-faq-for-conf-aux . "FAQ: \"%<20...#1s\" %[%#2@[invalid]%] %#3s")
(faq-for-server-aux . "FAQ for the LysKOM-server")
(faq-in-text-aux . "FAQ in text: %10#1n %#2D")
(bad-faq-in-text-aux . "FAQ in text: \"%<20...#1s %[%#2@[invalid]%] %#3s")
(conf-to-add-faq . "Which conference do you want to add an FAQ for? ")
(text-to-add-as-faq . "Which text is the new FAQ? ")
(text-to-change-as-faq . "Which FAQ do you want to change? ")
......
......@@ -145,15 +145,17 @@ do this. To add a FAQ, use `kom-add-server-faq'."
(defun lyskom-del-faq (conf-stat)
(let ((faq-list
(mapcar (lambda (aux)
(cons (aux-item->data aux)
(aux-item->aux-no aux)))
(lyskom-get-aux-item
(if (null conf-stat)
(server-info->aux-item-list
(blocking-do 'get-server-info))
(conf-stat->aux-items conf-stat))
14)))
(delq nil
(mapcar (lambda (aux)
(and (lyskom-string-to-int (aux-item->data aux))
(cons (aux-item->data aux)
(aux-item->aux-no aux))))
(lyskom-get-aux-item
(if (null conf-stat)
(server-info->aux-item-list
(blocking-do 'get-server-info))
(conf-stat->aux-items conf-stat))
14))))
(text-no nil))
(cond
......@@ -221,9 +223,10 @@ do this. To add a FAQ, use `kom-add-server-faq'."
(defun lyskom-unread-faq (conf-stat aux-list)
(let ((faq-list (mapcar (lambda (aux)
(string-to-int (aux-item->data aux)))
(lyskom-get-aux-item aux-list 14))))
(let ((faq-list (delq nil
(mapcar (lambda (aux)
(lyskom-string-to-int (aux-item->data aux)))
(lyskom-get-aux-item aux-list 14)))))
(if (null faq-list)
(lyskom-format-insert 'conf-has-no-faq conf-stat)
(lyskom-traverse text-no faq-list
......@@ -232,9 +235,10 @@ do this. To add a FAQ, use `kom-add-server-faq'."
(lyskom-mark-unread text-no))))))
(defun lyskom-review-faq (conf-stat aux-list)
(let ((faq-list (mapcar (lambda (aux)
(string-to-int (aux-item->data aux)))
(lyskom-get-aux-item aux-list 14))))
(let ((faq-list (delq nil
(mapcar (lambda (aux)
(lyskom-string-to-int (aux-item->data aux)))
(lyskom-get-aux-item aux-list 14)))))
(cond
((null faq-list)
(lyskom-format-insert 'conf-has-no-faq conf-stat))
......@@ -290,10 +294,13 @@ create a new FAQ."
"Change a FAQ for a conference."
;; Get a list of FAQ texts and corresponding aux-item-numbers
;; Get the FAQ to change
(let* ((faq-list (mapcar (lambda (x)
(cons (aux-item->data x)
(aux-item->aux-no x)))
aux-list))
(let* ((faq-list
(delq nil
(mapcar (lambda (x)
(and (lyskom-string-to-int (aux-item->data x))
(cons (aux-item->data x)
(aux-item->aux-no x))))
aux-list)))
(text-no-aux (cond ((= (length faq-list) 1) (car faq-list))
((null faq-list) nil)
(t (lyskom-string-assoc
......@@ -419,11 +426,13 @@ create a new FAQ."
(conf-stat->aux-items conf-stat)
(server-info->aux-item-list lyskom-server-info)))
(faq-list
(filter-list (lambda (faq)
(not (lyskom-faq-is-read conf-no faq)))
(mapcar (lambda (aux)
(string-to-int (aux-item->data aux)))
(lyskom-get-aux-item aux-list 14)))))
(filter-list
(lambda (faq)
(not (lyskom-faq-is-read conf-no faq)))
(delq nil
(mapcar (lambda (aux)
(lyskom-string-to-int (aux-item->data aux)))
(lyskom-get-aux-item aux-list 14))))))
;; Filter out FAQs that don't exist
(let ((collector (make-collector)))
......@@ -473,11 +482,13 @@ create a new FAQ."
(defun lyskom-do-list-faqs (conf-stat faq-list)
(setq faq-list (delq nil
(mapcar (lambda (aux)
(lyskom-string-to-int (aux-item->data aux)))
faq-list)))
(cond (faq-list
(lyskom-format-insert 'all-faqs-header
(and conf-stat
(conf-stat->conf-no conf-stat)))
(lyskom-do-list-summary (mapcar (lambda (faq)
(string-to-int (aux-item->data faq)))
faq-list)))
(lyskom-do-list-summary faq-list))
(t (lyskom-format-insert 'conf-has-no-faq conf-stat))))
......@@ -1253,7 +1253,7 @@ Args: FORMAT-STRING &rest ARGS"
(defvar lyskom-format-format
"%\\(=\\)?\\(-?[0-9]+\\|-?[0-9]+\\.[0-9]+\\|-?[0-9]+\\.[0-9]+\\.[0-9]+\\)?\\(:.\\)?\\(#\\([0-9]+\\)\\)?\\(_\\)?\\(:\\)?\\(&\\)?\\([][$@MmPpnrtsdoxlcfgCSDF%?]\\)"
"%\\(=\\|<\\|>\\)?\\(-?[0-9]+\\|-?[0-9]+\\.[0-9]+\\|-?[0-9]+\\.[0-9]+\\.[0-9]+\\)?\\(\\.\\.\\.\\)?\\(:.\\)?\\(#\\([0-9]+\\)\\)?\\(_\\)?\\(:\\)?\\(&\\)?\\([][$@MmPpnrtsdoxlcfgCSDF%?]\\)"
"regexp matching format string parts.")
(defun lyskom-insert-string (atom)
......@@ -1405,6 +1405,7 @@ Deferred insertions are not supported."
(equals-flag nil)
(downcase-flag nil)
(face-flag nil)
(trailer nil)
(abort-format nil))
;;
......@@ -1458,23 +1459,27 @@ Deferred insertions are not supported."
(t (setq pad-length (string-to-int s))))))
(setq pad-length nil))
(setq equals-flag (match-beginning 1)
arg-no (if (match-beginning 5)
(string-to-int (match-string
5 (format-state->format-string
format-state)))
(setq equals-flag (and (match-beginning 1)
(aref (match-string 1
(format-state->format-string
format-state)) 0))
arg-no (if (match-beginning 6)
(string-to-int
(match-string 6 (format-state->format-string
format-state)))
nil)
downcase-flag (match-beginning 6)
colon-flag (match-beginning 7)
face-flag (match-beginning 8)
pad-string (and (match-beginning 3)
downcase-flag (match-beginning 7)
colon-flag (match-beginning 8)
face-flag (match-beginning 9)
trailer (match-beginning 3)
pad-string (and (match-beginning 4)
(substring (format-state->format-string format-state)
(1+ (match-beginning 3))
(match-end 3)))
format-letter (if (match-beginning 9)
(1+ (match-beginning 4))
(match-end 4)))
format-letter (if (match-beginning 10)
(aref (format-state->format-string
format-state)
(match-beginning 9))
(match-beginning 10))
(signal 'lyskom-internal-error
(list 'lyskom-format-aux
(format-state->format-string
......@@ -1500,6 +1505,7 @@ Deferred insertions are not supported."
arg-no
format-letter
equals-flag
trailer
colon-flag
face-flag
downcase-flag
......@@ -1524,6 +1530,7 @@ Deferred insertions are not supported."
arg-no
format-letter
equals-flag
trailer
colon-flag
face-flag
downcase-flag
......@@ -1813,7 +1820,9 @@ Deferred insertions are not supported."
(if (null tmp)
(let* ((format-element
(concat "%#2@%"
(if equals-flag "=" "")
(if equals-flag
(make-string 1 equals-flag)
"")
(if pad-length (int-to-string pad-length))
"#1"
(if colon-flag ":" "")
......@@ -1824,12 +1833,14 @@ Deferred insertions are not supported."
'lyskom-deferred-insert-conf
oldpos
(if pad-length
(if equals-flag
(abs pad-length)
(max (length
lyskom-defer-indicator)
(abs pad-length)))
(length lyskom-defer-indicator))
(cond ((eq equals-flag ?=)
abs-length)
((eq equals-flag ?<)
(min (length lyskom-defer-indicator)
abs-length))
(t (max (length lyskom-defer-indicator)
abs-length)))
(length lyskom-defer-indicator))
format-element
lyskom-default-conf-string)))
(set-format-state->delayed-content
......@@ -1984,7 +1995,7 @@ Deferred insertions are not supported."
(t
(let ((format-element
(concat "%"
(if equals-flag "=" "")
(if equals-flag (make-string 1 equals-flag) "")
(if pad-length (int-to-string pad-length))
"#1"
(if colon-flag ":" "")
......@@ -1994,11 +2005,14 @@ Deferred insertions are not supported."
;; Note: length is right below. string-width is wrong.
(set-defer-info->del-chars
arg (if pad-length
(if equals-flag
(abs pad-length)
(max (length lyskom-defer-indicator)
(abs pad-length)))
(length lyskom-defer-indicator)))
(cond ((eq equals-flag ?=)
abs-length)
((eq equals-flag ?<)
(min (length lyskom-defer-indicator)
abs-length))
(t (max (length lyskom-defer-indicator)
abs-length)))
(length lyskom-defer-indicator)))
(set-defer-info->format arg format-element))
(set-format-state->delayed-content
format-state
......@@ -2021,6 +2035,8 @@ Deferred insertions are not supported."
(cond ((or (null pad-length)
(null result)) nil)
((and (eq equals-flag ?<)
(> abs-length (lyskom-string-width result))) nil)
((> abs-length (lyskom-string-width result))
(let ((padstring (make-string (- abs-length (lyskom-string-width result))
pad-letter)))
......@@ -2032,10 +2048,10 @@ Deferred insertions are not supported."
(progn