From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jim Diamond Newsgroups: gmane.emacs.help Subject: Re: 24.1.50 + lexical-binding + server.el + server-visit-hook = problem Date: Mon, 11 Jun 2012 11:33:49 -0300 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1339425319 24836 80.91.229.3 (11 Jun 2012 14:35:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2012 14:35:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 11 16:35:19 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Se5i6-0008Am-8o for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jun 2012 16:35:14 +0200 Original-Received: from localhost ([::1]:41204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se5i6-0004J9-1S for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jun 2012 10:35:14 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-2.dfn.de!news.dfn.de!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Injection-Info: mx04.eternal-september.org; posting-host="TN4cDgbvm2dMBTkc2tVm+A"; logging-data="27975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RlkPPCHK2RzyZducSGMYy" User-Agent: slrn/0.9.9p1 (Linux) Cancel-Lock: sha1:MnPu+nwTSJMAKO3wcUBTWeq+yQw= Original-Xref: usenet.stanford.edu gnu.emacs.help:192805 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85208 Archived-At: On 2012-06-11 at 10:27 ADT, Stefan Monnier wrote: (>> comments are from Kevin Rodger) >> Ideally, server.el would define a global dynamically-scoped variable >> `server-default-directory' that users could reliably reference to get >> the value of the -dir DIRNAME emacsclient option (instead of defining >> the internal lexically scoped `dir'). > It's not quite ideal, tho, because you can have several active > emacsclients at the same time. True, but if you capture the value of the variable into a "safe place" when the hook is called, that's not an issue. On the other hand, why not have this variable be buffer-local, which would solve the problem of having multiple concurrent emacsclients? > A better solution is to store this `dir' into the process's > properties. > A related problem is that server-visit-hook is not quite right since > it's run once-per-file, so if you run "emacsclient FILE1 FILE2 FILE3" > it's run 3 times, and if you run "emacsclient -t" it's not run at all. > And server-switch-hook is not any better. Running the hook 3 times for "emacsclient f1 f2 f3" is not a problem for me, but your point is good. > So we'd want a new hook. > Maybe server-visit-files-function would make sense: its default value > would be server-visit-files, and you could override it with any other > function which takes the same arguments (and can call > server-visit-files internally). Since server-visit-files receives the > `proc' as argument, it would have easy access to the process's properties > (although that would not actually be needed in this case since that > function is called with default-directory set as needed) and it also > receives the list of files to visit, which might also come in handy. Thanks for your thoughts. Given the lack of discussion in this thread, I get the idea I'm the only person doing anything like this. Jim