GNU bug report logs -
#7488
24.0.50; format-decode-region acts on whole buffer, not on region
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Fri, 26 Nov 2010 17:30:03 UTC
Severity: normal
Found in version 24.0.50
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7488 in the body.
You can then email your comments to 7488 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7488
; Package
emacs
.
(Fri, 26 Nov 2010 17:30:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 26 Nov 2010 17:30:04 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
emacs -Q
;; On Windows, load cygwin-mount.el and setup-cygwin.el, from Emacs wiki:
http://www.emacswiki.org/cgi-bin/wiki?action=index;match=%5C.(el%7Ctar)(%5C.gz)%
3F%24
;; (That just gives you a bash shell etc.)
C-x b *scratch*
Select the text "notes you don't want".
M-x format-encode-region RET rot13 RET
Select the same region (text that was just encoded).
M-x format-decode-region RET rot13 RET
The entire buffer gets ROT13'd, not just the region.
In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
of 2010-11-22 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags
-Ic:/imagesupport/include'
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7488
; Package
emacs
.
(Mon, 29 Nov 2010 11:23:01 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
Drew Adams wrote:
> emacs -Q
> ;; On Windows, load cygwin-mount.el and setup-cygwin.el, from Emacs wiki:
> http://www.emacswiki.org/cgi-bin/wiki?action=index;match=%5C.(el%7Ctar)(%5C.gz)%
> 3F%24
format-decode-run-method seems to ignore the values of its region
arguments (assuming the buffer is narrowed maybe?)
Here's a patch:
From d1bc7ad648e75979169765d6384314a21c9dcf17 Mon Sep 17 00:00:00 2001
From: Lawrence Mitchell <wence <at> gmx.li>
Date: Mon, 29 Nov 2010 11:24:57 +0000
Subject: [PATCH] Make format-decode-run-method pay attention to region arguments.
Instead of assuming a narrowed buffer and apply the decoding method to
the whole buffer, use the passed in values of FROM and TO.
---
lisp/ChangeLog | 6 ++++++
lisp/format.el | 3 +--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 58fce7a..9a12f5e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-29 Lawrence Mitchell <lawrence.mitchell <at> ed.ac.uk>
+
+ * format.el (format-decode-run-method): Use values of FROM and TO
+ rather than point-min and point-max to operate on the region
+ correctly.
+
2010-11-15 Agustín Martín <agustin.martin <at> hispalinux.es>
* textmodes/flyspell.el (flyspell-generic-progmode-verify):
diff --git a/lisp/format.el b/lisp/format.el
index 0436187..b4277ef 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -181,8 +181,7 @@ it should be a Lisp function. Decoding is done for the given BUFFER."
;; We should perhaps go via a temporary buffer and copy it
;; back, in case of errors.
(if (and (zerop (save-window-excursion
- (shell-command-on-region (point-min) (point-max)
- method t t
+ (shell-command-on-region from to method t t
error-buff)))
;; gzip gives zero exit status with bad args, for instance.
(zerop (with-current-buffer error-buff
--
1.7.2.2.180.g9841a.dirty
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7488
; Package
emacs
.
(Mon, 06 Dec 2010 19:31:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 7488 <at> debbugs.gnu.org (full text, mbox):
Lawrence Mitchell <wence <at> gmx.li> writes:
> format-decode-run-method seems to ignore the values of its region
> arguments (assuming the buffer is narrowed maybe?)
>
> Here's a patch:
Thanks. Strange that this bug hadn't been caught before. I've
committed your patch to the emacs-23 branch.
bug closed, send any further explanations to "Drew Adams" <drew.adams <at> oracle.com>
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> debbugs.gnu.org
.
(Mon, 06 Dec 2010 19:31:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 04 Jan 2011 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 174 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.