From: Bruno Haible Date: Thu, 19 Jul 2001 14:41:58 +0000 (+0000) Subject: Big merge part 8. X-Git-Tag: v0.11~601 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75aa7faf3066a542e3075b08bfb6fa668f2e29d0;p=thirdparty%2Fgettext.git Big merge part 8. --- diff --git a/misc/ChangeLog b/misc/ChangeLog index bebb77c51..8f1e4c34a 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,13 @@ +2001-08-12 François Pinard + + * 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 + + * 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 * po-mode.el (po-send-mail): Clarify some prompts. diff --git a/misc/po-mode.el b/misc/po-mode.el index 31ecff3b4..ac02dcbfb 100644 --- a/misc/po-mode.el +++ b/misc/po-mode.el @@ -190,8 +190,8 @@ or remove the -m if you are not using the GNU version of `uuencode'." ;;; 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)