Commit Graph

894 Commits

Author SHA1 Message Date
Robert Pluim 01b0fb14bc
Backport from main: Escape single left quotes in docstrings
* lisp/ob-core.el (org-babel-default-header-args):
* lisp/ob-julia.el (org-babel-julia-evaluate-external-process):
(org-babel-julia-evaluate-session):
* lisp/ob-lua.el (org-babel-lua-read-string):
* lisp/ob-table.el (org-sbe):
* lisp/oc-basic.el (org-cite-basic--shorten-names):
* lisp/org-agenda.el (org-agenda-sorting-strategy):
(org-agenda--mark-blocked-entry):
(org-agenda-set-restriction-lock):
* lisp/org-fold-core.el (org-fold-core--specs):
(org-fold-core-remove-folding-spec):
(org-fold-core-get-folding-spec):
(org-fold-core--isearch-overlays):
* lisp/org-plot.el (org--plot/prime-factors):
* lisp/org-table.el (org-table-collapse-header):
* lisp/org.el (org-special-ctrl-o):
(org-latex-to-html-convert-command):
* lisp/ox-html.el (org-html--unlabel-latex-environment):
* lisp/ox-publish.el (org-publish-find-property):
Use \\=' when there's a need for a single left quote in a docstring.

The emacs-29 byte compiler complains about such usage.
2022-07-24 20:19:11 +08:00
Bastien 64ee5c2c47 lisp/org-table.el: Fix bug in `org-table-row-get-visible-string'
* lisp/org-table.el (org-table-row-get-visible-string): Don't use
`backward-char' in a function called in a post-command hook.
2022-03-31 17:31:50 +02:00
Kyle Meyer 5a229cbc44 Update copyright year to 2022 2022-01-01 15:17:08 -05:00
Ihor Radchenko 4b1def3c5c
org-table.el: Do not create new field when at EOL after table line
* lisp/org-table.el (org-table-justify-field-maybe): Do not treat "|$"
as unclosed table field.

Fixes https://orgmode.org/list/trinity-2561db57-1561-470b-982f-0d91ddf4f145-1629900012884@3c-app-mailcom-lxa06
2021-11-23 21:40:58 +08:00
Bastien 806ac1b7f6 *el: Fix indentation 2021-09-29 09:22:47 +02:00
Kyle Meyer 1292d89c37 Clean up spacing to pass Emacs's pre-commit check
* lisp/org-agenda.el (org-agenda-highlight-todo):
(org-agenda-set-mode-name):
* lisp/org-table.el (org-table-eval-formula): Avoid space before tab in
indent.

This is in preparation for syncing with the Emacs repo.
2021-09-29 00:37:30 -04:00
Bastien 72c9f1bf42 Merge branch 'bugfix' 2021-09-26 08:54:40 +02:00
Bastien dbbb93dfdf lisp/org-table.el: Fix positioning of "#+TBLFM:
* lisp/org-table.el (org-table-store-formulas): Fix positioning of
"#+TBLFM:".

Reported-by: tbanelwebmin <tbanelwebmin@free.fr>
<http://list.orgmode.org/43910853-03cb-c226-f46d-4736d0e6cca6@free.fr>
2021-09-26 08:53:36 +02:00
Nicholas Vollmer 74a5af619c Fix byte-comp function warnings
* (org.el, org-table.el org-keys.el) Declare functions for byte compiler.
2021-09-25 21:31:25 +02:00
Nicholas Vollmer d8b9bd05ba Fix byte-comp function warnings
* (org.el, org-table.el org-keys.el) Declare functions for byte compiler.
2021-09-25 21:30:32 +02:00
Utkarsh Singh e626185081 org-table.el: Fix usage of user-error
* lisp/org-table.el (org-table-convert-region): Don't use `if' because
  Elisp has no concept of continuable errors.
