Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs #246

Closed
snunez1 opened this issue Mar 30, 2020 · 31 comments
Closed

Emacs #246

snunez1 opened this issue Mar 30, 2020 · 31 comments

Comments

@snunez1
Copy link

snunez1 commented Mar 30, 2020

Nice project. Have you considered adding emacs to the list of tools/projects?

@trunkmaster
Copy link
Owner

Thank, you. I don't quite understand what do you mean by "adding emacs". Could you plase explain what exactly you expect?

@alexmyczko
Copy link
Contributor

Maybe Emacs.app? http://aiei.ch/emacs.png

@snunez1
Copy link
Author

snunez1 commented Mar 30, 2020

An emacs app is what I was referring to. Trying to compile emacs under GNUstep hasn't worked for a long time as far as I am aware. It would make a nice addition to the toolkit.

@trunkmaster
Copy link
Owner

trunkmaster commented Mar 31, 2020

@snunez1 It would be nice to have Emacs.app for everyday usage but... I've tried current version from master. It is running but almost unusable - randomly crashes, scrollbars buggy, font settings doesn't applied from ~/.emacs, menu flickers on almost any action. It seems GNUstep support needs huge amount of work to make Emacs.app useful. I'd like to have time to do that work, but I don't right now. Any volunteers?

@snunez1
Copy link
Author

snunez1 commented Mar 31, 2020

It sounds like you have got farther than I. Yesterday I wasn't even able to get it to compile. I've reported it to the GNUstep maintainers. Perhaps we can mark this one as an enhancement or nice-to-have and return to it as time permits.

@enzuru
Copy link
Contributor

enzuru commented Apr 17, 2020

Hey all, I'm an Emacs user and I occasionally submit patches to the Emacs project. I was able to get the latest Emacs.app to compile against the latest NEXTSPACE but it involved a couple minor patches of the code and CentOS 7.

It seems quite stable, but I'll report back if that proves otherwise. I am noticing the font problem, but everything else seems fine.

I'm going to work on getting the patch submitted upstream to Emacs first. After I have gotten it merged, I'll write a blog article on how to compile Emacs.app on NEXTSPACE.

And after that, I'm going to prepare two Ansible playbooks. One will convert a minimal CentOS 7 instance into a NEXTSPACE workstation. The second will convert a minimal CentOS7 instance into a NEXTSPACE developer workstation with the latest version and source of NEXTSPACE as well as a brand new Emacs.app.

Emacs.app is probably our best bet for writing serious Objective-C code.

@snunez1
Copy link
Author

snunez1 commented Apr 17, 2020 via email

@trunkmaster
Copy link
Owner

@enzuru Please build Emacs.app against master branch (now we have up-to-date build instructions in .circleci/config.yml, thank you).
It would be great if you create emacs fork so I could create a pull requests. I had numerous issues with my build of Emacs.app (and some ideas too).

@enzuru
Copy link
Contributor

enzuru commented Apr 17, 2020

@nextspace I've successfully built the latest Emacs.app against the latest nextspace GNUstep branches. While I do notice crashing (usually when I am closing Emacs, meaning it is not costing me much) and some font issues, Emacs.app is largely usable.

Some Objective-C code was refactored recently in Emacs which caused the latest to break. I just submitted a patch to the emacs-devel mailing list. As soon as the code is merged, I'll write that blog.

Afterwards, we can setup an Emacs branch on GitHub for further improvement.

@trunkmaster
Copy link
Owner

@enzuru I'm using emacs for development too. Also org-mode is very good. I dream about full-featured Emacs.app, actually. Looking for your emacs fork/branch.

@enzuru
Copy link
Contributor

enzuru commented Apr 18, 2020

Blog post here: https://medium.com/@enzuru/compiling-emacs-app-on-nextspace-centos-7-12e0be45f502

Next project is making the NEXTSTEP Ansible scripts for end users.

@trunkmaster
Copy link
Owner

trunkmaster commented Apr 18, 2020

@enzuru You've mentioned NEXTSTEP several times through your blog post. Is it intentional or just typos?

@enzuru
Copy link
Contributor

enzuru commented Apr 18, 2020

@trunkmaster a bit tired and groggy... that was a mistake. Will fix.

@trunkmaster
Copy link
Owner

trunkmaster commented Apr 19, 2020

@enzuru no problem. It's a proof of correct name I've choosen. ;)

BTW, you don't need to patch CentOS to overcome __unused and __block - it can be #ifdef'ed like my in patch to libdispatch. Look here as an example.

@enzuru
Copy link
Contributor

enzuru commented Apr 19, 2020

@trunkmaster I suggest you fork this repo if you want to start making extensive changes to Emacs.app: https://github.com/emacs-mirror/emacs

If you share notes with me, perhaps I can help as well.

@enzuru
Copy link
Contributor

enzuru commented Apr 20, 2020

BTW, I just got Xcode-style Cocoa-aware autocompletion working through ccls: https://github.com/MaskRay/ccls

I'll write a blog entry shortly on how to get this setup for Emacs on NEXTSPACE.

@trunkmaster
Copy link
Owner

Wow! I badly need good autocompletion for Objective-C. I'm not happy with auto-complete, company, irony, yas and their combinations.

