I only want to click with the righter mouse button on a file in the buffe=
list and set that file to read only via the context menu. Thats all.
In the actual version the context menu provides "Save" and "Close".
What about this possible context menu:
| Save |
| Close |
| Edit Mode > |-| x Read only |
------------- | Read / Write |
BTW: I've tested that function 'toggle-read-only' to put it in the=20
init.lisp-file, but the function is not available after restart.
Maybe I did something wrong...
And what is "lisp"? I thougt, the editor is written in Java???
BTW: There are - I think - thousands of functions implemented, but I don'=
want to have them all in my /dev/brain. There is not enough space left...
So, what about improvements to make that "usability" more easier?
Am 07/14/03 03:59 PM schrieb Peter Graves:
> On Mon, 14 Jul 2003 at 14:00:58 +0200, Berthold wrote:
>>Hi Peter, all,
>>again I want you to know about my needs and produce some traffic: ;-)
>>I would like to be able to set a file via mouse to read-only (for the=20
>>I think, it wouldn't be so hard to do. What do you think?
> You're right, it's not so hard to do.
> In principle, you should be able to do this:
> (defun toggle-read-only ()
> (setf (variable-value 'force-read-only :buffer (current-buffer))
> (not (variable-value 'force-read-only))))
> (global-map-key "whatever key you want here" 'toggle-read-only)
> And be done. (Except that I'm not sure exactly what you mean by "via
> mouse". But in principle, you should be able to put any command you
> want on any menu, so once you have the command, the rest should be
> There are, however, a couple of minor discrepancies between principle
> and reality in this case.
> Buffers do have, in effect, a field called force-read-only (or at least
> that's what it would be called that if it were exported to Lisp, which
> currently is not the case).
> And for your own private purposes, maybe all you need is for me to
> export this field, so that you could take the TOGGLE-READ-ONLY
> function provided above and put it in your init.lisp and be done.
> Unfortunately, the force-read-only flag is already used by j internally
> in a couple of situations that you might not care about (buffers
> displaying rendered HTML and Microsoft Word documents) to prevent the
> user from editing the buffer, even though the corresponding file might
> be writable on disk.
> You don't want to let TOGGLE-READ-ONLY make a Microsoft Word buffer
> become writable, so if you happen to make some change to the buffer, it
> gets subsequently written out as plain text (which is what j would do
> in that situation) and loses all of its formatting information (which
> arguably might not be such a great loss, but it would still be a rude
> thing to do).
> So before I export force-read-only to Lisp, I need to deal with this
> problem (and the analogous one involving rendered HTML). I haven't
> gotten around to doing this.
> (Of course it makes no difference at all whether you try to attack this
> problem in Lisp or in Java; the use of the force-read-only flag still
> needs to be refactored before it can safely be used for the purpose you
> have in mind.)
> I probably don't feel the same sense of urgency about this problem that
> you do, but if I'm going to work on it at all, I'd like to do it in
> what I think of as the "right" way, and use it as an opportunity to
> improve the code base as a whole, and not just write a quick hack that
> would solve your immediate personal problem but lead to further
> confusion in the code (or possibly even outright breakage of other
> This SF.Net email sponsored by: Parasoft
> Error proof Web apps, automate testing & more.
> Download & eval WebKing and get a free book.
> armedbear-j-devel mailing list