all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to use defadvice without infinite loop
@ 2003-09-27 15:09 Ivan Kanis
  2003-09-27 20:22 ` Robert Marshall
  2003-09-28  5:14 ` Klaus Berndl
  0 siblings, 2 replies; 5+ messages in thread
From: Ivan Kanis @ 2003-09-27 15:09 UTC (permalink / raw)


I want to save VM files to _always_ be saved before calling the function
save-some buffers.

I am tired of answering 'yes' for these files when grepping, compiling
or quiting emacs.

I came up with a defadvice function but the proble is that it's
calling save-some-buffers and it produces an infinite loop. Is there a
way to avoid that?

(defadvice save-some-buffers(before my-save-some-buffers activate)
  "Ask to save buffers."
  (interactive)
  (save-some-buffers nil 'my-always-save))

(defun my-always-save()
  "Files to always save."
  (when buffer-file-name
	(when (string-match "^/home/ivank/mail" buffer-file-name)
	  (save-buffer))))

-- 
/-----------------------------------------------------------------------------*
| "When a man is attempting to describe another person's |                    |
| character, he may be right or he may be wrong, but     |      Ivan Kanis    |
| in one thing he will always succeed,that is, in        | Software Developper|
| describing himself."                                   |     www.kanis.cc   |
| (Samuel Taylor Coleridge)                              |                    |
*-----------------------------------------------------------------------------/

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

end of thread, other threads:[~2003-09-29 15:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-27 15:09 How to use defadvice without infinite loop Ivan Kanis
2003-09-27 20:22 ` Robert Marshall
2003-09-28  5:14 ` Klaus Berndl
2003-09-29  4:58   ` Ivan Kanis
2003-09-29 15:08     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.