FEATURE REQUEST: Automatic pair completition for German quotes

Bug #716189 reported by dauerflucher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scribes
Fix Released
Wishlist
Mystilleef

Bug Description

Version:
==========
Scribes version 0.4-dev-build849 on Ubuntu 10.04 Lucid Lynx

Issue:
==========
Scribes currently features automatic pair completition for most quotation marks except German ones which are are also used in several languages of the Balkans ( http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks ).

Refering to numbers English quotation marks opens with “ looking like a 66 and closes with ” looking like a 99. Single marks accordingly with ‘ looking like a 6 and ’ looking like a 9.

The German counterpart opens with „ looking like a 99 and closes with “ looking like a 66. Single marks with ‚ looking like a 9 and ‘ looking like a 6. Except of the fact the opening character is on the bottom of the line the opening and closing characters are vice versa compared to the English variant.

The problem now is when using Scribes for e.g. writing textes with some markup language like reStructruredText the German closing character is the same as the English open character. Means, pair completition for English quotation marks is always invoked when trying to close a German quotation.

I guess on most common Linux systems xmodmap refers those characters to [Alt Gr] + ([Shift] (for single quotes)) + [v] (German opening), [b] (German closing, English opening) and [n] (English closing). It would be very, very nice if automatic pair completition is implemented for the German opening character as well so you get a „“ when pressing [Alt Gr] + [v] resp. ‚‘ when pressing [Alt Gr] + [Shift] + [v].

Remaining problem here would be an implementation of hungarian quotation marks because they use German opening and English closing character, but such exceptions could be solved by allowing to disable the automatic pair completition manually by the user. Which might be as well very helpful when writing wiki entries or board/blog posts locally with a syntax containing other characters effected by this auto completition.

This is my first entry to your bug list so i will of course drop a line to tell you how much i appreciate your efforts. Scribes is a really great editor. My default one for now and hopefully still in remote future.

Thanks,
Andreas Lis

summary: - Automatic pair completition for German quotes
+ FEATURE REQUEST: Automatic pair completition for German quotes
description: updated
description: updated
description: updated
Revision history for this message
dauerflucher (dauerflucher) wrote :

Well, i had a brief look in GenericPlugins/BracketCompletion/Manager.py and correct me if i'm wrong...

Somewhere between lines 4-23 add:

KEYSYMS = {
        ...
 keysyms.singlelowquotemark : keysyms.leftsinglequotemark,
 keysyms.doublelowquotemark : keysyms.leftdoublequotemark,
}

And somewhere between lines 41-49 add:

self.__open_pair_characters = [..., keysyms.singlelowquotemark, keysyms.doublelowquotemark]

Revision history for this message
dauerflucher (dauerflucher) wrote :

Path submitted as attachment... just to spare you some work if you like to implement it.

Revision history for this message
dauerflucher (dauerflucher) wrote :

--- Last comment
+++ New comment

- Path submitted as attachment... just to spare you some work if you like to implement it.
+ Patch submitted as attachment... just to save you some work if you like to implement it.

Revision history for this message
Mystilleef (mystilleef) wrote :

Wow thank you! I'll have a look at it.

Changed in scribes:
assignee: nobody → Mystilleef (mystilleef)
status: New → In Progress
importance: Undecided → Wishlist
Revision history for this message
Mystilleef (mystilleef) wrote :

The patch looks good. For some reason I can't simulate German keyboard layout. I'm applying the patch without testing. So you have to do the testing.

Mystilleef (mystilleef)
Changed in scribes:
status: In Progress → Fix Committed
Revision history for this message
dauerflucher (dauerflucher) wrote :

I modified the source code of Scribes version 0.4-dev-build849 already this afternoon before submitting and afterwards continued work on a german documentation for some hours without any problems. I guess that's it, especially because your code for pair completition is very simple while very functional and even me could figure out how to add this tiny feature extension. And let me tell you, programming of any kind is not my business.

Anyways, thanks for pushing this fix topically. I will report back if something weird happens although I am very confident.

Recent bzr version 0.4-dev-build852 works as expected concerning this feature too.

Mystilleef (mystilleef)
Changed in scribes:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.