https://github.com/netromdk/annotate-depth
Annotate buffer if indentation depth is beyond threshold in Emacs.
https://github.com/netromdk/annotate-depth
annotates-buffer emacs emacs-mode indentation-depth melpa
Last synced: 7 months ago
JSON representation
Annotate buffer if indentation depth is beyond threshold in Emacs.
- Host: GitHub
- URL: https://github.com/netromdk/annotate-depth
- Owner: netromdk
- Created: 2016-05-14T19:39:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-20T20:40:31.000Z (over 9 years ago)
- Last Synced: 2025-01-19T06:44:09.013Z (9 months ago)
- Topics: annotates-buffer, emacs, emacs-mode, indentation-depth, melpa
- Language: Emacs Lisp
- Homepage:
- Size: 45.9 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](http://melpa.org/#/annotate-depth)
# Annotate Depth mode [Emacs]
`annotate-depth-mode` annotates buffer if indentation depth is beyond threshold (see `annotate-depth-threshold` which defaults to 5). An idle timer is started when entering the mode and disabled when exiting it. The face `annotate-depth-face` is applied at indentation level and to end-of-line for each line on or beyond threshold.
Usage:
```elisp
(add-hook 'prog-mode-hook 'annotate-depth-mode)
```The threshold can be fine-tuned for specific modes if necessary:
```elisp
(add-hook 'annotate-depth-mode-hook
(lambda ()
(if (equal major-mode 'emacs-lisp-mode)
(setq-local annotate-depth-threshold 10)
(when (equal major-mode 'c++-mode)
(setq-local annotate-depth-threshold 4)))))
```