From 6e33c3fc3c6a4e3b313d67a4ed11bbaa1861f39d Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 12 Feb 2010 18:48:16 +0100 Subject: [PATCH] ASCII export: Remove narrowing of columns for export --- lisp/ChangeLog | 8 ++++++++ lisp/org-ascii.el | 16 ++++++++++++++++ lisp/org-table.el | 6 ++++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6a7b9205..32b5ccda 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2010-02-12 Carsten Dominik + * org-ascii.el (org-export-ascii-table-widen-columns): New + option. + (org-export-ascii-preprocess): Realign tables to remove narrowing + if `org-export-ascii-table-widen-columns' is set. + + * org-table.el (org-table-do-narrow): New variable. + (org-table-align): Narrow only if `org-table-do-narrow' is t. + * org.el (org-deadline, org-schedule): Allow updating if the relevant time stamp does not have a repeater, i.e. do not require that no time stamp has a repeater. diff --git a/lisp/org-ascii.el b/lisp/org-ascii.el index 92227052..6c395b37 100644 --- a/lisp/org-ascii.el +++ b/lisp/org-ascii.el @@ -65,6 +65,13 @@ for column grouping." :group 'org-export-ascii :type 'boolean) +(defcustom org-export-ascii-table-widen-columns t + "Non-nil means widen narrowed columns for export. +When nil, narrowed columns will look in ASCII export just like in org-mode, +i.e. with \"=>\" as ellipsis." + :group 'org-export-ascii + :type 'boolean) + ;;; Hooks (defvar org-export-ascii-final-hook nil @@ -483,6 +490,15 @@ publishing directory." (defun org-export-ascii-preprocess (parameters) "Do extra work for ASCII export" + ;; + ;; Realign tables to get rid of narrowing + (when org-export-ascii-table-widen-columns + (let ((org-table-do-narrow nil)) + (goto-char (point-min)) + (org-table-map-tables + (lambda () + (org-if-unprotected + (org-table-align)))))) ;; Put quotes around verbatim text (goto-char (point-min)) (while (re-search-forward org-verbatim-re nil t) diff --git a/lisp/org-table.el b/lisp/org-table.el index 49c59e35..4581fa84 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -575,6 +575,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.") (make-variable-buffer-local 'org-table-overlay-coordinates) (defvar org-last-recalc-line nil) +(defvar org-table-do-narrow t) ; for dynamic scoping (defconst org-narrow-column-arrow "=>" "Used as display property in narrowed table columns.") @@ -621,7 +622,8 @@ When nil, simply write \"#ERROR\" in corrupted fields.") ;; Check if we are narrowing any columns (goto-char beg) - (setq narrow (and org-format-transports-properties-p + (setq narrow (and org-table-do-narrow + org-format-transports-properties-p (re-search-forward "<[rl]?[0-9]+>" end t))) (goto-char beg) (setq falign (re-search-forward "<[rl][0-9]*>" end t)) @@ -666,7 +668,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.") (setq e (pop c)) (when (and (stringp e) (string-match "^<\\([rl]\\)?\\([0-9]+\\)?>$" e)) (if (match-end 1) (setq falign1 (match-string 1 e))) - (if (match-end 2) + (if (and org-table-do-narrow (match-end 2)) (setq fmax (string-to-number (match-string 2 e)) c nil)))) ;; Find fields that are wider than fmax, and shorten them (when fmax -- 2.11.4.GIT