Code Monkey home page Code Monkey logo

Comments (3)

jrblevin avatar jrblevin commented on August 16, 2024

Currently, no, but I'd be happy to add such a feature. Please also see the discussion in #22.

I'm not an expert on window management, so I don't quite know what the right "Emacs way" to implement this is. For example, I wouldn't quite know how to implement (1) above. If you're able to submit a patch, I will certainly take a look.

from deft.

unlaered avatar unlaered commented on August 16, 2024

Thanks for the quick response! I don't know any Elisp (or any other programming languages) sadly. I'll be sure to have a look at #22.

from deft.

glucas avatar glucas commented on August 16, 2024

Emacs has a general mechanism for deciding how windows are split and/or reused. See How display-buffer works in the Emacs manual for more. You can tune this behavior by customizing display-buffer-alist -- see Choosing a Window for Display.

The display-buffer-alist lets you define rules for how to display buffers based on the buffer name. That may not help here because your deft buffers can have arbitrary names. However you can use this same mechanism to define your own variations of deft-open-file-other-window. For example, here's a command that will open the file in a window below the current window.

(defun my-deft-open-file-below ()
  (interactive)
  (let ((display-buffer-overriding-action
         (cons
          '(display-buffer-reuse-window
            display-buffer-use-some-window
            display-buffer-below-selected)
          nil)))
        (deft-open-file-other-window)))

This works by temporarily changing the default display action list before calling `deft-open-file-other-window. The specified action list is:

  • If the buffer is already displayed somewhere, reuse that window.
  • Otherwise use an existing window.
  • Otherwise split to create a new window below the current one.

from deft.

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.