From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emre Sahin Newsgroups: gmane.emacs.bugs Subject: bug#643: Battery update Date: Fri, 08 Aug 2008 16:26:49 +0300 Message-ID: <8763qbocx2.fsf__5640.45651485703$1218203333$gmane$org@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> Reply-To: Emre Sahin , 643@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218203276 6667 80.91.229.12 (8 Aug 2008 13:47:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Aug 2008 13:47:56 +0000 (UTC) Cc: 643@emacsbugs.donarmstrong.com, Emre Sahin , Sven Joachim , emacs-devel@gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 08 15:48:45 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KRSKb-0000Rx-SZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Aug 2008 15:48:38 +0200 Original-Received: from localhost ([127.0.0.1]:46028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRSJf-0006Px-3U for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Aug 2008 09:47:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KRSJa-0006Ps-Bm for bug-gnu-emacs@gnu.org; Fri, 08 Aug 2008 09:47:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KRSJX-0006Pf-Hj for bug-gnu-emacs@gnu.org; Fri, 08 Aug 2008 09:47:33 -0400 Original-Received: from [199.232.76.173] (port=44076 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRSJX-0006PZ-9Z for bug-gnu-emacs@gnu.org; Fri, 08 Aug 2008 09:47:31 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:46359) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KRSJV-0002HB-OS for bug-gnu-emacs@gnu.org; Fri, 08 Aug 2008 09:47:31 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m78DlNHw005164; Fri, 8 Aug 2008 06:47:23 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m78DZ3cW001027; Fri, 8 Aug 2008 06:35:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Emre Sahin Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 08 Aug 2008 13:35:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 643 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 643-submit@emacsbugs.donarmstrong.com id=B643.121820202431660 (code B ref 643); Fri, 08 Aug 2008 13:35:03 +0000 Original-Received: (at 643) by emacsbugs.donarmstrong.com; 8 Aug 2008 13:27:04 +0000 Original-Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m78DQxl9031654 for <643@emacsbugs.donarmstrong.com>; Fri, 8 Aug 2008 06:27:01 -0700 Original-Received: by nf-out-0910.google.com with SMTP id 30so357950nfu.31 for <643@emacsbugs.donarmstrong.com>; 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, 3) Resent-Date: Fri, 08 Aug 2008 09:47:33 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19142 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