;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Code:
(require 'riece-options)
(defun riece-debug-1 (message detail)
- (let ((time (format-time-string "%Y-%m-%d:%H:%M:%S")))
- (message "riece-debug:%s: %s" time message)
- (save-excursion
- (set-buffer riece-debug-buffer)
+ (message "riece-debug: %s" message)
+ (with-current-buffer riece-debug-buffer
(goto-char (point-max))
- (if detail
- (insert "*** " time ": " message "\n" detail "\n")
- (insert "*** " time ": " message "\n"))))
+ (let ((time (format-time-string "%Y-%m-%d:%H:%M:%S")))
+ (if detail
+ (insert "*** " time ": " message "\n" detail "\n")
+ (insert "*** " time ": " message "\n")))))
(defun riece-debug (message &optional detail)
"Print a one-line debug MESSAGE at the bottom of the frame.
(defun riece-debug-reset-standard-output ()
"Reset `riece-temp-buffer' to be used as `standard-output'."
- (save-excursion
- (set-buffer riece-temp-buffer)
+ (with-current-buffer riece-temp-buffer
(buffer-disable-undo)
(erase-buffer)))
,@body)
(error
(if riece-debug
- (save-excursion
- (set-buffer riece-temp-buffer)
+ (with-current-buffer riece-temp-buffer
(goto-char (point-min))
(if (re-search-forward "^ signal(" nil t)
(delete-region (point-min) (match-beginning 0)))