Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: clojure-emacs/clojure-mode
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 449d734f1a61815f76bff23c79dc602c2f687cb4
Choose a base ref
..
head repository: clojure-emacs/clojure-mode
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9c2f9677819510ec70e03d68a68a99e6d04175ca
Choose a head ref
Showing with 18 additions and 10 deletions.
  1. +7 −6 CHANGELOG.md
  2. +1 −1 README.md
  3. +1 −1 clojure-mode-extra-font-locking.el
  4. +4 −2 clojure-mode.el
  5. +5 −0 test/clojure-mode-util-test.el
13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,11 +2,13 @@

## master (unreleased)

## 5.19.0 (2024-05-26)

### Bugs fixed

* Fix `clojure-align` when called from `clojure-ts-mode` major mode buffers.
* [#671](https://github.com/clojure-emacs/clojure-mode/issues/671): Syntax highlighting for digits after the first in `%` args. (e.g. `%10`)
* Sync version of `clojure-mode-extra-font-locking.el` with `clojure-mode.el`.
* [#680](https://github.com/clojure-emacs/clojure-mode/issues/680): Change syntax class of ASCII control characters to punctuation, fixing situations where carriage returns were being interpreted as symbols.

# Changes

@@ -38,15 +40,14 @@

### Bugs fixed

* [#656](https://github.com/clojure-emacs/clojure-mode/issues/656): Fix clojure-find-ns when ns form is preceded by other forms.

* [#593](https://github.com/clojure-emacs/clojure-mode/issues/593): Fix clojure-find-ns when ns form is preceded by whitespace or inside comment form.
* [#656](https://github.com/clojure-emacs/clojure-mode/issues/656): Fix `clojure-find-ns` when ns form is preceded by other forms.
* [#593](https://github.com/clojure-emacs/clojure-mode/issues/593): Fix `clojure-find-ns` when ns form is preceded by whitespace or inside comment form.

## 5.16.2 (2023-08-23)

### Changes

* `clojure-find-ns`: add an option to never raise errors, returning nil instead on unparseable ns forms.
* `clojure-find-ns`: add an option to never raise errors, returning `nil` instead on unparseable ns forms.

## 5.16.1 (2023-06-26)

@@ -70,7 +71,7 @@

* [#581](https://github.com/clojure-emacs/clojure-mode/issues/581): Fix font locking not working for keywords starting with a number.
* [#377](https://github.com/clojure-emacs/clojure-mode/issues/377): Fix everything starting with the prefix `def` being highlighted as a definition form. Now definition forms are enumerated explicitly in the font-locking code, like all other forms.
* [#638](https://github.com/clojure-emacs/clojure-mode/pull/638): Fix imenu with Clojure code in string or comment.
* [#638](https://github.com/clojure-emacs/clojure-mode/pull/638): Fix `imenu` with Clojure code in string or comment.

## 5.15.1 (2022-07-30)

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ highlighting), indentation, navigation and refactoring support for the
**This documentation tracks the `master` branch of `clojure-mode`. Some of
the features and settings discussed here might not be available in
older releases (including the current stable release). Please, consult
the relevant git tag (e.g. [5.18.1](https://github.com/clojure-emacs/clojure-mode/tree/v5.18.1)) if you need documentation for a
the relevant git tag (e.g. [5.19.0](https://github.com/clojure-emacs/clojure-mode/tree/v5.19.0)) if you need documentation for a
specific `clojure-mode` release.**

## Installation
2 changes: 1 addition & 1 deletion clojure-mode-extra-font-locking.el
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.dev>
;; URL: https://github.com/clojure-emacs/clojure-mode
;; Version: 5.19.0-snapshot
;; Version: 3.0.0
;; Keywords: languages, lisp
;; Package-Requires: ((clojure-mode "3.0"))

6 changes: 4 additions & 2 deletions clojure-mode.el
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
;; Maintainer: Bozhidar Batsov <bozhidar@batsov.dev>
;; URL: https://github.com/clojure-emacs/clojure-mode
;; Keywords: languages clojure clojurescript lisp
;; Version: 5.19.0-snapshot
;; Version: 5.20.0-snapshot
;; Package-Requires: ((emacs "25.1"))

;; This file is not part of GNU Emacs.
@@ -373,7 +373,8 @@ The prefixes are used to generate the correct namespace."
(defvar clojure-mode-syntax-table
(let ((table (make-syntax-table)))
;; Initialize ASCII charset as symbol syntax
(modify-syntax-entry '(0 . 127) "_" table)
;; Control characters from 0-31 default to the punctuation syntax class
(modify-syntax-entry '(32 . 127) "_" table)

;; Word syntax
(modify-syntax-entry '(?0 . ?9) "w" table)
@@ -385,6 +386,7 @@ The prefixes are used to generate the correct namespace."
(modify-syntax-entry ?\xa0 " " table) ; non-breaking space
(modify-syntax-entry ?\t " " table)
(modify-syntax-entry ?\f " " table)
(modify-syntax-entry ?\r " " table)
;; Setting commas as whitespace makes functions like `delete-trailing-whitespace' behave unexpectedly (#561)
(modify-syntax-entry ?, "." table)

5 changes: 5 additions & 0 deletions test/clojure-mode-util-test.el
Original file line number Diff line number Diff line change
@@ -163,6 +163,11 @@
(with-clojure-buffer "(ns)(ns foo)"
(expect (clojure-find-ns) :to-equal "foo"))
(with-clojure-buffer "(ns )(ns foo)"
(expect (clojure-find-ns) :to-equal "foo")))
(it "should ignore carriage returns"
(with-clojure-buffer "(ns \r\n foo)"
(expect (clojure-find-ns) :to-equal "foo"))
(with-clojure-buffer "(ns\r\n ^{:doc \"meta\r\n\"}\r\n foo\r\n)"
(expect (clojure-find-ns) :to-equal "foo"))))

(describe "clojure-sort-ns"