mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 12:02:52 +00:00
Fix positioning bug when returning from source code editing
This commit is contained in:
parent
95a4be9088
commit
a6449c0324
|
@ -1,6 +1,8 @@
|
||||||
2009-06-09 Carsten Dominik <carsten.dominik@gmail.com>
|
2009-06-09 Carsten Dominik <carsten.dominik@gmail.com>
|
||||||
|
|
||||||
* org-src.el (org-src-mode): Renamed from `org-exit-edit-mode'.
|
* org-src.el (org-src-mode): Renamed from `org-exit-edit-mode'.
|
||||||
|
(org-edit-src-exit): Better cursor positioning when returning from
|
||||||
|
editing.
|
||||||
|
|
||||||
* org-latex.el (org-export-latex-use-verb): New variable.
|
* org-latex.el (org-export-latex-use-verb): New variable.
|
||||||
(org-export-latex-emph-format): Prefer \texttt over \verb when
|
(org-export-latex-emph-format): Prefer \texttt over \verb when
|
||||||
|
|
|
@ -407,18 +407,19 @@ the language, a switch telling of the content should be in a single line."
|
||||||
(interactive)
|
(interactive)
|
||||||
(unless (string-match "\\`*Org Edit " (buffer-name (current-buffer)))
|
(unless (string-match "\\`*Org Edit " (buffer-name (current-buffer)))
|
||||||
(error "This is not an sub-editing buffer, something is wrong..."))
|
(error "This is not an sub-editing buffer, something is wrong..."))
|
||||||
(let ((line (if (org-bound-and-true-p org-edit-src-force-single-line)
|
(let ((beg org-edit-src-beg-marker)
|
||||||
1
|
|
||||||
(org-current-line)))
|
|
||||||
(beg org-edit-src-beg-marker)
|
|
||||||
(end org-edit-src-end-marker)
|
(end org-edit-src-end-marker)
|
||||||
(ovl org-edit-src-overlay)
|
(ovl org-edit-src-overlay)
|
||||||
(buffer (current-buffer))
|
(buffer (current-buffer))
|
||||||
(nindent org-edit-src-nindent)
|
(nindent org-edit-src-nindent)
|
||||||
code)
|
code line)
|
||||||
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(if (looking-at "[ \t\n]*\n") (replace-match ""))
|
(if (looking-at "[ \t\n]*\n") (replace-match ""))
|
||||||
(if (re-search-forward "\n[ \t\n]*\\'" nil t) (replace-match ""))
|
(if (re-search-forward "\n[ \t\n]*\\'" nil t) (replace-match "")))
|
||||||
|
(setq line (if (org-bound-and-true-p org-edit-src-force-single-line)
|
||||||
|
1
|
||||||
|
(org-current-line)))
|
||||||
(when (org-bound-and-true-p org-edit-src-force-single-line)
|
(when (org-bound-and-true-p org-edit-src-force-single-line)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(while (re-search-forward "\n" nil t)
|
(while (re-search-forward "\n" nil t)
|
||||||
|
|
Loading…
Reference in a new issue