]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Big merge part 8.
authorBruno Haible <bruno@clisp.org>
Thu, 19 Jul 2001 14:41:58 +0000 (14:41 +0000)
committerBruno Haible <bruno@clisp.org>
Thu, 19 Jul 2001 14:41:58 +0000 (14:41 +0000)
misc/ChangeLog
misc/po-mode.el

index bebb77c51f293065944227e0e7d429edbca8d346..8f1e4c34a2a48624a137e1ee29e6692f4937edf3 100644 (file)
@@ -1,3 +1,13 @@
+2001-08-12  François Pinard  <pinard@iro.umontreal.ca>
+
+       * po-mode.el (po-find-charset, po-compute-counters,
+       po-check-file-header, po-set-msgstr): Emacs 19 portability matters.
+
+2000-01-03  François Pinard  <pinard@iro.umontreal.ca>
+
+       * po-mode.el (po-check-file-header): Add a new line after default
+       header only for non-empty PO files.
+
 1999-12-10  François Pinard  <pinard@iro.umontreal.ca>
 
        * po-mode.el (po-send-mail): Clarify some prompts.
index 31ecff3b408001a584b719af0110d1014ff3dd78..ac02dcbfb297f7c3400c2c8d4108396a57ebda3b 100644 (file)
@@ -190,8 +190,8 @@ or remove the -m if you are not using the GNU version of `uuencode'."
 \f
 ;;; Emacs portability matters - part II.
 
-;;; Many portability matters are addressed in this page.  All other cases
-;;; involve one of `eval-and-compile' or `fboundp', just search for these.
+;;; Many portability matters are addressed in this page.  The few remaining
+;;; cases, elsewhere, all involve  `eval-and-compile', `boundp' or `fboundp'.
 
 ;; Protect string comparisons from text properties if possible.
 (eval-and-compile
@@ -759,8 +759,8 @@ Content-Type into a Mule coding system.")
           ;; value was loaded.  Load the next 1024 bytes; if charset still
           ;; isn't available, give up.
           (insert-file-contents filename nil (point) (+ (point) 1024)))
-        (when (re-search-forward po-charset nil t)
-          (match-string 1))))))
+        (if (re-search-forward po-charset nil t)
+           (match-string 1))))))
 
 (eval-and-compile
   (if (or po-EMACS20 po-XEMACS)
@@ -977,7 +977,7 @@ Then, update the mode line counters."
       (goto-char (point-min))
       ;; While counting, skip the header entry, for consistency with msgfmt.
       (po-find-span-of-entry)
-      (when (string= (po-get-msgid nil) "")
+      (if (string= (po-get-msgid nil) "")
         (po-next-entry))
       ;; Start counting
       (while (re-search-forward po-any-msgstr-regexp nil t)
@@ -1062,7 +1062,11 @@ Position %d/%d; %d translated, %d fuzzy, %d untranslated, %d obsolete")
        ;; Not a single entry found.
        (setq insert-flag t))
       (goto-char (point-min))
-      (and insert-flag (insert po-default-file-header "\n")))))
+      (if insert-flag
+         (progn
+           (insert po-default-file-header)
+           (if (not (eobp))
+               (insert "\n")))))))
 
 (defun po-replace-revision-date ()
   "Replace the revision date by current time in the PO file header."
@@ -1612,21 +1616,21 @@ described by FORM is merely identical to the msgstr already in place."
     (save-excursion
       (goto-char po-start-of-entry)
       (save-excursion                   ; check for an indexed msgstr
-        (when (re-search-forward po-msgstr-idx-keyword-regexp
-                                po-end-of-entry t)
-          (setq msgstr-idx (buffer-substring-no-properties
-                     (match-beginning 0) (match-end 0)))))
+        (if (re-search-forward po-msgstr-idx-keyword-regexp
+                              po-end-of-entry t)
+           (setq msgstr-idx (buffer-substring-no-properties
+                             (match-beginning 0) (match-end 0)))))
       (re-search-forward po-any-msgstr-regexp po-end-of-entry)
       (and (not (string-equal (po-match-string 0) string))
           (let ((buffer-read-only po-read-only))
             (po-decrease-type-counter)
             (replace-match string t t)
              (goto-char (match-beginning 0))
-             (unless (eq msgstr-idx nil) ; hack: replace msgstr with msgstr[d]
-               (progn
-                 (insert msgstr-idx)
-                 (looking-at "\\(#~[ \t]*\\)?msgstr")
-                 (replace-match "")))
+             (if (eq msgstr-idx nil) ; hack: replace msgstr with msgstr[d]
+                nil
+              (insert msgstr-idx)
+              (looking-at "\\(#~[ \t]*\\)?msgstr")
+              (replace-match ""))
             (goto-char po-start-of-msgid)
             (po-find-span-of-entry)
             (po-increase-type-counter)