Tomasz Buchert <tomasz.buch...@inria.fr> writes:
>
> Would you be able to provide patches to both bugs you submitted?

I suggest the bits below, which in addition adds a verbiste-mode-hook in
the usual style, and which avoids "sh -c" since I think the
`verbiste-quote' bit might be inadequate for arbitrary strings.
(shell-quote-argument would be the ticket if sh -c was really wanted,
but direct args to start-process are easier).

I might have been tempted to rename the "defgroup Verbiste-Mode" to a
lower-case "defgroup verbiste-mode" rather than the "put" for
customize-mode, but perhaps there's a reason for it and "defgroup
Verbiste" named that way.


Attachment: 50verbiste-el.el
Description: application/emacs-lisp

--- verbiste.el.orig	2013-07-06 09:26:06.000000000 +1000
+++ verbiste.el	2013-07-11 08:49:38.000000000 +1000
@@ -102,6 +102,11 @@
   :type 'sexp
   :group 'Verbiste-Mode)
 
+(defcustom verbiste-mode-hook nil
+  "*Hook run by `verbiste-mode'."
+  :type  'hook
+  :group 'Verbiste-Mode)
+
 (defun verbiste-quote (word)
   "Quote WORD if necessary."
   (if verbiste-always-quote-terms
@@ -130,10 +135,12 @@
 	     (if deconj "Deconjugating" "Conjugating")
 	     word)
     (set-process-sentinel
-     (start-process "verbiste" buffer "sh" "-c"
-		    (format "%s %s"
-			    (if deconj "french-deconjugator" "french-conjugator -p")
-			    (verbiste-quote word)))
+     (apply 'start-process "verbiste" buffer
+            (append
+             (if deconj
+                 '("french-deconjugator")
+               '("french-conjugator" "--pronouns"))
+             (list word)))
      'verbiste-bgproc-sentinel)))
 
 (defun verbiste-bgproc-sentinel (process msg)
@@ -213,10 +220,22 @@
     result))
 
 (defun verbiste-mode()
-  (interactive)
+  "Major mode for Verbiste output.
+
+\\{verbiste-mode-keymap}"
+
   (use-local-map verbiste-mode-keymap)
   (setq mode-name "Verbiste")
-  (setq major-mode 'verbiste-mode))
+  (setq major-mode 'verbiste-mode)
+  (setq buffer-read-only t)
+
+  (if (eval-when-compile (fboundp 'run-mode-hooks))
+      (run-mode-hooks 'verbiste-mode-hook) ;; xemacs21,emacs22 up
+    (run-hooks 'verbiste-mode-hook)))
+
+;; for `M-x customize-mode' in a verbiste-mode buffer, because the group is
+;; not called lower-case `verbiste-mode'
+(put 'verbiste-mode 'custom-mode-group 'Verbiste-Mode)
 
 (defun verbiste-update-key-bindings ()
   "Update verbiste key bindings."

Reply via email to