Commit 07a26a30 authored by Christer Ekholm's avatar Christer Ekholm
Browse files

Use save-match-data in lyskom-remove-buffer-from-lists.

Protect match-data from being changed when called from
kill-buffer-hook.

This function caused evaluation of python code from org-mode to
fail. Reported by Pär Kurlberg in text 2023386.
parent b58926d6
2014-06-26 Christer Ekholm <che@chrekh.se>
* buffers.el (lyskom-remove-buffer-from-lists): Use
save-match-data around code that does regexp matching, since this
get's called from kill-buffer-hook.
This function caused evaluation of python code from org-mode to
fail. Reported by Pär Kurlberg in text 2023386.
2014-06-22 Christer Ekholm <che@chrekh.se> 2014-06-22 Christer Ekholm <che@chrekh.se>
* compatibility.el: Added compatibility-macro for read-only-mode. * compatibility.el: Added compatibility-macro for read-only-mode.
......
...@@ -223,11 +223,12 @@ the children object" ...@@ -223,11 +223,12 @@ the children object"
"Remove BUFFER from all internal lists. "Remove BUFFER from all internal lists.
If BUFFER is not specified, assume the current buffer" If BUFFER is not specified, assume the current buffer"
(unless buffer (setq buffer (current-buffer))) (unless buffer (setq buffer (current-buffer)))
(lyskom-remove-unread-buffer buffer) (save-match-data
(setq lyskom-buffer-list (lyskom-remove-unread-buffer buffer)
(delq buffer lyskom-buffer-list)) (setq lyskom-buffer-list
(lyskom-update-unread-mode-line) (delq buffer lyskom-buffer-list))
(lyskom-set-default 'lyskom-need-prompt-update t)) (lyskom-update-unread-mode-line)
(lyskom-set-default 'lyskom-need-prompt-update t)))
(defun lyskom-remove-unread-buffer (buffer &optional letters-only) (defun lyskom-remove-unread-buffer (buffer &optional letters-only)
(unless letters-only (unless letters-only
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment