0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-22 18:10:43 +00:00
Commit graph

352 commits

Author SHA1 Message Date
Carsten Dominik 7712d78ab4 HTML export: Use forced alignment like <l> or <r> in tables
* lisp/org-table.el (org-table-cookie-line-p): Fix indentation.
* lisp/org-exp.el (org-store-forced-table-alignment): New function.
(org-export-preprocess-string): Call `org-store-forced-table-alignment'.
* lisp/org-html.el (org-format-org-table-html): Use stored
alignment information.
2010-10-21 16:28:06 +02:00
Carsten Dominik 397880bcde Fix special character bug in `orgtbl-to-html'
* lisp/org-table.el (orgtbl-to-html): Apply `org-html-expand' to the
table fields.
2010-10-15 08:22:29 +02:00
Carsten Dominik ae6d203a4b Make `org-table-current-column' an interactive command
* lisp/org-table.el (org-table-current-column): Add interactive to turn
this into a command.
2010-09-30 08:29:37 +02:00
Carsten Dominik ce58d6dd0a Align table before converting it to a table.el table
* lisp/org-table.el (org-table-create-with-table.el): Align table
before converting.
2010-08-18 08:35:15 +02:00
Eric Schulte 08a7f6a6df fix infinite loop in csv table import
* lisp/org-table.el (org-table-convert-region): don't continue csv
importation which the point catches the end, this fixes an infinite
loop which was caused by the (point) never catching up with the
"end" marker

Hi,

