jinja2-mode icon indicating copy to clipboard operation
jinja2-mode copied to clipboard

Wishlist: minor mode

Open BrianHicks opened this issue 9 years ago • 8 comments

I use jinja2 in tons of places that aren't HTML - basically everywhere in Ansible or Salt. Stuff like YAML and RC files where I'd still like to have syntax highlighting and major modes for those files, but also take advantage of the work you've done for my {{ blocks }}. Do you think a minor mode is even possible with this code? Would it be a lot of work to add?

BrianHicks avatar Mar 19 '15 15:03 BrianHicks

I'm trying to do this, I've got this so far but it doesn't work, any ideas?

(setq kwds `(,jinja2-font-lock-keywords
  ,jinja2-font-lock-keywords-1
  ,jinja2-font-lock-keywords-2
  ,jinja2-font-lock-keywords-3))

(define-minor-mode blah-mode
  "doc string"
  nil " blah" nil

  (if blah-mode
      (font-lock-add-keywords nil kwds)
    (font-lock-remove-keywords nil kwds))

  (if (fboundp 'font-lock-flush)
      (font-lock-flush)
    (when font-lock-mode
      (with-no-warnings (font-lock-fontify-buffer)))))

BrianHicks avatar Mar 20 '15 16:03 BrianHicks

It would be really useful to be able to use this mode together with yaml-mode for SaltStack and will interest other people.

Although it's possible to have a very basic jinja2 highlighting with mmm-jinja2 it isn't complete at all.

bricewge avatar Nov 26 '15 14:11 bricewge

Since I had to start working with jinja2 and had the need for something like this mode, I started merging pull requests and ideas at https://gitweb.krosos.org/emacs-jinja2-mode-ng0/ feel free to send git-format patches to one of the addresses at https://krosos.org/ng0/

ghost avatar Sep 24 '17 16:09 ghost

Do you want maintainer rights to this repo instead?

On Sun, Sep 24, 2017, 18:27 ng0 [email protected] wrote:

Since I had to start working with jinja2 and had the need for something like this mode, I started merging pull requests and ideas at https://gitweb.krosos.org/emacs-jinja2-mode-ng0/ feel free to send git-format patches to one of the addresses at https://krosos.org/ng0/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/paradoxxxzero/jinja2-mode/issues/12#issuecomment-331721267, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQjKK8VNIaITojNEpVeiETNSShpTkXdks5sloL8gaJpZM4DxbAW .

paradoxxxzero avatar Sep 24 '17 16:09 paradoxxxzero

I have some strong feelings about github. Unless I can avoid it, I prefer decentralized work with git remotes for small projects.

And I'm still not 100% sure wether I'll be able to keep development steady. It's my first look into writing modes after just using emacs for years. Can't do anything more than to just do it.

ghost avatar Sep 24 '17 16:09 ghost

Alright, if you can, just make PR from your git and I'll try to merge them. If anyone else wants to become the next maintainer, just ask

On Sun, Sep 24, 2017, 18:55 ng0 [email protected] wrote:

I have some strong feelings about github. Unless I can avoid it, I prefer decentralized work with git remotes for small projects.

And I'm still not 100% sure wether I'll be able to keep development steady. It's my first look into writing modes after just using emacs for years. Can't do anything more than to just do it.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/paradoxxxzero/jinja2-mode/issues/12#issuecomment-331723342, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQjKO_mEXBC5SrUP06JvanWub0qaq_-ks5slolZgaJpZM4DxbAW .

paradoxxxzero avatar Sep 24 '17 17:09 paradoxxxzero

I have some strong feelings about github. Unless I can avoid it, I prefer decentralized work with git remotes for small projects.

Now this decentralized work is just lost. Does anyone have any progress with the topic?

Andor avatar Jun 22 '20 11:06 Andor

I made some / limited changes at https://github.com/teknokatze/jinja2-mode-ng0 or whatever I called it. It might still be out of sync as I moved from git to hg to git in the last years and use github as a mirror to showcase.

Edit: https://github.com/teknokatze/emacs-jinja2-mode

Edit2: I have limited time for open source besides my main projects, I've just added to jinja2-mode what I needed for my last job where I used jinja2. Another approach could be to just move this original repository to a group and then changes (if there are still some to be made) can be done with more committers and/or discussion.

ghost avatar Jun 22 '20 12:06 ghost