diff options
| author | Ihor Radchenko <yantar92@posteo.net> | 2023-10-20 13:10:30 +0300 |
|---|---|---|
| committer | Ihor Radchenko <yantar92@posteo.net> | 2023-12-05 14:11:23 +0100 |
| commit | 315417582f320c0ce37de02bf9bd81d425f3fa0b (patch) | |
| tree | 7dcec4a97b93210bbb7effe0ef16d6a673f91a27 /etc/ORG-NEWS | |
| parent | 23378177c2ead82f6bc6e05e6b1ad6d4478109e3 (diff) | |
| download | org-mode-315417582f320c0ce37de02bf9bd81d425f3fa0b.tar.gz | |
lisp/org.el (org-mode): Force `tab-width' to be 8
* lisp/org-macs.el (org-current-text-column): Assert `tab-width' to be
8 to ensure consistency of the parser across user configurations.
* etc/ORG-NEWS (~tab-width~ value is now assumed to be 8): Document
the breaking change.
This breaking change is made to standardize Org mode format for list
items. With variable `tab-width', indentation in lists may depend on
user settings leading to inconsistent Org documents when open by
different users.
Link: https://orgmode.org/list/2c9a6cbd-21c0-45bf-8fbb-4f7eccac4ae7@app.fastmail.com
Diffstat (limited to 'etc/ORG-NEWS')
| -rw-r--r-- | etc/ORG-NEWS | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index aef7e11..bde25ab 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -19,6 +19,40 @@ When =FILE= does not exist, the reference is searched in the current file, using the verbatim reference. This way, =:var table=tbl:example= will be searched inside the current buffer. +*** ~tab-width~ value is now assumed to be 8 + +Org mode now assumes tab width to be 8 characters, when calculating +list and other indentation. ~tab-width~ is also set to 8 when Org +major mode is loaded. + +This is done to improve consistency of the markup for lists, where +indentation affects list items. + +Users with non-default values of ~tab-width~ should avoid overriding +the value of 8 set by Org mode. If the custom ~tab-width~ value is +_smaller_ than 8, the existing Org documents can be converted to the +new standard tab width using the following helper command: + +#+begin_src emacs-lisp +(defun org-compat-adjust-tab-width-in-buffer (old-width) + "Adjust visual indentation from `tab-width' equal OLD-WIDTH to 8." + (interactive "nOld `tab-width': ") + (cl-assert (derived-mode-p 'org-mode)) + (unless (= old-width 8) + (org-with-wide-buffer + (goto-char (point-min)) + (let (bound + (repl (if (< old-width 8) + (make-string old-width ?\s) + (concat "\t" (make-string (- old-width 8) ?\s))))) + (while (re-search-forward "^ *\t" nil t) + (skip-chars-forward " \t") + (setq bound (point-marker)) + (forward-line 0) + (while (search-forward "\t" bound t) + (replace-match repl))))))) +#+end_src + *** New export option ~org-export-expand-links~ The new option makes Org expand environment variables in link and INCLUDE paths. |
