bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#287261: gettext-el: bad interaction with view-read-only (fwd)


From: Kalle Olavi Niemitalo
Subject: Re: Bug#287261: gettext-el: bad interaction with view-read-only (fwd)
Date: Sat, 15 Jan 2005 13:59:01 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Bruno Haible <address@hidden> writes:

> When you do this, and the user presses RET, she can enter a translation
> for the particular message, but when she presses Ctrl-C Ctrl-C to
> complete the translation, the translation is thrown away and the status
> line says "Buffer is read-only: #<buffer ...po>".

There are the following cases:

(1) Writable file, (setq view-read-only nil)
    Current behaviour:
      The buffer is read-only and in PO mode, not in View mode.
      RET pops up another buffer for editing an msgstr.
        That buffer is modifiable and in Fundamental mode, not View mode.
        C-c C-c in that buffer saves the msgstr.
    With (put 'po-mode 'mode-class 'special):
      No change.
    Preferred behaviour: Current.

(2) Writable file, (setq view-read-only t)
    Current behaviour:
      The buffer is read-only and in PO and View modes.
      RET scrolls the window.
      M-x po-edit-msgstr pops up another buffer for editing an msgstr.
        That buffer is modifiable and in Fundamental mode, not View mode.
        C-c C-c in that buffer saves the msgstr.
      q quits View mode but does not make the buffer modifiable.
        Then, RET pops up another buffer for editing an msgstr.
          That buffer is modifiable and in Fundamental mode, not View mode.
          C-c C-c in that buffer saves the msgstr.
    With (put 'po-mode 'mode-class 'special):
      The buffer is read-only and in PO mode, not in View mode.
      RET pops up another buffer for editing an msgstr.
        That buffer is modifiable and in Fundamental mode, not View mode.
        C-c C-c in that buffer saves the msgstr.
    Preferred behaviour: The latter.

(3) Read-only file, (setq view-read-only nil)
    Current behaviour:
      The buffer is read-only and in PO mode, not in View mode.
      RET pops up another buffer for editing an msgstr.
        That buffer is modifiable and in Fundamental, not View mode.
        C-c C-c in that buffer signals a buffer-read-only error, if the
        msgstr has been modified.
    With (put 'po-mode 'mode-class 'special):
      No change.
    Preferred behaviour:
      The buffer is read-only and in PO mode, not in View mode.
      RET pops up another buffer for viewing an msgstr.
        That buffer is read-only and in Fundamental mode, not View mode.
        C-c C-c in that buffer signals a buffer-read-only error, if the
        msgstr has been modified.

(4) Read-only file, (setq view-read-only t)
    Current behaviour:
      The buffer is read-only and in PO and View modes.
      RET scrolls the window.
      M-x po-edit-msgstr pops up another buffer for editing an msgstr.
        That buffer is modifiable and in Fundamental, not View mode.
        C-c C-c in that buffer signals a buffer-read-only error, if the
        msgstr has been modified.
      q quits View mode but does not make the buffer modifiable.
        Then, RET pops up another buffer for editing an msgstr.
          That buffer is modifiable and in Fundamental, not View mode.
          C-c C-c in that buffer signals a buffer-read-only error, if the
          msgstr has been modified.
    With (put 'po-mode 'mode-class 'special):
      The buffer is read-only and in PO mode, not in View mode.
      RET pops up another buffer for editing an msgstr.
        That buffer is modifiable and in Fundamental, not View mode.
        C-c C-c in that buffer signals a buffer-read-only error, if the
        msgstr has been modified.
    Preferred behaviour:
      The buffer is read-only and in PO and View modes.
      RET scrolls the window.
      M-x po-edit-msgstr pops up another buffer for viewing an msgstr.
        That buffer is read-only and in Fundamental and View modes.
        C-c C-c in that buffer signals a buffer-read-only error, if the
        msgstr has been modified.
      q quits View mode but does not make the buffer modifiable.
        Then, RET pops up another buffer for viewing an msgstr.
          That buffer is read-only and in Fundamental and View modes.
          C-c C-c in that buffer signals a buffer-read-only error, if the
          msgstr has been modified.

Thus, (put 'po-mode 'mode-class 'special) does not introduce any new
buffer-read-only errors.

Do you agree with what I consider the preferred behaviour in each case?

> This is not a rewarding user experience. (*)

What is the (*) for?

> So, even with your patch, the user has to disable View mode / read-only
> mode before she can really use the PO mode.

I don't quite understand what you mean here.  Marking the mode as
special avoids View mode entirely in case (2), although also in case
(4) where it should be retained.  In cases (3) and (4), where the
file itself is read-only, I think it is appropriate to prevent editing
via po-mode commands.

> When you look in tool-bar.el, these are the items "save", "saveas",
> "undo", "cut", "paste". I don't think it's a good idea to remove "save"
> and "undo" actions from PO mode.

I didn't notice those, because I don't use the tool bar myself.
However, is that undo or po-undo?

> And, after all, by setting view-read-only to t, you have asked for *not*
> being able to edit files.

No, I have only asked to make it easier to browse files that I
would not be able to edit anyway.

> Why do you complain then that pressing RET in
> PO mode doesn't let you edit a message?!

Because of case (2).  PO mode makes the buffer read-only in order
to discourage me from editing it except by using PO mode commands,
but View mode then shadows (the most common of) those commands as well.

I am beginning to think PO mode should not make the buffer
read-only at all, if it conflicts this badly with how the rest
of the Emacs environment treats that flag.  It could instead call
po-compute-counters from after-change-functions or post-command-hook.

Attachment: pgpGLZMVMu5hl.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]