0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 18:36:26 +00:00

Fix bug with creating a new picture area.

The was a faulty regular expression in this function which never
matched, causing creation of a new picture area to mess up and start
the new area at the end of the previous line instead of the beginning
of the current.

Reported by Bernt Hansen.
This commit is contained in:
Carsten Dominik 2008-11-16 20:09:03 +01:00
parent d5d445d908
commit 423ce71439
2 changed files with 33 additions and 28 deletions

View file

@ -1,3 +1,8 @@
2008-11-16 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-edit-fixed-width-region): Fix bug when sarting a new
picture area.
2008-11-15 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-open-at-mouse): Ensure correct link abbreviations

View file

@ -5608,8 +5608,8 @@ exit by killing the buffer with \\[org-edit-src-exit]."
(beginning-of-line 1)
(if (looking-at "[ \t]*[^:\n \t]")
nil
(if (looking-at "[ \t]*\\(\n\\|\\'\\)]")
(setq beg (point) end (match-end 0))
(if (looking-at "[ \t]*\\(\n\\|\\'\\)")
(setq beg (point) end beg)
(save-excursion
(if (re-search-backward "^[ \t]*[^:]" nil 'move)
(setq beg (point-at-bol 2))
@ -5618,32 +5618,32 @@ exit by killing the buffer with \\[org-edit-src-exit]."
(if (re-search-forward "^[ \t]*[^:]" nil 'move)
(setq end (1- (match-beginning 0)))
(setq end (point))))
(goto-line line)
(if (get-buffer "*Org Edit Picture*")
(kill-buffer "*Org Edit Picture*"))
(switch-to-buffer (make-indirect-buffer (current-buffer)
"*Org Edit Picture*"))
(narrow-to-region beg end)
(remove-text-properties beg end '(display nil invisible nil
intangible nil))
(when (fboundp 'font-lock-unfontify-region)
(font-lock-unfontify-region (point-min) (point-max)))
(cond
((eq org-edit-fixed-width-region-mode 'artist-mode)
(fundamental-mode)
(artist-mode 1))
(t (funcall org-edit-fixed-width-region-mode)))
(set (make-local-variable 'org-edit-src-force-single-line) nil)
(set (make-local-variable 'org-edit-src-from-org-mode) org-mode-p)
(set (make-local-variable 'org-edit-src-picture) t)
(goto-char (point-min))
(while (re-search-forward "^[ \t]*: " nil t)
(replace-match ""))
(goto-line line)
(org-exit-edit-mode)
(org-set-local 'header-line-format msg)
(message "%s" msg)
t))))
(goto-line line))
(if (get-buffer "*Org Edit Picture*")
(kill-buffer "*Org Edit Picture*"))
(switch-to-buffer (make-indirect-buffer (current-buffer)
"*Org Edit Picture*"))
(narrow-to-region beg end)
(remove-text-properties beg end '(display nil invisible nil
intangible nil))
(when (fboundp 'font-lock-unfontify-region)
(font-lock-unfontify-region (point-min) (point-max)))
(cond
((eq org-edit-fixed-width-region-mode 'artist-mode)
(fundamental-mode)
(artist-mode 1))
(t (funcall org-edit-fixed-width-region-mode)))
(set (make-local-variable 'org-edit-src-force-single-line) nil)
(set (make-local-variable 'org-edit-src-from-org-mode) org-mode-p)
(set (make-local-variable 'org-edit-src-picture) t)
(goto-char (point-min))
(while (re-search-forward "^[ \t]*: ?" nil t)
(replace-match ""))
(goto-line line)
(org-exit-edit-mode)
(org-set-local 'header-line-format msg)
(message "%s" msg)
t)))
(defun org-edit-src-find-region-and-lang ()