13

Try setting sentence-end-double-space to nil.


9

The only consequence I'm seeing, is the ability to recognize periods from abbreviations. As stated by gnu.org: If you want to use just one space between sentences, you can set the variable sentence-end-double-space to nil to make the sentence commands stop for single spaces. However, this has a drawback: there is no way to distinguish between ...


9

You're probably using single space sentences, which is fine, but you need to tell Emacs about it. (setq sentence-end-double-space nil)


6

How the function works will depend on your configuration. As a default, Emacs expects two spaces after a sentence. You can change this to one space by setting the variable sentence-end-double-space to nil. Once you've done that, it'll work as you expect.


4

In my comment I suggested to use highlight-regexp. But meanwhile I discovered that that method does not keep the highlighting correctly updated (it actually should). So I wrote up a minor mode hlds-mode that does the job. I assume that with this minor mode the variable sentence-end-double-space becomes obsolete. You just only hook the minor mode into those ...


4

Don't forget the vanilla sentence commands. The main ones out of the box that might be relevant here are transpose-sentences, mark-end-of-sentence, kill-sentence (M-k), and backward-kill-sentence (C-x <backspace>). Others include: backward-sentence (M-a), forward-sentence (M-e, repunctuate-sentences.


3

You can use drag-stuff: https://github.com/rejeep/drag-stuff.el (require 'drag-stuff) (drag-stuff-global-mode t) (add-to-list 'drag-stuff-except-modes 'org-mode) # concurent (eval-after-load "org" '(progn (define-key org-mode-map (kbd "M-s-<up>") 'drag-stuff-up) (define-key org-mode-map (kbd "M-s-<down>") 'drag-stuff-down)))


3

Know that you can move forward and backward over sentences using M-e and M-a. And there are other sentence operations. See the Emacs manual, node Sentences. You can write a command that inserts increasing numbers before sentences. Iterate over the text using function backward-sentence, starting at the end of the buffer. For example: (defun foo-backward (...


3

You didn't specify exactly what you want to do. My understanding is: search for one of ., ! or ? that is followed by a space; if it is followed by at least two spaces, do nothing; if it is preceded with "mrs", "mr", etc. or a word of length 1, do nothing; otherwise, add a single space. The following should do what you need: (defun normalise-sentence-...


3

This is not really an answer to the question as stated ("what do I lose if I set sentence-end-double-space to nil"), but rather something like the third way;-). (Also, it is a (partial) copy from a post I've just written on my blog; if this is inappropriate, someone please delete this, but I hope this might be helpful.) So, basically, why do you want to ...


2

Here's an attempt at defining a custom kill-sentence-dwim command that will either kill the entire sentence or kill up to the sentence-ending punctuation. (defun my/forward-to-sentence-end () "Move point to just before the end of the current sentence." (forward-sentence) (backward-char) (unless (looking-back "[[:alnum:]]") (backward-char))) (...


2

UPDATE as of 2017-02-14: With this pull-request merged, now you just have to set sentence-end-double-space to nil and that's it. More information here.


1

The actual problem is that org-mode uses org-forward-paragraph as replacement for forward-paragraph but forward-paragraph is still used in elisp functions. For an instance forward-sentence directly uses forward-paragraph and org-forward-sentence directly uses forward-sentence. A hacky solution is to override forward-paragraph with org-forward-paragraph in ...


1

Flycheck uses checkdoc-current-buffer to implement the emacs-lisp-checkdoc checker which (in general) takes sentence-end-double-space into account. However, the checker itself is implemented by calling an emacs subprocess and only passing along the variables whitelisted in flycheck-emacs-lisp-checkdoc-variables, which doesn't include sentence-end-double-...


1

What you are looking at is called sentence-end-double-space. There is quite a bit of flexibility there, so I will not rehash the manual here.


1

A quick-and-dirty (i.e., too simplistic) answer is this: (defun at-sentence-beginning-p () "Return non-nil if at the beginning of a sentence." (looking-back (sentence-end))) It really tests whether point is after a sentence end. There are plenty of cases where it does not do the right thing, including, for example, a sentence enclosed in parens. But ...


1

There is a function for repunctuating sentences, and it's called repunctuate-sentences. It allows you to step through each occurrence of a punctuation character or to change all at once. If you don't like to use this function for some reason, you could temporarily disable sentence-end-double-space and then use forward-sentence to move by sentences and ...


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