]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix handling of comments of obsolete entries.
authorBruno Haible <bruno@clisp.org>
Sun, 17 Jun 2007 22:15:27 +0000 (22:15 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:56 +0000 (12:14 +0200)
gettext-tools/misc/ChangeLog
gettext-tools/misc/po-mode.el

index 6443e425b63f529d91ad9c572353c10073a664fb..3752ea6f453e18cc00e40f6ae0751be68aa36085 100644 (file)
@@ -1,3 +1,11 @@
+2007-06-17  Bruno Haible  <bruno@clisp.org>
+
+       Fix '#' command on obsolete entries.
+       * po-mode.el (po-comment-regexp): Renamed from po-active-comment-regexp.
+       (po-obsolete-comment-regexp): Remove variable.
+       (po-get-comment, po-set-comment): Fix syntax assumptions about comments
+       for obsolete entries.
+
 2007-06-17  Bruno Haible  <bruno@clisp.org>
 
        * po-mode.el (po-msgid-to-msgstr): Fix English message.
index 8788b7d96260c7fdad86530850b9dffc962063fc..9757b2a76c726c7cfb9c44b75a39aa19be0b0b5f 100644 (file)
@@ -1895,13 +1895,9 @@ or completely delete an obsolete entry, saving its msgstr on the kill ring."
 \f
 ;;; Killing and yanking comments.
 
-(defvar po-active-comment-regexp
+(defvar po-comment-regexp
   "^\\(#\n\\|# .*\n\\)+"
-  "Regexp matching the whole editable comment part of an active entry.")
-
-(defvar po-obsolete-comment-regexp
-  "^\\(#~ #\n\\|#~ # .*\n\\)+"
-  "Regexp matching the whole editable comment part of an obsolete entry.")
+  "Regexp matching the whole editable comment part of an entry.")
 
 (defun po-get-comment (kill-flag)
   "Extract and return the editable comment string, uncommented.
@@ -1910,14 +1906,12 @@ If KILL-FLAG, then add the unquoted comment to the kill ring."
        (obsolete (eq po-entry-type 'obsolete)))
     (save-excursion
       (goto-char po-start-of-entry)
-      (if (re-search-forward (if obsolete po-obsolete-comment-regexp
-                                po-active-comment-regexp)
-                            po-end-of-entry t)
+      (if (re-search-forward po-comment-regexp po-end-of-entry t)
          (po-with-temp-buffer
            (insert-buffer-substring buffer (match-beginning 0) (match-end 0))
            (goto-char (point-min))
            (while (not (eobp))
-             (if (looking-at (if obsolete "#~ # ?" "# ?"))
+             (if (looking-at (if obsolete "#\\(\n\\| \\)" "# ?"))
                  (replace-match "" t t))
              (forward-line 1))
            (and kill-flag (copy-region-as-kill (point-min) (point-max)))
@@ -1940,15 +1934,11 @@ The string is properly recommented before the replacement occurs."
          (insert "\n"))
       (goto-char (point-min))
       (while (not (eobp))
-       (insert (if (= (following-char) ?\n)
-                   (if obsolete "#~ #" "#")
-                 (if obsolete "#~ # " "# ")))
+       (insert (if (= (following-char) ?\n) "#" "# "))
        (search-forward "\n"))
       (setq string (buffer-string)))
     (goto-char po-start-of-entry)
-    (if (re-search-forward
-        (if obsolete po-obsolete-comment-regexp po-active-comment-regexp)
-        po-end-of-entry t)
+    (if (re-search-forward po-comment-regexp po-end-of-entry t)
        (if (not (string-equal (po-match-string 0) string))
            (let ((buffer-read-only po-read-only))
              (replace-match string t t)))