;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; File: dired-mob.el;; RCS:;; Dired Version: 7.13;; Description: Commands for marking files from another buffer.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Requirements and provisions(provide'dired-mob)(require'dired)(autoload'compilation-buffer-p"compile")(autoload'compile-reinitialize-errors"compile");; For the byte-compiler(defvarcompilation-error-list);;; Utilities(defundired-mark-these-files(file-listfrom);; Mark the files in FILE-LIST. Relative filenames are taken to be;; in the current dired directory.;; FROM is a string (used for logging) describing where FILE-LIST;; came from.;; Logs files that were not found and displays a success or failure;; message.(message"Marking files %s..."from)(let((total(lengthfile-list))(cur-dir(dired-current-directory))filefailures)(whilefile-list(setqfile(expand-file-name(carfile-list)cur-dir)file-list(cdrfile-list));;(message "Marking file `%s'" file)(save-excursion(if(dired-goto-filefile)(dired-mark1); supplying a prefix keeps it from checking; for a subdir.(setqfailures(cons(dired-make-relativefile)failures))(dired-log(buffer-name(current-buffer))"Cannot mark this file (not found): %s\n"file))))(dired-update-mode-line-modifiedt)(iffailures(dired-log-summary(buffer-name(current-buffer))(format"Failed to mark %d of %d files %s %s"(lengthfailures)totalfromfailures)failures)(message"Marked %d file%s %s."total(dired-plural-stotal)from))));;; User commands;;;###autoload(defundired-mark-files-from-other-dired-buffer(buf)"Mark files that are marked in the other Dired buffer.I.e, mark those files in this Dired buffer that have the samenon-directory part as the marked files in the Dired buffer in the other window."(interactive(list(window-buffer(next-window))))(if(eq(get-bufferbuf)(current-buffer))(error"Other dired buffer is the same"))(or(stringpbuf)(setqbuf(buffer-namebuf)))(let((other-files(save-excursion(set-bufferbuf)(or(eqmajor-mode'dired-mode)(error"%s is not a dired buffer"buf))(dired-get-marked-files'no-dir))))(dired-mark-these-filesother-files(concat"from buffer "buf))));;;###autoload(defundired-mark-files-compilation-buffer(&optionalbuf)"Mark the files mentioned in the `*compilation*' buffer.With a prefix, you may specify the other buffer."(interactive(list(let((buff(let((owin(selected-window))found)(unwind-protect(progn(other-window1)(while(null(orfound(eq(selected-window)owin)))(if(compilation-buffer-p(window-buffer(selected-window)))(setqfound(current-buffer)))(other-window1)))(select-windowowin))found)))(if(orcurrent-prefix-arg(nullbuff))(let((minibuffer-history(delqnil(mapcar(function(lambda(b)(and(compilation-buffer-pb)(buffer-nameb))))(buffer-list)))))(read-buffer"Use buffer: "(orbuff(carminibuffer-history))))buff))))(let((dired-dir(directory-file-namedefault-directory))files)(save-window-excursion(set-bufferbuf)(compile-reinitialize-errorsnil(point-max))(let((alistcompilation-error-list)fdelt)(whilealist(setqelt(caralist)alist(cdralist))(and(consp(setqelt(car(cdrelt))))(stringp(setqd(carelt)))(stringp(setqf(cdrelt)))(progn(setqd(expand-file-named))(dired-in-this-treeddired-dir))(progn(setqf(expand-file-namefd))(not(memberffiles)))(setqfiles(consffiles))))))(dired-mark-these-filesfiles(concat"From compilation buffer "(if(stringpbuf)buf(buffer-namebuf))))));;; end of dired-mob.el