File: README.org

package info (click to toggle)
wc-mode 1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 88 kB
  • sloc: lisp: 251; makefile: 2
file content (62 lines) | stat: -rwxr-xr-x 2,338 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62


* Wordcount Mode
  
  This is a minor mode to provide a 'wc' function for Emacs buffers as
  well as a modeline addition with live word, line and character counts.

  Additionally, a user can set specific goals for adding or deleting
  words.  These goals were partly inspired by [[http://750words.com][750words.com]] where the
  goal of the site is to encourage writing by setting a goal of 750
  words at a time.  I wanted the same functionality in Emacs.

* Customization

  There are a few settings that may be customized to provide better
  functionality for you.

** Modline string

   The default string displayed in the mode line can be changed to
   suit your needs. It can be defined through the variable
   customizaton interface.

   The setting itself is simply a string with a few special characters
   to represent the available statistics. These character strings are
   listed in the follow table.

   | Format String | Meaning                      |
   |---------------+------------------------------|
   | %C            | Original character count     |
   | %W            | Original word count          |
   | %L            | Original line count          |
   | %c            | Change (delta) in characters |
   | %w            | Change (delta) in words      |
   | %l            | change (delta) in lines      |
   | %gc           | Character change goal        |
   | %gw           | Word change goal             |
   | %gl           | Line change goal             |
   | %tc           | Total number of characters   |
   | %tw           | Total number of words        |
   | %tl           | Total number of lines        |


** Counting functions

   The default character, word and line counting functions may not
   produce the desired results.  They can be overridden on a
   per-buffer basis by supplying new functions to the appropiate
   variables.

   These functions must take RSTART and REND arguments representing
   the start and end points of the region on which to perform the
   count.

   For example, if you had a CSV file and wanted each entry to count
   as a word, you would override the default behavior as follows.

: ;; Override the counting of words to count commas (fields)
: (setq wc-count-words-function
:    (function (lambda (rstart rend)
:      (how-many "[^,\\n]+" rstart rend))))