~ubuntu-branches/ubuntu/utopic/dictionaries-common/utopic

« back to all changes in this revision

Viewing changes to debian/patches/210_flyspell.el_session-localwords.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Chris Cheney
  • Date: 2010-05-17 20:15:00 UTC
  • mfrom: (1.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100517201500-94c51rzr51ohoi41
Tags: 1.5.5ubuntu1
* Merge from debian unstable.  Remaining changes:
  - scripts/system/dc-debconf-select.pl: Drop default debconf priority
    from 'high' to 'medium'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 210_flyspell.el_session-localwords.dpatch by Agustin Martin Domingo <agmartin@debian.org>
 
3
##
 
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.
 
6
 
 
7
Status: Experimental. To be included upstream in the medium term.
 
8
 
 
9
@DPATCH@
 
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
 
13
@@ -1451,7 +1451,8 @@
 
14
 ;;*    declared correct.                                                */
 
15
 ;;*---------------------------------------------------------------------*/
 
16
 (defun flyspell-process-localwords (misspellings-buffer)
 
17
-  (let (localwords case-fold-search
 
18
+  (let ((localwords ispell-buffer-session-localwords)
 
19
+       case-fold-search
 
20
        (ispell-casechars (ispell-get-casechars)))
 
21
     ;; Get localwords from the original buffer
 
22
     (save-excursion
 
23
@@ -2108,6 +2109,9 @@
 
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