Re: [Evolution-hackers] Preformat by default



On Sat, 2018-04-07 at 23:03 +0200, Marek Howard wrote:
I'd like to change Evolution composer in plain text to use Preformat
block format by default. Below you can see what I did but the default
block format is still set to Normal/Paragraph in new messages.

        Hi,
it's because you changed the variables, but not the HTML structure,
which these variables modify. You can verify what the message structure
is when you press Ctrl+Shift+I when the composer body is focused, which
  will open a WebKit inspector (you might have
org.gnome.evolution.shell webkit-developer-mode set to true). I recall
something about an issue with cursor positioning around HTML tags, thus
even if the structure will be fine, the cursor can be slightly off the
proper place. In any case, I'd try to call the method of the
EContentEditor, which in this case is not to do this:
-               ACTION (STYLE_NORMAL), "current-value",
+               ACTION (STYLE_PRE), "current-value",
but do rather this:
   e_content_editor_set_block_format (cnt_editor,
       E_CONTENT_EDITOR_BLOCK_FORMAT_PRE);

I'm not that used to mailing list etiquette. Is the way I attached
the patch proper?

I think it depends on the community. While some communities prefer
patches inline, it's not the case of this mailing list (you know, you
didn't attach it by any means). But as long as you do not want to
upstream the change it doesn't matter.

By the way, you would be able to do this as a module, without touching
evolution code at all. You can use the example module as a starter:
https://wiki.gnome.org/Apps/Evolution/Extensions#Example_Module
only its MMsgComposerExtension, and change the code to your liking,
would be the end of the m_msg_composer_extension_constructed()
function, definitely after the call to parent's constructed() method.
The advantage is that you won't touch evolution code, thus you'd be
able to use stock evolution, only rebuild your module from time to time
(supposing you have write access to the module directory).

        Bye,
        Milan


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