Also I think it will be good idea to make good .emacs and emacs.d for NEXTSPACE (and GNUstep of course) development. These files can be put into https://github.com/trunkmaster/nextspace/tree/master/System/etc/skel. It might be a part of some -devel packages. What do you think?

@enzuru
Copy link
Contributor

enzuru commented Apr 21, 2020

@trunkmaster every Emacs user already has their own .emacs.d, so I think it would be better to document the process of setting up Emacs.app (or vanilla Emacs) with CCLS along with whatever other elisp libraries we need.

CCLS is editor agnostic, so it's possible that we should document that CCLS is basically required for an Xcode-style experience, and that any editor with a CCLS plugin will do.

How we can start building documentation together is I'll make a first pass using my blog (to get information out there for early adopters) and then you (or me) can go ahead and adapt the appropriate bits to the "official" documentation.

@enzuru
Copy link
Contributor

enzuru commented Apr 21, 2020

@trunkmaster blog post instructions here: https://medium.com/@enzuru/setting-up-emacs-as-a-modern-objective-c-ide-ffa57d9e8a75

@tsuu32
Copy link

tsuu32 commented Apr 21, 2020

I also challenged Emacs building with NEXTSPACE 0.85 and Emacs 26.3 (yes, not upstream) in VirtualBox.
I replaced /usr/include/unistd.h's __block with__libc_block (emacs source has many #include <unistd.h> so I didn't create source level patch).

And run followings...

sudo yum install gnutls-devel
sudo yum install ncurses-devel
cd emacs-26.3/
CC=clang ./configure --with-ns --without-x
CC=clang make

This can build emacs (!) but running the executable src/emacs cause segmentation fault.
Attachment is screenshot of backtrace by gdb src/emacs.
emacs-nextspace-bt

If I have time, I'll do it with upstream.
Thank you for the very cool project.

@trunkmaster
Copy link
Owner

@enzuru nice post, thanks. I'll play a little with this.

@trunkmaster
Copy link
Owner

@tsuu32 You should better compile Emacs agains master branch of NEXTSPACE. I've saw that type of crashes with old GNUstep libraries. NEXTSPACE 0.85 contains quite old ones. The next release will be based on the latest GNUstep libraries.

@trunkmaster
Copy link
Owner

@enzuru i've played a bit with ccls and can share some thoughts:

  1. It's true - the be best way to install ccls is snap package (it contains Ubuntu version of LLVM). I tried to build it myself, but LLVM shipped with CentOS does not fit ccls - it's segfaults. I'm beginning to think about move to Fedora. ;)
  2. I use gnustep-config --objc-flags output as a content of .ccls file. It works.
  3. I use company-lsp as frontend.

Overall impression - quite fast, functional but not accurate autocompletion solution. I failed to make autocompletion for NSTimer, NSNotificationCenter methods ('lsp' offered me a methods from NSTableView or something like this instead). However it managed to find methods list for NSString. It's strange...

Could you please share your impression or test results of above mentioned?

@enzuru
Copy link
Contributor

enzuru commented Apr 24, 2020

@trunkmaster so it appears to me that the autocompletion of class methods are not working. So if I type [NSTimer sch... all it provides only methods for NSObject.

However, if I go ahead and create the timer, then [timer set... pops up appropriate suggestions.

I'll see if I can work with the upstream projects to get this fixed. Might need to wait for the move to Fedora first, as compiling ccls seems a pain on CentOS 7.

@trunkmaster
Copy link
Owner

@enzuru one clarification: not all classes' class methods affected. For instance, NSString class methods autocompletion works for me.

@uchuugaka
Copy link

uchuugaka commented Apr 24, 2020 via email

@tsuu32
Copy link

tsuu32 commented Apr 27, 2020

I installed upstream gnustep and rebuilt emacs.
The emacs can run.

nextspace-emacs27-splash
nextspace-emacs27

I found some limitations,

  • proportional font is ugly. (monospace font is no problem)
  • Alt + x is not M-x. (Alt is recognized Super key?)
  • while emacs is running, gnustep icon put at left bottom.
  • when emacs is minimized, the icon doesn't appear.

...and some redisplay issue.

@tsuu32
Copy link

tsuu32 commented May 8, 2020

Alt + x is not M-x. (Alt is recognized Super key?)

I see Wiki https://github.com/trunkmaster/nextspace/wiki/Keyboard and understand it is intended.

@trunkmaster
Copy link
Owner

@tsuu32 sure. Alt (Command) is reserved for applications purposes. For example, if you run emacs in Terminal Cmd+x is reserved for "Edit->Cut" menu item action.

@queernix
Copy link

If there are still issues with Emacs, it might be beneficial to look at the macOS part of Emacs. I don't remember off the top of my head if it requires a separate patch or not, but the Emacs.app port (emacs-app) that I get from macports works very well. I doubt it's using many/any Cocoa-exclusive features that aren't going to be in GNUstep

@enzuru
Copy link
Contributor

enzuru commented Oct 15, 2020

@queernix my experience is actually that macOS is the problem, because Emacs.app maintainers make MacOS changes that sometimes breaks GNUstep support, since they are both "nextstep" versions, but with minor and subtle differences. And since there are 100x as many macOS users as GNUstep... it means our builds get broken.

Repository owner locked and limited conversation to collaborators Oct 18, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

7 participants