all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* opening files result in read-only buffers
@ 2007-07-11 21:48 Dirk Jagdmann
  2007-07-12  0:56 ` weber
  2007-07-12 15:29 ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Dirk Jagdmann @ 2007-07-11 21:48 UTC (permalink / raw)
  To: help-gnu-emacs

Hello experts,

I have recently switched to emacs 22.1.1 from a 21.x release. I work on 
Linux. My emacs configuration has remained unchanged. But now every time 
I open a file (C-x C-f) that is already existing emacs open the buffer 
as read-only. To edit the buffer I always have to use C-x C-q and this 
is really annoying.
I checked unix file permissions and they allow me (my UID) to write and 
I can save buffers without problems. I checked the Emacs News and my 
configuration but did not find anything suspicious.

Does anybody have a clue? Should I post my .emacs for investigation?

-- 
---> Dirk Jagdmann ^ doj / cubic
----> http://cubic.org/~doj
-----> http://llg.cubic.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: opening files result in read-only buffers
  2007-07-11 21:48 opening files result in read-only buffers Dirk Jagdmann
@ 2007-07-12  0:56 ` weber
  2007-07-12  9:05   ` "longlines mode" doesn't work well after restore by "desktop" brianjiang
  2007-07-12 19:05   ` opening files result in read-only buffers Dirk Jagdmann
  2007-07-12 15:29 ` Eli Zaretskii
  1 sibling, 2 replies; 6+ messages in thread
From: weber @ 2007-07-12  0:56 UTC (permalink / raw)
  To: help-gnu-emacs

On 11 jul, 18:48, Dirk Jagdmann <d...@cubic.org> wrote:
> Hello experts,
>
> I have recently switched to emacs 22.1.1 from a 21.x release. I work on
> Linux. My emacs configuration has remained unchanged. But now every time
> I open a file (C-x C-f) that is already existing emacs open the buffer
> as read-only. To edit the buffer I always have to use C-x C-q and this
> is really annoying.
> I checked unix file permissions and they allow me (my UID) to write and
> I can save buffers without problems. I checked the Emacs News and my
> configuration but did not find anything suspicious.
>
> Does anybody have a clue? Should I post my .emacs for investigation?
>
> --
> ---> Dirk Jagdmann ^ doj / cubic
> ---->http://cubic.org/~doj
> ----->http://llg.cubic.org

Normally the experts (not me!) ask you to try to replicate the error
after starting emacs with "emacs -q" so your customizations don't get
loaded.
Could try that and report back ?

-weber

^ permalink raw reply	[flat|nested] 6+ messages in thread

* "longlines mode" doesn't work well after restore by "desktop"
  2007-07-12  0:56 ` weber
@ 2007-07-12  9:05   ` brianjiang
  2007-07-12 19:05   ` opening files result in read-only buffers Dirk Jagdmann
  1 sibling, 0 replies; 6+ messages in thread
From: brianjiang @ 2007-07-12  9:05 UTC (permalink / raw)
  To: help-gnu-emacs


longlines-mode work well after I turn it on a buffer. When I close Emacs
and then start Emacs again, and the buffer is stored by the "desktop" el
with "longlines" minor mode activated. But the longlines doesn't work
correctly after that. And if I save the file at this time, the long line
will be saved as multiple lines just like the long line is auto-filled.

Likely the "longlines" and "desktop" doesn't work well with each other.

Any idea about this? Thanks.

Regards,
Brian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: opening files result in read-only buffers
  2007-07-11 21:48 opening files result in read-only buffers Dirk Jagdmann
  2007-07-12  0:56 ` weber
@ 2007-07-12 15:29 ` Eli Zaretskii
  1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2007-07-12 15:29 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Dirk Jagdmann <doj@cubic.org>
> Newsgroups: gnu.emacs.help
> Date: Wed, 11 Jul 2007 23:48:46 +0200
> 
> I have recently switched to emacs 22.1.1 from a 21.x release. I work on 
> Linux. My emacs configuration has remained unchanged. But now every time 
> I open a file (C-x C-f) that is already existing emacs open the buffer 
> as read-only.
> [..]
> Does anybody have a clue? Should I post my .emacs for investigation?

