[Howm-eng 52] Re: C-c C-c: save and kill buffer ?

Back to archive index

Xavier Maillard xma****@gnu*****
Wed Apr 9 09:00:09 JST 2008


   > 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




More information about the Howm-eng mailing list
Back to archive index