Coder Social home page Coder Social logo

Comments (9)

doublep avatar doublep commented on July 19, 2024 1

To make it even worse, this changes the stack order of buffers, so that C-x b RET no longer switches to the "previous" buffer. At this point polymode is unusable for me.

from polymode.

srnnkls avatar srnnkls commented on July 19, 2024 1

If you, like me, do use ivy-switch-buffer and friends you can go bruteforce with this regex:

(add-to-list 'ivy-ignore-buffers "\\[.+\\]")

EDIT (Ido version):

(setq ido-ignore-buffers '("\\` " "\\[.+\\]"))

from polymode.

doublep avatar doublep commented on July 19, 2024

Actually, just found this in Elisp manual:

Buffers that are ephemeral and generally uninteresting to the user have names starting with a space, so that the ‘list-buffers’ and ‘buffer-menu’ commands don’t mention them (but if such a buffer visits a file, it is mentioned). A name starting with space also initially disables recording undo information; see *note Undo::.

from polymode.

vspinu avatar vspinu commented on July 19, 2024

Hiding those buffers is a non-trivial change. I have in my agenda to re-start working on polymode this week after a long break. This issue is a priority.

this changes the stack order of buffers, so that C-x b RET no longer switches to the "previous" buffer.

What change do you mean more concretely? I don't understand what you mean.

Polymode shifts only its own "non-interesting" buffers at the end of the buffer stack. I am using ido and the most relevant buffer is always in front. I don't understand how a couple of more buffers in ido menu make polymode unusable.

from polymode.

doublep avatar doublep commented on July 19, 2024

Well, maybe it tries to shift, but fails. Tried both polymode from melpa and git head. I can just:

  • C-x f file1.jsp
  • C-x f file2.jsp

Now C-x b shows 'file1.jsp[js]' as the buffer it will switch to by default. This seems to be OK, since switching to that buffer effectively switches to 'file1.jsp', but in the course of my normal work I had worse cases where it would switch to something different entirely.

I also tried to change variable 'pm--ib-prefix' in the source code from empty string to one space, but that broke the mode entirely.

from polymode.

ashiklom avatar ashiklom commented on July 19, 2024

Loosely related, but I am currently using a function like this to kill all polymode buffers for the current buffer (useful when switching to plain markdown-mode). Perhaps a similar approach can be used as advice (?) for the buffer list.

(defun ans/kill-polymode-buffers ()
  "List all polymode implementation buffers."
  (interactive)
  (let* ((b (buffer-name))
         (pattern (concat b "\\[.+\\]"))
         (matched-buffers (-filter (lambda (buf) (s-matches? pattern (buffer-name buf))) (buffer-list)))
         (n-matched (length matched-buffers)))
    (-map #'kill-buffer matched-buffers)
    (message "Killed %d polymode buffers." n-matched)))

from polymode.

mavit avatar mavit commented on July 19, 2024

We can make that regular expression a little bit tighter, since the part in square brackets is always at the end of the buffer name.

(add-to-list 'ivy-ignore-buffers "\\[.+\\]\\'")

from polymode.

srnnkls avatar srnnkls commented on July 19, 2024

Good one. Just out of curiosity:

Is it more appropriate to use \\' than simply $ here?

from polymode.

mavit avatar mavit commented on July 19, 2024

Marginally. The following is a valid (if foolish) buffer name, since buffer names can contain newlines:

foo[bar]
baz

from polymode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.