This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-02
Channels
- # aws-lambda (5)
- # bangalore-clj (1)
- # beginners (96)
- # boot (66)
- # cider (39)
- # cljsjs (2)
- # cljsrn (5)
- # clojure (265)
- # clojure-android (1)
- # clojure-france (1)
- # clojure-greece (32)
- # clojure-italy (4)
- # clojure-russia (2)
- # clojure-sg (1)
- # clojure-spec (27)
- # clojure-uk (25)
- # clojurescript (88)
- # cursive (4)
- # datomic (31)
- # emacs (96)
- # hoplon (10)
- # immutant (14)
- # jobs (2)
- # luminus (1)
- # lumo (66)
- # off-topic (128)
- # om (8)
- # om-next (2)
- # onyx (9)
- # parinfer (5)
- # re-frame (37)
- # reagent (16)
- # rum (9)
- # schema (3)
- # specter (34)
- # unrepl (8)
- # yada (21)
Hi all, I’m just doing an audit of my config and the template I’ve used has this in it
(setq backup-directory-alist `(("." . ,(concat user-emacs-directory
"backups"))))
What does the second item (the unquoted dot) in that list do? For that matter I’m not sure what the first item is for!the second dot is just for easier readability in terms for alists. afaik it is optional
That’s what I thought about the first dot but this is supposed to be moving the backup file location to backups in the emacs.d directory. If that’s the case then you wouldn’t need to include the current directory would you?
Ah, it’s actually a catch all regex http://doc.endlessparentheses.com/Var/backup-directory-alist.html
@qqq in elisp
?
I didn't know it had (comment...
@qqq better ask #cider for this
Oh ok so it must be clojure-mode
Probably there is a defface
to duplicate in there
You can use describe-face
for checking where the face comes from
How do I access the code of clojure-mode (besides trying to guess a function in clojure-mode and doing C-h f)
(defface clojure-keyword-face
'((t (:inherit font-lock-constant-face)))
"Face used to font-lock Clojure keywords (:something)."
:package-version '(clojure-mode . "3.0.0"))
(defface clojure-character-face
'((t (:inherit font-lock-string-face)))
"Face used to font-lock Clojure character literals."
:package-version '(clojure-mode . "3.0.0"))
(defface clojure-interop-method-face
'((t (:inherit font-lock-preprocessor-face)))
"Face used to font-lock interop method names (camelCase)."
:package-version '(clojure-mode . "3.0.0"))
actually, that's all the deffaces that there arefrom this, it appears that ;;, #_ and comment differ. comment
must be readable, and therefore making it look commented out could lead to compilation errors or holding onto aliases after they have been removed, etc
(but you're right in that (comment ...) is read + returns nil rather than throw away at read time)
of course it doesn't matter how emacs displays it. my point is that there is often comment drift. and if it looks commented out you may not realize that the compiler requires it to move in lockstep and keep aliases, etc
ah it looks like the reader doesn't resolve anything, just makes sure the forms "look right"
By default, this only applies to code after the `#_' reader
macro. In order to also font-lock the `(comment ...)' macro as a
comment, you can set the value to:
\"#_ *\\\\(?1:[^ ]\\\\)\\\\|\\\\(?1:(comment\\\\_>\\\\)\"")
@qqq it would be great if you can contribute back to clojure.mode
I guess
@richiardiandrea : the code @dpsutton linked to iks already, literally, in the clojure-mode codebase
(setq clojure--comment-macro-regexp "# *\\(?1:[^ ]\\)\\|\\(?1:(comment\\>\\)") ^^ is literally all it takes
true, but it requires finding that regex in the source and setq'ing it.
(defun clojure-mode-toggle-comment ()
(setq clojure-comments-out-comments (not (clojure-comments-out-comments))
(setq clojure--comment-macro-regexp (clojure-mode-regex-for-comment-style ...)))
or something similar@richiardiandrea : can you package up @dpsutton 's patch and submit it as a pull request to clojure-mode? 🙂
sure can, isn't github
working for you?
got it, I can for sure, is it the only thing that's needed?
also, can this be on by default?
(comment ...) is kind of weird in that, when the code is run, it actually becomes a nil right ?
yes but this is something you don't care about in emacs...as long as it is grayed out
it is just for displaying it correctly
yeah you are basically executing (str)
there
I'm abusing it as follows:
(defn foo [ ... ]
(comment ... )
(... body of foo ... ))
then, since (comment l..) isn't stripeped away, I can insert all the type info for function foo thereit is not stripped at read time because it is not a reader macro
anyways, these are just details
probably it should be optional, because of that
it seems like the type of thing where you set once, and stick with the decisions for years
uhm, dunno in any case a defcustom
is cheap, I will add it and see what folks think about it
so @dpsutton where did you take clojure-comments-out-comments
?
where did i take it? naming things is hard so i just put a placeholder. i was guessing what it might eventually be called, but that's a pretty poor name
ah ok 😄
O don't like this as default. Stuff inside comment
is still code and would benefit from syntax highlighting
@dpsutton weird, do I need to refresh somehow the emacs display in order to see that?
the different face for (comment
ah ah ok 😉
uhm, lemme try that
oh, there is a font-lock-fontify-block
nice, it works 🙂
I had to call the above (easier!)