all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* *.ino files as c mode?
@ 2020-12-03 10:20 John Conover
  2020-12-03 10:25 ` Jean Louis
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: John Conover @ 2020-12-03 10:20 UTC (permalink / raw)
  To: help-gnu-emacs

Possible to set c mode for *.ino files?

    Thanks,

    John
    
-- 

John Conover, conover@rahul.net, http://www.johncon.com/



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

* Re: *.ino files as c mode?
  2020-12-03 10:20 *.ino files as c mode? John Conover
@ 2020-12-03 10:25 ` Jean Louis
  2020-12-03 10:31 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2020-12-03 10:41 ` tomas
  2 siblings, 0 replies; 7+ messages in thread
From: Jean Louis @ 2020-12-03 10:25 UTC (permalink / raw)
  To: John Conover; +Cc: help-gnu-emacs

* John Conover <conover@rahul.net> [2020-12-03 13:24]:
> Possible to set c mode for *.ino files?

(add-to-list 'auto-mode-alist '("/mutt-protected-.*" . mail-mode))

You may adapt this to use c mode for .ino



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

* Re: *.ino files as c mode?
  2020-12-03 10:20 *.ino files as c mode? John Conover
  2020-12-03 10:25 ` Jean Louis
@ 2020-12-03 10:31 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2020-12-03 10:41 ` tomas
  2 siblings, 0 replies; 7+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-12-03 10:31 UTC (permalink / raw)
  To: help-gnu-emacs

John Conover wrote:

> Possible to set c mode for *.ino files?

(let ((modes (list
     '("\\.bal\\'" . balance-mode)
     '("\\.lu\\'"  . lua-mode)
     '("\\.nqp\\'" . perl-mode)
     '("\\.php\\'" . html-mode)
     '("\\.pic\\'" . nroff-mode)
     '("\\.pl\\'"  . prolog-mode)
     '("\\.tex\\'" . latex-mode)
     '("\\.xr\\'"  . conf-xdefaults-mode)
     '("*"         . text-mode) )))
  (setf auto-mode-alist (nconc modes auto-mode-alist)) )

https://dataswamp.org/~incal/emacs-init/mode-by-filename.el

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




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

* Re: *.ino files as c mode?
  2020-12-03 10:20 *.ino files as c mode? John Conover
  2020-12-03 10:25 ` Jean Louis
  2020-12-03 10:31 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2020-12-03 10:41 ` tomas
  2020-12-03 11:13   ` Omar Polo
  2 siblings, 1 reply; 7+ messages in thread
From: tomas @ 2020-12-03 10:41 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

On Thu, Dec 03, 2020 at 02:20:50AM -0800, John Conover wrote:
> Possible to set c mode for *.ino files?

Most easily you can add the association ".ino" => c-mode to your
variable `auto-mode-alist', perhaps in your init file. The left
hand side of the association is a regular expression which has
to match the file names; in this case, perhaps something like
"\\.ino\\'". Something like

  (add-to-list 'auto-mode-alist c-mode)

in your init file might do.

Alternatively, you could put something like

/* -*- mode: c -*- */

somewhere at the top of your files.

For all the other possibilities and their ramifications, see
"23.3 Choosing File Modes" in the manual; in the Interwebs
here [1].

Cheers

[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html

 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: *.ino files as c mode?
  2020-12-03 10:41 ` tomas
@ 2020-12-03 11:13   ` Omar Polo
  2020-12-03 11:44     ` tomas
  2020-12-03 17:28     ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 7+ messages in thread
From: Omar Polo @ 2020-12-03 11:13 UTC (permalink / raw)
  To: tomas; +Cc: help-gnu-emacs


tomas@tuxteam.de writes:

> On Thu, Dec 03, 2020 at 02:20:50AM -0800, John Conover wrote:
>> Possible to set c mode for *.ino files?
>
> Most easily you can add the association ".ino" => c-mode to your
> variable `auto-mode-alist', perhaps in your init file. The left
> hand side of the association is a regular expression which has
> to match the file names; in this case, perhaps something like
> "\\.ino\\'". Something like
>
>   (add-to-list 'auto-mode-alist c-mode)
>
> in your init file might do.

I believe you wanted to write

    (add-to-list 'auto-mode-alist '("\\.ino\\'" . c-mode))

> Alternatively, you could put something like
>
> /* -*- mode: c -*- */
>
> somewhere at the top of your files.
>
> For all the other possibilities and their ramifications, see
> "23.3 Choosing File Modes" in the manual; in the Interwebs
> here [1].
>
> Cheers
>
> [1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html
>
>  - t




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

* Re: *.ino files as c mode?
  2020-12-03 11:13   ` Omar Polo
@ 2020-12-03 11:44     ` tomas
  2020-12-03 17:28     ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 7+ messages in thread
From: tomas @ 2020-12-03 11:44 UTC (permalink / raw)
  To: Omar Polo; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

On Thu, Dec 03, 2020 at 12:13:05PM +0100, Omar Polo wrote:
> 
> tomas@tuxteam.de writes:

> > [...] ino\\'". Something like
> >
> >   (add-to-list 'auto-mode-alist c-mode)
> >
> > in your init file might do.
> 
> I believe you wanted to write
> 
>     (add-to-list 'auto-mode-alist '("\\.ino\\'" . c-mode))

Argh. YES! Thanks for the correction.

Cheers
 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: *.ino files as c mode?
  2020-12-03 11:13   ` Omar Polo
  2020-12-03 11:44     ` tomas
@ 2020-12-03 17:28     ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 7+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-12-03 17:28 UTC (permalink / raw)
  To: help-gnu-emacs

Omar Polo wrote:

> I believe you wanted to write
>
>     (add-to-list 'auto-mode-alist '("\\.ino\\'" . c-mode))

Or put this topmost:

  /* -*- c -*- */

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




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

end of thread, other threads:[~2020-12-03 17:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03 10:20 *.ino files as c mode? John Conover
2020-12-03 10:25 ` Jean Louis
2020-12-03 10:31 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-03 10:41 ` tomas
2020-12-03 11:13   ` Omar Polo
2020-12-03 11:44     ` tomas
2020-12-03 17:28     ` Emanuel Berg via Users list for the GNU Emacs text editor

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.