[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Byte-compilation of custom themes
From: |
Eli Zaretskii |
Subject: |
Re: Byte-compilation of custom themes |
Date: |
Fri, 11 May 2018 20:32:56 +0300 |
> From: "Basil L. Contovounesios" <address@hidden>
> Cc: <address@hidden>, <address@hidden>
> Date: Fri, 11 May 2018 16:16:09 +0100
>
> > The original code carefully verified that the members in
> > custom-theme--load-path are directories, whereas your proposal calls
> > directory-files on each member unconditionally, which will barf if a
> > file is not a directory.
>
> The function custom-theme--load-path already incorporates the
> file-directory-p check, so it is technically redundant here.
> Would you rather it be kept regardless?
We should at least have a comment there that we are relying on
custom-theme--load-path to do the test, and perhaps also an assertion.
> >> - (define-key map "\C-x\C-s" 'custom-theme-write)
> >> - (define-key map "q" 'Custom-buffer-done)
> >> - (define-key map "n" 'widget-forward)
> >> - (define-key map "p" 'widget-backward)
> >> + (define-key map "\C-x\C-s" #'custom-theme-write)
> >> + (define-key map "q" #'Custom-buffer-done)
> >> + (define-key map "n" #'widget-forward)
> >> + (define-key map "p" #'widget-backward)
> >
> > Really? Are we going to switch to #'foo even in key bindings?
>
> Though I personally prefer to consistently #'-quote function symbols in
> my own code, both for the extra byte-compiler check and narrower
> in-buffer completion, I have no strong opinion here; I was simply making
> the change in a sweeping fashion, in line with what I had perceived as a
> welcome style. Out of curiosity, though, what makes key bindings
> special w.r.t. quoting?
Stefan gave one reason (with which I agree). From POV, it's another
stab into my heart of a veteran reader of Emacs Lisp code. I recently
find the code harder and harder to read due to all the new syntax and
unfamiliar functions. You can ignore me on that, though.
Thanks.