From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82560 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.gnus.general Subject: Re: reply hook? Date: Sat, 01 Dec 2012 13:48:01 +0200 Organization: Oleksandr Gavenko , http://gavenkoa.users.sf.net Message-ID: <87mwxy0z9q.fsf@gavenkoa.example.com> References: <87txs7i14z.fsf@gilgamesch.quim.ucm.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1354362545 18654 80.91.229.3 (1 Dec 2012 11:49:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2012 11:49:05 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M30826@lists.math.uh.edu Sat Dec 01 12:49:18 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TelZM-00007x-KT for ding-account@gmane.org; Sat, 01 Dec 2012 12:49:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1TelYR-0007lD-6J; Sat, 01 Dec 2012 05:48:19 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1TelYO-0007ku-69 for ding@lists.math.uh.edu; Sat, 01 Dec 2012 05:48:16 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TelYM-0001NC-9w for ding@lists.math.uh.edu; Sat, 01 Dec 2012 05:48:15 -0600 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1TelYK-0004Vn-D2 for ding@gnus.org; Sat, 01 Dec 2012 12:48:12 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TelYT-0007gt-Qu for ding@gnus.org; Sat, 01 Dec 2012 12:48:21 +0100 Original-Received: from 37.229.16.202 ([37.229.16.202]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Dec 2012 12:48:21 +0100 Original-Received: from gavenkoa by 37.229.16.202 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Dec 2012 12:48:21 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 37.229.16.202 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:cPo0eTwU1y0ry6W+H5/5LmunxYU= X-Spam-Score: -0.2 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82560 Archived-At: On 2012-11-30, Uwe Brauer wrote: > I would like to execute a couple of function when replying. > I have not found a relevant hook so I am using defadvice > which is not good for debugging. > > (defadvice gnus-summary-reply (after mycheckispell activate) > "Runs ispell dict checks and other stuff after > the gnus-summary-reply-with-original function." > (my-checks-spell)) > > > (defun my-checks-spell () > (interactive) > (bbdbciteadpt-insert-bbdbcite) > (bbdbispelladpt-try-bbdbispell) > (bbdbscadapt-try-bbdbsc) > (tool-check-from-and-change-ispell-dic) > (message-goto-subject) > (bbdb-inform-dict-and-abbrev)) > > Any suggestions? > Just type "M-x apropos-variable RET message-.*hook RET". I hope this help you. In such way I found useful hooks for my '.emacs' customisations: (defun my-message-mode-hook () (setq fill-column 78) (turn-on-auto-fill) (flyspell-mode 1)) (add-hook 'message-mode-hook 'my-message-mode-hook) (defun my-message-save () "Store message in `gnus-article-save-directory' after successful sending. It is possible that mail rejected and I lost it completely, this func save it for me." (unless (eq major-mode 'message-mode) (error "Attempt to call my-message-save in non message-mode buffer")) (make-directory gnus-article-save-directory t) (let ( (buf (current-buffer)) (field-to (my-clean-filename (or (message-fetch-field "Newsgroups") (message-fetch-field "To")))) (field-subject (my-clean-filename (message-fetch-field "Subject"))) file ) (setq file (concat gnus-article-save-directory "/" (format-time-string "%F_%T") "_" field-to "_" field-subject)) (with-temp-file file (insert-buffer buf) )) ) (add-hook 'message-sent-hook 'my-message-save) -- Best regards!