From mboxrd@z Thu Jan 1 00:00:00 1970 From: xma at gnu.org (Xavier Maillard) Date: Wed, 9 Apr 2008 02:00:09 +0200 Subject: [Howm-eng 52] Re: C-c C-c: save and kill buffer ? In-Reply-To: (khi@users.sourceforge.jp) References: <200804080629.m386TbvK007472@localhost.localdomain> Message-ID: <200804090000.m39009F1004703@localhost.localdomain> > I do not know why but I am used to press C-c C-c in almost all > the modes I use. What it does ? Simply save the buffer and bury > or kill it. How about this quick solution? (from http://howm.sourceforge.jp/cgi-bin/hiki/hiki.cgi?SaveAndKillBuffer) Yes thank you. I even found something more "consistent" in elscreen-howm: ;; From elscreen-howm (defun howm-save-and-kill-buffer () (interactive) (let* ((file-name (buffer-file-name))) (when (and file-name (string-match "\\.howm" file-name)) (if (save-excursion (goto-char (point-min)) (re-search-forward "[^ \t\r\n]" nil t)) (howm-save-buffer) (set-buffer-modified-p nil) (when (file-exists-p file-name) (delete-file file-name) (message "(Deleted %s)" (file-name-nondirectory file-name)))) (kill-buffer nil)))) (eval-after-load "howm-mode" '(progn (define-key howm-mode-map "\C-c\C-c" 'howm-save-and-kill-buffer))) I modified it a little bit to get rid of the elscreen part which I do not use. Why not put this in the howm code ? Xavier -- http://www.gnu.org http://www.april.org http://www.lolica.org