From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: `term' prefix for gpm support Date: Sat, 22 Sep 2007 16:00:33 -0400 Message-ID: References: <200709211426.l8LEQfuR010254@oogie-boogie.ics.uci.edu> <18164.29039.218922.86203@kahikatea.snap.net.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1190491255 4395 80.91.229.12 (22 Sep 2007 20:00:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 22 Sep 2007 20:00:55 +0000 (UTC) Cc: Dan Nicolaescu , emacs-devel@gnu.org To: Nick Roberts Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 22 22:00:49 2007 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.50) id 1IZB9j-0005pe-RL for ged-emacs-devel@m.gmane.org; Sat, 22 Sep 2007 22:00:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZB9h-00073J-GU for ged-emacs-devel@m.gmane.org; Sat, 22 Sep 2007 16:00:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IZB9e-000737-Ob for emacs-devel@gnu.org; Sat, 22 Sep 2007 16:00:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IZB9c-00072S-5y for emacs-devel@gnu.org; Sat, 22 Sep 2007 16:00:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZB9c-00072L-2t for emacs-devel@gnu.org; Sat, 22 Sep 2007 16:00:40 -0400 Original-Received: from tomts25.bellnexxia.net ([209.226.175.188] helo=tomts25-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IZB9b-0006T4-JH for emacs-devel@gnu.org; Sat, 22 Sep 2007 16:00:39 -0400 Original-Received: from pastel.home ([70.53.195.118]) by tomts25-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070922200038.VCMB19497.tomts25-srv.bellnexxia.net@pastel.home> for ; Sat, 22 Sep 2007 16:00:38 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 6E2A081F2; Sat, 22 Sep 2007 16:00:32 -0400 (EDT) In-Reply-To: <18164.29039.218922.86203@kahikatea.snap.net.nz> (Nick Roberts's message of "Sat\, 22 Sep 2007 13\:35\:43 +1200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Solaris 8 (1) 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:79525 Archived-At: >> > By the way, am I the only one annoyed by the Gpm code's use of the >> > `term' prefix? I mean `term-open-connection' sounds like a very odd >> > choice of name for a function which "Open a connection to Gpm." >> >> Agreed. I would even say that the GPM code in term.c can go into a >> separate file, that will reduce the amount of #ifdefs in term.c. > Maybe t-mouse-open, t-mouse-close would be better. I can't recall how I > arrived at those names but it was probably convoluted. Actually, the "t-mouse" part of the name comes from an earlier version of the feature implemented in ELisp, but nowadays it only appears in the t-mouse.el file whose content are minimal: (define-minor-mode t-mouse-mode "Toggle t-mouse mode to use the mouse in Linux consoles." :global t :group 'mouse (if window-system (error "t-mouse only works in the console on GNU/Linux") (if t-mouse-mode (progn (unless (fboundp 'term-open-connection) (progn (setq t-mouse-mode nil) (error "Emacs must be built with Gpm to use this mode"))) (unless (term-open-connection) (progn (setq t-mouse-mode nil) (error "Can't open mouse connection")))) ;; Turn it off (term-close-connection)))) so we might as well rename it to something else. Adding `gpm' to its name makes sense. Also the "open-connection" part of the name is a bit misleading because it makes me feel like this is going to return a connection. > There are four #ifdef HAVE_GPM blocks in term.c which doesn't seem that > many (term.c has 21 ifdefs in all). More importantly, when I wrote it, > the gpm code called static functions in term.c like write_glyphs. > If after multi-tty these functions are no longer part of term.c, maybe the > gpm code can go into a separate file. I think it's OK to keep it in term.c. Stefan