[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/captain 956e040 08/11: captain: Added examples for sett
From: |
Stefan Monnier |
Subject: |
[elpa] externals/captain 956e040 08/11: captain: Added examples for setting captain-predicate to commentary |
Date: |
Tue, 1 Dec 2020 15:22:47 -0500 (EST) |
branch: externals/captain
commit 956e04021df8557ebbbdb0075c8c49e483eeaa2a
Author: Ian Dunn <dunni@gnu.org>
Commit: Ian Dunn <dunni@gnu.org>
captain: Added examples for setting captain-predicate to commentary
* packages/captain/captain.el (Commentary): Added examples.
---
captain.el | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/captain.el b/captain.el
index b5af304..a921d28 100644
--- a/captain.el
+++ b/captain.el
@@ -37,13 +37,35 @@
;; `captain-sentence-start-function'. For example, you can set it to find the
;; start of a list or heading in `org-mode'.
-;; Further control can be obtained by modifying the local variable
-;; `captain-predicate', which tells the captain when to work and when to relax.
+;; In order to get the captain to start working, `captain-predicate' must be
+;; set. Otherwise, the slacker will just lie around all day doing nothing.
+
+;; The following will tell the captain to only work on comments in programming
+;; modes:
+
+;; (add-hook 'prog-mode-hook
+;; (lambda ()
+;; (setq captain-predicate (lambda () (nth 8 (syntax-ppss (point)))))))
+
+;; Or for text modes, work all the time:
+
+;; (add-hook 'text-mode-hook
+;; (lambda ()
+;; (setq captain-predicate (lambda () t))))
+
+;; Or don't work in source blocks in Org mode:
+
+;; (add-hook
+;; 'org-mode-hook
+;; (lambda ()
+;; (setq captain-predicate
+;; (lambda () (not (org-in-src-block-p))))))
;; It's also possible to automatically capitalize individual words using the
;; command `captain-capitalize-word'. This will capitalize the word at point
;; and tell the captain about it, so he knows that you want it capitalized from
-;; then on.
+;; then on. For a package that handles this for any automatic correction, see
+;; the auto-correct package.
;; This solves a similar problem to that of Kevin Rodgers's auto-capitalize
;; package, but using more modern Emacs features.
- [elpa] branch externals/captain created (now 574439a), Stefan Monnier, 2020/12/01
- [elpa] externals/captain 3ada93d 01/11: Added captain package, Stefan Monnier, 2020/12/01
- [elpa] externals/captain 949b6ad 02/11: captain.el: Changed default predicate to enable capitalization, Stefan Monnier, 2020/12/01
- [elpa] externals/captain 66584d2 04/11: captain: Change default predicate to a function, and call it unconditionally, Stefan Monnier, 2020/12/01
- [elpa] externals/captain 072c330 05/11: captain: Change abbrev table to be case sensitive, Stefan Monnier, 2020/12/01
- [elpa] externals/captain 574439a 11/11: * .gitignore: New file, Stefan Monnier, 2020/12/01
- [elpa] externals/captain 956e040 08/11: captain: Added examples for setting captain-predicate to commentary,
Stefan Monnier <=
- [elpa] externals/captain db93857 10/11: Updated copyright on auto-correct, captain, and vigenere, Stefan Monnier, 2020/12/01
- [elpa] externals/captain 49c3e29 03/11: captain.el: Reverted last commit, Stefan Monnier, 2020/12/01
- [elpa] externals/captain a341d4c 09/11: captain: Bumped version to 1.0.3, Stefan Monnier, 2020/12/01
- [elpa] externals/captain 2cb4569 07/11: captain: Bumped version, Stefan Monnier, 2020/12/01
- [elpa] externals/captain e167b64 06/11: captain: Fix docstring of captain-predicate to reflect recent change, Stefan Monnier, 2020/12/01