From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Add function to make frame topmost? Date: Fri, 30 Apr 2010 15:26:56 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1272634051 29216 80.91.229.12 (30 Apr 2010 13:27:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Apr 2010 13:27:31 +0000 (UTC) Cc: Emacs-Devel devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 30 15:27:29 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O7qFc-0000kz-MO for ged-emacs-devel@m.gmane.org; Fri, 30 Apr 2010 15:27:28 +0200 Original-Received: from localhost ([127.0.0.1]:40843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7qFb-0002ix-Ou for ged-emacs-devel@m.gmane.org; Fri, 30 Apr 2010 09:27:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O7qFW-0002is-E9 for emacs-devel@gnu.org; Fri, 30 Apr 2010 09:27:22 -0400 Original-Received: from [140.186.70.92] (port=44485 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7qFT-0002ij-LV for emacs-devel@gnu.org; Fri, 30 Apr 2010 09:27:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O7qFR-0002oQ-IE for emacs-devel@gnu.org; Fri, 30 Apr 2010 09:27:19 -0400 Original-Received: from fg-out-1718.google.com ([72.14.220.152]:19673) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O7qFR-0002oC-Cd for emacs-devel@gnu.org; Fri, 30 Apr 2010 09:27:17 -0400 Original-Received: by fg-out-1718.google.com with SMTP id e21so4439873fga.12 for ; Fri, 30 Apr 2010 06:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=smaKU62Lf4O1G0bPrcbj1EwCn8qG9JlBXdpbPmkyjV0=; b=DUwJKlrPzhheBRuZiCoXGFGwgpC3Y5R2dn16p2GpNv6rsNd7FDHzFDBN/cwZloxYev FtqIkbGeUQ8efbEXJJcwscSgbw/6iDFJ+gLUMBXoH0SD16ez1cOs4CjcxyH0YfCEe9++ qB5SM0M/89cmF6DGYfEJabCofV4j25yULw0II= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=F+d4KHjzliPN2wHnjCN+3jSSYI7C5gT+q7hA2TctWsod1uzALgmRUmgPMnctB48c0Z qROOITxXYmEMbkxeYUVBPf0bMQLyiR/rgPJqSxjCm6F0vUwZfzKuECamIqKxowpD9zis D8ioIkzQsSulvaMmo6rh8MRWAK7YUMvGkaFYs= Original-Received: by 10.239.187.131 with SMTP id l3mr980080hbh.104.1272634036103; Fri, 30 Apr 2010 06:27:16 -0700 (PDT) Original-Received: by 10.239.164.81 with HTTP; Fri, 30 Apr 2010 06:26:56 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124357 Archived-At: On Fri, Apr 30, 2010 at 3:06 PM, Stefan Monnier wrote: >> Could something like this please be added to w32fns.c? > > First, if it's w32-specific, its name should not start with "x-" but > with "w32-". =C2=A0If it's not, then its name should start with neither a= nd > the DEFUN should be in a system-independent file. This version is w32-specific, yes. It will only appear in an Emacs compiled for w32. Looking at w32fns.c it looks to me like this is how some functions (for example x-show-tip) that must have different implemantations for x and w32 are handled. But indeed that looks like a bad convention since it makes it impossible to choose function according to the display used. So I will rename it to w32-set-frame-topmost. And I think some other functions also should be renamed and integrated in the way I suggest below. Then there should of course be a similar function x-set-frame-topmost for X windows, but I can't write that. To tie this together I think something like (defun set-frame-topmost (frame top activate) (cond ((eq (display-type) 'x-windows) (x-set-frame-topmost frame top activat= e)) ((eq (display-type) 'w32) (w32-set-frame-topmost frame top activate)))= ) is needed. The function `display-type' does not exist yet of course. > Finally, I don't know what means "topmost", so the docstring needs to > be improved. Yes, "topmost" is what is used for tooltip etc to make that frame window stay above other windows without having focus. On w32 (and I guess on x) this also works across applications, ie a topmost frame window stays above the active application. My usecase for something like this is reminders that pops up at a certain times. You may want to see them even if you are not in Emacs. And you may prefer to not get interrupted when you type so directly activating Emacs might not be a good thing.