EMACS noob tab question

dds14u

Golden Member
Feb 24, 2004
1,310
0
0
For some reason my tab button no longer works in EMACS. I've played around with it and it seems equivalent to M - W (copy).


How do I change it???
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
Check your .emacs file. Any changes to the emacs configuration will reside somewhere in that file. It's Lisp, though, so hopefully you know enough to figure out the problem.
 

lousydood

Member
Aug 1, 2005
158
0
0
That's really weird. You can change it by evaluating

(global-set-key (kbd "TAB") 'indent-for-tab-command)

Either hit M-: before typing that to eval it, or put it in your .emacs file.
 

dds14u

Golden Member
Feb 24, 2004
1,310
0
0
Originally posted by: esun
Check your .emacs file. Any changes to the emacs configuration will reside somewhere in that file. It's Lisp, though, so hopefully you know enough to figure out the problem.

Don't know any Lisp, but have a few things in the .emacs file I can use for reference.

Originally posted by: lousydood
That's really weird. You can change it by evaluating

(global-set-key (kbd "TAB") 'indent-for-tab-command)

Either hit M-: before typing that to eval it, or put it in your .emacs file.

Tried sticking that in the file, but nothing works...

It seems that the tab key in emacs defaults to jumping to the first indentation of the line as opposed to (what I'm used to) inserting a " " tab.
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
Emacs auto-tabs most documents. E.g., if you are coding in C, then it'll automatically tab functions and such based on some configuration settings (it's specific for different languages). It's one of the more convenient features of Emacs IMO.
 

lousydood

Member
Aug 1, 2005
158
0
0
You're right. TAB in emacs does not insert a TAB by default. It is used for indentation.

The behavior is controlled by the setting of the variable indent-line-function. Type: C-h v indent-line-function to learn more. C-h v means "help on variable". (I also recommend typing C-h ? and exploring the extensive help system if you haven't already).

By default its value is indent-relative, which moves the cursor to the column of the next character following whitespace on the previous line. This is generally considered a good all-purpose mode.

There are a few other candidates defined:

(setq indent-line-function 'tab-to-tab-stop) and you can edit the tab stops with M-x edit-tab-stops. This will give you the behavior of jumping to the next "tab stop" whenever you hit TAB.

(setq indent-line-function 'insert-tab) basically just inserts TAB or tab-sized number of spaces.

I highly recommend NOT using tab characters because it leads to trouble down the road in various ways. Emacs will always substitute spaces for tabs if you set (setq indent-tabs-mode nil)

If you really want to insert a LITERAL character without any further interpretation, you can always prefix it with C-q. For example, C-q TAB always inserts a literal TAB character.

Finally, for a whole slew of information, see http://www.emacswiki.org/cgi-b...ki/CategoryIndentation

Edit: apparently "highlighting" text does not work.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |