From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uday Reddy Newsgroups: gmane.emacs.help Subject: Re: Is this correct? Date: Sat, 26 Feb 2011 12:44:15 +0000 Organization: SunSITE.dk - Supporting Open source Message-ID: <4d68f5ae$0$23760$14726298@news.sunsite.dk> References: <87tyfrp9p2.fsf@puma.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1298727643 32110 80.91.229.12 (26 Feb 2011 13:40:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 26 Feb 2011 13:40:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 26 14:40:36 2011 Return-path: Envelope-to: geh-help-gnu-emacs@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 1PtKNv-0003Tp-N1 for geh-help-gnu-emacs@m.gmane.org; Sat, 26 Feb 2011 14:40:36 +0100 Original-Received: from localhost ([127.0.0.1]:37443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PtKNt-0006Qu-P0 for geh-help-gnu-emacs@m.gmane.org; Sat, 26 Feb 2011 08:40:33 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 Original-Newsgroups: gnu.emacs.help In-Reply-To: <87tyfrp9p2.fsf@puma.rapttech.com.au> Original-Lines: 29 Original-NNTP-Posting-Host: 92.232.137.113 Original-X-Trace: news.sunsite.dk DXC=>Beml349FBRl[:W; BVUdS?DZIH?UQ6E]45i7E1PQiLQiXd?DWbWG[N=S List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79502 Archived-At: On 2/26/2011 6:54 AM, Tim X wrote: > > (defun force-mode-line-update (&optional all) > (if all (with-current-buffer (other-buffer))) > (set-buffer-modified-p (buffer-modified-p))) > > The bit that doesn't look quite right to me is > > (if all (with-current-buffer (other-buffer))) > > I'm assuming that by calling with-current-buffer, this will temporarily > make 'other-buffer' active and as a side effect, the mode-line etc will get > updated. That would be quite magical if it were true. My guess is that the parentheses have been misplaced. It should have been (if all (with-current-buffer (other-buffer) (set-buffer-modified-p (buffer-modified-p))) (set-buffer-modified-p (buffer-modified-p)) This doesn't make it right of course. The "other-buffer" doesn't equate to "all" buffers, and pretty often, the "other-buffer" is an invisible buffer. It is not guaranteed that the current-buffer is a visible buffer either. So, this code would seem to be wrong at many levels! Cheers, Uday