correcteur d'orthographe

2014-10-14 Par sujet Abdelkader Belahcene
Bonjour,

Dans les versions précédantes, je pense 1.x, il n y avais pas de probleme
de correcteur,
j'installais aspell et c'etait bon.
Maintenant , tout de suite je suis sur 2.1,  j ai installé ( je suis sur
debian et ubuntu)   aspell ( aspell-fr), ispell, hunspell,   la boite
correcteur reste desactivée, grisée ,
dans les preferences du correcteur, rien n'apparait pour faire le choix du
correcteur( ni aspell, ..).

merci pour l'aide


Re: correcteur d'orthographe

2014-10-14 Par sujet Jean-Pierre
Même après reconfiguration ?
Ici, pas de problème avec Wheezy/hunspell

-- 
Jean-Pierre

Le 14 octobre 2014 08:41:01 UTC+02:00, Abdelkader Belahcene 
abelahc...@gmail.com a écrit :
Bonjour,

Dans les versions précédantes, je pense 1.x, il n y avais pas de
probleme
de correcteur,
j'installais aspell et c'etait bon.
Maintenant , tout de suite je suis sur 2.1,  j ai installé ( je suis
sur
debian et ubuntu)   aspell ( aspell-fr), ispell, hunspell,   la boite
correcteur reste desactivée, grisée ,
dans les preferences du correcteur, rien n'apparait pour faire le choix
du
correcteur( ni aspell, ..).

merci pour l'aide

-- 
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.

Re: Statistiques

2014-10-14 Par sujet Jean-Pierre Chrétien

Le 14/10/2014 16:23, Jean-Marc Lasgouttes a écrit :



Moyennant ces petits changements, je pense que ce patch est prêt.


Bravo à tous !
Ces échanges de mail donnent envie de se mettre au codage...

--
Jean-Pierre




Re: Statistiques

2014-10-14 Par sujet Jean-Marc Lasgouttes

Le 14/10/2014 16:34, Jean-Pierre Chrétien a écrit :

Le 14/10/2014 16:23, Jean-Marc Lasgouttes a écrit :



Moyennant ces petits changements, je pense que ce patch est prêt.


Bravo à tous !
Ces échanges de mail donnent envie de se mettre au codage...


C'est le but :)

JMarc



Re: Statistiques

2014-10-14 Par sujet Stéphane Mourey

Bonsoir,

Le 14/10/2014 16:23, Jean-Marc Lasgouttes a écrit :

Moyennant ces petits changements, je pense que ce patch est prêt.
Voilà, j'ai corrigé tout ça. J'espère que la documentation dans 
LyXAction.cpp te conviendra, c'est le seul point sur lequel j'avais 
encore un doute


Cordialement,

Stéphane Mourey

--
Blog: Impossible Exil http://impossible-exil.info
From 17b6ebf2820746bad71a3246d90be5b33a0fd527 Mon Sep 17 00:00:00 2001
From: brokenclock stephane.mou...@impossible-exil.info
Date: Tue, 14 Oct 2014 21:55:04 +0200
Subject: [PATCH] Add LFUN_SERVER_GET_STATISTICS command

This function can be used with the LyX server to obtain the word, characters or characters+spaces count in the current document or selection.
---
 src/FuncCode.h|  1 +
 src/LyXAction.cpp | 17 +
 src/Text3.cpp | 28 
 3 files changed, 46 insertions(+)

diff --git a/src/FuncCode.h b/src/FuncCode.h
index 2ae820a..3bd0cd0 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -458,6 +458,7 @@ enum FuncCode
 	// 355
 	LFUN_SPELLING_CONTINUOUSLY, // vfr, 20130324
 	LFUN_SEPARATOR_INSERT,  // ef 20140502
