comparison lisp/gnuserv.el @ 276:6330739388db r21-0b36

Import from CVS: tag r21-0b36
author cvs
date Mon, 13 Aug 2007 10:30:37 +0200
parents c5d627a313b1
children 57709be46d1b
comparison
equal deleted inserted replaced
275:a68ae4439f57 276:6330739388db
1 ;;; gnuserv.el --- Lisp interface code between Emacs and gnuserv 1 ;;; gnuserv.el --- Lisp interface code between Emacs and gnuserv
2 ;; Copyright (C) 1989-1997 Free Software Foundation, Inc. 2 ;; Copyright (C) 1989-1997 Free Software Foundation, Inc.
3 3
4 ;; Version: 3.10 4 ;; Version: 3.11
5 ;; Author: Andy Norman (ange@hplb.hpl.hp.com), originally based on server.el 5 ;; Author: Andy Norman (ange@hplb.hpl.hp.com), originally based on server.el
6 ;; Hrvoje Niksic <hniksic@srce.hr> 6 ;; Hrvoje Niksic <hniksic@srce.hr>
7 ;; Maintainer: Jan Vroonhof <vroonhof@math.ethz.ch>, 7 ;; Maintainer: Jan Vroonhof <vroonhof@math.ethz.ch>,
8 ;; Hrvoje Niksic <hniksic@srce.hr> 8 ;; Hrvoje Niksic <hniksic@srce.hr>
9 ;; Keywords: environment, processes, terminals 9 ;; Keywords: environment, processes, terminals
749 called to dispose of the buffer after marking it as done. 749 called to dispose of the buffer after marking it as done.
750 750
751 Files that match `gnuserv-temp-file-regexp' are considered temporary and 751 Files that match `gnuserv-temp-file-regexp' are considered temporary and
752 are saved unconditionally and backed up if `gnuserv-make-temp-file-backup' 752 are saved unconditionally and backed up if `gnuserv-make-temp-file-backup'
753 is non-nil. They are disposed of using `gnuserv-done-temp-file-function' 753 is non-nil. They are disposed of using `gnuserv-done-temp-file-function'
754 (also bound to `kill-buffer' by default). 754 \(also bound to `kill-buffer' by default).
755 755
756 When all of a client's buffers are marked as \"done\", the client is notified." 756 When all of a client's buffers are marked as \"done\", the client is notified."
757 (interactive "P") 757 (interactive "P")
758 (when (null count) 758 (when (null count)
759 (setq count 1)) 759 (setq count 1))
760 (cond ((numberp count) 760 (cond ((numberp count)
761 (let (next) 761 (while (natnump (decf count))
762 (while (natnump (decf count)) 762 (let ((frame (selected-frame)))
763 (gnuserv-buffer-done (current-buffer)) 763 (gnuserv-buffer-done (current-buffer))
764 (setq next (gnuserv-next-buffer)) 764 (when (eq frame (selected-frame))
765 (when next 765 ;; Switch to the next gnuserv buffer. However, do this
766 (switch-to-buffer next))))) 766 ;; only if we remain in the same frame.
767 (let ((next (gnuserv-next-buffer)))
768 (when next
769 (switch-to-buffer next)))))))
767 (count 770 (count
768 (let* ((buf (current-buffer)) 771 (let* ((buf (current-buffer))
769 (clients (gnuserv-buffer-clients buf))) 772 (clients (gnuserv-buffer-clients buf)))
770 (unless clients 773 (unless clients
771 (error "%s does not belong to a gnuserv client" buf)) 774 (error "%s does not belong to a gnuserv client" buf))