LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 04:48 AM   #1
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

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, 05:27 AM   #2
YesItsMe
Member
 
Registered: Oct 2014
Posts: 915

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
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 05:30 AM.
 
Old 12-11-2018, 07:42 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

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

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-11-2018, 11:02 PM   #5
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
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, 06:17 AM   #6
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

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

Rep: Reputation: 205Reputation: 205Reputation: 205
there never was anything simple about emacs
 
Old 01-10-2019, 01:34 AM   #8
YesItsMe
Member
 
Registered: Oct 2014
Posts: 915

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

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


Reply



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 07:57 AM
emacs in terminal-mode constrains output to 80 columns (emacs bug, or watch bug?) jgombos Linux - Software 1 06-17-2011 09:49 PM
emacs: minor mode font-mode-lock not on by default?! hewsonism Linux - Newbie 2 06-10-2010 01:32 PM
Automatic hs-minor-mode in Emacs for PHP mode? CoderMan Programming 1 06-12-2009 09:38 AM

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

All times are GMT -5. The time now is 02:26 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
Open Source Consulting | Domain Registration