1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 210_flyspell.el_session-localwords.dpatch by Agustin Martin Domingo <agmartin@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Preserve session localwords across buffer switching. Needs debian/patches/210_ispell.el_session-localwords.
7
Status: Experimental. To be included upstream in the medium term.
10
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' dictionaries-common~/support/emacsen/flyspell.el dictionaries-common/support/emacsen/flyspell.el
11
--- dictionaries-common~/support/emacsen/flyspell.el 2010-04-27 12:57:47.000000000 +0200
12
+++ dictionaries-common/support/emacsen/flyspell.el 2010-04-27 13:06:36.000000000 +0200
14
;;* declared correct. */
15
;;*---------------------------------------------------------------------*/
16
(defun flyspell-process-localwords (misspellings-buffer)
17
- (let (localwords case-fold-search
18
+ (let ((localwords ispell-buffer-session-localwords)
20
(ispell-casechars (ispell-get-casechars)))
21
;; Get localwords from the original buffer
24
(setq ispell-pdict-modified-p '(t)))
25
((or (eq replace 'buffer) (eq replace 'session))
26
(ispell-send-string (concat "@" word "\n"))
27
+ (add-to-list 'ispell-buffer-session-localwords word)
28
+ (or ispell-buffer-local-name ; session localwords might conflict
29
+ (setq ispell-buffer-local-name (buffer-name)))
30
(flyspell-unhighlight-at cursor-location)
31
(if (null ispell-pdict-modified-p)
32
(setq ispell-pdict-modified-p