Skip to content

[refactor] Use Elisp style, -p predicates #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2016
Merged

Conversation

benedekfazekas
Copy link
Member

As discussed in #311 -p style predicates
are more consistent with the rest of clojure-emacs projects and the
language in general.

cljr predicates renamed

  • cljr--use-multiple-cursors?
  • cljr--comment-line?
  • cljr--whitespace?
  • cljr--inside-prefixed-libspec-vector?
  • cljr--even?
  • cljr--op-supported?
  • cljr--cljs-file?
  • cljr--cljc-file?
  • cljr--clj-file?
  • cljr--dash-in-file-name?
  • cljr--already-declared?
  • cljr--existing-group-of-defs?
  • cljr--point-in-reader-conditional?
  • cljr--point-in-reader-conditional-branch?
  • cljr--clj-context?
  • cljr--in-namespace-declaration?
  • cljr--excluded-from-project-clean?
  • cljr--empty-buffer?
  • cljr--end-of-buffer?
  • cljr--qualified-symbol?
  • cljr--is-keyword?
  • cljr--symbol?
  • cljr--keyword-lookup?
  • cljr--defn?
  • cljr--call-site?
  • cljr--no-changes-to-parameter-order?
  • cljr--apply-call-site?
  • cljr--partial-call-site?
  • cljr--ignorable-occurrence?

predicates renamed from dependencies

  • -contains? (dash)
  • -every? (dash)
  • s-contains? (s)
  • s-starts-with? (s)
  • s-ends-with? (s)
  • s-equals (s)
  • s-matches? (s)

predicates not renamed as there is no suitable alias

  • s-blank? (s)
  • s-present? (s)
  • s-uppercase? (s)

@bbatsov
Copy link
Member

bbatsov commented Mar 27, 2016

The changes look good to me. And the last section of the commit is a reminder that it's better to use seq and subr-x in the long run (for pretty much the same reasons).

@@ -724,7 +724,7 @@ at the opening parentheses of an anonymous function."
(when (<= (point) search-bound)
(error "Can't find definition of anonymous function!")))))))

(defun cljr--even? (n)
(defun cljr--even-p (n)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should've been cljr--evenp. There's only a hyphen before the p if there's a hyphen in the predicate.

See more here if you're really interested.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes. Even I forgot about this.

@expez
Copy link
Member

expez commented Mar 29, 2016

Great work @benedekfazekas!

As discussed in #311 `-p` style predicates
are more consistent with the rest of clojure-emacs projects and the
language in general.

cljr predicates renamed

- cljr--use-multiple-cursors?
- cljr--comment-line?
- cljr--whitespace?
- cljr--inside-prefixed-libspec-vector?
- cljr--even?
- cljr--op-supported?
- cljr--cljs-file?
- cljr--cljc-file?
- cljr--clj-file?
- cljr--dash-in-file-name?
- cljr--already-declared?
- cljr--existing-group-of-defs?
- cljr--point-in-reader-conditional?
- cljr--point-in-reader-conditional-branch?
- cljr--clj-context?
- cljr--in-namespace-declaration?
- cljr--excluded-from-project-clean?
- cljr--empty-buffer?
- cljr--end-of-buffer?
- cljr--qualified-symbol?
- cljr--is-keyword?
- cljr--symbol?
- cljr--keyword-lookup?
- cljr--defn?
- cljr--call-site?
- cljr--no-changes-to-parameter-order?
- cljr--apply-call-site?
- cljr--partial-call-site?
- cljr--ignorable-occurrence?

predicates renamed from dependencies

- -contains? (dash)
- -every? (dash)
- s-contains? (s)
- s-starts-with? (s)
- s-ends-with? (s)
- s-equals (s)
- s-matches? (s)

predicates with extra hypen

- cljr--toplevel-p
- cljr--whitespace-p
- cljr--defn-p
- cljr--asts-p

predicates not renamed as there is no suitable alias

- s-blank? (s)
- s-present? (s)
- s-uppercase? (s)
@benedekfazekas benedekfazekas merged commit e112688 into master Mar 29, 2016
@benedekfazekas benedekfazekas deleted the b-style-preds branch March 29, 2016 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants