[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: query-replace still doesn't check if the buffer is read-only
From: |
Kevin Rodgers |
Subject: |
Re: query-replace still doesn't check if the buffer is read-only |
Date: |
Tue, 02 Sep 2003 10:50:56 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Dan Jacobson wrote:
query-replace still (21.3.2) doesn't check if the buffer is read-only.
You only find out when you hit SPC.
2003-09-02 Kevin Rodgers <ihs_4664@yahoo.com>
* replace.el (query-replace-read-args, query-replace-regexp-eval,
map-query-replace-regexp, keep-lines-read-args): Signal a
`buffer-read-only' error if the current buffer is read-only,
before reading any arguments.
*** emacs-21.3/lisp/replace.el.orig Fri Oct 18 19:21:09 2002
--- emacs-21.3/lisp/replace.el Tue Sep 2 10:42:16 2003
***************
*** 57,62 ****
--- 57,63 ----
:version "20.3")
(defun query-replace-read-args (string regexp-flag)
+ (barf-if-buffer-read-only)
(let (from to)
(if query-replace-interactive
(setq from (car (if regexp-flag regexp-search-ring search-ring)))
***************
*** 155,160 ****
--- 156,162 ----
Fourth and fifth arg START and END specify the region to operate on."
(interactive
(let (from to start end)
+ (barf-if-buffer-read-only)
(when (and transient-mark-mode mark-active)
(setq start (region-beginning)
end (region-end)))
***************
*** 196,201 ****
--- 198,204 ----
Fourth and fifth arg START and END specify the region to operate on."
(interactive
(let (from to start end)
+ (barf-if-buffer-read-only)
(when (and transient-mark-mode mark-active)
(setq start (region-beginning)
end (region-end)))
***************
*** 294,299 ****
--- 297,303 ----
"Read arguments for `keep-lines' and friends.
Prompt for a regexp with PROMPT.
Value is a list, (REGEXP)."
+ (barf-if-buffer-read-only)
(list (read-from-minibuffer prompt nil nil nil
'regexp-history nil t)))
--
Kevin Rodgers
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: query-replace still doesn't check if the buffer is read-only,
Kevin Rodgers <=