Commit 4e9ea7ef authored by David Byers's avatar David Byers
Browse files

Fixed bugs 750, 1038, 1046 and 1047, problems with circular comment

graphs in kom-review-tree and related commands, problemw with URLs
broken over several lines and credit for the patch for bug 1038.

Detailed changes:
> 2003-06-01  David Byers  <byers@lysator.liu.se>
>
> 	Fix bug 1046:
> 	* option-edit.el (lyskom-customize-mode): New major mode.
> 	(kom-customize): Use it.
>
> 	Fix bug 1047:
> 	* review.el (lyskom-find-root): Only visit each text once. This
> 	also eliminates problems with cyclic structures.
> 	(kom-find-root-review): Proper error message when the root cannot
> 	be found (e.g. in when there are cycles in the comment graph).
> 	(kom-find-root): Ditto.
> 	(kom-unread-root): Ditto.
>
> 	* swedish-strings.el,swedish-strings.el: Completed fix of 1038.
> 	Per Starbäck, not Magnus Bark, provided the patch. Fixed that in
> 	this file.
>
> 2003-05-21  David Byers  <byers@lysator.liu.se>
>
> 	* vars.el.in (lyskom-text-buttons): Do RFC-compliant URLs after
> 	doing pseudo-urls since otherwise the first line will be marked
> 	as a pseudo URL, rather than the whole thing being marked as a
> 	real URL.
>
2a28,31
> 	Fix bug 750:
> 	* lyskom-buttons.el (kom-button-click): Pop up the menu if there
> 	is no button action.
>
11c40
< 	accepting-recommendation (patch from Magnus Bark).
---
> 	accepting-recommendation (patch from Per Starbäck).
parent f1eabad8
2003-06-01 David Byers <byers@lysator.liu.se>
Fix bug 1046:
* option-edit.el (lyskom-customize-mode): New major mode.
(kom-customize): Use it.
Fix bug 1047:
* review.el (lyskom-find-root): Only visit each text once. This
also eliminates problems with cyclic structures.
(kom-find-root-review): Proper error message when the root cannot
be found (e.g. in when there are cycles in the comment graph).
(kom-find-root): Ditto.
(kom-unread-root): Ditto.
* swedish-strings.el,swedish-strings.el: Completed fix of 1038.
Per Starbck, not Magnus Bark, provided the patch. Fixed that in
this file.
2003-05-21 David Byers <byers@lysator.liu.se>
* vars.el.in (lyskom-text-buttons): Do RFC-compliant URLs after
doing pseudo-urls since otherwise the first line will be marked
as a pseudo URL, rather than the whole thing being marked as a
real URL.
2003-05-17 David Byers <byers@lysator.liu.se>
Fix bug 750:
* lyskom-buttons.el (kom-button-click): Pop up the menu if there
is no button action.
Fix bug 986:
* lyskom-buttons.el (lyskom-view-url-netscape): Support
kom-netscape-variant.
......@@ -8,7 +37,7 @@
Fix bug 1038:
* swedish-strings.el,english-strings.el: Fixed problem with
accepting-recommendation (patch from Magnus Bark).
accepting-recommendation (patch from Per Starbck).
Fix bug 1039:
* commands1.el (lyskom-private-answer): Misc-list for personal
......
......@@ -1694,6 +1694,7 @@ You must become an active member of the conference to enter it.\n")
(confusion-what-to-unread-root . "I can't figure out which text's root you want to mark as unread.\n")
(confusion-what-to-unread-root-review . "I can't figure out which tree you want to mark as unread.\n")
(confusion-what-to-find-root . "I can't figure out which text's root you want to see.\n")
(could-not-find-root . "Unable to identify the root text. The comment structure may be cyclic.\n")
(confusion-what-to-find-root-review . "I can't figure out which tree you want to review.\n")
;; Help stuff
......@@ -1782,7 +1783,7 @@ Number of sessions: %21#1d (total)
(recommending-conf . "Recommending %#1M%#2?b%[ (priority %#2d)%]%[%]%#3?b%[ %#3s%]%[%]...")
(has-recommended-conf . "%#1P has recommended conference %#2M. Do you want to become a member?\n")
(accept-recommendation . "Join conference %#1M? ")
(accepting-recommendataion . "Joining recommended conference %#2M...")
(accepting-recommendation . "Joining recommended conference %#2M...")
(redirect-for-whom . "Redirect comments for whom: ")
(redirect-to-which-conf . "Redirect comments to: ")
......@@ -2936,18 +2937,24 @@ Select whether to execute command or keyboard macro.")
;;
(lyskom . "Configuration of LysKOM")
(lyskom-doc . "\\[lyskom-customize-save-and-quit] to save and quit,
(lyskom-doc . "\
These commands work outside editable text fields.
\\[lyskom-customize-save-and-quit] to save and quit,
\\[lyskom-customize-save-and-quit] to save and quit,
\\[lyskom-customize-save] to save without quitting,
\\[lyskom-customize-quit] to quit without saving.
\\[widget-forward] moves to the next setting
\\[widget-button-press] changes the value
Press C-h m for a complete list of commands.
Documentation: [?] Show documentation [!] Hide documentation
Lists etc. : [INS] Add a line [DEL] Remove a line [*] Modify
If the box before the name of the setting is selected, the setting will
be saved in the server. Otherwise it will be saved in your .emacs.")
be saved in the server. Otherwise it will be saved in your .emacs.
Click prompts with the middle mouse button to change values and bring
up menus.")
......
......@@ -123,7 +123,12 @@ this-command-keys."
(href (or (and widget (widget-get widget ':href))
(and parent (widget-get parent ':href))
(and widget (widget-get widget 'href))
(and parent (widget-get parent 'href)))))
(and parent (widget-get parent 'href))))
(type (get-text-property pos 'lyskom-button-type))
(data (assq type lyskom-button-actions))
(hint (get-text-property pos 'lyskom-button-hint))
(act (or (and kom-use-button-hints hint)
(and data (elt data 2)))))
(cond (href (require 'w3)
(w3-widget-button-click event))
((and do-default
......@@ -132,6 +137,7 @@ this-command-keys."
(let ((fn (lookup-key global-map (this-command-keys))))
(when (commandp fn)
(call-interactively fn))))
((null act) (kom-popup-menu event))
(t (lyskom-button-press pos)))))
(defun kom-button-click-or-yank (event)
......
......@@ -442,6 +442,54 @@ customize buffer but do not save them to the server."
(widget-button-click event)
(popup-mode-menu))))
(defun lyskom-customize-mode ()
"Major mode for editing LysKOM settings.
See the top of the buffer for localized help.
These commands work outside editable text fields.
\\[lyskom-customize-save-and-quit] to save and quit,
\\[lyskom-customize-save-and-quit] to save and quit,
\\[lyskom-customize-save] to save without quitting,
\\[lyskom-customize-quit] to quit without saving.
\\[widget-forward] moves to the next setting
\\[widget-button-press] changes the value
Press C-h m for a complete list of commands.
Documentation: [?] Show documentation [!] Hide documentation
Lists etc. : [INS] Add a line [DEL] Remove a line [*] Modify
If the box before the name of the setting is selected, the setting will
be saved in the server. Otherwise it will be saved in your .emacs.
Click prompts with the middle mouse button to change values and bring
up menus.
All key bindings:
\\{lyskom-customize-map}
"
(kill-all-local-variables)
(use-local-map lyskom-customize-map)
(make-local-variable 'lyskom-widgets)
(setq lyskom-widgets nil)
(let ((inhibit-read-only t))
(erase-buffer))
(condition-case nil
(lyskom-copy-face kom-active-face 'widget-button-face)
(error nil))
(mapcar 'lyskom-custom-insert lyskom-customize-buffer-format)
(widget-setup)
(mapcar (function
(lambda (variable)
(widget-value-set (cdr variable)
(save-excursion
(set-buffer lyskom-buffer)
(symbol-value (car variable))))))
lyskom-widgets)
(widget-setup)
(setq mode-name "LysKOM Settings")
(setq major-mode 'lyskom-customize-mode)
)
(defun kom-customize ()
"Open the customize buffer"
(interactive)
......@@ -453,27 +501,10 @@ customize buffer but do not save them to the server."
(unwind-protect
(progn
(lyskom-start-of-command 'kom-customize)
(save-excursion
(set-buffer buf)
(kill-all-local-variables)
(make-local-variable 'lyskom-widgets)
(setq lyskom-widgets nil)
(let ((inhibit-read-only t))
(erase-buffer))
(use-local-map lyskom-customize-map)
(condition-case nil
(lyskom-copy-face kom-active-face 'widget-button-face)
(error nil))
(mapcar 'lyskom-custom-insert lyskom-customize-buffer-format)
(widget-setup)
(mapcar (function
(lambda (variable)
(widget-value-set (cdr variable)
(save-excursion
(set-buffer lyskom-buffer)
(symbol-value (car variable))))))
lyskom-widgets)
(widget-setup))
(sit-for 0)
(save-excursion
(set-buffer buf)
(lyskom-customize-mode))
(lyskom-display-buffer buf))
(save-excursion
(set-buffer lyskom-buffer)
......
......@@ -1275,7 +1275,7 @@ all review-related functions."
(r (unless kom-review-uses-cache
(cache-del-text-stat (car r)))
(lyskom-view-text (car r)))
(t (signal 'lyskom-internal-error "Could not find root")))
(t (lyskom-insert-string 'could-not-find-root)))
)
)
(t
......@@ -1291,10 +1291,12 @@ This command accepts text number prefix arguments \(see
(if text-no
(let* ((ts (blocking-do 'get-text-stat text-no))
(r (lyskom-find-root ts t)))
(lyskom-traverse text-no r
(lyskom-format-insert 'marking-text-unread text-no)
(lyskom-report-command-answer
(lyskom-mark-unread text-no))))
(if r
(lyskom-traverse text-no r
(lyskom-format-insert 'marking-text-unread text-no)
(lyskom-report-command-answer
(lyskom-mark-unread text-no)))
(lyskom-insert-string 'could-not-find-root)))
(lyskom-insert-string 'confusion-what-to-unread-root)))
......@@ -1323,7 +1325,7 @@ all review-related functions."
(lyskom-get-string 'more-than-one-root-review) ts)
(lyskom-review-tree (car start)))
(start (lyskom-review-tree (car start)))
(t (signal 'lyskom-internal-error "Could not find root")))))
(t (lyskom-insert-string 'could-not-find-root)))))
(t (lyskom-insert-string 'confusion-what-to-find-root-review))))
(def-kom-command kom-unread-root-review (text-no)
......@@ -1353,41 +1355,46 @@ If ALL is set, return a list of all root texts."
(head nil)
(misclist nil)
(tmp nil)
(seen nil)
(result nil))
(while queue
(setq head (car queue))
(setq queue (cdr queue))
(setq tmp nil)
;;
;; For each parent, add it to the queue
;;
(setq misclist (text-stat->misc-info-list head))
(while misclist
(cond ((eq (misc-info->type (car misclist)) 'COMM-TO)
(unless kom-review-uses-cache
(cache-del-text-stat (misc-info->comm-to (car misclist))))
(setq tmp
(cons
(blocking-do 'get-text-stat
(misc-info->comm-to (car misclist)))
tmp)))
(if (memq (misc-info->comm-to (car misclist)) seen)
(setq tmp (cons t tmp))
(unless kom-review-uses-cache
(cache-del-text-stat (misc-info->comm-to (car misclist))))
(setq seen (cons (misc-info->comm-to (car misclist)) seen)
tmp (cons
(blocking-do 'get-text-stat
(misc-info->comm-to (car misclist)))
tmp))))
((eq (misc-info->type (car misclist)) 'FOOTN-TO)
(unless kom-review-uses-cache
(cache-del-text-stat (misc-info->footn-to (car misclist))))
(setq tmp
(cons
(blocking-do 'get-text-stat
(misc-info->footn-to (car misclist)))
tmp))))
(if (memq (misc-info->footn-to (car misclist)) seen)
(setq tmp (cons t tmp))
(unless kom-review-uses-cache
(cache-del-text-stat (misc-info->footn-to (car misclist))))
(setq seen (cons (misc-info->footn-to (car misclist)) seen)
tmp (cons
(blocking-do 'get-text-stat
(misc-info->footn-to (car misclist)))
tmp)))))
(setq misclist (cdr misclist)))
;;
;; Remove unreadable texts
;;
;;
;; Remove unreadable texts
;;
(setq tmp (delq nil tmp))
(setq tmp (delq nil tmp))
;;
;; If no parents were found, this is is a top-level text
......@@ -1395,9 +1402,16 @@ If ALL is set, return a list of all root texts."
(when (null tmp)
(setq result (cons head result))
(if (not all) (setq queue nil)))
(unless all (setq queue nil)))
;;
;; Remove "I visited this parent already" markers
;;
(setq tmp (delq t tmp))
(setq queue (nconc tmp queue)))
(if all (mapcar 'text-stat->text-no result)
(if all
(mapcar 'text-stat->text-no result)
(text-stat->text-no (car result)))))
(t nil)))
......
......@@ -1728,6 +1728,7 @@ Du m
(confusion-what-to-review-mail-headers . "Jag frstr inte vilket inlggs brevhuvud du vill se.\n")
(confusion-what-to-unread-root . "Jag frstr inte vilket inlggs urinlgg du vill markera olst.\n")
(confusion-what-to-find-root . "Jag frstr inte vilket inlggs urinlgg du vill terse.\n")
(could-not-find-root . "Kan inte identifiera urinlgget. Kommentarsstrukturen kanske r cirkulr.\n")
(confusion-what-to-unread-root-review . "Jag frstr inte vilket inlggstrd du vill markera olst.\n")
(confusion-what-to-find-root-review . "Jag frstr inte vilket inlggstrd du vill terse.\n")
......@@ -1818,7 +1819,7 @@ Antal sessioner: %21#1d (totalt)
(recommending-conf . "Rekommenderar %#1M%#2?b%[ (prioritet %#2d)%]%[%]%#3?b%[ %#3s%]%[%]...")
(has-recommended-conf . "%#1P har rekommenderat mte %#2M. Vill du bli medlem?\n")
(accept-recommendation . "G med i %#1M? ")
(accepting-recommendataion . "G med i rekommenderat mte %#2M...")
(accepting-recommendation . "G med i rekommenderat mte %#2M...")
(redirect-for-whom . "Dirigera om kommentarer fr: ")
(redirect-to-which-conf . "Dirigera om kommentarer till: ")
......@@ -3052,17 +3053,22 @@ teckenkodning.
(lyskom . "Instllningar fr LysKOM")
(lyskom-doc . "\
Dessa tangenter fungerar utanfr redigerbara textflt.
\\[lyskom-customize-save-and-quit] fr att spara och avsluta,
\\[lyskom-customize-save] fr att spara utan att avsluta
\\[lyskom-customize-quit] fr att avsluta utan att spara
\\[widget-forward] flyttar till nsta instllning
\\[widget-button-press] ndrar vrdet
Tryck C-h m fr en fullstndig lista av kommandon.
Hjlptexter: [?] Visa hjlptext [!] Gm hjlptext
Listor mm.: [INS] Lgg till rad [DEL] Ta bort rad [*] ndra vrde
Om rutan fre instllningens namn r ikryssad kommer vrdet att sparas
i servern. Annars sparas det i din .emacs.")
i servern. Annars sparas det i din .emacs.
Klicka med musens mittenknapp p ledtexterna fr att ndra vrde eller
ta fram menyer.")
(section . "------------------------------------------------------------------------------\n")
(look-and-feel-misc . "Diverse utseende och beteende\n")
......
......@@ -1809,17 +1809,17 @@ conference and person buttons are not expected.")
;; URLs
("<URL:\\s-*\\([^>]*\\)\\s-*>"
pseudo-url 1 1 kom-url-face lyskom-is-url)
("<\\s-*\\([^>]*\\)\\s-*>"
pseudo-url 1 1 kom-url-face lyskom-is-url)
("\\b\\(www\\|ftp\\|home\\)\\.[^\t \012\014\"<>|\\]*[^][\t \012\014\"<>|.,!(){}?'`:;]"
pseudo-url 0 nil kom-url-face)
("\\(file://\\|ftp://\\|gopher://\\|http://\\|https://\\|news:\\|wais://\\|mailto:\\|telnet:\\)[^\t \012\014\"<>|\\]*[^][\t \012\014\"<>|.,!(){}?'`:;]"
url 0 nil kom-url-face)
("<URL:\\s-*\\([^>]*\\)\\s-*>"
pseudo-url 1 1 kom-url-face lyskom-is-url)
("<\\s-*\\([^>]*\\)\\s-*>"
pseudo-url 1 1 kom-url-face lyskom-is-url)
;; JySKom enhancements
("<(?m[|ö]te[ \t\n\r]*\\([0-9]+\\)\\([^0-9>]?\\|[^0-9>][^>]*\\))?>"
......@@ -3783,6 +3783,7 @@ Values other than those listed are reserved for future use."
("text/x-kom-basic" . nil)
("x-kom/text" . nil) ;Archaic alias for text/x-kom-basic.
("x-kom/basic" . nil) ;Archaic alias for text/x-kom-basic.
("x-kom/user-area" . lyskom-format-x-kom/user-area)
("x-kom/ö\\." . lyskom-format-ö))
"AList of (FORMAT . FUNCTION) specifying functions that format texts
of that type. FORMAT is a symbol and FUNCTION is a function taking one
......
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