I've just noticed that I get an infinite loop when importing csv tables
into Org-mode tables.  For example calling

  (org-table-convert-region (point-min) (point-max) '(4))

from inside of a simple text file containing the following

--8<---------------cut here---------------start------------->8---
1,2,3
1
2
3
5
--8<---------------cut here---------------end--------------->8---

results in an infinite loop.  The attached patch fixes this issue [1],
however it seems weird that this would just surface now, given that the
code in question has been in the repo since last fall

,----
| commit 59c9c4cdd4
| Author: Carsten Dominik <carsten.dominik@gmail.com>
| Date:   Mon Oct 26 12:31:16 2009 +0100
|
|     Correctly interpret CVS tables with quoted fields
|
|     The csv parser was very primitive, ignoring quoted fields.  This is
|     now fixed.
`----

Has anyone else noticed this problem? Should I go ahead and apply this
patch?

Best -- Eric

Footnotes:
[1]

>From 3c3f4ca9a34dca23051ca2f4e4518b416338d4f4 Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Mon, 19 Jul 2010 13:45:25 -0700
Subject: [PATCH] org-table: fix infinite loop in table importation

* lisp/org-table.el (org-table-convert-region): don't continue csv
  importation which the point catches the end, this fixes an infinite
  loop which was caused by the (point) never catching up with the
  "end" marker
2010-07-20 09:28:22 +02:00
Carsten Dominik 6268cceec3 Mention release 7.01 on the website, push release number to 7.01trans 2010-07-19 08:33:24 +02:00
Philip Rooke 6e6790f685 Correct some doc strings [part 5]
This is the fifth patch in a series that makes some straightforward
corrections to a number of docstrings.  Each change is normally to:

- correct a typo, or
- fix up hyperlinks to function or variable names, or
- ensure slightly better conformance with the documentation guidelines
  and tips given in the Elisp manual

No attempt is made to provide missing docstrings or document arguments.

Cheers,

Phil
2010-07-18 07:23:51 +02:00
Eric Schulte 23b13749f6 remove newline characters from the contents of table cells
This patch changes the functionality of orgtbl-to-orgtbl so that it will
remove newline characters from the text of table cells and replace them
with "\n".  This protects the final table from such newlines.

This patch will probably only have any noticeable effect for tables
imported form external files, or from the results of code blocks.

Best -- Eric

>From 34aacc9aa037e8f17c8d32ed61a25f0a350713a0 Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Fri, 18 Jun 2010 12:38:26 -0700
Subject: [PATCH] org-table: will now strip newlines from the text of table cells

* lisp/org-table.el (orgtbl-to-generic): added the :remove-newlines
  option which will strip newline characters from the text of table
  cells and replace then with "\n"

  (orgtbl-to-orgtbl): now using the new :remove-newlines option to
  orgtbl-to-generic
2010-06-30 15:34:04 +02:00
Carsten Dominik 7f21f76d5e fix typo 2010-06-25 10:01:23 +02:00
Carsten Dominik 28babd4dff Better recognizing of source code snippets
* lisp/org.el (org-edit-special): Make sure source code editing goes
before table formula editing.
* lisp/org-table.el (org-table-fedit-map): "C-c '" will now also exit
the formula editor.
2010-06-06 12:51:27 +02:00
Carsten Dominik 0618aeafb3 Make raising and lowering not mess up table alignment
* lisp/org-compat.el (org-string-match-p):
(org-looking-at-p): New functions.
* lisp/org-table.el (org-table-align): Handle raised text with
invisible characters.
* lisp/org.el (org-script-display): Add raise properties for tables.
(org-raise-scripts): Handle raising differently inside tables.

Pretty display of subscripts and superscripts no longer messes up
table alignment.  This is achieved by two things:

1. Inside tables, the raised characters are not made smaller, they
   remains at the same size.  Instead they are raise/lowered more, by
   a full half character height to still be clearly readable as
   subscript or superscript.

2. The invisible characters are taken into account when computing the
   field width.
2010-06-03 10:24:04 +02:00
Carsten Dominik 11058a713a Fix alignment of numbers with invisible characters in tables
Bold numbers like *2.4* were aligned incorrectly in columns that have
mostly numbers.

Reported by Sebastian Rose
2010-05-19 11:34:23 +02:00
Carsten Dominik d78931408d Minor fix 2010-05-16 16:24:16 +02:00
Carsten Dominik 4d4267320d Add Stefans redefinition of orgstruct-mode 2010-05-16 16:18:23 +02:00
Carsten Dominik 336456d0c3 Make sure remote references will not switch the selected buffer
Karl Eichwalder writes:

> Consider the following two files:
>
> * 2009
> #+TBLNAME: 2009
>  :PROPERTIES:
>  :ID:       ea32e5b5-31ba-468e-8e31-3e0d09696bb0
>  :END:
> |-----+-------|
> |  mm |    km |
> |-----+-------|
> | all | 946.8 |
> |-----+-------|
>
> * 2010
> #+TBLNAME: 2010
>  :PROPERTIES:
>  :ID:       e0df84c4-8abc-458f-a1ee-eb53eb71b4f0
>  :END:
> |-----+-------+-------+-------|
> |  mm |    km |  B km |  G km |
> |-----+-------+-------+-------|
> | all | 249.4 | 429.2 | 678.6 |
> |-----+-------+-------+-------|
>
> * all
>  :PROPERTIES:
>  :ID:       44751a7f-73a4-4c07-b3c2-e3edb9042acd
>  :END:
> #+TBLNAME: all
> |------+--------|
> | yyyy |     km |
> |------+--------|
> | 2009 |        |
> | 2010 |  678.6 |
> |------+--------|
> |  all | 1625.4 |
> |------+--------|
> #+TBLFM: @2$2=remote(ea32e5b5-31ba-468e-8e31-3e0d09696bb0,$LR2);%.1f::@3$2=remote(2010,$LR4);%.1f::$LR2=vsum(@2$2..@-1);%.1f
>
> Then, in the 2010 file, eval the formula of the "all" table by pressing
> C-c C-c.
> ==>
>
> It takes the km value from the 2009 file, but also puts the cursor
> (point) into the 2009 file in front of the ID:
>
> * 2009
> #+TBLNAME: 2009
>  :PROPERTIES:
>  :ID:       -!-ea32e5b5-31ba-468e-8e31-3e0d09696bb0
>  :END:
> |-----+-------|
> |  mm |    km |
> |-----+-------|
> | all | 946.8 |
> |-----+-------|
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-
>
> I'd prefer if the point would stay in the 2010 file.
2010-05-12 15:06:27 +02:00
Carsten Dominik c86a3fc4aa Push version number to 6.36trans 2010-05-09 06:24:20 +02:00
Carsten Dominik 88100d1580 Release 6.36a 2010-05-09 06:13:54 +02:00
Carsten Dominik e27bc453de Add commands to recalculate and iterate all tables in a buffer
This was a request by Johna Ekh.
2010-05-07 09:45:34 +02:00
Carsten Dominik ce6caec446 Automatically remove lines with formatting cookies when exporting tables
Lines that only contain formatting cookies like <l20> or <10> will now
be removed automatically.  Optionally, the first field in a row can
also be "/".
2010-04-28 08:49:35 +02:00
Carsten Dominik 4462229742 Fix table formula bug with negative result numbers
Willian Henney writes:

> The following is using today's git trunk of org-mode with emacs
> 23.1.94.1 (aquamacs 2.0preview5)
>
>    Consider the following table
>
>    | -8 |
>    |    |
>    |    |
>    |    |
> #+TBLFM: $1=@-1 - 1::@1$1=-8
>
>    Evaluate formulas once (C-u C-c *):
>
>    | -8 |
>    | -9 |
>    |----|
>    | -1 |
>
>    Evaluate formulas again (C-u C-c *):
>
>    | -8 |
>    | -9 |
>    |----|
>    |----|
>
>    What I expected:
>
>    |  -8 |
>    |  -9 |
>    | -10 |
>    | -11 |
>
> The problem always seems to start at -10. When I turn on table
> debugging, it first calculates the -10 value correctly, but then fails
> to recognise the -10 cell as a number when calculating the next row,
> using 0 instead, which results in -1. This is because during the
> intermediate formatting of the cell the minus sign in -10 abuts the
> column separator: "|-10 |", and the "|-" part is then interpreted as
> the beginning of an hline.
2010-04-24 14:39:28 +02:00
Carsten Dominik 97e20048b2 Use `add-to-invisibility-spec' directly 2010-04-18 19:41:05 +02:00
Carsten Dominik b35b9914e6 Revert "Use `add-to-invisibility-spec' directly"
This reverts commit c2e5b13a2d.
2010-04-18 19:38:10 +02:00
Carsten Dominik c2e5b13a2d Use `add-to-invisibility-spec' directly 2010-04-18 19:26:30 +02:00
Carsten Dominik f45e6a28b1 Use the normal overlay API, not Org's one 2010-04-18 16:49:58 +02:00
Carsten Dominik 106ae88091 Allow dashes and more in the ORGTBL SEND name 2010-04-18 08:11:07 +02:00
Carsten Dominik 43bf1bbbd7 Push version number to 6.35trans 2010-04-15 12:24:55 +02:00
Carsten Dominik 6f3026edf1 Release 6.35g 2010-04-08 20:15:15 +02:00
Carsten Dominik a589c7a22e Release 6.35f 2010-04-08 10:36:32 +02:00
Carsten Dominik 50e5924d8a Release 6.35e 2010-04-07 16:33:52 +02:00
Carsten Dominik f722763f8a Release 6.35d 2010-04-07 16:26:42 +02:00
Carsten Dominik d65ed03be6 Update copyright notices and fix wrong version tags 2010-04-07 16:26:10 +02:00
Carsten Dominik cafbe1d038 Release 6.35c 2010-04-07 08:58:25 +02:00
Carsten Dominik b213c0f31e Release 6.35b 2010-04-07 07:54:14 +02:00
Carsten Dominik 08d0d2fa20 Release 6.35 2010-04-06 09:16:36 +02:00
Carsten Dominik 8fdf80bb5b Fix whitespace and compiler wanings 2010-04-01 13:11:54 +02:00
Carsten Dominik b349823687 Tables: Interpret <N> as fixed width, not maximum width
Requested by Michael Brand
2010-03-27 16:13:45 +01:00
Carsten Dominik 05b4fb9bcb Fix another typo 2010-03-26 11:22:56 +01:00
Carsten Dominik d1289ba906 Fix typo in variable name.
Patch by Mikael Fornius.
2010-03-25 12:47:48 +01:00
Carsten Dominik d70fb6fdba New helper functions in org-table.el 2010-03-21 20:08:01 +01:00
Carsten Dominik 7dd154cc2a Tables: Introduce field coordinates for formulas, improve docs
Patch by Michael Brand
2010-03-14 13:11:17 +01:00
Carsten Dominik dfc766a9c2 Implement a better way to catch function names that look like a reference 2010-03-08 08:40:06 +01:00
Carsten Dominik baa8f05baf Fix table formula editing bug
William Henney writes:

> Anyone have a clue what is going on here?
>
> Cheers
>
> Will
>
> * Arctan2 bug
> Activate the formula editor for the following table with =C-c '=, then
> exit without changing anything. Note what happens to the arctan2
> formula. For me, "arctan2" changes to "@2$20173232".
> | x | y | arctan | arctan2 |
> |---+---+--------+---------|
> | 1 | 1 |     45 |     45. |
> #+TBLFM: $3=arctan($1/$2)::$4=arctan2($1,$2)
>
> ** Versions
> Org 6.34trans, Aquamacs 2.0preview4, Emacs 23.1.92.1
2010-03-07 16:20:04 +01:00
Carsten Dominik 6e33c3fc3c ASCII export: Remove narrowing of columns for export 2010-02-12 18:48:16 +01:00
Carsten Dominik 2e53d9b137 Remove comma after means in many docstrings
Stephen Eglen says these commas should not be there.
2010-01-21 16:15:40 +01:00
Carsten Dominik 06e74afce3 Version number to 6.34trans 2010-01-20 10:13:21 +01:00
Carsten Dominik a1709ba641 Release 6.34c 2010-01-18 00:10:11 +01:00
Carsten Dominik 2f2f9441d4 Release 6.34b 2010-01-14 23:06:55 +01:00
Carsten Dominik c077142241 Release 6.34a 2010-01-12 08:53:44 +01:00
Carsten Dominik 288c724335 Release 6.34 2010-01-10 10:57:53 +01:00
Carsten Dominik 275b6627a6 Release 3.34 2010-01-10 10:54:52 +01:00
Carsten Dominik 62a7301a5e Push release number to 6.33trans 2009-11-20 20:20:31 +01:00
Carsten Dominik 24061fddd1 Release 6.33f 2009-11-20 15:15:05 +01:00
Carsten Dominik 37e9b1c51f Release 6.33e 2009-11-20 13:58:31 +01:00
Carsten Dominik 24a49967f1 Release 6.33d 2009-11-20 12:34:50 +01:00
Carsten Dominik c7371cc7fe Push version number to 6.33trans 2009-11-15 09:46:43 +01:00
Carsten Dominik 6bc6379dfe Release 6.33c 2009-11-15 08:00:52 +01:00
Carsten Dominik 6c977c41c3 Release 6.33b 2009-11-14 16:25:31 +01:00
Carsten Dominik b8a6721a68 Release 6.33a 2009-11-13 23:22:18 +01:00
Carsten Dominik 5ca6635993 Push version number to 6.33a 2009-11-13 22:54:22 +01:00
Carsten Dominik 82ee0cc583 Release 6.33 2009-11-13 07:10:51 +01:00
Bernt Hansen 0042080e4c Fix spelling and grammar 2009-11-12 07:39:29 -05:00
Carsten Dominik 6671877fa6 Don't bind S-iso-lefttab in XEmacs 2009-11-12 11:23:30 +01:00
Carsten Dominik 535ca7a6b9 Fix bug in CSV table import
Dan Davison writes:

> If a file contains "-1" followed by a newline and nothing else,
> org-table-import on that file fails. The first commit with this
> property is a commit (below) to do with CVS tables made a few
> days ago. I have given up trying to work out a good solution to
> this :) In case it is useful, the failure occurs when
> org-table-align is called at the end of
> org-table-convert-region. I think it is long-standing behaviour
> that hitting tab inside of
>
> |-1|
>
> doesn't make a table containing "-1", so presumably there is
> something different about the context in which org-table-align is
> now being called.
2009-10-31 09:24:32 +01:00
Carsten Dominik 58562167b4 Version number to 6.32trans 2009-10-27 18:23:19 +01:00
Carsten Dominik e0949896f7 Release 6.32b 2009-10-27 18:22:28 +01:00
Carsten Dominik 037b685d50 Push version number to 6.32trans 2009-10-27 09:25:30 +01:00
Carsten Dominik 59c9c4cdd4 Correctly interpret CVS tables with quoted fields
The csv parser was very primitive, ignoring quoted fields.  This is
now fixed.
2009-10-26 12:31:16 +01:00
Carsten Dominik fcd2ef541f Release 6.32 2009-10-26 08:57:21 +01:00
Carsten Dominik 6b0a251eea Push version number to 6.31trans 2009-10-01 11:57:17 +02:00
Carsten Dominik 1b37d5e07c Release 6.31a 2009-10-01 09:13:58 +02:00
Carsten Dominik c11e0b44ae Release 6.31 2009-09-30 16:03:17 +02:00
Carsten Dominik fec6e55af3 Apply fixes from downstream Emacs
Patch by Glen Morris
2009-09-30 09:20:28 +02:00
Carsten Dominik 38f82c430b Remove final dot from a number of error messages
Downstream Emacs patch.
2009-09-24 09:09:33 +01:00
Carsten Dominik 1530e0eafe Fix bugs with TBLNAME
Francesco Pizzolante writes:

> I'm using orgmode 6.30c and I still have this problem: if
> the #+TBLNAME: tag is not located in column 0, the remote
> reference does not work.
>
> Here's my little test:
>
> #+TBLNAME: A
>    |   |     T |
>    |---+-------|
>    |   |  2.00 |
>    |   |  5.00 |
>    |---+-------|
>    | # |  9.00 |
>    | ^ | total |
>    #+TBLFM: $2=vsum(@-I..@-II);%.2f
>
>    #+TBLNAME: price
>       |    T |    PU | Total |
>       |------+-------+-------|
>       | 9.00 | 10.25 | 92.25 |
>       |------+-------+-------|
>    #+TBLFM: @2$1=remote(A,$total);%.2f::@2$3=$1*$2;%.2f
>
>
> Just add a few spaces at the first line and when you recompute
> the second table you get a "Can't find remote table A" message.
>
> Moreover, in a LaTeX environment, using the orgtbl minor mode,
> the highlighting (font locking) does not work on the #+TBLNAME:
> line, even if located in column 0.
2009-09-15 14:11:21 +01:00
Carsten Dominik d892aa9642 Fix bug with table alignment and alignment cookies
Michael Brand writes:

> First, when I open a file with the content
>
> -*- eval: (org-mode) -*-
> #+STARTUP: align
> | <l8>     |
> | 3.14     |
> | 3.1415926535897932384626433832795 |
>
> and answer yes, I get
>
> -*- eval: (org-mode) -*-
> #+STARTUP: align
> | <l8>| <l8>     |
> | 3.14     |
> | 3.1415=> |
>
> but would expect
>
> -*- eval: (org-mode) -*-
> #+STARTUP: align
> | <l8>     |
> | 3.14     |
> | 3.1415=> |
>
> Second, when I delete the last line and save the file, the file content
> will be
>
> -*- eval: (org-mode) -*-
> #+STARTUP: align
> | <l8>| <l8>     |
> | 3.14     |
>
> as I can see e. g. with emacs itself when I close the file and open it
> again declining org-mode with answering no. But the file content should
> be
>
> -*- eval: (org-mode) -*-
> #+STARTUP: align
> | <l8>     |
> | 3.14     |
>
> Can someone please confirm with a more stable and recent emacs version?
2009-09-10 19:54:44 +02:00
Carsten Dominik 291a6db848 Release number back to 6.30trans 2009-09-04 10:39:01 +02:00
Carsten Dominik 12ab55ca43 Release 6.30d 2009-09-03 13:53:46 +02:00
Carsten Dominik c855e4cbcc Restore the window configuration after editing table formulas
Karl Stump writes:

> Table Editing Cycle With Multiple Windows On One Buffer Does Not
> Return to Start State
>
> When I have two windows open on two buffers, one to a table in a
> file that I'm editing, the other to some other file of interest,
> the editing cycle of C-` ... C-c C-c works great, meaning that
> when the cycle is finished, the windows are restored to the start
> state.
>
> But when I have two windows open on the same buffer, one window
> on the table, and the other window somewhere else, the editing
> cycle does not restore to the beginning state.
2009-09-03 08:10:36 +02:00
Carsten Dominik adfa87282d Push version number to 6.30trans 2009-09-03 08:10:36 +02:00
Carsten Dominik 63e1714288 Release 6.30c 2009-09-02 14:40:56 +02:00
Carsten Dominik fc332703bf Release 6.30b 2009-09-02 11:33:10 +02:00
Carsten Dominik 1d04b205e6 Release 6.30a 2009-09-02 09:00:23 +02:00
Carsten Dominik db70cdb13b Release 6.30 2009-09-01 06:09:23 +02:00
Carsten Dominik 8160044f2e Avoid problems with table alignment an overlays.
We now first insert a new aligned table, and then remove to old one,
this helps to keep overlays after the table from covering table text
as well.
2009-08-27 12:50:36 +02:00
Carsten Dominik 350691164b Avoid calling `goto-line' from lisp programs 2009-08-27 10:24:09 +02:00
Carsten Dominik bfdd3d3fd3 Push version number to 6.29trans 2009-08-06 12:07:20 +02:00
Carsten Dominik 0864163024 Release 6.29c 2009-08-06 06:26:23 +02:00
Carsten Dominik d6b37ddbea Release 6.29b 2009-08-05 12:34:30 +02:00
Carsten Dominik 1c25048e48 Release 6.29a 2009-08-04 23:54:22 +02:00
Carsten Dominik d67a9be8a2 Release 6.29 2009-08-04 23:06:39 +02:00
Carsten Dominik 6062cef1c6 Allow export of tables from temporary buffers without a file
Gregory Grubbs writes:

I like to make org-mode tables in arbitrary buffers, then
save them as CVS files. The export fails when done from a
buffer with no associated file.

Here's a little patch that allows exporting a table from
any buffer (org-mode version 6.28trans):
2009-08-03 07:42:40 +02:00
Carsten Dominik 31ceed47ff New minor mode org-indent-mode
This mode implements outline indentation similar to clean view, but in
a dynamic and virtual way, at display time.
2009-08-03 06:24:24 +02:00
Carsten Dominik 2cc99fbb0a Tables: Relative row references may now cross hlines
A relative row reference like @-1 in a table may now reach across a
horizontal separator line.  I hope this will not break any important
tables out there, but I think it is the right thing to do.

The original reason for not-crossing was to implement running
averages of one column in the next.  This can now be done using field
formulas near the beginning and end of the column, and a column
formula for the central part.

See the variable `org-table-relative-ref-may-cross-hline' for more
details.
2009-08-01 07:56:26 +02:00
Carsten Dominik 09cccb22b3 Tables: Cut or copy single fields if no active region is defined
C-c C-x C-w and C-c C-x M-w now act on single table fields if there is
no active region defined.
2009-07-31 07:35:02 +02:00
Carsten Dominik 9a6261df78 Tables: Allow #+TABNAME to be indented 2009-07-02 09:10:20 +02:00
Carsten Dominik f648323253 Push version number to 6.28trans 2009-06-26 17:26:50 +02:00
Carsten Dominik cd4e52a5ef Release 6.28d 2009-06-26 17:23:27 +02:00
Carsten Dominik 00ddc4dba7 Release 6.28c 2009-06-26 09:27:50 +02:00
Carsten Dominik dfe2186724 Fix typos 2009-06-26 07:04:22 +02:00
Carsten Dominik e7ffcc1d4d Release 6.28b 2009-06-25 09:01:20 +02:00