help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Several beginner-questions


From: Marko Vojinovic
Subject: Re: Several beginner-questions
Date: Wed, 27 Jul 2011 03:57:05 +0100
User-agent: KMail/1.13.7 (Linux/2.6.35.13-92.fc14.x86_64; KDE/4.6.3; x86_64; ; )

On Monday 25 July 2011 16:14:58 Eli Zaretskii wrote:
> > From: Marko Vojinovic <address@hidden>
> > Date: Sun, 24 Jul 2011 23:22:31 +0100
> > 
> > 1) Is there a package to recreate the old MS-DOS pull-down menu display,
> > instead of the default "open new buffer to display menu items" behavior
> > (invoked by F10)?
> 
> I don't think so.  Someone(TM) should back-port the DOS code that
> supports menus of a text-only terminal to the rest of Emacs platforms.

I guess I wasn't clear enough. I have never used Emacs under DOS, and I am not 
saying that there is any existing code to be backported. But I did use other 
text editors under DOS (the rudimentary "Edit" editor comes to mind), and most 
of them had the pull-down menus drawn in ascii-art using various "graphics" 
characters (greater-than-128 codes of ascii of the bios-provided font).

I was wondering if something of similar look-and-feel ever existed for Emacs. 
So this has nothing to do with backporting any DOS code, my guess is that this 
should be created from scratch. I just thought that someone already did it, 
since I guess it is (or should be) a common thing to have pull-down menus, 
even in a text-only terminal. :-)

> > 2) I have set (line-number-mode 1) and (column-number-mode 1) in order to
> > see the cursor coordinates, and this works. However, column numbering
> > begins with zero --- the top-left corner of the buffer has coordinates
> > (1,0). How do I get rid of the 0-th column? I want the columns to be
> > counted from 1 (so that the corner has coordinates (1,1), which is more
> > natural from my POV)?
> 
> You could redefine mode-line-format to do that, but it will need a bit
> of Lisp programming.

Oh, ok. I guess I'll just have to add one column in my head every time I need 
to know where the point is...

But *why* (for heaven's sake) does it count columns from zero? I've never ever 
seen any other text editor do that. Even the KMail composer that I'm typing 
into right now counts the first column as "column 1"... I'm a bit dissapointed 
that such a weird default counting was chosen, and in addition that it takes a 
lisp expert to customize it. What was the thinking behind the 0-th column?

> > 3) When I do a M-x list-colors-display, emacs displays all 256 colors
> > properly, but with wrong names. Instead of giving the colors names as per
> > the rgb.txt file, it lists names like color-16, color-17, etc. Those
> > names are not recognized in the .emacs (while rgb.txt names are). How do
> > I make it use color names from the rgb.txt file, when invoking
> > list-colors-display?
> 
> See tty-colors.el for the infrastructure and term/xterm.el for an
> example of using it.  Actually, since you seem to be using a 256-color
> xterm, Emacs should have done this automatically for you.  Perhaps you
> have an old version of Emacs, in which case upgrade.

Umm, I don't seem to understand how to use the tty-colors package. In order to 
try it out, I opened it, did M-x eval-buffer, and after that the
M-x list-colors-display still displays the colors with names color-16, 
color-17, etc, just in different order than before. There is no mention of the 
usual human-readable names for colors. What do I need to do to have the names 
appear in the colors that correspond to them?

I'd appreciate some hand-holding here, I'm fairly new to Emacs, and Lisp is 
also somewhat a mistery for me (although I am familiar with the concepts of 
functional programming in general).

> > 4) I'd like to use the TAB key to type four SPC characters in the buffer
> > when I press it. However, I don't want to disturb its auto-completion
> > functionality when doing anything other than just typing text in the
> > buffer. What is the "safest" way to create a keybinding for this?
> 
> See indent-tabs-mode and tab-width.

Ok, I have RTFM for those variables (and hopefully understood it), set

(setq-default indent-tabs-mode nil) 
(setq-default tab-width 4)

in the .emacs, restarted Emacs, and when I press the TAB key in the buffer, 
nothing happens. The cursor doesn't move, it completely ignores the TAB key. 
What I want is the cursor to type four spaces instead of me doing it manually. 
What am I doing wrong?

Btw, the TAB key works perfectly for the auto-completion in the minibuffer, it 
just does nothing in the text buffer.
 
> > address@hidden ~]$ emacs -nw --version
> > GNU Emacs 23.2.1
> 
> Suggest to upgrade to Emacs 23.3, the latest official release.

 :-) And here I am using Fedora because it's providing me with "leading edge" 
software... ;-) But I wouldn't like to go away from the distro-provided 
version if I don't really have to. I don't think that my questions above are 
obsolete just because I use 23.2.1 instead of 23.3.

Thanks for help! :-)
Marko






reply via email to

[Prev in Thread] Current Thread [Next in Thread]