2021-09-25 16:23:54 +02:00
Stefan Kangas 51cdd6e30f Various minor docfixes found by checkdoc 2021-09-16 21:24:59 +02:00
Bastien 0f2ece647b Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
Bastien c7824f9cf8 Merge branch 'maint' 2021-05-02 05:46:57 +02:00
Bastien eedbe286ef lisp/org-table.el: Fix bug with `org-table-wrap-region'
* lisp/org-table.el (org-table-copy-region): Only display a
message when called interactively.
(org-table-wrap-region): Prevent `org-table-cut-region' from
losing track of the region beginning.

Reported-by: Marko Schuetz-Schmuck <marko.schutz@upr.edu>
Link: https://orgmode.org/list/875z84fnwv.fsf@tpad-m.i-did-not-set--mail-host-address--so-tickle-me/
2021-05-02 05:44:46 +02:00
Utkarsh Singh 7c99d15557 org-table.el: Allow to import files with no .txt, .tsv or .csv
* lisp/org-table.el (org-table-import): Allow to import files
with no .txt, .tsv or .csv extension.

TINYCHANGE
2021-05-01 10:48:07 +02:00
Bastien Guerry 29d4cc1802 Merge branch 'maint' 2021-04-26 21:52:25 +02:00
Bastien Guerry 058339d6e6 org-table.el: Fix a bug when displaying a table header
* lisp/org-table.el (org-table-row-get-visible-string): Fix wrong
beginning of the header string.
(org-table-header-set-header): Get the real beginning of the line.

Reported-by: "Oorja Sandhu" <oorja.sandhu@inoutbox.com>
Link: https://orgmode.org/list/7beea3b5-6fe5-4ba6-831e-19a88d87de6b@www.fastmail.com/
2021-04-26 21:51:12 +02:00
Kyle Meyer 664b653448 Merge branch 'km/from-emacs-master' 2021-04-18 02:12:44 -04:00
Stefan Monnier 8c29cbdef7 Backport commit c45bfd3c4 from Emacs
* lisp/ox-beamer.el (org-beamer-mode-map): Move initialization
into declaration.
(org-beamer-mode):
* lisp/org.el (org-cdlatex-mode):
* lisp/org-table.el (org-table-header-line-mode)
(org-table-follow-field-mode, orgtbl-mode):
* lisp/org-src.el (org-src-mode):
* lisp/org-list.el (org-list-checkbox-radio-mode):
* lisp/org-indent.el (org-indent-mode):
* lisp/org-capture.el (org-capture-mode):
Avoid old-style positional args to `define-minor-mode`.

* lisp/**/*.el: Avoid positional args to `define-minor-mode`
c45bfd3c4abbfa585c9199f4866b6b8046945117
Stefan Monnier
Sun Apr 11 23:47:14 2021 -0400
2021-04-18 02:11:35 -04:00
Kyle Meyer a02a3bd6ac Merge branch 'maint' 2021-04-17 15:19:41 -04:00
Kyle Meyer f12ca1a562 table: Restore temporary-goal-column after displaying header
* lisp/org-table.el (org-table-header-set-header): Restore
temporary-goal-column to prevent disrupting the expected next-line and
previous-line movement.

org-table-header-set-header, which org-table-header-line-mode adds to
post-command-hook, changes the value of temporary-goal-column to zero,
interfering with the logic in line-move-1.

Reported-by: Oorja Sandhu <oorja.sandhu@inoutbox.com>
Ref: https://orgmode.org/list/1b8b1a96-149e-4409-9738-fc45fad3a604@www.fastmail.com
2021-04-17 15:06:11 -04:00
Stefan Kangas 2e1c984153 Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
Kyle Meyer e0fb2339f4 Merge branch 'km/from-emacs-master'
Porting from Emacs's master to Org's maint branch has been on hold
leading up to the Emacs 27.2 release to avoid any required fixup syncs
carrying those commits into the emacs-27 branch.  This merge brings
those changes into master.  The km/from-emacs-master branch should be
merged to maint when Emacs 27.2 has been released (assuming Org 9.5
hasn't been released, in which case maint will be tracking 9.5.x and
already include these changes).
2021-02-14 18:06:23 -05:00
Stefan Kangas 4aa4ae8cf0 Backport commit bbe88cd82 from Emacs
* lisp/org-table.el (org-table-edit-field):
* lisp/org.el (org-restart-font-lock): Assume font-lock-mode variable
is not void; it is preloaded.