+	LFUN_SERVER_GET_STATISTICS, // brokenclock 20141010
 	LFUN_LASTACTION // end of the table
 };
 
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 175f68e..2df6ec9 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -3526,6 +3526,23 @@ void LyXAction::init()
  */
 		{ LFUN_STATISTICS, statistics, ReadOnly, System },
 /*!
+ * \var lyx::FuncCode lyx::LFUN_SERVER_GET_STATISTICS
+ * \li Action: Count the statistics (number of words and characters)
+   in the document or in the selection if any.
+ * \li Notion: Note that this function gives the number of words/chars written,
+   not the number of characters which will be typeset.
+ * \li Syntax: server-get-statistics [TYPE]
+ * \li Params: TYPE: words|chars|chars-space The needed count. If not
+   specified, the words, chars and chars-space counts.
+   space separated.
+   words: count words
+   chars: count characters
+   chars-space: count characters and spaces
+ * \li Origin: brokenclock, Oct 10 2014
+ * \endvar
+ */
+		{ LFUN_SERVER_GET_STATISTICS, server-get-statistics, ReadOnly | Argument, System },
+/*!
  * \var lyx::FuncCode lyx::LFUN_COMPLETION_INLINE
  * \li Action: Show the inline completion at the cursor position.
  * \li Syntax: completion-inline
diff --git a/src/Text3.cpp b/src/Text3.cpp
index 79711f4..6bf3bc6 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -2391,6 +2391,33 @@ void Text::dispatch(Cursor  cur, FuncRequest  cmd)
 		needsUpdate = true;
 		break;
 
+	case LFUN_SERVER_GET_STATISTICS:
+		{
+			DocIterator from, to;
+			if (cur.selection()) {
+from = cur.selectionBegin();
+to = cur.selectionEnd();
+			} else {
+from = doc_iterator_begin(cur.buffer());
+to = doc_iterator_end(cur.buffer());
+			}
+
+			cur.buffer()-updateStatistics(from, to);
+			string const arg0 = cmd.getArg(0);
+			if (arg0 == words) {
+cur.message(convertdocstring(cur.buffer()-wordCount()));
+			} else if (arg0 == chars) {
+cur.message(convertdocstring(cur.buffer()-charCount(false)));
+			} else if (arg0 == chars-space) {
+cur.message(convertdocstring(cur.buffer()-charCount(true)));
+			} else {
+cur.message(convertdocstring(cur.buffer()-wordCount()) +  
++ convertdocstring(cur.buffer()-charCount(false)) +  
++ convertdocstring(cur.buffer()-charCount(true)));
+			}
+		}
+		break;
+
 	default:
 		LYXERR(Debug::ACTION, Command   cmd   not DISPATCHED by Text);
 		cur.undispatched();
@@ -3109,6 +3136,7 @@ bool Text::getStatus(Cursor  cur, FuncRequest const  cmd,
 	case LFUN_UNICODE_INSERT:
 	case LFUN_THESAURUS_ENTRY:
 	case LFUN_ESCAPE:
+	case LFUN_SERVER_GET_STATISTICS:
 		// these are handled in our dispatch()
 		enable = true;
 		break;
-- 
1.9.1



correcteur d'orthographe

2014-10-14 Par sujet Abdelkader Belahcene
Bonjour,

Dans les versions précédantes, je pense 1.x, il n y avais pas de probleme
de correcteur,
j'installais aspell et c'etait bon.
Maintenant , tout de suite je suis sur 2.1,  j ai installé ( je suis sur
debian et ubuntu)   aspell ( aspell-fr), ispell, hunspell,   la boite
correcteur reste desactivée, grisée ,
dans les preferences du correcteur, rien n'apparait pour faire le choix du
correcteur( ni aspell, ..).

merci pour l'aide


Re: correcteur d'orthographe

2014-10-14 Par sujet Jean-Pierre
Même après reconfiguration ?
Ici, pas de problème avec Wheezy/hunspell

-- 
Jean-Pierre

Le 14 octobre 2014 08:41:01 UTC+02:00, Abdelkader Belahcene 
 a écrit :
>Bonjour,
>
>Dans les versions précédantes, je pense 1.x, il n y avais pas de
>probleme
>de correcteur,
>j'installais aspell et c'etait bon.
>Maintenant , tout de suite je suis sur 2.1,  j ai installé ( je suis
>sur
>debian et ubuntu)   aspell ( aspell-fr), ispell, hunspell,   la boite
>correcteur reste desactivée, grisée ,
>dans les preferences du correcteur, rien n'apparait pour faire le choix
>du
>correcteur( ni aspell, ..).
>
>merci pour l'aide

-- 
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.

Re: Statistiques

2014-10-14 Par sujet Jean-Pierre Chrétien

Le 14/10/2014 16:23, Jean-Marc Lasgouttes a écrit :



Moyennant ces petits changements, je pense que ce patch est prêt.


Bravo à tous !
Ces échanges de mail donnent envie de se mettre au codage...

--
Jean-Pierre




Re: Statistiques

2014-10-14 Par sujet Jean-Marc Lasgouttes

Le 14/10/2014 16:34, Jean-Pierre Chrétien a écrit :

Le 14/10/2014 16:23, Jean-Marc Lasgouttes a écrit :



Moyennant ces petits changements, je pense que ce patch est prêt.


Bravo à tous !
Ces échanges de mail donnent envie de se mettre au codage...


C'est le but :)

JMarc



Re: Statistiques

2014-10-14 Par sujet Stéphane Mourey

Bonsoir,

Le 14/10/2014 16:23, Jean-Marc Lasgouttes a écrit :

Moyennant ces petits changements, je pense que ce patch est prêt.
Voilà, j'ai corrigé tout ça. J'espère que la documentation dans 
LyXAction.cpp te conviendra, c'est le seul point sur lequel j'avais 
encore un doute


Cordialement,

Stéphane Mourey

--
Blog: Impossible Exil 
>From 17b6ebf2820746bad71a3246d90be5b33a0fd527 Mon Sep 17 00:00:00 2001
From: brokenclock 
Date: Tue, 14 Oct 2014 21:55:04 +0200
Subject: [PATCH] Add LFUN_SERVER_GET_STATISTICS command

This function can be used with the LyX server to obtain the word, characters or characters+spaces count in the current document or selection.
---
 src/FuncCode.h|  1 +
 src/LyXAction.cpp | 17 +
 src/Text3.cpp | 28 
 3 files changed, 46 insertions(+)

diff --git a/src/FuncCode.h b/src/FuncCode.h
index 2ae820a..3bd0cd0 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -458,6 +458,7 @@ enum FuncCode
 	// 355
 	LFUN_SPELLING_CONTINUOUSLY, // vfr, 20130324
 	LFUN_SEPARATOR_INSERT,  // ef 20140502
+	LFUN_SERVER_GET_STATISTICS, // brokenclock 20141010
 	LFUN_LASTACTION // end of the table
 };
 
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 175f68e..2df6ec9 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -3526,6 +3526,23 @@ void LyXAction::init()
  */
 		{ LFUN_STATISTICS, "statistics", ReadOnly, System },
 /*!
+ * \var lyx::FuncCode lyx::LFUN_SERVER_GET_STATISTICS
+ * \li Action: Count the statistics (number of words and characters)
+   in the document or in the selection if any.
+ * \li Notion: Note that this function gives the number of words/chars written,
+   not the number of characters which will be typeset.
+ * \li Syntax: server-get-statistics []
+ * \li Params: :  The needed count. If not
+   specified, the words, chars and chars-space counts.
+   space separated.
+   words: count words
+   chars: count characters
+   chars-space: count characters and spaces
+ * \li Origin: brokenclock, Oct 10 2014
+ * \endvar
+ */
+		{ LFUN_SERVER_GET_STATISTICS, "server-get-statistics", ReadOnly | Argument, System },
+/*!
  * \var lyx::FuncCode lyx::LFUN_COMPLETION_INLINE
  * \li Action: Show the inline completion at the cursor position.
  * \li Syntax: completion-inline
diff --git a/src/Text3.cpp b/src/Text3.cpp
index 79711f4..6bf3bc6 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -2391,6 +2391,33 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 		needsUpdate = true;
 		break;
 
+	case LFUN_SERVER_GET_STATISTICS:
+		{
+			DocIterator from, to;
+			if (cur.selection()) {
+from = cur.selectionBegin();
+to = cur.selectionEnd();
+			} else {
+from = doc_iterator_begin(cur.buffer());
+to = doc_iterator_end(cur.buffer());
+			}
+
+			cur.buffer()->updateStatistics(from, to);
+			string const arg0 = cmd.getArg(0);
+			if (arg0 == "words") {
+cur.message(convert(cur.buffer()->wordCount()));
+			} else if (arg0 == "chars") {
+cur.message(convert(cur.buffer()->charCount(false)));
+			} else if (arg0 == "chars-space") {
+cur.message(convert(cur.buffer()->charCount(true)));
+			} else {
+cur.message(convert(cur.buffer()->wordCount()) + " "
++ convert(cur.buffer()->charCount(false)) + " "
++ convert(cur.buffer()->charCount(true)));
+			}
+		}
+		break;
+
 	default:
 		LYXERR(Debug::ACTION, "Command " << cmd << " not DISPATCHED by Text");
 		cur.undispatched();
@@ -3109,6 +3136,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
 	case LFUN_UNICODE_INSERT:
 	case LFUN_THESAURUS_ENTRY:
 	case LFUN_ESCAPE:
+	case LFUN_SERVER_GET_STATISTICS:
 		// these are handled in our dispatch()
 		enable = true;
 		break;
-- 
1.9.1