d, the cursor at start of msgid, then return 't'.
Otherwise, move nothing, and just return 'nil'."
  (let ((current (current-buffer))
        (buffer (find-file-noselect name)))
    (set-buffer buffer)
    (let ((start (point))
          found)
      (goto-char (point-min))
      (while (and (not found) (search-forward string nil t))
        ;; Screen out longer 'msgid's.
        (if (looking-at "^msgstr ")
            (progn
              (po-find-span-of-entry)
              ;; Ignore an untranslated entry.
              (or (string-equal
                   (buffer-substring po-start-of-msgstr-block po-end-of-entry)
                   "msgstr \"\"\n")
                  (setq found t)))))
      (if found
          (progn
            (switch-to-buffer buffer)
            (po-find-span-of-entry)
            (if po-highlighting
                (progn
                  (goto-char po-start-of-entry)
                  (re-search-forward po-any-msgstr-block-regexp nil t)
                  (let ((end (1- (match-end 0))))
                    (goto-char (match-beginning 0))
                    (re-search-forward "msgstr +" nil t)
                    ;; Just "borrow" the marking overlay.
                    (po-highlight po-marking-overlay (point) end))))
            (goto-char po-start-of-msgid))
        (goto-char start)
        (po-find-span-of-entry)
        (set-buffer current))
      found)))

(defun po-cycle-auxiliary ()
  "Select the next auxiliary file having an entry with same 'msgid'."
  (interactive)
  (po-find-span-of-entry)
  (if po-auxiliary-list
      (let ((string (buffer-substring po-start-of-msgid
                                      po-start-of-msgstr-block))
            (cursor po-auxiliary-cursor)
            found name)
        (while (and (not found) cursor)
          (setq name (car (car cursor)))
          (if (and (not (string-equal buffer-file-name name))
                   (po-seek-equivalent-translation name string))
              (setq found t
                    po-auxiliary-cursor cursor))
          (setq cursor (cdr cursor)))
        (setq cursor po-auxiliary-list)
        (while (and (not found) cursor)
          (setq name (car (car cursor)))
          (if (and (not (string-equal buffer-file-name name))
                   (po-seek-equivalent-translation name string))
              (setq found t
                    po-auxiliary-cursor cursor))
          (setq cursor (cdr cursor)))
        (or found (message (_"No other translation found")))
        found)))

(defun po-subedit-cycle-auxiliary ()
  "Cycle auxiliary file, but from the translation edit buffer."
  (interactive)
  (let* ((entry-marker (nth 0 po-subedit-back-pointer))
         (entry-buffer (marker-buffer entry-marker))
         (buffer (current-buffer)))
    (pop-to-buffer entry-buffer)
    (po-cycle-auxiliary)
    (pop-to-buffer buffer)))

(defun po-select-auxiliary ()
  "Select one of the available auxiliary files and locate an equivalent entry.
If an entry having the same 'msgid' cannot be found, merely select the file
without moving its cursor."
  (interactive)
  (po-find-span-of-entry)
  (if po-auxiliary-list
      (let ((string
              (buffer-substring po-start-of-msgid po-start-of-msgstr-block))
            (name (car (assoc (completing-read (_"Which auxiliary file? ")
                                               po-auxiliary-list nil t)
                              po-auxiliary-list))))
        (po-consider-as-auxiliary)
        (or (po-seek-equivalent-translation name string)
            (find-file name)))))
