GithubHelp home page GithubHelp logo

plugin-emacs's Introduction

Emacs Plugin

This plugin replicates the functionality of the emacs plugin for oh-my-zsh. It is essentially a wrapper around the very useful emacs daemon capability.

Below is an extract from the original plugin source file:

"Emacs 23 daemon capability is a killing feature. One emacs process handles all your frames whether you use a frame opened in a terminal via a ssh connection or X frames opened on the same host. Benefits are multiple

  • You don't have the cost of starting Emacs all the time anymore
  • Opening a file is as fast as Emacs does not have anything else to do.
  • You can share opened buffered across opened frames.
  • Configuration changes made at runtime are applied to all frames."

Usage

To use this plugin, install it as:

omf install emacs

Requirements

Emacs 23 or later is required for this plugin.

plugin-emacs's People

Contributors

bobthecow avatar bpinto avatar cap10morgan avatar iory avatar karthiknayak avatar onekelvinsmith avatar sagebind avatar tasmo avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugin-emacs's Issues

Error on OMF loading when Emacs plugin is installed using Fish 2.7.1

Hello, I've just upgraded Fish to 2.7.1 (from 2.6 I think) and now I have the following error message every time I open a new term (or when I omf reload):

omf reload  
test returned eval errors:
	invalid integer ''

If I remove the emacs plugin then the error disappears. Debug mode gives me:

<5> fish: intern /Users/nico/.local/share/omf/pkg/emacs/init.fish
<3> fish: path_get_path( 'sed' )
<4> fish: Exec job 'echo $full_version | sed  "s/\..*//"' with id 10
<4> fish: Created pipe using fds 7 and 8
<2> fish: Fork #16, pid 12628: internal builtin for 'echo'
<5> fish: universal log sync
<5> fish: universal log sync elided based on fast stat()
<5> fish: universal log no modifications
<2> fish: Fork #17, pid 12629: spawn external command '/usr/bin/sed' from '/Users/nico/.local/share/omf/pkg/emacs/init.fish'
<3> fish: Job is constructed
<4> fish: Continue job 10, gid 12612 (echo $full_version | sed  "s/\..*//"), UNCOMPLETED, NON-INTERACTIVE
<3> fish: select_try on 5
<3> fish: proc::read_try('echo $full_version | sed  "s/\..*//"')
<3> fish: select_try on 5
<3> fish: proc::read_try('echo $full_version | sed  "s/\..*//"')
<4> fish: io_buffer_t::read: blocking read on fd 5
<4> fish: Exec job 'set -l major_version (echo $full_version | sed  "s/\..*//")' with id 11
<3> fish: Skipping fork: no output for internal builtin 'set'
<3> fish: Set status of set -l major_version (echo $full_version | sed  "s/\..*//") to 0 using short circuit
<3> fish: Job is constructed
<4> fish: Continue job 11, gid -2 (set -l major_version (echo $full_version | sed  "s/\..*//")), COMPLETED, NON-INTERACTIVE
<3> fish: proc::read_try('set -l major_version (echo $full_version | sed  "s/\..*//")')
<4> fish: Exec job 'echo $major_version' with id 10
<3> fish: Skipping fork: buffered output for internal builtin 'echo'
<3> fish: Set status of echo $major_version to 0 using short circuit
<3> fish: Job is constructed
<4> fish: Continue job 10, gid -2 (echo $major_version), COMPLETED, NON-INTERACTIVE
<3> fish: proc::read_try('echo $major_version')
<3> fish: Job is constructed
<4> fish: Continue job 6, gid -2 (__major_version $__emacs), COMPLETED, NON-INTERACTIVE
<3> fish: proc::read_try('__major_version $__emacs')
<4> fish: io_buffer_t::read: blocking read on fd 3
<4> fish: Exec job 'set __emacs_version (__major_version $__emacs)' with id 9
<5> fish: universal log sync
<5> fish: universal log sync elided based on fast stat()
<5> fish: universal log no modifications
<3> fish: Skipping fork: no output for internal builtin 'set'
<3> fish: Set status of set __emacs_version (__major_version $__emacs) to 0 using short circuit
<3> fish: Job is constructed
<4> fish: Continue job 9, gid -2 (set __emacs_version (__major_version $__emacs)), COMPLETED, NON-INTERACTIVE
<5> fish: intern /Users/nico/.local/share/omf/pkg/emacs/init.fish
<4> fish: Exec job 'test "$__emacs_version" -gt 23' with id 6
<3> fish: Skipping fork: ordinary output for internal builtin 'test'
test returned eval errors:
	invalid integer ''
<3> fish: Set status of test "$__emacs_version" -gt 23 to 1 using short circuit

I do think that some internals of Fish have changes and that integer comparison done in this plugin to check Emacs version breaks plugin init.

Hope you can fix it. Feel free to ask me if I can be of any help.

Empty commit message

On Linux I get an empty commit message in any terminal because Emacs is called with the --no-wait option.

A function for git commits with waiting would be nice e.g.:

function gmacs
  __launch_emacs $argv --create-frame
end

funced does open emacsclient rightly.

Ideally funced should do something like this:

function fed
	funced -e "emacsclient -a ''" $argv
end

But instead this is what funced looks like:

$ funced fed
Editor exited but the function was not modified

which is not desireable. This seems to be because it is called with --no-wait, which is not how funced is designed.
Try this:

function fedupwithbug
	funced -e "emacsclient -a '' --no-wait" $argv
end
fedupwithbug fedupwithbug

Error upon entering `/usr/bin` or `/usr/local/bin`

I have multiple versions of Emacs installed -- but I am not sure that is the problem. When I cd into either /usr/bin or /usr/local/bin, I get the following error:

Invalid argument: ''                                                                                                      14:20:23
~/.config/fish/functions/./emacs.fish (line 30):
  if test "$__emacs_version" -gt 23
     ^
in function 'init' with arguments '/home/pymander/.local/share/omf/pkg/emacs'
	called during startup
in event handler: handler for generic event “init_emacs”
	called during startup
Invalid argument: ''
~/.config/fish/functions/./emacs.fish (line 30):
  if test "$__emacs_version" -gt 23
     ^
in function 'init' with arguments '/home/pymander/.local/share/omf/pkg/emacs'
	called during startup
in event handler: handler for generic event “init_emacs”
	called during startup

plugin-emacs doesn't work

I use this command to install emacs plugin, but it doesn't work.

omf install emacs

I checked the ~/.local/share/omf/pkg/emacs, the folder structure seems incorrect.
image

If I create functions folder, and move all fish files into it, it works.

x-display-list frame bug

The file __launch_emacs.fish assumes that (x-display-list) will return nil when all the frames are closed.

This doesn't always happen on my system, where it will stay as '(":1")' even when I have no frames open. This results in e silently doing nothing and returning to the command line.

A workaround is to call ec.

Reproduction steps:

  1. Put this in your .emacs
(setf (symbol-function 'x-display-list) (lambda (&rest ignore) '(":1")))
  1. Start the server /usr/bin/emacs.
  2. Have no frames open.
  3. call e ~ and it will not open a new frame.

Version extraction regex failed

The current regex

grep -o "[0-9]\+.[0-9]\+.[0-9]\+"

would fail on version like: GNU Emacs 26.1. A small tweak to

grep -oE "[0-9]+\.[0-9]+(\.[0-9]+)?"

could make it work.

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.