Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Cursoring in an article : want to add a hook.
@ 2008-03-03 15:43 Richard G Riley
  2008-03-03 18:39 ` Tassilo Horn
       [not found] ` <mailman.8245.1204569624.18990.info-gnus-english@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Richard G Riley @ 2008-03-03 15:43 UTC (permalink / raw)
  To: info-gnus-english


Could someone suggest how I might add a hook which is called when I
cursor around in a Gnus article buffer? I wish to add call to some
rdictcc stuff which I have done successfully in w3m, but dont see an
equivalent for 'w3m-after-cursor-move-hook for normal article buffers.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
  2008-03-03 15:43 Cursoring in an article : want to add a hook Richard G Riley
@ 2008-03-03 18:39 ` Tassilo Horn
       [not found] ` <mailman.8245.1204569624.18990.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-03 18:39 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

> Could someone suggest how I might add a hook which is called when I
> cursor around in a Gnus article buffer?

I don't know one.

> I wish to add call to some rdictcc stuff which I have done
> successfully in w3m, but dont see an equivalent for
> 'w3m-after-cursor-move-hook for normal article buffers.

You could create wrapper functions that call rdictcc followed by the
movement command and bind them in gnus-article-mode-map.

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
       [not found] ` <mailman.8245.1204569624.18990.info-gnus-english@gnu.org>
@ 2008-03-04  1:09   ` Richard G Riley
  2008-03-04  9:05     ` Tassilo Horn
       [not found]     ` <mailman.8274.1204621575.18990.info-gnus-english@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Richard G Riley @ 2008-03-04  1:09 UTC (permalink / raw)
  To: info-gnus-english

Tassilo Horn <tassilo@member.fsf.org> writes:

> Richard G Riley <rileyrgdev@gmail.com> writes:
>
> Hi Richard,
>
>> Could someone suggest how I might add a hook which is called when I
>> cursor around in a Gnus article buffer?
>
> I don't know one.
>
>> I wish to add call to some rdictcc stuff which I have done
>> successfully in w3m, but dont see an equivalent for
>> 'w3m-after-cursor-move-hook for normal article buffers.
>
> You could create wrapper functions that call rdictcc followed by the
> movement command and bind them in gnus-article-mode-map.
>
> Bye,
> Tassilo

I did this and it works well enough. I now have an auto updated rdictcc
buffer when scrolling around in w3m or article buffers. Thanks for your
help. Maybe some sort of timer would be nice so it only updates the
rdictcc buffer after resting on the same word for a while - but that is
a little beyond my current experience at the moment. Another nice
addition might be to be able to set the rdictcc window height so its
always a fixed height at the bottom of the frame.

You can toggle the rdictcc auto update using f5-o in the code below.

==

(setq show-translations nil)

