unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* yasnippet global mode not active when visiting a markdown buffer
@ 2022-11-07 16:01 Luca Ferrari
  2022-11-11 12:54 ` Luca Ferrari
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Ferrari @ 2022-11-07 16:01 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,
in my configuration I've:

  (use-package markdown-mode
    :ensure t
    :init
    (setq markdown-command "multimarkdown"))

(use-package yasnippet
  :ensure t)

(add-hook 'prog-mode-hook #'yas-minor-mode)


(global-set-key (kbd "C-c s n") 'yas-new-snippet)
(global-set-key (kbd "C-c s i") 'yas-insert-snippet)
(global-set-key (kbd "C-c s v") 'yas-visit-snippet-file)

(use-package yasnippet-snippets :ensure t)
(yas-global-mode 1)

However, whenever I visit a markdown file the yas-globa-mode is always
toggled off, and I've to automatically enable it. Moreover, even after
enabling it, the keybindings are the default ones, not the global one
I've set up.
What am I missing here?

Thanks,
Luca



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: yasnippet global mode not active when visiting a markdown buffer
  2022-11-07 16:01 yasnippet global mode not active when visiting a markdown buffer Luca Ferrari
@ 2022-11-11 12:54 ` Luca Ferrari
  2022-11-11 20:06   ` Bruno Barbier
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Ferrari @ 2022-11-11 12:54 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Nov 7, 2022 at 5:01 PM Luca Ferrari <fluca1978@gmail.com> wrote:
>
> Hi all,
> in my configuration I've:
>
>   (use-package markdown-mode
>     :ensure t
>     :init
>     (setq markdown-command "multimarkdown"))
>
> (use-package yasnippet
>   :ensure t)
>
> (add-hook 'prog-mode-hook #'yas-minor-mode)
>
>
> (global-set-key (kbd "C-c s n") 'yas-new-snippet)
> (global-set-key (kbd "C-c s i") 'yas-insert-snippet)
> (global-set-key (kbd "C-c s v") 'yas-visit-snippet-file)
>
> (use-package yasnippet-snippets :ensure t)
> (yas-global-mode 1)

This is driving me crazy, is there a way to understand if
yas-global-mode is turned off whenever I enter the markdown-mode?

Thanks,
Luca



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: yasnippet global mode not active when visiting a markdown buffer
  2022-11-11 12:54 ` Luca Ferrari
@ 2022-11-11 20:06   ` Bruno Barbier
  2022-11-14 13:09     ` Luca Ferrari
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Barbier @ 2022-11-11 20:06 UTC (permalink / raw)
  To: Luca Ferrari, help-gnu-emacs



I'm not using use-package nor markdown-mode.

But why would this:

>> (add-hook 'prog-mode-hook #'yas-minor-mode)

be relevant here ?


markdown-mode is not about programs, it's about text.

IOW, I would try:

  (add-hook 'text-mode-hook #'yas-minor-mode)

or something like that.



Bruno





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: yasnippet global mode not active when visiting a markdown buffer
  2022-11-11 20:06   ` Bruno Barbier
@ 2022-11-14 13:09     ` Luca Ferrari
  2022-11-15  2:50       ` Emanuel Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Ferrari @ 2022-11-14 13:09 UTC (permalink / raw)
  To: Bruno Barbier; +Cc: help-gnu-emacs

On Fri, Nov 11, 2022 at 9:00 PM Bruno Barbier <brubar.cs@gmail.com> wrote:
>
>
>
> I'm not using use-package nor markdown-mode.
>
> But why would this:
>
> >> (add-hook 'prog-mode-hook #'yas-minor-mode)
>
> be relevant here ?
>
>
> markdown-mode is not about programs, it's about text.
>

Thanks, yes, my idea is to load yas-minor-mode whenever a programming
mode is there.
I know markdown-mode is not about programming, and I think there's a
reason why it is not working with my setup: markdown-mode binds a set
of commands to C-c C-s as I'm trying to do.
I will report back once I've configured it, also testing your idea.

Thanks,
Luca



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: yasnippet global mode not active when visiting a markdown buffer
  2022-11-14 13:09     ` Luca Ferrari
@ 2022-11-15  2:50       ` Emanuel Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2022-11-15  2:50 UTC (permalink / raw)
  To: help-gnu-emacs

Luca Ferrari wrote:

> Thanks, yes, my idea is to load yas-minor-mode whenever
> a programming mode is there. I know markdown-mode is not
> about programming [...]

Actually that distinction is ... something. It is data that is
organized in certain ways according to rules and then it is,
or can be, processed by a computer program.

Programming pretty much.

But I admit I like Lisp more than Markdown ...

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-15  2:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07 16:01 yasnippet global mode not active when visiting a markdown buffer Luca Ferrari
2022-11-11 12:54 ` Luca Ferrari
2022-11-11 20:06   ` Bruno Barbier
2022-11-14 13:09     ` Luca Ferrari
2022-11-15  2:50       ` Emanuel Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).