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: Bruno Haible
Subject: Re: Bug#287261: gettext-el: bad interaction with view-read-only (fwd)
Date: Fri, 14 Jan 2005 13:39:59 +0100
User-agent: KMail/1.5

Kalle Olavi Niemitalo wrote:
> I have customized `view-read-only' to t, which generally results 
> in useful behavior.  Now however, when I visit a *.po file, 
> `after-find-file' calls `normal-mode', which calls `po-mode', 
> which sets `buffer-read-only' to t, and `after-find-file' then 
> enables View mode, which shadows the key bindings of PO mode: for 
> example, RET scrolls the buffer rather than opens a translation 
> for editing.  I then have to explicitly disable View mode before 
> I can edit the translations.
> 
> I believe the right way to solve the problem is to add this form 
> somewhere near (defun po-mode ...) in po-mode.el:
> 
>   (put 'po-mode 'mode-class 'special)

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>". This is not a rewarding
user experience. (*)

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

> According to the Emacs Lisp 
> Reference Manual, the setting will also affect two other aspects 
> of PO mode:
> ...
> - Items specific to editing will not appear in the tool bar in PO 
> mode.

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 think the 'mode-class 'special is meant to be used for buffers that are
not backed by a file. This is indicated by
  1) The list of actions that depend on it in tool-bar.el,
  2) The list of modes which use 'mode-class 'special:
     calendar, debug, shell, gnus, mail, games, sql modes.
But PO mode is used on buffers that are backed by a file, therefore I
don't think it makes sense to declare it as 'special.

And, after all, by setting view-read-only to t, you have asked for *not*
being able to edit files. Why do you complain then that pressing RET in
PO mode doesn't let you edit a message?! It would be ok to complain about
the navigation commands of PO mode, though.

             Bruno





reply via email to

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