LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 12-11-2018, 05:48 AM   #1
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 552

Rep: Reputation: 28
Simple emacs mode


I'm looking for a major mode for emacs that does absolutely nothing. No formatting, no indentation.

I want only the characters entered from the keyboard in the buffer without modification.

Is there such a mode?
 
Old 12-11-2018, 06:27 AM   #2
YesItsMe
Member
 
Registered: Oct 2014
Distribution: Gentoo
Posts: 515

Rep: Reputation: 182Reputation: 182
Why?

I mean, it would probably be like this:

Code:
(defun noop-mode ()
  "Don't do anything."
  t)

(provide 'noop-mode)
But... why don't you just not load a mode then?

Last edited by YesItsMe; 12-11-2018 at 06:30 AM.
 
Old 12-11-2018, 08:42 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,392

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
I think you're looking for fundamental-mode.
 
Old 12-11-2018, 09:04 AM   #4
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 552

Original Poster
Rep: Reputation: 28
Sorry, but no. It has the problem that if a line is indented, pressing Enter at the end of that line puts the cursor on the next line indented.

I tried
Code:
;;;###autoload
(define-generic-mode null-mode
  nil nil nil nil nil
  "Do nothing.")

(provide 'null-mode)
It allowed me to select null-mode, but has the same problem.

It looks like I need to find where \n is configured when emacs is started.
 
Old 12-12-2018, 12:02 AM   #5
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,392

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by CollieJim View Post
Sorry, but no. It has the problem that if a line is indented, pressing Enter at the end of that line puts the cursor on the next line indented.
Depending on which version of Emacs you're using, disabling electric-indentation-mode might help (M-- M-x electric-indentation-mode).

Otherwise, I guess you'll need to make a new mode with a different value for indent-line-function (the default is indent-relative):

Code:
(define-derived-mode no-indent-mode fundamental-mode "NoIndent" 
  (setq-local indent-line-function #'ignore))
 
Old 12-12-2018, 07:17 AM   #6
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 552

Original Poster
Rep: Reputation: 28
Thanks.
Disabling electric-indent-mode works.
 
Old 01-09-2019, 11:05 PM   #7
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,054

Rep: Reputation: 200Reputation: 200Reputation: 200
there never was anything simple about emacs
 
Old 01-10-2019, 02:34 AM   #8
YesItsMe
Member
 
Registered: Oct 2014
Distribution: Gentoo
Posts: 515

Rep: Reputation: 182Reputation: 182
There actually was.
 
Old 01-10-2019, 02:00 PM   #9
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,054

Rep: Reputation: 200Reputation: 200Reputation: 200
e3 now that is a simple editor and at 17KB (for the 64bit version)
it is small and it's easy to use
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get emacs -nw when I call emacs from a terminal but GUI emacs elsewhere? Blackened Justice Linux - Newbie 4 09-08-2011 08:57 AM
emacs in terminal-mode constrains output to 80 columns (emacs bug, or watch bug?) jgombos Linux - Software 1 06-17-2011 10:49 PM
emacs: minor mode font-mode-lock not on by default?! hewsonism Linux - Newbie 2 06-10-2010 02:32 PM
Automatic hs-minor-mode in Emacs for PHP mode? CoderMan Programming 1 06-12-2009 10:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 04:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration