From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emre Sahin Newsgroups: gmane.emacs.devel Subject: Re: Battery update Date: Fri, 08 Aug 2008 16:26:49 +0300 Message-ID: <8763qbocx2.fsf@leonardo.iesahin.net> References: <87bq04dbqc.fsf@stupidchicken.com> <87ej50g0ib.fsf@gmx.de> <87bq048z7t.fsf@stupidchicken.com> <878wv8fxmr.fsf@gmx.de> <87abfo4obc.fsf@stupidchicken.com> <873algfw2d.fsf@gmx.de> <87bq04r2f8.fsf@stupidchicken.com> <87d4kko450.fsf@leonardo.iesahin.net> <87tzdwmknn.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218202039 2657 80.91.229.12 (8 Aug 2008 13:27:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Aug 2008 13:27:19 +0000 (UTC) Cc: 643@emacsbugs.donarmstrong.com, Emre Sahin , Sven Joachim , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 08 15:28:08 2008 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 1KRS0j-0001O3-Sy for ged-emacs-devel@m.gmane.org; Fri, 08 Aug 2008 15:28:06 +0200 Original-Received: from localhost ([127.0.0.1]:48979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRRzo-0004Ed-9B for ged-emacs-devel@m.gmane.org; Fri, 08 Aug 2008 09:27:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KRRzj-0004BH-57 for emacs-devel@gnu.org; Fri, 08 Aug 2008 09:27:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KRRzg-00046P-KG for emacs-devel@gnu.org; Fri, 08 Aug 2008 09:27:02 -0400 Original-Received: from [199.232.76.173] (port=33318 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRRzg-00046A-GB for emacs-devel@gnu.org; Fri, 08 Aug 2008 09:27:00 -0400 Original-Received: from nf-out-0910.google.com ([64.233.182.191]:9056) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KRRzf-0007c9-Ur for emacs-devel@gnu.org; Fri, 08 Aug 2008 09:27:00 -0400 Original-Received: by nf-out-0910.google.com with SMTP id c7so344946nfi.26 for ; Fri, 08 Aug 2008 06:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:cc:subject:in-reply-to :user-agent:references:date:message-id:mime-version:content-type :from; bh=sGb6dytSCpgpgTmrqfdt0zlwveRHHO39bCK7ccY1KRY=; b=q8pLwtRm9WaBt9pkn7YoBbNggvxL2g9XuJXSpUKNzAYg4DYtlA9TuqxfKk+fBIYy3w lnZa4ZfFSk0LoLyfHrObL711vZzGPb+r0dLBxaAFPHLdyKhQ+0cGWu6mkl4LwFZGY5ms UuHnYeAZwE0NNu2krLABwbAetxLiF5dsy90jI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:cc:subject:in-reply-to:user-agent:references:date:message-id :mime-version:content-type:from; b=x8Qh68y879vGic5tJx3VNJSTdFTyPs0Y0HHpnxcXSCcvVEiKEAWhzCV9KB4g8EoCCA fLYEd18aMkEz5RxlWbNn0i47pR1HcW/JdeU20MK87DYT6AkJDJN+R5+7dJajihD6UAvw s1YB0LKu5jSShVgwdbK777AfZqHAtezDbGkw4= Original-Received: by 10.210.66.1 with SMTP id o1mr5478955eba.135.1218202018825; Fri, 08 Aug 2008 06:26:58 -0700 (PDT) Original-Received: from leonardo.iesahin.net.emresahin.net ( [81.214.249.90]) by mx.google.com with ESMTPS id i8sm1728604nfh.20.2008.08.08.06.26.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 08 Aug 2008 06:26:57 -0700 (PDT) In-Reply-To: <87tzdwmknn.fsf@stupidchicken.com> (Chong Yidong's message of "Thu\, 07 Aug 2008 20\:10\:20 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: 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:102202 Archived-At: Chong Yidong writes: > Emre Sahin writes: > >> Maybe I did something wrong with diff & patch; this is my first >> adventure with them in practice. (Yes, really!) >> >> Message is something like: >> >> Loading /home/iesahin/site-lisp/battery.el (source)...done >> setq: Wrong type argument: listp, "/sys/class/power_supply/AC/online" > > No, it was a typo in the patch. Could you replace the line > > (if (battery-search-for-one-match-in-files > "/sys/class/power_supply/AC/online" "1" 0) > "AC" > > on line 471 of the battery.el, with > > (if (battery-search-for-one-match-in-files > (list "/sys/class/power_supply/AC/online") "1" 0) > "AC" > > and try again? This looks OK. It fills %p in battery-mode-line-format and gives an equal value with "acpi -b". Thank you. I may try to retrieve other (available) information from sysfs interface by looking your code. I don't know if Sven has anything to add about interface though. I think the interface change is thought for multi-battery systems. If battery.el should support them, battery.el interface should also change I think, which is, IMHO, not necessary at the moment. Regards, Emre -- I. Emre Sahin @ Ankara, Turkey Software Developer & Consultant @ http://ydyazilim.com Ph.D. Candidate @ http://cs.bilkent.edu.tr Blogger, Writer, Poet @ http://emresahin.net Maybe hears the phone @ +90 532 261 8985 Maybe gtalk (or jabber) @ i.emre.sahin@gmail.com