dabbrev for every buffer
reddit / emacs
----------------------------------------------------------------------
zsome · 2022-02-25 05:46
Hi,
I would like to use the dabbrev for every file where connected to our
git project.
I wrote it to use every buffer (just for testing):
`(defun my/dabbrev-select-buffer (other-buffer)`
`(eq 1 1))`
`(setq dabbrev-friend-buffer-function #'my/dabbrev-select-
buffer)`
But it isn't working.
How can I set it up well ?
----------------------------------------------------------------------
7890yuiop · 2022-02-25 06:11
The only code formatting method which works for all of reddit is to
switch the reddit editor to markdown mode and indent the code by 4
spaces (you can use `M-4 C-x C-i` on a region followed by `M-x
untabify` to achieve this in Emacs). Otherwise for lots of readers
your message looks like this: https://old.reddit.com/r/emacs/comments/
t0wc5e/dabbrev_for_every_buffer/
----------------------------------------------------------------------
zsome · 2022-02-25 07:25
Thanks! Any comment for the question?
----------------------------------------------------------------------
eli-zaretskii · 2022-02-25 08:12
Can you explain the issue you are trying to solve? `dabbrev` searches
all the (non-trivial) buffers by default, so what is your problem with
the default behavior, and why do you need to change anything from the
defaults?
----------------------------------------------------------------------
zsome · 2022-02-25 08:18
I would like to use the dabbrev to find the words in a css file when
I'm working with an html. I try to add the css class to the html tag.
css file:
.css-class-1 {
... }
html file:
if I use the dabbrev in the css file I can find the words well.
I found that the default process use the other buffers with same major
mode only.
I wrote this small defun just check it's working or not.
----------------------------------------------------------------------
7890yuiop · 2022-02-25 09:03
No, because I still can't tell what the actual code you're attempting
to use is -- it remains completely broken-looking. (The purpose of my
previous comment was that you would fix it so that readers could see
what it really was.)
----------------------------------------------------------------------
eli-zaretskii · 2022-02-25 13:28
> I found that the default process use the other buffers with same
major mode only.
By default? That is not true, AFAIK: it looks in *all* buffers.
Do you see what you describe above in `emacs -Q`? If not, perhaps you
have some customizations that produce that effect.
----------------------------------------------------------------------
zsome · 2022-02-25 15:56
Thank yo for your answer but I think I can't read or ...
If I think well the dabbrev-friend-buffer-function what is make a
decision they need to check in the other buffers or not. I thought I
need to make a function here to find the css and html and js files
when I use dabbrev.
The setting is same with plugins and without plugins ("dabbrev--same-
major-mode-p') and now with -Q the html and css file see each others.
Woow.
I need to use emacs without plugins :D
Maybe there is an other line somewhere what I havne't read yet :D
Could you advice a documentation where I can read it ?
----------------------------------------------------------------------
eli-zaretskii · 2022-02-25 19:45
My suggestion is to find which of the plugins you use modifies the
default values of dabbrev variables. You can review all the
defcustoms at the beginning of `dabbrev.el` and compare their values
in your session with the default values. Then try to find out which
plugins make these changes.
----------------------------------------------------------------------
zsome · 2022-02-25 19:47
u/eli-zaretskii, I thought I write back what I found:
The dabbrev works in that way what you mentioned.
The web-mode causes the problem.
I don't know why and how to do it
I'm dropping it and use ng2-mode or html-mode instead.
Thank you for the help!