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

Fix bug 697

parent e696d317
2002-09-16 David Byers <>
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 <>
Fix problem when calling kom-view before reading anything:
......@@ -115,16 +115,14 @@
"Delete a text. Argument: TEXT-NO"
(interactive (list (lyskom-read-text-no-prefix-arg 'what-text-to-delete)))
(if text-no
(let* ((do-delete t)
(text-stat (blocking-do 'get-text-stat text-no))
(num-marks (text-stat->no-of-marks text-stat))
(let* ((text-stat (blocking-do 'get-text-stat text-no))
(num-marks (and text-stat (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)))
(cond ((null text-stat)
(lyskom-report-command-answer nil)
(setq do-delete nil))
((> (text-stat->no-of-marks text-stat) 0)
(setq do-delete
(if (null text-stat)
(lyskom-report-command-answer nil)
(when (and (or (eq 0 num-marks)
(lyskom-format 'delete-marked-text
(if (> num-marks 0)
......@@ -134,13 +132,21 @@
(lyskom-format 'delete-marked-by-you-and-others
(1- num-marks)))
(lyskom-format 'delete-marked-by-several
(when do-delete
(or (eq 0 num-comments)
(progn (lyskom-format-insert "%#1@%#2t\n"
'(face kom-warning-face)
(lyskom-get-string 'delete-commented-text-help))
(lyskom-beep t)
(and (lyskom-j-or-n-p
(lyskom-get-string 'delete-commented-text))
(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-unmark-text text-no))))))
(lyskom-insert 'confusion-what-to-delete)))
......@@ -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-and-others . "marked by you and %#1?d%[someone else%]%[%#1d others%]")
(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...")
(presentation-for-whom . "Which conference/user? ")
......@@ -247,6 +247,13 @@ Guran vill helst s
(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-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...")
(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