public inbox for howm-eng@lists.osdn.me
 help / color / mirror / Atom feed
* [Howm-eng 50]  C-c C-c: save and kill buffer ?
@ 2008-04-08  6:29 xma
  2008-04-08 15:57 ` [Howm-eng 51] " khi
  0 siblings, 1 reply; 5+ messages in thread
From: xma @ 2008-04-08  6:29 UTC (permalink / raw)


Hi,

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.

I read the code of howm and did not find such thing.

Does it exist as an extension somewhere or should I provide
something to you ? It would be really cool to see this included
in the howm distribution.

Regards,

	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org



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

* [Howm-eng 51] Re: C-c C-c: save and kill buffer ?
  2008-04-08  6:29 [Howm-eng 50] C-c C-c: save and kill buffer ? xma
@ 2008-04-08 15:57 ` khi
  2008-04-09  0:00   ` [Howm-eng 52] " xma
  0 siblings, 1 reply; 5+ messages in thread
From: khi @ 2008-04-08 15:57 UTC (permalink / raw)


Hi.

At Tue, 8 Apr 2008 08:29:37 +0200,
Xavier Maillard wrote:
> 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)

(defun my-save-and-kill-buffer ()
  (interactive)
  (save-buffer)
  (kill-buffer nil))

(global-set-key "\C-c\C-c" 'my-save-and-kill-buffer)
;; or
(define-key howm-mode-map "\C-c\C-c" 'my-save-and-kill-buffer)
        
-- 
khi at users.sourceforge.jp



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

* [Howm-eng 52] Re: C-c C-c: save and kill buffer ?
  2008-04-08 15:57 ` [Howm-eng 51] " khi
@ 2008-04-09  0:00   ` xma
  2008-04-09 13:22     ` [Howm-eng 57] " khi
  0 siblings, 1 reply; 5+ messages in thread
From: xma @ 2008-04-09  0:00 UTC (permalink / raw)



   > 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



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

* [Howm-eng 57] Re: C-c C-c: save and kill buffer ?
  2008-04-09  0:00   ` [Howm-eng 52] " xma
@ 2008-04-09 13:22     ` khi
  2008-04-12  0:00       ` [Howm-eng 65] " xma
  0 siblings, 1 reply; 5+ messages in thread
From: khi @ 2008-04-09 13:22 UTC (permalink / raw)


At Wed, 9 Apr 2008 02:00:09 +0200,
Xavier Maillard wrote:
> ;; From elscreen-howm
> (defun howm-save-and-kill-buffer ()

> Why not put this in the howm code ?

I agree that these features are convenient for many users.
* C-c C-c saves and kills the current buffer.
* If we save an empty buffer, its corresponding file is removed.
But, their benefit is not limited to howm.
I recommend you to define them *globally*.

-- 
khi at users.sourceforge.jp



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

* [Howm-eng 65] Re: C-c C-c: save and kill buffer ?
  2008-04-09 13:22     ` [Howm-eng 57] " khi
@ 2008-04-12  0:00       ` xma
  0 siblings, 0 replies; 5+ messages in thread
From: xma @ 2008-04-12  0:00 UTC (permalink / raw)



   > ;; From elscreen-howm
   > (defun howm-save-and-kill-buffer ()

   > Why not put this in the howm code ?

   But, their benefit is not limited to howm.
   I recommend you to define them *globally*.

I agree. I will try to extend it for much than howm.

	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org



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

end of thread, other threads:[~2008-04-12  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-08  6:29 [Howm-eng 50] C-c C-c: save and kill buffer ? xma
2008-04-08 15:57 ` [Howm-eng 51] " khi
2008-04-09  0:00   ` [Howm-eng 52] " xma
2008-04-09 13:22     ` [Howm-eng 57] " khi
2008-04-12  0:00       ` [Howm-eng 65] " xma

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).