GNU bug report logs -
#8047
image-mode and require-final-newline
Previous Next
Reported by: Eli Zaretskii <eliz <at> gnu.org>
Date: Tue, 15 Feb 2011 20:06:02 UTC
Severity: normal
Found in version 23.2.94
Fixed in version 23.3
Done: Glenn Morris <rgm <at> gnu.org>
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 8047 in the body.
You can then email your comments to 8047 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#8047
; Package
emacs
.
(Tue, 15 Feb 2011 20:06:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 15 Feb 2011 20:06:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
emacs -Q
C-x C-f FOO.png RET (or any other image file)
C-x C-w BAR.png RET
=> save-buffer: Text is read-only
This happens because image-file.el makes the whole buffer displaying
the image read-only.
I think this nuisance should be fixed before Emacs 23.3 is released.
In GNU Emacs 23.2.94.1 (i386-mingw-nt5.1.2600)
of 2011-02-15 on HOME-C4E4A596F7
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: ENU
value of $XMODIFIERS: nil
locale-coding-system: cp1255
default enable-multibyte-characters: t
Major mode: RMAIL
Minor modes in effect:
diff-auto-refine-mode: t
desktop-save-mode: t
show-paren-mode: t
display-time-mode: t
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-encryption-mode: t
auto-compression-mode: t
temp-buffer-resize-mode: t
line-number-mode: t
Recent input:
C-x b I N B <tab> - <tab> <return> <C-next> <C-next>
<C-next> <C-next> <C-next> <C-next> <C-next> <C-next>
<M-end> C-x 5 b * i <tab> 1 > <return> <help-echo>
<switch-frame> C-x 5 b x d <tab> <return> <switch-frame>
C-x b <return> C-x C-f i m a g e - f i <tab> <return>
<next> <next> <next> <next> C-z C-z C-z C-z C-z C-z
C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z
C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z
C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z
C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z
C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z
C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z C-z
C-z C-z C-z C-z C-z C-z <prior> <prior> <prior> <prior>
<prior> <prior> <prior> <next> <next> <next> <next>
<next> <up> <prior> <next> <next> <next> <prior> <prior>
C-x b I N B <tab> <return> C-x C-f <M-backspace> d
a t a / e m a c s - m e n <tab> <return> C-x C-w x
x . p n g <return> C-x k <return> y e s <return> M-x
r e p o r t - e m <tab> <return>
Recent messages:
Indentation setup for shell type sh
Setting up indent for shell type sh
setting up indent stuff
Indentation variables are now local.
Indentation setup for shell type sh
Note: file is write protected [3 times]
Wrote d:/usr/eli/.emacs.desktop.lock
Desktop: 260 buffers restored.
Type C-c C-c to view the image as text.
Saving file d:/usr/eli/data/xx.png...
save-buffer: Text is read-only
Load-path shadows:
None found.
Features:
(shadow mailalias sendmail emacsbug image-mode ld-script sh-script
executable dired-x dired-aux dired tcl nxml-uchnm rng-xsd xsd-regexp
rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse
rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln
nxml-rap nxml-util nxml-glyph nxml-enc xmltok sgml-mode arc-mode
archive-mode parse-time conf-mode newcomment tar-mode add-log generic
vc-cvs diff-mode jka-compr texinfo org-wl org-w3m org-vm org-rmail
org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp
org-exp-blocks org-agenda org-info org-gnus org-bibtex org-bbdb org
byte-opt warnings bytecomp byte-compile advice help-fns advice-preload
org-footnote org-src org-list org-faces org-compat org-macs make-mode
gud comint ring flyspell ispell noutline outline easy-mmode autorevert
info vc-bzr cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs regexp-opt rmailsum rmailmm message
ecomplete rfc822 mml easymenu mml-sec password-cache mm-decode
mm-bodies mm-encode mailcap mailabbrev nnheader gnus-util netrc
gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash
mail-parse rfc2231 rmail rfc2047 rfc2045 ietf-drums time-date qp
mm-util mail-prsvr mail-utils desktop server filecache saveplace
generic-x paren battery time tooltip ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process multi-tty emacs)
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Tue, 15 Feb 2011 23:27:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
> emacs -Q
> C-x C-f FOO.png RET (or any other image file)
> C-x C-w BAR.png RET
>
> => save-buffer: Text is read-only
I don't see this in current emacs-23 or trunk on GNU/Linux.
Even if I manually enable auto-image-file-mode (mentioned in your
subject, it is not on by default), I don't see it. I also have no
problem using C-x C-w in read-only buffers.
> In GNU Emacs 23.2.94.1 (i386-mingw-nt5.1.2600)
> of 2011-02-15 on HOME-C4E4A596F7
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 02:56:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> emacs -Q
> C-x C-f FOO.png RET (or any other image file)
> C-x C-w BAR.png RET
>
> => save-buffer: Text is read-only
>
> This happens because image-file.el makes the whole buffer displaying
> the image read-only.
>
> I think this nuisance should be fixed before Emacs 23.3 is released.
It seems what you mean is image-mode.el, not image-file.el.
image-mode is intended for viewing images, not editing.
(I suppose `C-x C-w' is an editing command.)
When you want to edit textual representation of the image,
you can toggle `image-minor-mode' with `C-c C-c'.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 04:02:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: 8047 <at> debbugs.gnu.org
> Date: Tue, 15 Feb 2011 18:35:04 -0500
>
> Eli Zaretskii wrote:
>
> > emacs -Q
> > C-x C-f FOO.png RET (or any other image file)
> > C-x C-w BAR.png RET
> >
> > => save-buffer: Text is read-only
>
> I don't see this in current emacs-23 or trunk on GNU/Linux.
Set require-final-newline non-nil, and you will.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 04:05:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Juri Linkov <juri <at> jurta.org>
> Cc: 8047 <at> debbugs.gnu.org
> Date: Wed, 16 Feb 2011 02:48:33 +0200
>
> image-mode is intended for viewing images, not editing.
> (I suppose `C-x C-w' is an editing command.)
Huh? C-x C-w is a command to write the current buffer to a specified
file. It doesn't edit anything.
> When you want to edit textual representation of the image,
> you can toggle `image-minor-mode' with `C-c C-c'.
That's unreasonable: visiting an image file automatically shows it as
an image, so from a user perspective, I simply visited a file and want
to save it to another file. A practical use-case would be to display
an image file from a compressed archive, then write it to a file, thus
effectively extracting it from the archive. I know about C-c C-c, but
it's a nuisance, and shouldn't be required, IMO.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 04:48:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
> Set require-final-newline non-nil, and you will.
Well, I wasn't going to guess that.
Anyway, Emacs back to at least 22.1 behaves the same, so I disagree that
this needs fixing before 23.3. (IMO the bug is for Emacs to try and add
a newline to a binary file, so it's perhaps doing you a service by
barfing...)
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 10:03:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Eli Zaretskii wrote:
>>
>> > emacs -Q
>> > C-x C-f FOO.png RET (or any other image file)
>> > C-x C-w BAR.png RET
>> >
>> > => save-buffer: Text is read-only
>>
>> I don't see this in current emacs-23 or trunk on GNU/Linux.
>
> Set require-final-newline non-nil, and you will.
Don't do that then.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 11:11:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 8047 <at> debbugs.gnu.org (full text, mbox):
On Wed, Feb 16, 2011 at 11:11 AM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> Eli Zaretskii wrote:
>>>
>>> > emacs -Q
>>> > C-x C-f FOO.png RET (or any other image file)
>>> > C-x C-w BAR.png RET
>>> >
>>> > => save-buffer: Text is read-only
>>>
>>> I don't see this in current emacs-23 or trunk on GNU/Linux.
>>
>> Set require-final-newline non-nil, and you will.
>
> Don't do that then.
;-)
Do you suggest removing the option?
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 12:25:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Lennart Borgman <lennart.borgman <at> gmail.com> writes:
> Do you suggest removing the option?
Why do you think so?
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 12:29:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 8047 <at> debbugs.gnu.org (full text, mbox):
On Wed, Feb 16, 2011 at 1:33 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>
>> Do you suggest removing the option?
>
> Why do you think so?
What good is an option for if you should avoiding changing it? ;-)
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 12:38:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 8047 <at> debbugs.gnu.org (full text, mbox):
2011/2/16 Andreas Schwab <schwab <at> linux-m68k.org>:
> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>
>> Do you suggest removing the option?
>
> Why do you think so?
>
Wouldn't it be great if we all just said what was on our minds?
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 12:49:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Lennart Borgman <lennart.borgman <at> gmail.com> writes:
> On Wed, Feb 16, 2011 at 1:33 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>
>>> Do you suggest removing the option?
>>
>> Why do you think so?
>
> What good is an option for if you should avoiding changing it? ;-)
Where did I say that?
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 13:00:03 GMT)
Full text and
rfc822 format available.
Message #41 received at 8047 <at> debbugs.gnu.org (full text, mbox):
On Wed, Feb 16, 2011 at 1:57 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>
>> On Wed, Feb 16, 2011 at 1:33 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>
>>>> Do you suggest removing the option?
>>>
>>> Why do you think so?
>>
>> What good is an option for if you should avoiding changing it? ;-)
>
> Where did I say that?
In your response to Eli.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 13:09:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Lennart Borgman <lennart.borgman <at> gmail.com> writes:
> On Wed, Feb 16, 2011 at 1:57 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>
>>> On Wed, Feb 16, 2011 at 1:33 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>>
>>>>> Do you suggest removing the option?
>>>>
>>>> Why do you think so?
>>>
>>> What good is an option for if you should avoiding changing it? ;-)
>>
>> Where did I say that?
>
> In your response to Eli.
I don't see that.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 13:11:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 8047 <at> debbugs.gnu.org (full text, mbox):
On Wed, Feb 16, 2011 at 2:17 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>
>> On Wed, Feb 16, 2011 at 1:57 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>
>>>> On Wed, Feb 16, 2011 at 1:33 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>>>
>>>>>> Do you suggest removing the option?
>>>>>
>>>>> Why do you think so?
>>>>
>>>> What good is an option for if you should avoiding changing it? ;-)
>>>
>>> Where did I say that?
>>
>> In your response to Eli.
>
> I don't see that.
So what did you mean here then?:
>> Set require-final-newline non-nil, and you will.
>
> Don't do that then.
>
> Andreas.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 13:22:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Lennart Borgman <lennart.borgman <at> gmail.com> writes:
> On Wed, Feb 16, 2011 at 2:17 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>
>>> On Wed, Feb 16, 2011 at 1:57 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>>
>>>>> On Wed, Feb 16, 2011 at 1:33 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>>>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>>>>
>>>>>>> Do you suggest removing the option?
>>>>>>
>>>>>> Why do you think so?
>>>>>
>>>>> What good is an option for if you should avoiding changing it? ;-)
>>>>
>>>> Where did I say that?
>>>
>>> In your response to Eli.
>>
>> I don't see that.
>
> So what did you mean here then?:
>
>>> Set require-final-newline non-nil, and you will.
>>
>> Don't do that then.
>>
>> Andreas.
>
Where did I suggest removing the option?
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 13:29:02 GMT)
Full text and
rfc822 format available.
Message #53 received at 8047 <at> debbugs.gnu.org (full text, mbox):
On Wed, Feb 16, 2011 at 2:30 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>
>> On Wed, Feb 16, 2011 at 2:17 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>
>>>> On Wed, Feb 16, 2011 at 1:57 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>>>
>>>>>> On Wed, Feb 16, 2011 at 1:33 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>>>>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>>>>>
>>>>>>>> Do you suggest removing the option?
>>>>>>>
>>>>>>> Why do you think so?
>>>>>>
>>>>>> What good is an option for if you should avoiding changing it? ;-)
>>>>>
>>>>> Where did I say that?
>>>>
>>>> In your response to Eli.
>>>
>>> I don't see that.
>>
>> So what did you mean here then?:
>>
>>>> Set require-final-newline non-nil, and you will.
>>>
>>> Don't do that then.
>>>
>>> Andreas.
>>
>
> Where did I suggest removing the option?
I suggest that you suggested it there. And I suggest that you agree
with me so we can stop this ;-)
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 14:32:01 GMT)
Full text and
rfc822 format available.
Message #56 received at 8047 <at> debbugs.gnu.org (full text, mbox):
>> > emacs -Q
>> > C-x C-f FOO.png RET (or any other image file)
>> > C-x C-w BAR.png RET
>> >
>> > => save-buffer: Text is read-only
>> I don't see this in current emacs-23 or trunk on GNU/Linux.
> Set require-final-newline non-nil, and you will.
Even if it's set to `ask'?
As for the actual fix, maybe require-final-newline should be ignored
when the encoding is `binary'?
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 17:49:02 GMT)
Full text and
rfc822 format available.
Message #59 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Glenn Morris <rgm <at> gnu.org>, 8047 <at> debbugs.gnu.org
> Date: Wed, 16 Feb 2011 09:40:23 -0500
>
> >> > emacs -Q
> >> > C-x C-f FOO.png RET (or any other image file)
> >> > C-x C-w BAR.png RET
> >> >
> >> > => save-buffer: Text is read-only
> >> I don't see this in current emacs-23 or trunk on GNU/Linux.
> > Set require-final-newline non-nil, and you will.
>
> Even if it's set to `ask'?
Of course not.
> As for the actual fix, maybe require-final-newline should be ignored
> when the encoding is `binary'?
That's what I have in mind; feel free to beat me to it, because I
don't buy the argument that since this was so in Emacs 22, we need to
live with it until 24.1.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 18:27:02 GMT)
Full text and
rfc822 format available.
Message #62 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
> That's what I have in mind; feel free to beat me to it, because I
> don't buy the argument that since this was so in Emacs 22, we need to
> live with it until 24.1.
That was meant to be a reference to policy, not an argument.
http://lists.gnu.org/archive/html/emacs-devel/2011-02/msg00649.html
Developers: please note that the emacs-23 branch is now in hard
freeze. Commits should be for regressions against 23.2, or
documentation bugs, only.
Changed bug title to 'image-mode and require-final-newline' from '23.2.94; Auto image mode breaks C-x C-w'
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Wed, 16 Feb 2011 18:38:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 19:55:02 GMT)
Full text and
rfc822 format available.
Message #67 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 16 Feb 2011 19:57:19 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 8047 <at> debbugs.gnu.org
>
> > As for the actual fix, maybe require-final-newline should be ignored
> > when the encoding is `binary'?
>
> That's what I have in mind; feel free to beat me to it, because I
> don't buy the argument that since this was so in Emacs 22, we need to
> live with it until 24.1.
However, since emacs-23 is in deep freeze, I would like to suggest an
even more conservative change, see below. This one affects only
image-mode buffers that display image files.
Chong, is this okay to install on the release branch, even though the
bug predates Emacs 23.2?
--- lisp/image-mode.el~ 2011-02-15 21:32:39.565125000 +0200
+++ lisp/image-mode.el 2011-02-16 21:55:04.190125000 +0200
@@ -507,6 +507,9 @@ (defun image-toggle-display-image ()
;; This just makes the arrow displayed in the right fringe
;; area look correct when the image is wider than the window.
(setq truncate-lines t)
+ ;; Disable adding a newline at the end of the image file when it
+ ;; is written with, e.g., C-x C-w.
+ (setq find-file-literally t)
;; Allow navigation of large images
(set (make-local-variable 'auto-hscroll-mode) nil)
(setq image-type type)
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 20:50:03 GMT)
Full text and
rfc822 format available.
Message #70 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> --- lisp/image-mode.el~ 2011-02-15 21:32:39.565125000 +0200
> +++ lisp/image-mode.el 2011-02-16 21:55:04.190125000 +0200
> @@ -507,6 +507,9 @@ (defun image-toggle-display-image ()
> ;; This just makes the arrow displayed in the right fringe
> ;; area look correct when the image is wider than the window.
> (setq truncate-lines t)
> + ;; Disable adding a newline at the end of the image file when it
> + ;; is written with, e.g., C-x C-w.
> + (setq find-file-literally t)
> ;; Allow navigation of large images
> (set (make-local-variable 'auto-hscroll-mode) nil)
> (setq image-type type)
Is this really as safe as it seems? I mean, what happens when you visit
an XPM, PS, or SVG file encoded in utf-8?
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 21:00:03 GMT)
Full text and
rfc822 format available.
Message #73 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Chong Yidong <cyd <at> stupidchicken.com>, 8047 <at> debbugs.gnu.org
> Date: Wed, 16 Feb 2011 15:58:55 -0500
>
> what happens when you visit an XPM, PS, or SVG file encoded in
> utf-8?
Maybe I'm missing something, but I don't think anything will happen
that doesn't happen already. Care to elaborate what you had in mind?
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 21:00:04 GMT)
Full text and
rfc822 format available.
Message #76 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
> + ;; Disable adding a newline at the end of the image file when it
> + ;; is written with, e.g., C-x C-w.
> + (setq find-file-literally t)
You would need to make it buffer-local.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Wed, 16 Feb 2011 21:35:02 GMT)
Full text and
rfc822 format available.
Message #79 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
> However, since emacs-23 is in deep freeze, I would like to suggest an
> even more conservative change, see below.
This seems a lot less conservative than setting require-final-newline
to nil at exactly the same location.
> + ;; Disable adding a newline at the end of the image file when it
> + ;; is written with, e.g., C-x C-w.
> + (setq find-file-literally t)
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Thu, 17 Feb 2011 01:42:02 GMT)
Full text and
rfc822 format available.
Message #82 received at 8047 <at> debbugs.gnu.org (full text, mbox):
>> what happens when you visit an XPM, PS, or SVG file encoded in
>> utf-8?
> Maybe I'm missing something, but I don't think anything will happen
> that doesn't happen already. Care to elaborate what you had in mind?
These aren't "binary files", so setting find-file-literally may have
undesired effects. E.g. the coding cookie will be ignored upon save,
even though such files might like to use them. Those will also like to
obey require-final-newline, BTW.
So I suggest to set find-file-literally only in the case where
buffer-file-coding-system is `no-conversion'.
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Thu, 17 Feb 2011 03:50:03 GMT)
Full text and
rfc822 format available.
Message #85 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, Chong Yidong <cyd <at> stupidchicken.com>, 8047 <at> debbugs.gnu.org
> Date: Wed, 16 Feb 2011 16:08:55 -0500
>
> Eli Zaretskii wrote:
>
> > + ;; Disable adding a newline at the end of the image file when it
> > + ;; is written with, e.g., C-x C-w.
> > + (setq find-file-literally t)
>
> You would need to make it buffer-local.
??? It's permanently local already, see its doc string.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Thu, 17 Feb 2011 03:52:02 GMT)
Full text and
rfc822 format available.
Message #88 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, Chong Yidong <cyd <at> stupidchicken.com>, 8047 <at> debbugs.gnu.org
> Date: Wed, 16 Feb 2011 16:43:56 -0500
>
> Eli Zaretskii wrote:
>
> > However, since emacs-23 is in deep freeze, I would like to suggest an
> > even more conservative change, see below.
>
> This seems a lot less conservative than setting require-final-newline
> to nil at exactly the same location.
I'm okay with that as well.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Thu, 17 Feb 2011 03:53:01 GMT)
Full text and
rfc822 format available.
Message #91 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: cyd <at> stupidchicken.com, 8047 <at> debbugs.gnu.org
> Date: Wed, 16 Feb 2011 20:50:20 -0500
>
> So I suggest to set find-file-literally only in the case where
> buffer-file-coding-system is `no-conversion'.
Fine with me.
So do you prefer the above, or do you prefer Glenn's suggestion to set
require-final-newline instead?
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Thu, 17 Feb 2011 04:26:01 GMT)
Full text and
rfc822 format available.
Message #94 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
>> You would need to make it buffer-local.
>
> ??? It's permanently local already, see its doc string.
If you test your proposed patch, you will find it sets the global value.
It is permanently local, *once made buffer local*.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Thu, 17 Feb 2011 10:30:04 GMT)
Full text and
rfc822 format available.
Message #97 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: monnier <at> iro.umontreal.ca, cyd <at> stupidchicken.com, 8047 <at> debbugs.gnu.org
> Date: Wed, 16 Feb 2011 23:34:43 -0500
>
> Eli Zaretskii wrote:
>
> >> You would need to make it buffer-local.
> >
> > ??? It's permanently local already, see its doc string.
>
> If you test your proposed patch, you will find it sets the global value.
I tested it, just not deep enough ;-)
> It is permanently local, *once made buffer local*.
Turns out I had a fundamental misunderstanding of what "permanently
local" means. The fact that the Elisp manual is silent about that
does not help. Is there something beyond the fact that
kill-all-local-variables doesn't touch them, or is that all there is
to it?
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Thu, 17 Feb 2011 20:02:01 GMT)
Full text and
rfc822 format available.
Message #100 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> does not help. Is there something beyond the fact that
> kill-all-local-variables doesn't touch them, or is that all there is
> to it?
That's all there is to them,
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Thu, 17 Feb 2011 20:32:02 GMT)
Full text and
rfc822 format available.
Message #103 received at 8047 <at> debbugs.gnu.org (full text, mbox):
On Thu, Feb 17, 2011 at 9:10 PM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
>> does not help. Is there something beyond the fact that
>> kill-all-local-variables doesn't touch them, or is that all there is
>> to it?
>
> That's all there is to them,
Though it might be worth noting that local-permanent-hook has a bit
more complicated semantics.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Fri, 18 Feb 2011 09:46:02 GMT)
Full text and
rfc822 format available.
Message #106 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 17 Feb 2011 06:01:31 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: cyd <at> stupidchicken.com, 8047 <at> debbugs.gnu.org
>
> > From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> > Cc: cyd <at> stupidchicken.com, 8047 <at> debbugs.gnu.org
> > Date: Wed, 16 Feb 2011 20:50:20 -0500
> >
> > So I suggest to set find-file-literally only in the case where
> > buffer-file-coding-system is `no-conversion'.
>
> Fine with me.
>
> So do you prefer the above, or do you prefer Glenn's suggestion to set
> require-final-newline instead?
Ping!
Please say if you agree to install this change on the emacs-23 branch,
and also which of the solutions (setting require-final-newline or
find-file-literally) you prefer (both will be made buffer-local). I
don't want to do this on my own so close to the release.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Fri, 18 Feb 2011 10:25:02 GMT)
Full text and
rfc822 format available.
Message #109 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Glenn Morris <rgm <at> gnu.org>, cyd <at> stupidchicken.com, 8047 <at> debbugs.gnu.org
> Date: Thu, 17 Feb 2011 15:10:55 -0500
>
> > does not help. Is there something beyond the fact that
> > kill-all-local-variables doesn't touch them, or is that all there is
> > to it?
>
> That's all there is to them,
So documented.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Fri, 18 Feb 2011 17:25:01 GMT)
Full text and
rfc822 format available.
Message #112 received at 8047 <at> debbugs.gnu.org (full text, mbox):
>> > So I suggest to set find-file-literally only in the case where
>> > buffer-file-coding-system is `no-conversion'.
>> Fine with me.
>> So do you prefer the above, or do you prefer Glenn's suggestion to set
>> require-final-newline instead?
> Please say if you agree to install this change on the emacs-23 branch,
> and also which of the solutions (setting require-final-newline or
> find-file-literally) you prefer (both will be made buffer-local). I
> don't want to do this on my own so close to the release.
I think find-file-literally is more right, but require-final-newline is
safer, so I suggest to use require-final-newline in the emacs-23 branch
and find-file-literally in the trunk.
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Fri, 18 Feb 2011 18:01:01 GMT)
Full text and
rfc822 format available.
Message #115 received at 8047 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> Cc: cyd <at> stupidchicken.com, 8047 <at> debbugs.gnu.org
> Date: Fri, 18 Feb 2011 12:24:50 -0500
>
> >> > So I suggest to set find-file-literally only in the case where
> >> > buffer-file-coding-system is `no-conversion'.
> >> Fine with me.
> >> So do you prefer the above, or do you prefer Glenn's suggestion to set
> >> require-final-newline instead?
> > Please say if you agree to install this change on the emacs-23 branch,
> > and also which of the solutions (setting require-final-newline or
> > find-file-literally) you prefer (both will be made buffer-local). I
> > don't want to do this on my own so close to the release.
>
> I think find-file-literally is more right, but require-final-newline is
> safer, so I suggest to use require-final-newline in the emacs-23 branch
> and find-file-literally in the trunk.
Done.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8047
; Package
emacs
.
(Sat, 19 Feb 2011 03:39:02 GMT)
Full text and
rfc822 format available.
Message #118 received at 8047 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
>> I think find-file-literally is more right, but require-final-newline is
>> safer, so I suggest to use require-final-newline in the emacs-23 branch
>> and find-file-literally in the trunk.
>
> Done.
If you fix the same thing two different ways at the same time in trunk
and branch, please try to mark the branch commit with "do not merge to
trunk". It can be confusing if someone tries to merge branch to trunk
several days later and is not familiar with the code in question.
bug marked as fixed in version 23.3, send any further explanations to Eli Zaretskii <eliz <at> gnu.org>
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sat, 19 Feb 2011 21:23: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
.
(Sun, 20 Mar 2011 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 114 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.