Skip to content

Commit

Permalink
[Fix #1707] Add customization for line truncating in special buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
bkruczyk authored and bbatsov committed Oct 16, 2016
1 parent 041b3e1 commit 1491f7d
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,14 @@

## master (unreleased)

### New Features

* Add new customization variable `cider-special-mode-truncate-lines`.

### Bugs Fixed

* [#1707](https://github.com/clojure-emacs/cider/issues/1707): Allow to customize line truncating in CIDER's special buffers.

## 0.14.0 (2016-10-13)

### New Features
Expand Down
3 changes: 2 additions & 1 deletion cider-browse-ns.el
Expand Up @@ -71,7 +71,8 @@
\\{cider-browse-ns-mode-map}"
(setq buffer-read-only t)
(setq-local electric-indent-chars nil)
(setq-local truncate-lines t)
(when cider-special-mode-truncate-lines
(setq-local truncate-lines t))
(setq-local cider-browse-ns-current-ns nil))

(defun cider-browse-ns--text-face (var-meta)
Expand Down
3 changes: 2 additions & 1 deletion cider-classpath.el
Expand Up @@ -50,7 +50,8 @@
\\{cider-classpath-mode-map}"
(setq buffer-read-only t)
(setq-local electric-indent-chars nil)
(setq-local truncate-lines t))
(when cider-special-mode-truncate-lines
(setq-local truncate-lines t)))

(defun cider-classpath-list (buffer items)
"Populate BUFFER with ITEMS."
Expand Down
3 changes: 2 additions & 1 deletion cider-client.el
Expand Up @@ -388,7 +388,8 @@ connection but can be invoked from any buffer (like `cider-refresh')."
"CIDER Connections Buffer Mode.
\\{cider-connections-buffer-mode-map}
\\{cider-popup-buffer-mode-map}"
(setq-local truncate-lines t))
(when cider-special-mode-truncate-lines
(setq-local truncate-lines t)))

(defvar cider--connection-ewoc)
(defconst cider--connection-browser-buffer-name "*cider-connections*")
Expand Down
7 changes: 7 additions & 0 deletions cider-common.el
Expand Up @@ -42,6 +42,13 @@ prompt if that throws an error."
:group 'cider
:package-version '(cider . "0.9.0"))

(defcustom cider-special-mode-truncate-lines t
"If non-nil, contents of CIDER's special buffers will be line-truncated.
Should be set before loading CIDER."
:type 'boolean
:group 'cider
:package-version '(cider . "0.15.0"))

(defun cider--should-prompt-for-symbol (&optional invert)
"Return the value of the variable `cider-prompt-for-symbol'.
Optionally invert the value, if INVERT is truthy."
Expand Down
3 changes: 2 additions & 1 deletion cider-doc.el
Expand Up @@ -168,7 +168,8 @@
\\{cider-docview-mode-map}"
(setq buffer-read-only t)
(setq-local truncate-lines t)
(when cider-special-mode-truncate-lines
(setq-local truncate-lines t))
(setq-local electric-indent-chars nil)
(setq-local cider-docview-symbol nil)
(setq-local cider-docview-javadoc-url nil)
Expand Down
3 changes: 2 additions & 1 deletion cider-inspector.el
Expand Up @@ -81,7 +81,8 @@ The page size can be also changed interactively within the inspector."
(set-syntax-table clojure-mode-syntax-table)
(setq buffer-read-only t)
(setq-local electric-indent-chars nil)
(setq-local truncate-lines t))
(when cider-special-mode-truncate-lines
(setq-local truncate-lines t)))

;;;###autoload
(defun cider-inspect-last-sexp ()
Expand Down
3 changes: 2 additions & 1 deletion cider-stacktrace.el
Expand Up @@ -225,7 +225,8 @@ The error types are represented as strings."
\\{cider-stacktrace-mode-map}"
(setq buffer-read-only t)
(setq-local truncate-lines t)
(when cider-special-mode-truncate-lines
(setq-local truncate-lines t))
(setq-local electric-indent-chars nil)
(setq-local cider-stacktrace-prior-filters nil)
(setq-local cider-stacktrace-hidden-frame-count 0)
Expand Down
3 changes: 2 additions & 1 deletion cider-test.el
Expand Up @@ -198,7 +198,8 @@
\\{cider-test-report-mode-map}"
(setq buffer-read-only t)
(setq-local truncate-lines t)
(when cider-special-mode-truncate-lines
(setq-local truncate-lines t))
(setq-local electric-indent-chars nil))

;; Report navigation
Expand Down
11 changes: 11 additions & 0 deletions doc/configuration.md
Expand Up @@ -125,6 +125,17 @@ More details can be found [here](https://github.com/clojure-emacs/cider/issues/9
(setq cider-filter-regexps '(".*nrepl"))
```

* By default contents of CIDER's special buffers such as `*cider-test-report*`
or `*cider-doc*` are line truncated. You can set
`cider-special-mode-truncate-lines` to `nil` to make those buffers use word
wrapping instead of line truncating.

This variable should be set before loading CIDER.

``` el
(setq cider-special-mode-truncate-lines nil)
```

## Configuring eldoc

* Enable `eldoc` in Clojure buffers:
Expand Down
4 changes: 3 additions & 1 deletion nrepl-client.el
Expand Up @@ -70,6 +70,7 @@
;;; Code:
(require 'seq)
(require 'cider-compat)
(require 'cider-common)
(require 'cl-lib)
(require 'nrepl-dict)
(require 'queue)
Expand Down Expand Up @@ -1072,7 +1073,8 @@ operations.")
\\{nrepl-messages-mode-map}"
(setq buffer-read-only t)
(setq-local truncate-lines t)
(when cider-special-mode-truncate-lines
(setq-local truncate-lines t))
(setq-local electric-indent-chars nil)
(setq-local comment-start ";")
(setq-local comment-end "")
Expand Down

0 comments on commit 1491f7d

Please sign in to comment.