Assume font-lock-mode variable is not void
bbe88cd82e4bbfd76df06223614ab74d1022c119
Stefan Kangas
Fri Feb 5 01:15:02 2021 +0100
2021-02-14 17:38:07 -05:00
Kyle Meyer 291993888d Merge branch 'maint' 2021-01-01 15:02:10 -05:00
Kyle Meyer 99eafe3787 Update copyright year to 2021 2021-01-01 14:59:01 -05:00
Kyle Meyer f845305c31 Merge branch 'maint' 2020-12-13 14:56:59 -05:00
Kyle Meyer d7d714c7d5 Silence byte-compiler in Emacs repo
These show up in the Emacs repo (before and after the latest sync in
f22856a5c5), but for an unknown reason do not show up with `make
compile' or `make single' in the Org repo.

All of these functions are autoloaded.
2020-12-13 13:56:29 -05:00
Kyle Meyer b3b29e1d59 Merge branch 'maint' 2020-11-27 01:35:31 -05:00
Stefan Kangas 00bc3097cd Backport commit affe9b225 from Emacs
* lisp/org-agenda.el (org-agenda-mode):
* lisp/org-table.el (org-table-edit-formulas, orgtbl-mode):
* lisp/org.el: Don't call easy-menu-add, an obsolete XEmacs compat
alias.

Make XEmacs compat aliases easy-menu-{add,remove} obsolete
affe9b225de711429248a73f920dc9f38b15c932
Stefan Kangas
Tue Nov 24 18:06:05 2020 +0100
2020-11-26 19:31:48 -05:00
Daniele Nicolodi 15469774dd org-table: Add mode flag to enable Calc units simplification mode
* org-table.el (org-table-eval-formula): Add the `u` mode flag to
enable Calc's units simplification mode.

* test-org-table.el (test-org-table/mode-string-u): Add Unit test for
the new mode flag.

* org-manual.org: Document new mode flag.
2020-11-24 20:59:39 -05:00
Daniele Nicolodi abd9949431 org-table: Simplify mode string parsing
* org-table.el (org-table-eval-formula): Simplify mode string parsing
and reduce scope of local variables.
2020-11-24 20:58:27 -05:00
Daniele Nicolodi bd7e16ca21 org-table: Remove unused org-tbl-calc-modes variable declaration
* org-table.el (org-tbl-calc-modes): Remove variable declaration as
the varialble is used only within `org-table-eval-formula'.

* org-table.el (org-table-eval-formula): Rename `org-tbl-calc-modes`
local variable without the `org-tbl-` prefix and use the gained screen
real estate to avoid indirection through covenience macro. This
requires moving the mode lookup table from `org-table--set-calc-mode`
to here.

* org-table.el (org-table--set-calc-mode): Drop convenience macro.
Note that the macro was not working as intended when the caller tried
to add a new entry in the plist as in this case the macro would create
a new plist with the added entry but return the old one.
2020-11-24 20:58:27 -05:00
Stefan Kangas 9a6689f9ce Backport commit c6fa0ad31 from Emacs
; Prefer https to http in many URLs
c6fa0ad315e38167cb81a4d8c143cc53ad783cc3
Stefan Kangas
Thu Oct 1 15:28:15 2020 +0200
2020-10-04 15:06:39 -04:00
Nicolas Goaziou 10ed4994f5 table: Fix regexp
* lisp/org-table.el (org-table-import): Fix missing leading
backslash.  Switch to Rx notation for clarity.
2020-09-15 09:50:29 +02:00
Bastien Guerry 9c31cba002 org-table.el: Throw an error when importing a non-csv/tsv/txt file
* lisp/org-table.el (org-table-import): Throw an error when
interactively trying to import a non-csv/tsv/txt file.

Reported-by: swedebugia <swedebugia@riseup.net>
See https://orgmode.org/list/20200912135043.0354bac4@parabola/
2020-09-13 19:13:05 +02:00
Bastien b2f54f9f8e Merge branch 'maint' 2020-09-05 15:20:06 +02:00
Bastien 114d509829 org-table.el: Prevent an error from occurring
* lisp/org-table.el (org-table-justify-field-maybe): Fix bug.

Reported-by: Lester Longley <lester@ieee.org>
https://orgmode.org/list/CAA3095_oH2sH_a=nNeYEa=agZp7L2K8Vp2s-c7fN4M4Sro=stQ@mail.gmail.com
2020-09-05 15:18:51 +02:00
mfrasca 73e367fca4 table: Allow collapsing header into single line
* lisp/org-table.el (org-table-collapse-header): New function.

* lisp/org-plot.el (org-plot/gnuplot): Use org-table-collapse-header
and trust there will be no more leading `hline' symbols in lisp table.

