From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Should Emacs provide a uuid function? Date: Mon, 09 May 2011 18:50:08 +0300 Message-ID: <83liyfj2kv.fsf@gnu.org> References: <87ipu3v0ru.fsf@stupidchicken.com> <871v0raqub.fsf@uwakimon.sk.tsukuba.ac.jp> <42A7030B-DE0C-4CCA-A768-B82BE70C42F9@raeburn.org> <87liyynm6a.fsf@stupidchicken.com> <83aaewjq1x.fsf@gnu.org> <83vcxkhqqj.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1304956216 10707 80.91.229.12 (9 May 2011 15:50:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 9 May 2011 15:50:16 +0000 (UTC) Cc: cyd@stupidchicken.com, raeburn@raeburn.org, sdl.web@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 09 17:50:12 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QJSip-00015D-Ul for ged-emacs-devel@m.gmane.org; Mon, 09 May 2011 17:50:12 +0200 Original-Received: from localhost ([::1]:49861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJSip-00067K-Gk for ged-emacs-devel@m.gmane.org; Mon, 09 May 2011 11:50:11 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJSil-00065Q-TX for emacs-devel@gnu.org; Mon, 09 May 2011 11:50:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJSik-0003gD-NQ for emacs-devel@gnu.org; Mon, 09 May 2011 11:50:07 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:52511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJSik-0003e6-Ee for emacs-devel@gnu.org; Mon, 09 May 2011 11:50:06 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LKX00900QHSJU00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Mon, 09 May 2011 18:50:03 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.234.175]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LKX009PTQND2SC0@a-mtaout21.012.net.il>; Mon, 09 May 2011 18:50:03 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139269 Archived-At: > From: Stefan Monnier > Cc: cyd@stupidchicken.com, raeburn@raeburn.org, sdl.web@gmail.com, emacs-devel@gnu.org > Date: Mon, 09 May 2011 12:41:04 -0300 > > I was only making a general remark about your assertion that "using > platform-dependent interfaces in Lisp is not the Emacs way, in my book". Fair enough. My wording was probably too general, sorry. I have that bad habit ;-) > In this particular case, if some half gets written in C and the other in > Elisp, the benefit of using Elisp might not be worth the trouble, indeed. I was particularly trying to avoid proliferating the ugliness of the kind we have in battery.el: (defcustom battery-status-function (cond ((and (eq system-type 'gnu/linux) (file-readable-p "/proc/apm")) 'battery-linux-proc-apm) ((and (eq system-type 'gnu/linux) (file-directory-p "/proc/acpi/battery")) 'battery-linux-proc-acpi) ((and (eq system-type 'gnu/linux) (file-directory-p "/sys/class/power_supply/") (directory-files "/sys/class/power_supply/" nil "BAT[0-9]$")) 'battery-linux-sysfs) ((and (eq system-type 'darwin) (condition-case nil (with-temp-buffer (and (eq (call-process "pmset" nil t nil "-g" "ps") 0) (> (buffer-size) 0))) (error nil))) 'battery-pmset) ((eq system-type 'windows-nt) 'w32-battery-status)) I think it would be much cleaner to have 5 different implementations in sysdep.c of the same primitive, than have the above followed by 4 different Lisp functions plus one primitive.