all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* `batch-byte-compile' for directories?
@ 2015-06-19 18:19 Philipp Stephani
  0 siblings, 0 replies; 5+ messages in thread
From: Philipp Stephani @ 2015-06-19 18:19 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

the function `batch-byte-compile' supports directories.  The code for
this is:

	  (let (source dest)
	    (dolist (file (directory-files (car command-line-args-left)))
	      (if (and (string-match emacs-lisp-file-regexp file)
		       (not (auto-save-file-name-p file))
		       (setq source
                             (expand-file-name file
                                               (car command-line-args-left)))
		       (setq dest (byte-compile-dest-file source))
		       (file-exists-p dest)
		       (file-newer-than-file-p source dest))
		  (if (null (batch-byte-compile-file source))
		      (setq error t)))))

What I find weird is the condition that the destination file has to
exist for the compilation to be performed.  I would expect logic similar
to the explicit file case (don't check destination file by default, and
if NOFORCE is set check for either nonexistent or old destination
file).  Is the current behavior intended?

Thanks,
Philipp

-- 
Google Germany GmbH
Dienerstraße 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Diese E-Mail ist vertraulich.  Wenn Sie nicht der richtige Adressat sind,
leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen
Sie die E-Mail und alle Anhänge.  Vielen Dank.
       
This e-mail is confidential.  If you are not the right addressee please do not
forward it, please inform the sender, and please erase this e-mail including
any attachments.  Thanks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `batch-byte-compile' for directories?
       [not found] <mailman.5310.1434737951.904.help-gnu-emacs@gnu.org>
@ 2015-06-19 18:54 ` Stefan Monnier
  2015-06-21 12:02   ` Philipp Stephani
       [not found]   ` <mailman.5355.1434888145.904.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2015-06-19 18:54 UTC (permalink / raw)
  To: help-gnu-emacs

> What I find weird is the condition that the destination file has to
> exist for the compilation to be performed.

Yes, that's a leftover from eons ago when this was used as a way to
control which files to keep uncompiled.


        Stefan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `batch-byte-compile' for directories?
  2015-06-19 18:54 ` `batch-byte-compile' for directories? Stefan Monnier
@ 2015-06-21 12:02   ` Philipp Stephani
       [not found]   ` <mailman.5355.1434888145.904.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Philipp Stephani @ 2015-06-21 12:02 UTC (permalink / raw)
  To: Stefan Monnier, help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> schrieb am Fr., 19. Juni 2015 um
20:55 Uhr:

> > What I find weird is the condition that the destination file has to
> > exist for the compilation to be performed.
>
> Yes, that's a leftover from eons ago when this was used as a way to
> control which files to keep uncompiled.
>
>
OK, so what should be do?
- Change the behavior to match the behavior for single files?
- Remove the possibility to run on directories altogether?
- Document the current behavior?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `batch-byte-compile' for directories?
       [not found]   ` <mailman.5355.1434888145.904.help-gnu-emacs@gnu.org>
@ 2015-06-21 17:31     ` Stefan Monnier
  2015-06-21 19:27       ` Philipp Stephani
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2015-06-21 17:31 UTC (permalink / raw)
  To: help-gnu-emacs

> OK, so what should be do?
> - Change the behavior to match the behavior for single files?
> - Remove the possibility to run on directories altogether?
> - Document the current behavior?

I suggest you file a bug report (or send a message to emacs-devel)
requesting the behavior you like.  Personally I just don't use this
behavior and instead use the batch-recompile-directory with
a 0 argument, which gives me the behavior I want without having to deal
with potentially breaking compatibility for some corner case
script somewhere.


        Stefan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `batch-byte-compile' for directories?
  2015-06-21 17:31     ` Stefan Monnier
@ 2015-06-21 19:27       ` Philipp Stephani
  0 siblings, 0 replies; 5+ messages in thread
From: Philipp Stephani @ 2015-06-21 19:27 UTC (permalink / raw)
  To: Stefan Monnier, help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> schrieb am So., 21. Juni 2015 um
19:35 Uhr:

> > OK, so what should be do?
> > - Change the behavior to match the behavior for single files?
> > - Remove the possibility to run on directories altogether?
> > - Document the current behavior?
>
> I suggest you file a bug report (or send a message to emacs-devel)
> requesting the behavior you like.  Personally I just don't use this
> behavior and instead use the batch-recompile-directory with
> a 0 argument, which gives me the behavior I want without having to deal
> with potentially breaking compatibility for some corner case
> script somewhere.
>
>
>
Created bug 20867. I can send a patch if you want.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-21 19:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5310.1434737951.904.help-gnu-emacs@gnu.org>
2015-06-19 18:54 ` `batch-byte-compile' for directories? Stefan Monnier
2015-06-21 12:02   ` Philipp Stephani
     [not found]   ` <mailman.5355.1434888145.904.help-gnu-emacs@gnu.org>
2015-06-21 17:31     ` Stefan Monnier
2015-06-21 19:27       ` Philipp Stephani
2015-06-19 18:19 Philipp Stephani

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.