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

Fixade att kom-write-footnote valde fel inlägg.

Fixade overlays i XEmacs vid HTML-inlägg
parent cd382642
2002-09-15 David Byers <david.byers@swipnet.se> 2002-09-15 David Byers <david.byers@swipnet.se>
kom-write-footnote footnoted the wrong text:
* utilities.el (lyskom-read-text-no-prefix-arg): Use default
parameter as default in prompt when the command is specified to
always prompt.
Fix problem with overlays in XEmacs when viewing HTML:
* lyskom-rest.el (lyskom-do-special-inserts): Extracted logic to
handle special-insert from lyskom-do-insert.
(lyskom-do-insert): Call the new function once for overlays and
once for special-insert.
(lyskom-format-insert-at-point): Call
lyskom-format-transform-result to convert overlay positions to
text properties. Don't explicitly insert overlays.
(lyskom-format-insert): Same here.
(lyskom-format-insert-overlays): Removed this function. No longer
used as we use lyskom-special-insert-overlay instead.
Fix bug 746: Fix bug 746:
* commands2.el (kom-status-person): Count unreads in passive * commands2.el (kom-status-person): Count unreads in passive
conferences separately. Show passive memberships in gray. conferences separately. Show passive memberships in gray.
......
...@@ -1054,33 +1054,36 @@ The position lyskom-last-viewed will always remain visible." ...@@ -1054,33 +1054,36 @@ The position lyskom-last-viewed will always remain visible."
;;; ;;;
(defun lyskom-do-special-inserts (start sym)
(condition-case var
(let ((bounds (next-text-property-bounds 1 (max (point-min) (1- start))
sym))
(next (make-marker))
(fn nil))
(while bounds
(set-marker next (cdr bounds))
(setq fn (get-text-property (car bounds) sym))
(remove-text-properties (car bounds) (cdr bounds) (list sym))
(condition-case val
(funcall (if (listp fn)
(car fn)
fn)
(car bounds)
(cdr bounds)
(if (listp fn)
(cdr fn)
nil))
(error (apply 'message "%S" val)))
(setq start next)
(setq bounds (next-text-property-bounds 1 (1- start) sym))))
(error (lyskom-ignore var))))
(defun lyskom-do-insert (string) (defun lyskom-do-insert (string)
(let ((start (point))) (let ((start (point)))
(insert string) (insert string)
(condition-case var (lyskom-do-special-inserts start 'lyskom-overlay)
(let ((bounds (next-text-property-bounds 1 (max (point-min) (1- start)) (lyskom-do-special-inserts start 'special-insert)
'special-insert)) ))
(next (make-marker))
(fn nil))
(while bounds
(set-marker next (cdr bounds))
(setq fn (get-text-property (car bounds) 'special-insert))
(remove-text-properties (car bounds) (cdr bounds)
'(special-insert))
(condition-case val
(funcall (if (listp fn)
(car fn)
fn)
(car bounds)
(cdr bounds)
(if (listp fn)
(cdr fn)
nil))
(error (apply 'message "%S" val)))
(setq start next)
(setq bounds (next-text-property-bounds 1 (1- start)
'special-insert))))
(error (lyskom-ignore var)))))
...@@ -1204,7 +1207,7 @@ Args: FORMAT-STRING &rest ARGS" ...@@ -1204,7 +1207,7 @@ Args: FORMAT-STRING &rest ARGS"
(lyskom-traverse overlay (format-state->delayed-overlays state) (lyskom-traverse overlay (format-state->delayed-overlays state)
(add-text-properties (aref overlay 0) (add-text-properties (aref overlay 0)
(aref overlay 1) (aref overlay 1)
(list 'special-insert (list 'lyskom-overlay
(cons 'lyskom-special-insert-overlay (cons 'lyskom-special-insert-overlay
(aref overlay 2))) (aref overlay 2)))
result)) result))
...@@ -1242,24 +1245,6 @@ Args: FORMAT-STRING &rest ARGS" ...@@ -1242,24 +1245,6 @@ Args: FORMAT-STRING &rest ARGS"
(defun lyskom-format (format-string &rest argl) (defun lyskom-format (format-string &rest argl)
(lyskom-format-transform-result (lyskom-do-format format-string argl))) (lyskom-format-transform-result (lyskom-do-format format-string argl)))
(defun lyskom-format-insert-overlays (start format-state)
"Insert delayed overlays according to FORMAT-STATE."
(lyskom-traverse overlay (format-state->delayed-overlays format-state)
(lyskom-xemacs-or-gnu
(let ((overlay (lyskom-limited-make-overlay (+ start (aref overlay 0))
(+ start (aref overlay 1))))
(args (aref overlay 2)))
(while args
(set-extent-property overlay (car args) (car (cdr args)))
(setq args (nthcdr 2 args)))
(set-extent-priority overlay 1000))
(let ((overlay (lyskom-limited-make-overlay (+ start (aref overlay 0))
(+ start (aref overlay 1))))
(args (aref overlay 2)))
(while args
(overlay-put overlay (car args) (car (cdr args)))
(setq args (nthcdr 2 args)))))))
(defun lyskom-format-insert (format-string &rest argl) (defun lyskom-format-insert (format-string &rest argl)
"Format and insert a string according to FORMAT-STRING. "Format and insert a string according to FORMAT-STRING.
The string is inserted at the end of the buffer with `lyskom-insert'." The string is inserted at the end of the buffer with `lyskom-insert'."
...@@ -1267,10 +1252,8 @@ The string is inserted at the end of the buffer with `lyskom-insert'." ...@@ -1267,10 +1252,8 @@ The string is inserted at the end of the buffer with `lyskom-insert'."
;; We have to use a marker, because lyskom-insert may trim ;; We have to use a marker, because lyskom-insert may trim
;; the buffer size. ;; the buffer size.
(start (point-max-marker)) (start (point-max-marker))
(deferred (format-state->delayed-content state)) (deferred (format-state->delayed-content state)))
(insert-start (point-max))) (lyskom-insert (lyskom-format-transform-result state))
(lyskom-insert (format-state->result state))
(lyskom-format-insert-overlays insert-start state)
(while deferred (while deferred
(let ((defer-info (car deferred)) (let ((defer-info (car deferred))
...@@ -1285,10 +1268,9 @@ The string is inserted at the end of the buffer with `lyskom-insert'." ...@@ -1285,10 +1268,9 @@ The string is inserted at the end of the buffer with `lyskom-insert'."
"Format and insert a string according to FORMAT-STRING. "Format and insert a string according to FORMAT-STRING.
The string is inserted at point." The string is inserted at point."
(let* ((state (lyskom-do-format format-string argl t)) (let* ((state (lyskom-do-format format-string argl t))
(start (point)) (start (point))
(deferred (format-state->delayed-content state))) (deferred (format-state->delayed-content state)))
(lyskom-insert-at-point (format-state->result state)) (lyskom-insert-at-point (lyskom-format-transform-result state))
(lyskom-format-insert-overlays start state)
(while deferred (while deferred
(let ((defer-info (car deferred)) (let ((defer-info (car deferred))
(m (make-marker))) (m (make-marker)))
......
...@@ -773,9 +773,10 @@ its first argument and remaining list items appended to the argument list." ...@@ -773,9 +773,10 @@ its first argument and remaining list items appended to the argument list."
(or always-prompt (or always-prompt
(lyskom-read-text-no-prompt-p lyskom-current-command))) (lyskom-read-text-no-prompt-p lyskom-current-command)))
(lyskom-read-number prompt (lyskom-read-number prompt
(if (lyskom-plusp text-no) (cond ((lyskom-plusp default) default)
text-no ((lyskom-plusp text-no) text-no)
(lyskom-default-value 'lyskom-current-text)))) (t (lyskom-default-value
'lyskom-current-text)))))
((and (lyskom-plusp text-no)) ;; a proper text-no ((and (lyskom-plusp text-no)) ;; a proper text-no
text-no) text-no)
((null current-prefix-arg) ;; a fall-back when no strategy had kicked in ((null current-prefix-arg) ;; a fall-back when no strategy had kicked in
......
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