[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to add property for a buffer object
From: |
York Zhao |
Subject: |
Re: How to add property for a buffer object |
Date: |
Wed, 12 Sep 2012 12:36:06 -0400 |
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 <RET> 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