all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marko Vojinovic <vvmarko@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Several beginner-questions
Date: Thu, 28 Jul 2011 23:07:17 +0100	[thread overview]
Message-ID: <201107282307.17607.vvmarko@gmail.com> (raw)
In-Reply-To: <E1Qlwr8-0002oU-8A@fencepost.gnu.org>

On Wednesday 27 July 2011 06:40:30 Eli Zaretskii wrote:
> > From: Marko Vojinovic <vvmarko@gmail.com>
> > Date: Wed, 27 Jul 2011 03:57:05 +0100
> > 
> > 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).
> 
> Emacs does as well, but only in its DOS build.  I was saying that
> someone should take that code and implement it for the Unix TTY.

Aha, ok. So I guess I was right to assume that this already exists, I just 
missed that it exists only for the DOS build. Understood. :-)

Unfortunately, as much as I would like to see those menus in Unix TTY, I don't 
think that I have enough knowledge to actually port the code. :-( Maybe one 
day...
 
> > 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
> 
> Most of the software you see today copycats Microsoft Windows GUI
> style, so it's no surprise they all look similar and different from
> Emacs.  Emacs predates all of them.  So if you want to talk about
> weird defaults, it's those other programs that are "weird" ;-)

Oh, but I didn't use "weird" in the "different from MS editors" sense, but in 
the "why would anyone want to count columns from zero?" sense. The fact that 
Emacs was designed before most other editors is something I appreciate, but it 
has nothing to do with the default being "weird" (tradition notwithstanding).

If it's too hard to reconfigure, then ok, I'll live with it, but... it's weird. 
;-)
 
> Take a look at tty-color-define, this is the function you want to
> use.  And please be sure to look more carefully the commentary and the
> code of the packages you are pointed to: they have all this
> information spelled out.  For example, term/xterm.el includes a
> function names xterm-register-default-colors, which shows how to
> associate color names with colors supported by the xterm.  You should
> do something similar, but with color names you want to use.

Ok, I think I resolved this issue. The point that I was missing was that the 
256 colors displayed by the terminal are not neccessarily RGB-equivalent to 
the 256 colors defined in the rgb.txt file.

So while color-name-rgb-alist variable contains the colors from rgb.txt, the 
list-colors-display doesn't display those colors, but the colors that the 
terminal actually supports, which might be different (and are, in my case). 
Those (actually used) colors are listed in tty-defined-color-alist, and I see 
that they have names like color-16, color-17, etc.

The problem is that those two sets of colors are different from each other, and 
the tty-colors.el infrastructure approximates the standard ones with the ones 
available. IOW, there is no unique way to rename "color-16" to the standard 
name from rgb.txt (what I was hoping to achieve), since this color isn't even 
defined there.

So, if I want to configure syntax highlighting using the colors that I actually 
see on the screen, it seems that the simplest way is to just stick to the 
"color-##" names and forget about rgb.txt. :-)

Thanks for the help, now I know what I'm doing. ;-)

Incidentally, the tty-colors.el is apparently already built in my default 
Emacs install, I didn't even need to load it separately. I just needed to 
understand that the colors I see on the screen are *not* the colors defined in 
rgb.txt. :-)

> > > 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.
> 
> What is your value of tab-always-indent?

If I set it to t, TAB does nothing. If I set it to nil, then it works as 
expected when I am in the middle of a line. However, if I am at the beginning 
of the line, I need to press it twice --- the first TAB is swallowed, the 
second TAB prints spaces.

So I guess nil is what I want. I'm just confused why it swallows the first TAB 
when it is at the beginning of the line? The description says:

If t, hitting TAB always just indents the current line.
If nil, hitting TAB indents the current line if point is at the left margin
or in the line's indentation, otherwise it inserts a "real" TAB character.

AFAICS, there is some 'procedure of indentation' that does nothing in my case, 
while inserting the "real" TAB character is replaced with the four spaces, as 
I wanted. So how is this indentation being done, if not by inserting tabs or 
spaces into a file? The first time I press TAB, the line is apparently just 
being internally "marked" as indented (without anything visible actually 
happening), and only then the second TAB actually inserts something into the 
buffer. Am I understanding this right?

Btw, sorry for spamming the list with these things, I'm just trying to learn 
some of this basic stuff... :-)

Best, :-)
Marko




  reply	other threads:[~2011-07-28 22:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-24 22:22 Several beginner-questions Marko Vojinovic
2011-07-25 15:06 ` suvayu ali
2011-07-27  1:05   ` Marko Vojinovic
2011-07-27  1:36     ` suvayu ali
2011-08-15  0:36       ` Ken Goldman
2011-08-15  0:39     ` Ken Goldman
2011-07-25 15:14 ` Eli Zaretskii
2011-07-27  2:57   ` Marko Vojinovic
2011-07-27  5:40     ` Eli Zaretskii
2011-07-28 22:07       ` Marko Vojinovic [this message]
2011-07-29  6:08         ` Eli Zaretskii
2011-07-29 18:07           ` Vijay Lakshminarayanan
2011-07-27  6:48     ` Teemu Likonen
2011-07-27 13:57       ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2011-07-23  7:13 Marko Vojinovic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201107282307.17607.vvmarko@gmail.com \
    --to=vvmarko@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=vmarko@ipb.ac.rs \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.