瀏覽代碼

Turn off flyspell-mode for the duration of column view.

Bernt Hansen had reported an infinite loop due to the interaction between
flyspell and Org  column view.
Carsten Dominik 17 年之前
父節點
當前提交
ba91e25cae
共有 2 個文件被更改,包括 27 次插入4 次删除
  1. 14 2
      ChangeLog
  2. 13 2
      lisp/org-colview.el

+ 14 - 2
ChangeLog

@@ -1,14 +1,26 @@
+2008-04-24  Carsten Dominik  <dominik@science.uva.nl>
+
+	* lisp/org-colview.el (org-columns, org-agenda-columns): Remember
+	is `flyspell-mode' was active when entering column display, and
+	turn it off if it is on.
+	(org-columns-remove-overlays): Turn `flyspell-mode' back on if it
+	was on before column view was entered.
+
+	* lisp/org-infojs.el (org-infojs-options-inbuffer-template)
+	(org-infojs-opts-table): Removed the `runs' parameter, it is no
+	longer needed.
+
 2008-04-23  Carsten Dominik  <dominik@science.uva.nl>
 
 	* lisp/org.el (org-op-to-function, org<>, org-string<=)
 	(org-string>=, org-string<>): New functions.
 	(org-property-re): Make sure the value contains a non-white
-	character. 
+	character.
 
 2008-04-21  Carsten Dominik  <dominik@science.uva.nl>
 
 	* lisp/org-remember.el (org-get-x-clipboard): Protect the call to
-	`x-selection-value'. 
+	`x-selection-value'.
 
 2008-04-16  Jason Riedy  <jason@acm.org>
 

+ 13 - 2
lisp/org-colview.el

@@ -206,7 +206,10 @@ This is the compiled version of the format.")
   "The header line format before column view was turned on.")
 (defvar org-columns-inhibit-recalculation nil
   "Inhibit recomputing of columns on column view startup.")
-
+(defvar org-columns-flyspell-was-active nil
+  "Remember the state of `flyspell-mode' before column view.
+Flyspell-mode can cause problems in columns view, so it is turned off
+for the duration of the command."
 
 (defvar header-line-format)
 (defvar org-columns-previous-hscroll 0)
@@ -263,7 +266,9 @@ This is the compiled version of the format.")
        (mapc 'org-delete-overlay org-columns-overlays)
        (setq org-columns-overlays nil)
        (let ((inhibit-read-only t))
-	 (remove-text-properties (point-min) (point-max) '(read-only t)))))))
+	 (remove-text-properties (point-min) (point-max) '(read-only t))))
+      (when org-columns-flyspell-was-active
+	(flyspell-mode 1)))))
 
 (defun org-columns-cleanup-item (item fmt)
   "Remove from ITEM what is a column in the format FMT."
@@ -570,6 +575,9 @@ Where possible, use the standard interface for changing this line."
 	(setq maxwidths (org-columns-get-autowidth-alist fmt cache))
 	(org-set-local 'org-columns-current-maxwidths maxwidths)
 	(org-columns-display-here-title)
+	(when (org-set-local 'org-columns-flyspell-was-active
+			     (org-bound-and-true-p flyspell-mode))
+	  (flyspell-mode 0))
 	(mapc (lambda (x)
 		(goto-line (car x))
 		(org-columns-display-here (cdr x)))
@@ -1111,6 +1119,9 @@ and tailing newline characters."
 	(setq maxwidths (org-columns-get-autowidth-alist fmt cache))
 	(org-set-local 'org-columns-current-maxwidths maxwidths)
 	(org-columns-display-here-title)
+	(when (org-set-local 'org-columns-flyspell-was-active
+			     (org-bound-and-true-p flyspell-mode))
+	  (flyspell-mode 0))
 	(mapc (lambda (x)
 		(goto-line (car x))
 		(org-columns-display-here (cdr x)))