10

Give this a go: (defun freaky-space () (interactive) (cond ((looking-back "\\(?:^\\|\\.\\) +") (insert " ")) ((eq this-command last-command) (backward-delete-char 1) (insert ". ")) (t (insert " ")))) (define-key text-mode-map " " 'freaky-space)


7

Keychords would let you do this. You would also want SPC SPC to be translated to . SPC only when you type them fast enough. That's exactly what keychords would do. After installing key-chord you can define something like this: (key-chord-define-local (kbd "SPC SPC") (lambda () (insert ". ")))


6

Function to capitalize only the first char Make sure that the below function is evaluated in your emacs config before the yasnippet snippets are loaded. (defun my/capitalize-first-char (&optional string) "Capitalize only the first character of the input STRING." (when (and string (> (length string) 0)) (let ((first-char (substring string nil ...


4

If you use Icicles then you can do what you want pretty much directly. You can search only for uppercase letters that do not start a sentence. And you can replace them by their lowercase equivalents -- either selectively or all at once. You do this using Icicles search. Here are the building blocks: You define a set of search contexts - using a regexp, ...


4

One suggestion might be to do this: Lower-case all capitalized words. E.g., C-x h M-x downcase-region. Capitalize all words that begin a sentence. Function sentence-end returns a regexp that matches sentence ends - you can adapt that. Command query-replace-regexp is your friend. You can even replace subgroup matches with text produced or transformed by a ...


4

I've been wanting the same thing so I wrote one. You can get poetry.el here: http://www.bobnewell.net/filez/poetry.zip It's somewhat modelled after 'Verse Perfect' except, of course, it's for Emacs. It works with Linux. I don't have other systems to test on. It does these things: Provides foot counts by line in the left margin. Interfaces with offline ...


4

Emacs Muse (also known as “Muse” or “Emacs-Muse”) is an authoring and publishing environment for Emacs. It simplifies the process of writing documents and publishing them to various output formats.Muse consists of two main parts: an enhanced text-mode for authoring documents and navigating within Muse projects, and a set of publishing styles for generating ...


3

Here is another way to search for uppercase letters that do not start a sentence, and replace them by lowercase on demand (selective occurrences or all). To use this method you need libraries isearch-prop.el and isearch+.el - see Isearch+: Library isearch-prop.el lets you add properties to zones of your buffer. And it lets you search only such ...


3

Auto-capitalize defines the variable auto-capitalize-predicate, which can be used to check whether to enable auto-capitalization based on context. Try this (setq auto-capitalize-predicate (lambda () (not (texmathp)))) to turn it off in LaTeX formulas.


2

First of all, sentence-end should match everything up to the fist word of the next sentence. The following sets a buffer-local binding of sentence-end in org-mode buffers, which seems to work for me. (defun org-auto-capitalize-headings-and-lists () "Create a buffer-local binding of sentence-end to auto-capitalize section headings and list items." (make-...


2

In your specific example you can hit M-l to down-case the next word. A general solution would involve some code: you'd want a custom function to run after auto-capitalize and call downcase-word. You also want to make sure the next word is part of the same sentence first. Something like: (defun downcase-next-word-in-sentence () (interactive) "Downcase ...


2

The doc-string for the variable auto-capitalize-words states as follows: "If non-nil, a list of proper nouns or acronyms. If 'auto-capitalize' mode is on, these words will be automatically capitalized or upcased as listed (mixed case is allowable as well), even in the middle of a sentence. A lowercase word will not have its casemodified." [Admittedly, ...


2

(I assume you meant text in a buffer, and not a string (as the original question said). M-e M-c (press and hold Meta while hitting e, then c. The M-e moves forward-sentence. The M-c does capitalize-word. See the Emacs manual, nodes: Words Case You can of course write a simple command that does that, and bind that to a single key. But is it worth it? (...


1

This is a rough start but seems to work: (defun recapitalize-sentence () "Recapitalizes current sentence as a sentence. Relies on the function sentence-end to find the end of a sentence, which by ...


1

There's this command maybe you've seen? It doesn't toggle, but rather just Init case with a list of words of exceptions. (defun xah-title-case-region-or-line (*begin *end) "Title case text between nearest brackets, or current line, or text selection. Capitalize first letter of each word, except words like {to, of, the, a, in, or, and, …}. If a word ...


1

Here's what I came up with, building on @glucas's idea to use defadvice. This code works, but I'm just starting to learn Lisp (and programming) so feel free to suggest improvements to my code. (defadvice capitalize-word (after capitalize-word-advice activate) "After capitalizing the new first word in a sentence, downcase the next word, since that next word ...


1

You may find a working solution here. Function (defun capitalizeFirst (s) (if (> (length s) 0) (concat (upcase (substring s 0 1)) (downcase (substring s 1))) nil)) Again put this function to your .emacs file before yasnippet initialization. Snippet # -*- mode: snippet -*- # name: name # key: name # -- Hi, my name is ${1:$$(capitalizeFirst ...


Only top voted, non community-wiki answers of a minimum length are eligible