Re: [bug-gettext] Problem with gettext emacs support

2017-04-19 Thread Bruno Haible
Peter Hull wrote:
> Might have something here.
> In po-preset-string-functions (in po-mode.el) there is the following:
>   (let ((pair (cond ...
>  ...
> ((member mode-name '("C" "C++"))
>  '(po-find-c-string . po-mark-c-string))
> ...
> When my emacs loads C code, electric mode is enabled and therefore the
> mode name is 'C/l', not 'C'. Therefore, po-preset-string-functions
> does not select the correct po-find-... and po-mark-... functions.

Thanks for the insights. I've registered the bug at


Bruno




[bug-gettext] [bug #50830] PO mode does not find any translatable strings when electric-mode is enabled

2017-04-19 Thread Bruno Haible
Update of bug #50830 (project gettext):

Severity:  3 - Normal => 4 - Important  
  Status:   Confirmed => Fixed  
 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

Fixed through
http://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=99c9002cb1fb89189ca21b98ee74091d67122a58

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




Re: [bug-gettext] [bug #50830] PO mode does not find any translatable strings when electric-mode is enabled

2017-04-19 Thread Peter Hull
On Wed, Apr 19, 2017 at 10:27 AM, Bruno Haible  wrote:
> URL:
>   
>
>  Summary: PO mode does not find any translatable strings when
> electric-mode is enabled
Thanks, Bruno.
The following change fixes it for me (sorry, was not able to attach it
to the bug report) - hopefully will be useful.

--- /usr/share/emacs/site-lisp/gettext/po-mode.el2016-02-10
12:13:03.0 +
+++ po-mode.el2017-04-19 10:38:36.413602789 +0100
@@ -2931,7 +2931,8 @@
 These variables are locally set in source buffer only when not already bound."
   (let ((pair (cond ((string-equal mode-name "AWK")
  '(po-find-awk-string . po-mark-awk-string))
-((member mode-name '("C" "C++"))
+((let ((major-only (car (split-string mode-name "/"
+   (member major-only '("C" "C++")))
  '(po-find-c-string . po-mark-c-string))
 ((string-equal mode-name "Emacs-Lisp")
  '(po-find-emacs-lisp-string . po-mark-emacs-lisp-string))



[bug-gettext] [bug #50830] PO mode does not find any translatable strings when electric-mode is enabled

2017-04-19 Thread Bruno Haible
URL:
  

 Summary: PO mode does not find any translatable strings when
electric-mode is enabled
 Project: GNU gettext
Submitted by: haible
Submitted on: Wed 19 Apr 2017 11:27:33 AM CEST
Category: PO mode
Severity: 3 - Normal
  Item Group: None
  Status: Confirmed
 Privacy: Public
 Assigned to: haible
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

Reported by Peter Hull in
https://lists.gnu.org/archive/html/bug-gettext/2017-04/msg0.html :
No translatable strings are found if on the C file buffer, electric mode is
enabled. This setting has the effect that a "/l" suffix gets appended to the
variable 'mode-name', see
https://www.gnu.org/software/emacs/manual/html_node/ccmode/Minor-Modes.html
https://www.gnu.org/software/emacs/manual/html_node/emacs/Electric-C.html





___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




Re: [bug-gettext] Problem with gettext emacs support

2017-04-19 Thread Peter Hull
Might have something here.
In po-preset-string-functions (in po-mode.el) there is the following:
  (let ((pair (cond ...
 ...
((member mode-name '("C" "C++"))
 '(po-find-c-string . po-mark-c-string))
...
When my emacs loads C code, electric mode is enabled and therefore the
mode name is 'C/l', not 'C'. Therefore, po-preset-string-functions
does not select the correct po-find-... and po-mark-... functions.

What do you think?

I will investigate further.

Pete