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

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

Re: Quite a few emacs questions


From: Amy Templeton
Subject: Re: Quite a few emacs questions
Date: Wed, 16 May 2007 17:07:51 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

mowgli <address@hidden> wrote:
> How to make eshell behave properly? typing Ctrl-L to clear screen
> doesn't work and outputs junk. The clear command doesn't work
> either.

CODE:
______________________________

(defun eshell/clear ()
  "Clears the eshell buffer."
  (interactive)
  (let ((inhibit-read-only t))
    (erase-buffer)))
______________________________

...works for me. Just put that function definition in your .emacs.
If you would like to test it out in your current session (I assume
this is the case), put your cursor after the *last* parenthesis
after the (erase-buffer) command and hit "C-x C-e" (to evaluate the
code). Then test it out in the eshell buffer.

> How to make eshell work like on full page? Typing any command
> scrolls half the page to top.

Could you be more specific? I'm not really sure what you mean by
this. You can go back in the eshell buffer just like any other
buffer, if that's your question.

> I'm just installing w3. Does it support frames like the links or
> elinks browsers?

I don't believe so, and neither does emacs-w3m (my browser of
choice). You might try to look into a comparison of w3 and
emacs-w3m's features before deciding on one; try googling for each
one.

> When using X, how to change the default font used by emacs? It's
> extremely small.

CODE:
_________________________________________________________________

(if window-system
      (set-default-font
      "-adobe-courier-medium-r-*-*-14-*-100-100-*-*-iso10646-1"))
_________________________________________________________________

...would do this, assuming you wanted that particular font. Enter
your font of choice.

> How do you add these to .emacs?

I'll take these one at a time...

> M-x color-theme xyz

CODE:
_________________

(color-theme-xyz)
_________________ 

An M-x command uses the full name of the command, so what you put
in your .emacs should match what you enter with M-x. However, I
would suggest doing it this way:

CODE:
________________________

(if window-system
      (color-theme-xyz))
________________________

...because that way, if you start it in a terminal your colors
won't be all messed up. If you wanted, you could add a second part
to the if statement that would make it use a different color theme
(instead of no color theme) if you weren't using emacs in an X
window.

CODE:
_______________________________________________

(if window-system
      (color-theme-xyz)
  (color-theme-your-favorite-for-the-terminal))
_______________________________________________

> M-x font-lock-mode

(global-font-lock-mode 1)

> M-x shell-script-mode

Entering this in your .emacs would not, I think, have the effect
you're looking for. Correct me if I'm wrong, but are you looking to
start shell-script-mode on certain types of files or on certain
individual files? If so, you might be more interested in something
like this:

CODE:
_____________________________________________________

(add-to-list 'auto-mode-alist '("\\.ses" . ses-mode))
_____________________________________________________

...inserting, of course, the file or file ending you wanted instead
of ".ses" and the mode you wanted instead of "ses-mode."

> M-x set-variable visible-bell true

CODE:
_____________________

(setq visible-bell t)
_____________________

setq is the command to set one or more variables.

> M-x highlight-current-line-globally

CODE:
_____________________________

(highlight-current-line-on t)
_____________________________

...will turn it on. Passing it an argument of nil (instead of t)
will turn it off again if it gets on your nerves.

> I have put the cyclebuffer-forward and cyclebuffer-backward in
> .emacs but it doesn't seem to work since M-N and M-B are already
> emacs keys. How to tell emacs to use it for the cyclebuffer
> commands and not interpret it the default way?

I'd suggest just binding them to keys that you don't use. As far as
I can tell, M-n is not globally set to anything. M-b is, but it
would probably make more sense to your fingers to use M-p (which is
globally not defined) instead, since C-n and C-p are already
associated (next and previous line, respectively). So you could
do...

CODE:
__________________________________________________

(global-set-key (kbd "M-n") 'cyclebuffer-forward)
(global-set-key (kbd "M-p") 'cyclebuffer-backward)
__________________________________________________

...in your .emacs (and eval them the same was as with the first
command I suggested). That should make it work.

Amy

-- 
One planet is all you get.




reply via email to

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