Commit 1da39a88 authored by David Byers's avatar David Byers
Browse files

Fix bug 697

parent e696d317
2002-09-16 David Byers <david.byers@swipnet.se>
Fix bug 679:
* commands1.el (kom-delete-text): Nag if the user tries to delete
a text with comments. Rewrote the main logic.
2002-09-15 David Byers <david.byers@swipnet.se> 2002-09-15 David Byers <david.byers@swipnet.se>
Fix problem when calling kom-view before reading anything: Fix problem when calling kom-view before reading anything:
......
...@@ -115,32 +115,38 @@ ...@@ -115,32 +115,38 @@
"Delete a text. Argument: TEXT-NO" "Delete a text. Argument: TEXT-NO"
(interactive (list (lyskom-read-text-no-prefix-arg 'what-text-to-delete))) (interactive (list (lyskom-read-text-no-prefix-arg 'what-text-to-delete)))
(if text-no (if text-no
(let* ((do-delete t) (let* ((text-stat (blocking-do 'get-text-stat text-no))
(text-stat (blocking-do 'get-text-stat text-no)) (num-marks (and text-stat (text-stat->no-of-marks text-stat)))
(num-marks (text-stat->no-of-marks text-stat)) (num-comments (and text-stat (length (lyskom-text-comments text-stat))))
(is-marked-by-me (cache-text-is-marked text-no))) (is-marked-by-me (cache-text-is-marked text-no)))
(cond ((null text-stat)
(lyskom-report-command-answer nil) (if (null text-stat)
(setq do-delete nil)) (lyskom-report-command-answer nil)
(when (and (or (eq 0 num-marks)
((> (text-stat->no-of-marks text-stat) 0) (lyskom-j-or-n-p
(setq do-delete (lyskom-format 'delete-marked-text
(lyskom-j-or-n-p (if (> num-marks 0)
(lyskom-format 'delete-marked-text (if is-marked-by-me
(if (> num-marks 0) (if (= num-marks 1)
(if is-marked-by-me (lyskom-get-string 'delete-marked-by-you)
(if (= num-marks 1) (lyskom-format 'delete-marked-by-you-and-others
(lyskom-get-string 'delete-marked-by-you) (1- num-marks)))
(lyskom-format 'delete-marked-by-you-and-others (lyskom-format 'delete-marked-by-several
(1- num-marks))) num-marks))))))
(lyskom-format 'delete-marked-by-several (or (eq 0 num-comments)
num-marks)))))))) (progn (lyskom-format-insert "%#1@%#2t\n"
(when do-delete '(face kom-warning-face)
(lyskom-format-insert 'deleting-text text-no) (lyskom-get-string 'delete-commented-text-help))
(when (lyskom-report-command-answer (lyskom-beep t)
(blocking-do 'delete-text text-no)) (and (lyskom-j-or-n-p
(when is-marked-by-me (lyskom-get-string 'delete-commented-text))
(lyskom-unmark-text text-no))))) (lyskom-j-or-n-p
(lyskom-get-string 'really-delete-commented-text))))))
(lyskom-format-insert 'deleting-text text-no)
(when (lyskom-report-command-answer
(blocking-do 'delete-text text-no))
(when is-marked-by-me
(lyskom-unmark-text text-no))))))
(lyskom-insert 'confusion-what-to-delete))) (lyskom-insert 'confusion-what-to-delete)))
......
...@@ -273,6 +273,13 @@ Be ashamed of being You! You have a very good reason.\n\n") ...@@ -273,6 +273,13 @@ Be ashamed of being You! You have a very good reason.\n\n")
(delete-marked-by-you . "marked by you") (delete-marked-by-you . "marked by you")
(delete-marked-by-you-and-others . "marked by you and %#1?d%[someone else%]%[%#1d others%]") (delete-marked-by-you-and-others . "marked by you and %#1?d%[someone else%]%[%#1d others%]")
(delete-marked-by-several . "marked by %#1d user%#1?d%[%]%[s%]") (delete-marked-by-several . "marked by %#1d user%#1?d%[%]%[s%]")
(delete-commented-text-help . "\
The text you are about to remove has comments. If you remove it the
comments will lose their context, and this annoys and even angers
many readers. You should consider moving it to another conference
instead of removing it.")
(delete-commented-text . "The text has comments. Remove anyway? ")
(really-delete-commented-text . "Removing a commented text may annoy many readers. Remove anyway?")
(deleting-text . "Removing text %#1:n...") (deleting-text . "Removing text %#1:n...")
(presentation-for-whom . "Which conference/user? ") (presentation-for-whom . "Which conference/user? ")
......
...@@ -247,6 +247,13 @@ Guran vill helst s ...@@ -247,6 +247,13 @@ Guran vill helst s
(delete-marked-by-you . "markerat av dig") (delete-marked-by-you . "markerat av dig")
(delete-marked-by-you-and-others . "markerad av dig och %#1?d%[ngon annan%]%[%#1d andra%]") (delete-marked-by-you-and-others . "markerad av dig och %#1?d%[ngon annan%]%[%#1d andra%]")
(delete-marked-by-several . "markerat av %#1d person%#1?d%[%]%[er%]") (delete-marked-by-several . "markerat av %#1d person%#1?d%[%]%[er%]")
(delete-commented-text-help . "\
Inlgget du hller p att radera har kommentarer. Om du tar bort inlgget
s kommer dessa kommentarer att frlora sitt sammanhang. Detta irriterar
mnga lsare. vervg att flytta inlgget till ett annat mte istllet
fr att radera det.")
(delete-commented-text . "Inlgget har kommentarer. Radera nd? ")
(really-delete-commented-text . "Att radera kommenterade inlgg irriterar mnga lsare. Radera nd?")
(deleting-text . "Radering av text %#1:n...") (deleting-text . "Radering av text %#1:n...")
(presentation-for-whom . "Vilket mte/person? ") (presentation-for-whom . "Vilket mte/person? ")
......
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