If "emacs -Q" does not exhibit this problem, then indeed you should
show us your .emacs.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: opening files result in read-only buffers
  2007-07-12  0:56 ` weber
  2007-07-12  9:05   ` "longlines mode" doesn't work well after restore by "desktop" brianjiang
@ 2007-07-12 19:05   ` Dirk Jagdmann
  1 sibling, 0 replies; 6+ messages in thread
From: Dirk Jagdmann @ 2007-07-12 19:05 UTC (permalink / raw)
  To: help-gnu-emacs

> Normally the experts (not me!) ask you to try to replicate the error
> after starting emacs with "emacs -q" so your customizations don't get
> loaded.
> Could try that and report back ?

thanks for this suggestion. With the help of -q and some 
divide-and-conquer approach on my .emacs configuration I was able to 
locate a function from a "quilt.el" package I installed ages ago which 
was linked into the find-file-hook and made the buffer read-only. As I 
did not use this quilt.el anyway I just threw it out of my configuration.

-- 
---> Dirk Jagdmann ^ doj / cubic
----> http://cubic.org/~doj
-----> http://llg.cubic.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: "longlines mode" doesn't work well after restore by "desktop"
@ 2007-08-03  4:54 brianjiang
  0 siblings, 0 replies; 6+ messages in thread
From: brianjiang @ 2007-08-03  4:54 UTC (permalink / raw)
  To: help-gnu-emacs

The problem has been solved finally. That is because I put
(desktop-read) in my .emacs and it caused (desktop-read) running
twice. 
And I sent a bug report to bug-gnu-emacs@gnu.org regarding this
problem too. See below: 

----------------------------------------------------
A potential bug of longlines-mode.

If for some reason executing (longlines-mode 1) twice for the same
buffer, the longlines will be cut with "hard newline" instead of the
"soft newline". Then when the buffer is saved, the long line will be
saved as multiple lines. And when the longlines-mode is disabled, the
longline cannot go back to a single lines.

This may break the format of the user's file unexpectedly (since no
modified flag wil be set when adding the newline.).

I met this issue recently because I put "(desktop-read)" in my .emacs
file (I followed some out-of-date tips) wrongly. then the
(desktop-read) is executing twice (one is during load eva the .emacs
file, the other time is when after-init-hook is running.). So the
(longlines-mode 1) is executing twice too.

I have a brief look at the longlines.el, and find the mechanism of
the mode is: When enabling the mode, it replaces all the newline with
"hard newline" and the fill the paragraph using "soft newline". When
disabling the mode, it removes all the "soft newline" so that the
buffer go back to its original content.

But if we executing (longlines-mode 1) when the longlines mode already
turned on, then all the "soft newline" added by longlines mode
previously will be replaced by "hard newline" and the when we disable
the mode or save the file, we cannot go back to the original text
since we cannot distinguish which newline is added by longlines and
which newline the file already has before.

All we need to do to fix this problem is that when enabling the
longlines mode, check whether the longlnes mode have already
enabled. If yes, then don't replace the "soft newline" with "hard
newline" (or don't do the turn on action again). 




-----Original Message-----
From: Brian Jiang 
Sent: 2007年7月12日 17:06
To: help-gnu-emacs@gnu.org
Subject: "longlines mode" doesn't work well after restore by "desktop"


longlines-mode work well after I turn it on a buffer. When I close Emacs and then start Emacs again, and the buffer is stored by the "desktop" el with "longlines" minor mode activated. But the longlines doesn't work correctly after that. And if I save the file at this time, the long line will be saved as multiple lines just like the long line is auto-filled.

Likely the "longlines" and "desktop" doesn't work well with each other.

Any idea about this? Thanks.

Regards,
Brian

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-03  4:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-11 21:48 opening files result in read-only buffers Dirk Jagdmann
2007-07-12  0:56 ` weber
2007-07-12  9:05   ` "longlines mode" doesn't work well after restore by "desktop" brianjiang
2007-07-12 19:05   ` opening files result in read-only buffers Dirk Jagdmann
2007-07-12 15:29 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2007-08-03  4:54 "longlines mode" doesn't work well after restore by "desktop" brianjiang

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.