diff options
author | Bastien Guerry <bzg@altern.org> | 2013-02-18 18:07:04 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-02-18 18:07:04 +0100 |
commit | e8a6b56db92c04e3b006f7b4f92e5bf8c7ddabe9 (patch) | |
tree | 1ad0ba37379b25c5d863b79fc9aa61d75d93ac82 | |
parent | 4708a4804fefe62e98cc8ca72afd8166a638ca84 (diff) | |
download | org-mode-e8a6b56db92c04e3b006f7b4f92e5bf8c7ddabe9.tar.gz |
Fix commit 5cdf84ea68
* org.el (org-mode): Don't make characters from
`org-emphasis-alist' word constituants.
(org-mode-transpose-word-syntax-table): Rename from
`org-syntax-table'.
(org-transpose-words): Use
`org-mode-transpose-word-syntax-table'.
Thanks to Achim Gratz and T.F. Torrey for reporting the broken tests.
-rw-r--r-- | lisp/org.el | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index 4f8af3b..5569c7e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5198,8 +5198,7 @@ The following commands are available: (org-set-tag-faces 'org-tag-faces org-tag-faces)) ;; Calc embedded (org-set-local 'calc-embedded-open-mode "# ") - (mapc (lambda(c) (modify-syntax-entry (string-to-char (car c)) "w p")) - org-emphasis-alist) + ;; Modify a few syntax entries (modify-syntax-entry ?< "(") (modify-syntax-entry ?> ")") (modify-syntax-entry ?{ "(") @@ -5297,6 +5296,13 @@ The following commands are available: ;; Try to set org-hide correctly (set-face-foreground 'org-hide (org-find-invisible-foreground))) +(defvar org-mode-transpose-word-syntax-table + (let ((st (make-syntax-table))) + (mapc (lambda(c) (modify-syntax-entry + (string-to-char (car c)) "w p" st)) + org-emphasis-alist) + st)) + (when (fboundp 'abbrev-table-put) (abbrev-table-put org-mode-abbrev-table :parents (list text-mode-abbrev-table))) @@ -19043,6 +19049,16 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names." (org-defkey map (vector 'remap old) new) (substitute-key-definition old new map global-map))))) +(defun org-transpose-words () + "Transpose words for Org. +This uses the `org-mode-transpose-word-syntax-table' syntax +table, which interprets characters in `org-emphasis-alist' as +word constituants." + (interactive) + (with-syntax-table org-mode-transpose-word-syntax-table + (call-interactively 'transpose-words))) +(org-remap org-mode-map 'transpose-words 'org-transpose-words) + (when (eq org-enable-table-editor 'optimized) ;; If the user wants maximum table support, we need to hijack ;; some standard editing functions |