* testing/lisp/test-org-table.el (test-org-table/to-lisp):
Adding tests to already existing to-lisp function.
(test-org-table/collapse-header): Adding tests to new
collapse-header function.

* testing/lisp/test-ox.el (test-org-export/has-header-p): Testing
exporting table with multi-line header.
2020-06-28 23:02:26 +02:00
Nicolas Goaziou e3a7247b68 table: Gracefully align hrule-only tables
* lisp/org-table.el (org-table-align): Try to align the table even
when it only consists of horizontal rules.
* testing/lisp/test-org-table.el (test-org-table/align): Add test.
2020-06-15 21:34:00 +02:00
Nicolas Goaziou e39365e32f table: Avoid unnecessary consing
* lisp/org-table.el (org-table-align): Avoid unnecessary consing.
2020-05-09 10:44:43 +02:00
Nicolas Goaziou ba7bf12b44 table: Small refactoring of `org-table-align'
* lisp/org-table.el (org-table-align): Remove dead code.  Slightly
simplify code.
2020-05-08 23:40:57 +02:00
Nicolas Goaziou 984c7af21f table: `org-table-to-lisp' preserves text properties.
* lisp/org-table.el (org-table-to-lisp): Preserve text properties.
Otherwise, it breaks `org-table-align', which needs to know about
invisible characters.
2020-05-08 16:14:50 +02:00
Nicolas Goaziou 13195a4a5f table: Speed-up for `org-table-align'
* lisp/org-table.el (org-table-align): Use `org-table-to-lisp'.

Suggested-by: Thierry Banel <tbanelwebmin@free.fr>
2020-05-08 15:42:43 +02:00
Nicolas Goaziou 7d35d46494 Fix :package-version values
* lisp/ol.el (org-link-email-description-format):
* lisp/org-src.el (org-src-tab-acts-natively):
* lisp/org-table.el (org-table-header-line-p):
* lisp/org.el (org-loop-over-headlines-in-active-region):
(org-fontify-done-headline): Use correct (PACKAGE . VERSION-STRING)
value.  Remove :version keyword since :package-version overrides it.
2020-05-06 02:12:23 +02:00
Nicolas Goaziou e5eda0beeb table: Tiny clean-up
* lisp/org-table.el (org-table-export): Remove unnecessary calls to
`buffer-substring-no-properties'.
2020-05-02 11:32:17 +02:00
Marco Wahl 90185c98f4 table: Remove the last row (LR) feature
The feature was undocumented and broken according to Carsten.

* lisp/org-table.el (org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-get-formula):
(org-table-fix-formulas):
(org-table-analyze): Remove the parts refering to LR.
2020-05-02 00:04:30 +02:00
Nicolas Goaziou ce10179cc2 table: `org-table-to-lisp' does not check if point is at a table
* lisp/org-table.el (org-table-to-lisp): Do not check if point is at
a table.  Leave it to the caller.

See <http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00000.html>.
2020-05-01 15:00:47 +02:00
Nicolas Goaziou e955976983 table: Small fix
* lisp/org-table.el (org-table-to-lisp): Make sure to stop at the end
of the table.
2020-05-01 12:29:11 +02:00