emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r104642: * src/process.c (Fset_pr


From: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r104642: * src/process.c (Fset_process_buffer): Clarify return value in docstring.
Date: Tue, 21 Jun 2011 21:59:49 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> I'm just wondering: can I rely on `set-process-buffer' always returning the
> buffer from now on or is it prone to change given the fact that it is
> "accidental"?

Now that you documented it, you can probably rely on it.
But if I undocument it before the release, then there's a risk it
might change.  If I were you I'd use

(defun dirc-setup-server-buffer (process)
  "Set up the server buffer for PROCESS."
  (let ((buffer (pop-to-buffer-same-window
                  (dirc-make-process-buffer-name process))))
    (set-process-buffer process buffer)))
    (with-current-buffer buffer
      (set (make-local-variable 'dirc-buffer-type) 'server)
      (set (make-local-variable 'dirc-process process)))))

which I find more readable and where you don't need to worry about it.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]