(defun mytranslate()
  (interactive)
;  (save-window-excursion
  (message "myt")
  (save-selected-window
    (let ((word (rdictcc-current-word)))
      (when (and word show-translations)
	(rdictcc-translate-word word)
	)
      )
    )
  )

(add-hook 'w3m-after-cursor-move-hook 'mytranslate)

(global-set-key (kbd "<f5> T") 'mytranslate)
(global-set-key (kbd "<f5> o") (lambda()(interactive)(setq show-translations (not show-translations))))

(define-key gnus-article-mode-map [right] (lambda () (interactive)(mytranslate)(forward-char)))
(define-key gnus-article-mode-map [left] (lambda () (interactive)(mytranslate)(backward-char)))
(define-key gnus-article-mode-map [up] (lambda () (interactive)(mytranslate)(previous-line)))
(define-key gnus-article-mode-map [down] (lambda () (interactive)(mytranslate)(next-line)))

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
  2008-03-04  1:09   ` Richard G Riley
@ 2008-03-04  9:05     ` Tassilo Horn
       [not found]     ` <mailman.8274.1204621575.18990.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-04  9:05 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

> I did this and it works well enough. I now have an auto updated
> rdictcc buffer when scrolling around in w3m or article buffers. Thanks
> for your help. Maybe some sort of timer would be nice so it only
> updates the rdictcc buffer after resting on the same word for a while
> - but that is a little beyond my current experience at the
> moment.

I'd suggest to save the current word in a global variable (`defvar') and
only update the translation if the current word is not nil and not
string= with the saved word.  When that's the case, do the translation
and save the current word in the global variable.

> Another nice addition might be to be able to set the rdictcc window
> height so its always a fixed height at the bottom of the frame.

I normally don't need that, because I use Emacs fullscreen and use this
in my ~/.emacs.

--8<---------------cut here---------------start------------->8---
(defun th-split-window (window)
  "Split WINDOW either horizontally or vertically.

If the WINDOW is wide enough, then split horizontally, else
vertically."
  (if (>= (window-width window) 150)
      (split-window window nil t)
    (split-window window)))

(setq split-window-preferred-function 'th-split-window)
--8<---------------cut here---------------end--------------->8---

So new windows will be created beside (and not below) the current one if
the current window has more than 150 columns.

The variable `split-window-preferred-function' is pretty new, so it's
possible that it won't work for you unless you use emacs 23.

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
       [not found]     ` <mailman.8274.1204621575.18990.info-gnus-english@gnu.org>
@ 2008-03-04 13:54       ` Richard G Riley
  2008-03-04 16:49         ` Tassilo Horn
                           ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Richard G Riley @ 2008-03-04 13:54 UTC (permalink / raw)
  To: info-gnus-english

Tassilo Horn <tassilo@member.fsf.org> writes:

> Richard G Riley <rileyrgdev@gmail.com> writes:
>
> Hi Richard,
>
>> I did this and it works well enough. I now have an auto updated
>> rdictcc buffer when scrolling around in w3m or article buffers. Thanks
>> for your help. Maybe some sort of timer would be nice so it only
>> updates the rdictcc buffer after resting on the same word for a while
>> - but that is a little beyond my current experience at the
>> moment.
>
> I'd suggest to save the current word in a global variable (`defvar') and
> only update the translation if the current word is not nil and not
> string= with the saved word.  When that's the case, do the translation
> and save the current word in the global variable.

Works well. I'd already done this last night actually but used setq. Is
this bad?

,----
| 
| (setq rdictcc-rgr-show-translations nil)
| (setq rdictcc-rgr-last-word nil)
| 
| (defun rdictcc-rgr-translate()
|   (interactive)
| ;  (save-window-excursion
|   (message "myt")
|   (save-selected-window
|     (let ((word (rdictcc-current-word)))
|       (when (and word rdictcc-rgr-show-translations (not(eq word rdictcc-rgr-last-word)))
| 	(rdictcc-translate-word word)
| 	)
|       (setq rdictcc-rgr-last-word word)
|       )
|     )
|   )
| 
| (add-hook 'w3m-after-cursor-move-hook 'rdictcc-rgr-translate)
| 
| (define-key gnus-article-mode-map [right] (lambda () (interactive)(rdictcc-rgr-translate)(forward-char)))
| (define-key gnus-article-mode-map [left] (lambda () (interactive)(rdictcc-rgr-translate)(backward-char)))
| (define-key gnus-article-mode-map [up] (lambda () (interactive)(rdictcc-rgr-translate)(previous-line)))
| (define-key gnus-article-mode-map [down] (lambda () (interactive)(rdictcc-rgr-translate)(next-line)))
| 
| (global-set-key (kbd "<f5> T") 'rdictcc-rgr-translate)
| (global-set-key (kbd "<f5> o") (lambda()(interactive)(setq rdictcc-rgr-show-translations (not rdictcc-rgr-show-translations))))
`----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
  2008-03-04 13:54       ` Richard G Riley
@ 2008-03-04 16:49         ` Tassilo Horn
  2008-03-04 16:57         ` Richard G Riley
       [not found]         ` <mailman.8291.1204649408.18990.info-gnus-english@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-04 16:49 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

> Works well. I'd already done this last night actually but used
> setq. Is this bad?

Not really.  You will get compiler warnings when trying to byte-compile
it and it's not a clean style.

| (defun rdictcc-rgr-translate()
|   (interactive)
| ;  (save-window-excursion
|   (message "myt")
|   (save-selected-window
|     (let ((word (rdictcc-current-word)))
|       (when (and word rdictcc-rgr-show-translations (not(eq word rdictcc-rgr-last-word)))
| 	(rdictcc-translate-word word)
| 	)
|       (setq rdictcc-rgr-last-word word)
|       )
|     )
|   )

I've "corrected" it to this:

--8<---------------cut here---------------start------------->8---
(defun rdictcc-rgr-translate()
  (interactive)
  (save-selected-window
    (let ((word (rdictcc-current-word)))
      (when (and word
                 rdictcc-rgr-show-translations
                 (not (string= word rdictcc-rgr-last-word)))
 	(rdictcc-translate-word word)
        (setq rdictcc-rgr-last-word word)))))
--8<---------------cut here---------------end--------------->8---

When comparing strings you normally use `string=', because two strings
may have the same contents but are not `eq', e.g. they're not the same
lisp object.

And I've moved the last setq into the `when', cause if the word didn't
change there's no reason to re-set it.

Bye,
Tassilo
-- 
Chuck Norris doesn't see dead people. He makes people dead. 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
  2008-03-04 13:54       ` Richard G Riley
  2008-03-04 16:49         ` Tassilo Horn
@ 2008-03-04 16:57         ` Richard G Riley
       [not found]         ` <mailman.8291.1204649408.18990.info-gnus-english@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Richard G Riley @ 2008-03-04 16:57 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

> Tassilo Horn <tassilo@member.fsf.org> writes:
>
>> Richard G Riley <rileyrgdev@gmail.com> writes:
>>
>> Hi Richard,
>>
>>> I did this and it works well enough. I now have an auto updated
>>> rdictcc buffer when scrolling around in w3m or article buffers. Thanks
>>> for your help. Maybe some sort of timer would be nice so it only
>>> updates the rdictcc buffer after resting on the same word for a while
>>> - but that is a little beyond my current experience at the
>>> moment.
>>
>> I'd suggest to save the current word in a global variable (`defvar') and
>> only update the translation if the current word is not nil and not
>> string= with the saved word.  When that's the case, do the translation
>> and save the current word in the global variable.
>
> Works well. I'd already done this last night actually but used setq. Is
> this bad?

Apologies. Well, it would work well had I posted the working code:

>
> ,----
> | 
> | (setq rdictcc-rgr-show-translations nil)
> | (setq rdictcc-rgr-last-word nil)
> | 

*snip incorrect function using EQ instead of EQUAL*

*insert working function*

(defun rdictcc-rgr-translate()
  (interactive)
  (save-selected-window
    (let ((word (rdictcc-current-word)))
      (when (and word rdictcc-rgr-show-translations (not(equal word rdictcc-rgr-last-word)))
	(rdictcc-translate-word word)
        (setq rdictcc-rgr-last-word word)
	)
      )
    )
  )


> | 
> | (add-hook 'w3m-after-cursor-move-hook 'rdictcc-rgr-translate)
> | 
> | (define-key gnus-article-mode-map [right] (lambda () (interactive)(rdictcc-rgr-translate)(forward-char)))
> | (define-key gnus-article-mode-map [left] (lambda () (interactive)(rdictcc-rgr-translate)(backward-char)))
> | (define-key gnus-article-mode-map [up] (lambda () (interactive)(rdictcc-rgr-translate)(previous-line)))
> | (define-key gnus-article-mode-map [down] (lambda () (interactive)(rdictcc-rgr-translate)(next-line)))
> | 
> | (global-set-key (kbd "<f5> T") 'rdictcc-rgr-translate)
> | (global-set-key (kbd "<f5> o") (lambda()(interactive)(setq rdictcc-rgr-show-translations (not rdictcc-rgr-show-translations))))
> `----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
       [not found]         ` <mailman.8291.1204649408.18990.info-gnus-english@gnu.org>
@ 2008-03-04 17:03           ` Richard G Riley
  2008-03-04 18:00           ` Richard G Riley
  1 sibling, 0 replies; 13+ messages in thread
From: Richard G Riley @ 2008-03-04 17:03 UTC (permalink / raw)
  To: info-gnus-english

Tassilo Horn <tassilo@member.fsf.org> writes:

> Richard G Riley <rileyrgdev@gmail.com> writes:
>
> Hi Richard,
>
>> Works well. I'd already done this last night actually but used
>> setq. Is this bad?
>
> Not really.  You will get compiler warnings when trying to byte-compile
> it and it's not a clean style.
>
> | (defun rdictcc-rgr-translate()
> |   (interactive)
> | ;  (save-window-excursion
> |   (message "myt")
> |   (save-selected-window
> |     (let ((word (rdictcc-current-word)))
> |       (when (and word rdictcc-rgr-show-translations (not(eq word rdictcc-rgr-last-word)))
> | 	(rdictcc-translate-word word)
> | 	)
> |       (setq rdictcc-rgr-last-word word)
> |       )
> |     )
> |   )
>
> I've "corrected" it to this:
>
> (defun rdictcc-rgr-translate()
>   (interactive)
>   (save-selected-window
>     (let ((word (rdictcc-current-word)))
>       (when (and word
>                  rdictcc-rgr-show-translations
>                  (not (string= word rdictcc-rgr-last-word)))
>  	(rdictcc-translate-word word)
>         (setq rdictcc-rgr-last-word word)))))
>
> When comparing strings you normally use `string=', because two strings
> may have the same contents but are not `eq', e.g. they're not the same
> lisp object.
>
> And I've moved the last setq into the `when', cause if the word didn't
> change there's no reason to re-set it.
>
> Bye,
> Tassilo

Thanks. All pointers appreciated. I tend to only pop into elisp when I
need something and it rarely sticks into my head since its such a rare
occurrence and lisp isn't the most obvious language from coming from C
:-;

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
       [not found]         ` <mailman.8291.1204649408.18990.info-gnus-english@gnu.org>
  2008-03-04 17:03           ` Richard G Riley
@ 2008-03-04 18:00           ` Richard G Riley
  2008-03-04 19:10             ` Tassilo Horn
       [not found]             ` <mailman.8297.1204657843.18990.info-gnus-english@gnu.org>
  1 sibling, 2 replies; 13+ messages in thread
From: Richard G Riley @ 2008-03-04 18:00 UTC (permalink / raw)
  To: info-gnus-english

Tassilo Horn <tassilo@member.fsf.org> writes:

> Richard G Riley <rileyrgdev@gmail.com> writes:
>
> Hi Richard,
>
>> Works well. I'd already done this last night actually but used
>> setq. Is this bad?
>
> Not really.  You will get compiler warnings when trying to byte-compile
> it and it's not a clean style.
>
> | (defun rdictcc-rgr-translate()
> |   (interactive)
> | ;  (save-window-excursion
> |   (message "myt")
> |   (save-selected-window
> |     (let ((word (rdictcc-current-word)))
> |       (when (and word rdictcc-rgr-show-translations (not(eq word rdictcc-rgr-last-word)))
> | 	(rdictcc-translate-word word)
> | 	)
> |       (setq rdictcc-rgr-last-word word)
> |       )
> |     )
> |   )
>
> I've "corrected" it to this:
>
> (defun rdictcc-rgr-translate()
>   (interactive)
>   (save-selected-window
>     (let ((word (rdictcc-current-word)))
>       (when (and word
>                  rdictcc-rgr-show-translations
>                  (not (string= word rdictcc-rgr-last-word)))
>  	(rdictcc-translate-word word)
>         (setq rdictcc-rgr-last-word word)))))
>
> When comparing strings you normally use `string=', because two strings
> may have the same contents but are not `eq', e.g. they're not the same
> lisp object.
>
> And I've moved the last setq into the `when', cause if the word didn't
> change there's no reason to re-set it.
>
> Bye,
> Tassilo

Hi Tassilo,

I followed your advice and used defvar and went a step further and made
tthe use of rdictcc in Gnus articles or w3m buffer customisable. I
include the code below in case you think its handy enough to include on
your wiki page. I can only say that as a native English speaker living
in Germany I use it a lot! I can pretty much guarantee the code can be
improved upon as I'm most certainly not an elisp wizard.

Thanks for your help and rdictcc in the first place.

The default binding to toggle all rdictcc auto popups is "f5-o"

r.

,----
| (defvar rdictcc-show-translations nil )
| 
| (defcustom rdictcc-show-translations
|   nil
|   "Whether to popup translations when you cursor to a word in either a Gnus article buffer or a w3m buffer. Also see rdictcc-gnus-article and rdictcc-w3m settings. Setting this to nil stops all pop ups."
|   :group 'rdictcc
|   :type 'boolean)
| 
| (defcustom rdictcc-w3m
|   nil
|   "Whether to show rdictcc translations in w3m buffers"
|   :group 'rdictcc
|   :type 'boolean
| )
| 
| (defcustom rdictcc-gnus-article
|   nil
|   "Whether to show rdictcc translations for words in Gnus article buffers."
|   :group 'rdictcc
|   :type 'boolean
| )
| 
| 
| (defvar rdictcc-last-word nil "The last word translated by rdictcc. Used to stop multiple translations as you cursor through a word.")
| 
| (defun rdictcc-translate()
|   (interactive)
|   (save-selected-window
|     (let ((word (rdictcc-current-word)))
|       (when (and word
|                  rdictcc-show-translations
|                  (not (string= word rdictcc-last-word)))
|  	(rdictcc-translate-word word)
|         (setq rdictcc-last-word word)))))
| 
| 
| (add-hook 'w3m-after-cursor-move-hook (lambda() (interactive) (when rdictcc-w3m (rdictcc-translate))))
| 
| (define-key gnus-article-mode-map [right] (lambda () (interactive)(when rdictcc-gnus-article (rdictcc-translate))(forward-char)))
| (define-key gnus-article-mode-map [left] (lambda () (interactive)(when rdictcc-gnus-article (rdictcc-translate))(backward-char)))
| (define-key gnus-article-mode-map [up] (lambda () (interactive)(when rdictcc-gnus-article (rdictcc-translate))(previous-line)))
| (define-key gnus-article-mode-map [down] (lambda () (interactive)(when rdictcc-gnus-article (rdictcc-translate))(next-line)))
| 
| (global-set-key (kbd "<f5> T") 'rdictcc-translate)
| (global-set-key (kbd "<f5> o") (lambda()(interactive)(setq rdictcc-show-translations (not rdictcc-show-translations))))
`----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
  2008-03-04 18:00           ` Richard G Riley
@ 2008-03-04 19:10             ` Tassilo Horn
       [not found]             ` <mailman.8297.1204657843.18990.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-04 19:10 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

> I followed your advice and used defvar and went a step further and
> made tthe use of rdictcc in Gnus articles or w3m buffer
> customisable. I include the code below in case you think its handy
> enough to include on your wiki page.

It is handy enough to include it in rdictcc.el. ;-)

I'll refactor it a bit and then release a new version.  Thanks for the
contribution.

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
       [not found]             ` <mailman.8297.1204657843.18990.info-gnus-english@gnu.org>
@ 2008-03-04 19:38               ` Richard G Riley
  2008-03-05  7:57                 ` Tassilo Horn
  0 siblings, 1 reply; 13+ messages in thread
From: Richard G Riley @ 2008-03-04 19:38 UTC (permalink / raw)
  To: info-gnus-english

Tassilo Horn <tassilo@member.fsf.org> writes:

> Richard G Riley <rileyrgdev@gmail.com> writes:
>
> Hi Richard,
>
>> I followed your advice and used defvar and went a step further and
>> made tthe use of rdictcc in Gnus articles or w3m buffer
>> customisable. I include the code below in case you think its handy
>> enough to include on your wiki page.
>
> It is handy enough to include it in rdictcc.el. ;-)
>
> I'll refactor it a bit and then release a new version.  Thanks for the
> contribution.
>
> Bye,
> Tassilo

Brilliant, my first Emacs contribution :-; 

You might consider some options for the format of the output. e,g
"Gutentag: hello, goodday, etc,etc2" on one line rather than the
multiline output.  I would also remove the "DE->EN" headers (I have
locally) and maybe just include it in the output lines e.g (DE:EN)
Gutentag : hello, good day etc etc etc. It saves some real estate in the
height of the windows needed for the pop up buffer.

Thanks again,

r.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
  2008-03-04 19:38               ` Richard G Riley
@ 2008-03-05  7:57                 ` Tassilo Horn
  2008-03-05 10:51                   ` Tassilo Horn
  0 siblings, 1 reply; 13+ messages in thread
From: Tassilo Horn @ 2008-03-05  7:57 UTC (permalink / raw)
  To: info-gnus-english

Richard G Riley <rileyrgdev@gmail.com> writes:

Hi Richard,

>> It is handy enough to include it in rdictcc.el. ;-)
>>
>> I'll refactor it a bit and then release a new version.  Thanks for
>> the contribution.
>
> Brilliant, my first Emacs contribution :-; 

,----[ ~/repos/rdictcc/rdictcc.el ]
| ;;; rdictcc.el --- use the rdictcc.rb client from within Emacs
| 
| ;; Copyright (C) 2006, 2007, 2008 by Tassilo Horn
| 
| ;; Author: Tassilo Horn <tassilo@member.fsf.org>
| 
| ;; Patches and contributions:
| ;;   - Richard G Riley <rileyrgdev@gmail.com>
`----

Version 5.7 is out now.  Now, if you call the translation commands

  rdictcc-translate-word and
  rdictcc-translate-word-at-point

with an prefix arg, the translation buffer won't be selected.  And
there's a new command

  rdictcc-refresh-translation

which updates the translation buffer if the current word under point has
changed (without selecting it).  So you'll want to use that in the w3m
hook and the gnus article bindings.

When I find some time I'll investigate if it's feasible to remap all
movement commands to your wrapper functions buffer-locally and produce a
minor mode out of it.

> You might consider some options for the format of the output. e,g
> "Gutentag: hello, goodday, etc,etc2" on one line rather than the
> multiline output.

Yes, that might be a good idea.  I'll implement it and release a new
version.

> Thanks again,

You're welcome,
Tassilo
-- 
     My software never has bugs. It just develops random features.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cursoring in an article : want to add a hook.
  2008-03-05  7:57                 ` Tassilo Horn
@ 2008-03-05 10:51                   ` Tassilo Horn
  0 siblings, 0 replies; 13+ messages in thread
From: Tassilo Horn @ 2008-03-05 10:51 UTC (permalink / raw)
  To: info-gnus-english

Hi Richard,

I've released 6.0, which should satisfy all your needs. :)

> And there's a new command
>
>   rdictcc-refresh-translation
>
> which updates the translation buffer if the current word under point
> has changed (without selecting it).  So you'll want to use that in the
> w3m hook and the gnus article bindings.

No need to do that yourself anymore, because...

> When I find some time I'll investigate if it's feasible to remap all
> movement commands to your wrapper functions buffer-locally and produce
> a minor mode out of it.

... I've done just that.  There's a new minor mode

  rdictcc-permanent-translation-mode

which remaps most point movement commands to wrapper functions that
first move point and then update the translation buffer.  So you'd
simply switch it on with `M-x rdictcc-permanent-translation-mode' or add
it to hooks like this:

  (add-hook 'gnus-article-mode-hook 'rdictcc-permanent-translation-mode)
  (add-hook 'w3m-mode-hook 'rdictcc-permanent-translation-mode)

>> You might consider some options for the format of the output. e,g
>> "Gutentag: hello, goodday, etc,etc2" on one line rather than the
>> multiline output.
>
> Yes, that might be a good idea.  I'll implement it and release a new
> version.

Done.  Now the option -c to rdictcc.rb uses a more compact output
format.  You can set that option for the emacs interface by customizing
`rdictcc-program-args'.

Have fun,
Tassilo
-- 
      "DRM manages rights in the same way a jail manages freedom"

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-03-05 10:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-03 15:43 Cursoring in an article : want to add a hook Richard G Riley
2008-03-03 18:39 ` Tassilo Horn
     [not found] ` <mailman.8245.1204569624.18990.info-gnus-english@gnu.org>
2008-03-04  1:09   ` Richard G Riley
2008-03-04  9:05     ` Tassilo Horn
     [not found]     ` <mailman.8274.1204621575.18990.info-gnus-english@gnu.org>
2008-03-04 13:54       ` Richard G Riley
2008-03-04 16:49         ` Tassilo Horn
2008-03-04 16:57         ` Richard G Riley
     [not found]         ` <mailman.8291.1204649408.18990.info-gnus-english@gnu.org>
2008-03-04 17:03           ` Richard G Riley
2008-03-04 18:00           ` Richard G Riley
2008-03-04 19:10             ` Tassilo Horn
     [not found]             ` <mailman.8297.1204657843.18990.info-gnus-english@gnu.org>
2008-03-04 19:38               ` Richard G Riley
2008-03-05  7:57                 ` Tassilo Horn
2008-03-05 10:51                   ` Tassilo Horn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).