浏览代码

Column view: Force truncate-lines while column view is active

Carsten Dominik 16 年之前
父节点
当前提交
922fe1e05f
共有 3 个文件被更改,包括 32 次插入2 次删除
  1. 11 0
      lisp/ChangeLog
  2. 11 1
      lisp/org-colview-xemacs.el
  3. 10 1
      lisp/org-colview.el

+ 11 - 0
lisp/ChangeLog

@@ -1,5 +1,16 @@
 2009-03-21  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-colview.el (org-colview-initial-truncate-line-value): New
+	variable.
+	(org-columns-remove-overlays): Restore the value of `truncate-lines'.
+	(org-columns): Remember the value of `truncate-lines'.
+
+	* org-colview-xemacs.el (org-colview-initial-truncate-line-value):
+	New variable.
+	(org-columns-remove-overlays): Restore the value of
+	`truncate-lines'.
+	(org-columns): Remember the value of `truncate-lines'.
+
 	* org.el (org-columns-skip-arrchived-trees): New option.
 
 	* org-agenda.el (org-agenda-export-html-style): Define color for

+ 11 - 1
lisp/org-colview-xemacs.el

@@ -469,6 +469,9 @@ This is the compiled version of the format.")
 	  org-columns-previous-hscroll (window-hscroll))
     (force-mode-line-update)))
 
+(defvar org-colview-initial-truncate-line-value nil
+  "Remember the value of `truncate-lines' across colview.")
+
 (defun org-columns-remove-overlays ()
   "Remove all currently active column overlays."
   (interactive)
@@ -489,7 +492,10 @@ 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 (local-variable-p 'org-colview-initial-truncate-line-value)
+	(setq truncate-lines org-colview-initial-truncate-line-value)))))
+
 
 (defun org-columns-cleanup-item (item fmt)
   "Remove from ITEM what is a column in the format FMT."
@@ -863,6 +869,10 @@ around it."
 	(setq maxwidths (org-columns-get-autowidth-alist fmt cache))
 	(org-set-local 'org-columns-current-maxwidths maxwidths)
 	(org-columns-display-here-title)
+	(unless (local-variable-p 'org-colview-initial-truncate-line-value)
+	  (org-set-local 'org-colview-initial-truncate-line-value
+			 truncate-lines))
+	(setq truncate-lines t)	
 	(mapc (lambda (x)
 		(goto-line (car x))
 		(org-columns-display-here (cdr x)))

+ 10 - 1
lisp/org-colview.el

@@ -295,6 +295,9 @@ for the duration of the command.")
 	  org-columns-previous-hscroll (window-hscroll))
     (force-mode-line-update)))
 
+(defvar org-colview-initial-truncate-line-value nil
+  "Remember the value of `truncate-lines' across colview.")
+
 (defun org-columns-remove-overlays ()
   "Remove all currently active column overlays."
   (interactive)
@@ -312,7 +315,9 @@ for the duration of the command.")
        (let ((inhibit-read-only t))
 	 (remove-text-properties (point-min) (point-max) '(read-only t))))
       (when org-columns-flyspell-was-active
-	(flyspell-mode 1)))))
+	(flyspell-mode 1))
+      (when (local-variable-p 'org-colview-initial-truncate-line-value)
+	(setq truncate-lines org-colview-initial-truncate-line-value)))))
 
 (defun org-columns-cleanup-item (item fmt)
   "Remove from ITEM what is a column in the format FMT."
@@ -684,6 +689,10 @@ around it."
 	(when (org-set-local 'org-columns-flyspell-was-active
 			     (org-bound-and-true-p flyspell-mode))
 	  (flyspell-mode 0))
+	(unless (local-variable-p 'org-colview-initial-truncate-line-value)
+	  (org-set-local 'org-colview-initial-truncate-line-value
+			 truncate-lines))
+	(setq truncate-lines t)	
 	(mapc (lambda (x)
 		(goto-line (car x))
 		(org-columns-display-here (cdr x)))