From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: York Zhao Newsgroups: gmane.emacs.help Subject: Re: How to add property for a buffer object Date: Wed, 12 Sep 2012 12:36:06 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1347467782 30174 80.91.229.3 (12 Sep 2012 16:36:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2012 16:36:22 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 12 18:36:25 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TBpvN-0004t4-CV for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Sep 2012 18:36:25 +0200 Original-Received: from localhost ([::1]:37759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBpvJ-0003J8-Px for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Sep 2012 12:36:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBpv8-0003Is-Ux for help-gnu-emacs@gnu.org; Wed, 12 Sep 2012 12:36:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBpv4-0000GD-Ta for help-gnu-emacs@gnu.org; Wed, 12 Sep 2012 12:36:10 -0400 Original-Received: from mail-vc0-f169.google.com ([209.85.220.169]:58880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBpv4-0000G9-PZ for help-gnu-emacs@gnu.org; Wed, 12 Sep 2012 12:36:06 -0400 Original-Received: by vcbfl13 with SMTP id fl13so2890650vcb.0 for ; Wed, 12 Sep 2012 09:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=igfbyra0/vndDmVvNg6SiyDOOyhcDzO7H6lY+LOjOY4=; b=s8yjdV1+Vevn0UcqsukGnbMVhl2WAh4Mk69pnU4s40JmTf4txFtFUL51Ugd0YPHnr2 5AxaCqaTDir4dNiTYyRvz7p121jh2NqF9s62GdfOm+6HY7+Hcz+PnsWKC3927S/T+kdA IMOiEf7wxwCw4C30WY2lUMUaijKpmBg/XcaMcB2A+E27HWUidmTqtImner2KTejVrYih CarOPrfE/N2bBs9FSmIZytctIVxVC5UywhH7hPPXIRWivrJjz3qJWHj94dDFVg/Uk5IN /vaVi3gtm8/CBu723IAuZ+C6Kolks9hQHQg8wQgJJaw8KS2EdF+dJOKPfLWVXFvz4geB sVPQ== Original-Received: by 10.220.150.201 with SMTP id z9mr28878377vcv.70.1347467766322; Wed, 12 Sep 2012 09:36:06 -0700 (PDT) Original-Received: by 10.52.185.194 with HTTP; Wed, 12 Sep 2012 09:36:06 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.220.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86734 Archived-At: Thank you very much Drew for the reply, I have been so impressed by your warm hearted on this list, and your knowledge on Emacs lisp (of course). And your trick of turning on `debug-on-quit' had been a life saver for me to figure out which part of which function was holding up the CPU. Thanks a lot, really. > You can use `get' and `put' on the symbol that is the value of variable > `major-mode'. I don't think this would help because I need to attach something to the buffer, not all the buffers in the major-mode. > Or you can simply make some variable buffer-local for a given mode. Yes, I think this would work, but I then have to create a variable for this, have no idea why Emacs doesn't allow assigning property to the buffer object itself, just like assigning property to a symbol. > Test something specific to the buffer or its mode (see above). > Or just use a prefix arg (and test that). I'm sure this would work, but I'm still not happy with having to do it this way. Maybe the ultimate solution is to fix the `refill-mode' itself so that I can alway have it turned on (tired of having to hit "M-q" almost all the time). The major problem with `refill-mode' however, is that it intercepts the "fill-function" therefor was not able to handle refilling properly in org-mode, especially, it would mess up org tables. Also, if you have `refill-mode' turned on, you will never be able to break a paragraph into two by hitting while the point is in the middle of the paragraph. On the other hand, the `auto-fill-mode' never "auto-fill" when inserting text in the middle of a line, because of this, I have to hit "M-q" all the time. Do you know of any other way to really handle "auto-fill" property? Thanks again, York