[Geany-devel] Fwd: Re: [Geany] A read-only command line option
thomas.martitz at xxxxx
Mon Nov 7 09:03:53 UTC 2011
I figured this should probably moved to geany-devel.
-------- Original-Nachricht --------
Betreff: Re: [Geany] A read-only command line option
Datum: Thu, 03 Nov 2011 22:42:42 +0100
Von: Thomas Martitz <thomas.martitz at student.htw-berlin.de>
Antwort an: Geany general discussion list <geany at uvena.de>
An: geany at uvena.de
Am 06.03.2010 12:15, schrieb LUK ShunTim:
> Enrico Tröger wrote:
>> On Thu, 4 Mar 2010 12:47:35 +1100, Lex wrote:
>>> I'd suggest the simplest solutions,
>>> --readonly applies to all files on the command line irrespective of
>>> positioning and has no effect on any other files opened by session or
>>> menu. This answers 1,2,3,4 (Note POSIX says it must be before any
>>> files but GNU allows anywhere)
>>> Current behaviour on attempting to re-open a file with different
>>> read-only status is that nothing happens, the already open file is
>>> raised but not changed. I would leave this as is irrespective of
>>> method of second opening (cli or menu)
>>> This answers 5,6.
>> I complete second this suggestion, not only because it would be simple
>> to implement but also because it is simple to understand and so use.
>> If there are no major objections, I'll implement this in the near
>> future (whatever this means in terms of my limited spare time). Of
>> course, if anyone is faster than me and posts a patch, that'd be much
>> appreciated :).
> It'd be a nice-to-have, convenient enhancement. No hurry. Please take
> your time.
As I need it myself now, I implemented it. It was indeed relatively easy
to do. I've done it in the exact way as Lex suggested. You can find the
according pull request here: https://github.com/geany/geany/pull/11
Please feel free to comment, I hope I did it correctly. It seems to work
fine for me.
I didn't update the manual because I don't know how to do it.
On a related note: IMO the behavor of 5/6 should be changed in a
separate patch. Especially if you open from the command line, but also
with the file browser, you may get unwanted behavior (even data loss in
the extreme case) if you opened a file in read-only mode but it didn't
do it because it was already opened (I would switch to readonly for
non-readonly files, but not the other way around, i.e. play safe).
Geany mailing list
Geany at uvena.de
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Devel