Coder Social home page Coder Social logo

nameframe's Introduction

Nameframe

Nameframe provides utility functions to manage frames by their names.

It’s primary goal is to be used with project.el (or Projectile) and/or perspective.el. When opening a project, it will either switch to an existing frame of the project, or create a new frame for the project.

Installation

MELPA

Nameframe is now available on MELPA. The project.el and perspective.el integrations are distributed separately (and thus will need to be installed separately).

  • M-x package-install RET nameframe RET
  • M-x package-install RET nameframe-project RET
  • M-x package-install RET nameframe-perspective RET

Manual install

Copy nameframe.el into your Emacs load path.

Optionally, copy nameframe-project.el and nameframe-perspective.el into your load path as well. See Usage section below for details.

Usage

Vanilla

symboldescription
nameframe-switch-frame(interactive) function to switch between existing frames by name
nameframe-create-frame(interactive) function to create a new frame

Project.el

Nameframe provides project.el integration to open projects in their own frames. To enable project.el integration, add the following line to your init file:

(nameframe-project-mode t)

With project.el integration enabled, an advice is added to create/switch to a project’s frame when switching projects with project-switch-project.

Projectile

Nameframe provides Projectile integration to open projects in their own frames. To enable Projectile integration, add the following line to your init file:

(nameframe-projectile-mode t)

With Projectile integration enabled, a hook is added to create/switch to a project’s frame when switching projects.

Perspective

Nameframe also provides perspective.el integration, so each frame has its own perspective (and thus have its own list of buffers).

To enable perspective integration, add the following line to your init file:

(nameframe-perspective-mode t)

With perspective integration enabled, calling nameframe-create-frame will now create a perspective.

Recommended setup

Although the project.el and perspective.el integrations are optional, nameframe really shines when used in conjunction with both packages. Here is a snippet on how to use nameframe to its full potential:

;; Assuming project.el and perspective.el are already installed

(persp-mode)

(nameframe-project-mode t)
(nameframe-perspective-mode t)

;; If your OS can't switch between applications windows by default *cough* OS X *cough*
;; you can have a shortcut to switch between existing frames by name
(global-set-key (kbd "M-P") 'nameframe-switch-frame)

With this setup, switching to a project will open it in its own dedicated frame with isolated buffers.

Caveats

  • Only (thoroughly) tested on GUI Emacs 24.5 on OS X
    • but seems to work fine on terminal Emacs
  • Does not work with Helm (I personally don’t use Helm. Pull-requests welcome.)

Demo with Projectile

https://raw.githubusercontent.com/john2x/nameframe/master/nameframe-demo.gif

License

See LICENSE.txt.

nameframe's People

Contributors

john2x avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nameframe's Issues

Make nameframe work with helm

Readme states that nameframe will not work with helm which I can see now. Do you know why or where to start looking to add such support?

I can see that after a frame was created, the keyboard input focus is still on the original frame...? At least on first interaction. Also, helm's buffer seems to stay open after selecting a project.

If I try to press Meta X in the newly created frame (after opening a project with projectile, with perspective enabled as well) I can see this messages:

persp-switch: Marker points into wrong buffer: #<marker in no buffer>
Aborting an helm session running in background

Respect frame-title-format

When creating frames with the name property specified, the name is used as the title (ignoring frame-title-format.

It would be nice if the frame-title-format is still followed, so that a frame-title-format of "[%F] %b" would allow a more descriptive frame title.

[Enhancement] next/previous-buffer per frame

I am trying to get a frame based workflow working. I work mostly in terminal and want to open frames which dont share buffers with other frame. Nameframe seems to work as I want when I use ivy.

I want to override the next/previous-buffer for fast switching buffers per frame. Right now it shows buffers of all frames.

I have the below config.

(use-package nameframe
  :defer t
  :after projectile perspective
  :init
  (persp-mode)
  (nameframe-projectile-mode t)
  (nameframe-perspective-mode t)
  )

Projectile + nameframe

I've tried setting up name frame in different configurations (mostly using use-package). Right now I can see that in fact:

projectile-before-switch-project-hook's value is (nameframe-projectile--before-switch-project-hook)

but it does not seem to work. When switching projects using projectile-switch-project it continues to re-use the same frame, always.

name frame-create-frame works and opens the currently active buffer in a new frame.

dired, magit etc

I was wondering how we can make this work were e.g. all dired buffers would be grouped together (all dired buffers into one buffer, possibly having to use perspective).

Any clue how?

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.