all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sivaram Neelakantan <nsivaram.net@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: About Emacs features
Date: Wed, 15 Jan 2014 08:11:23 +0530	[thread overview]
Message-ID: <87bnzedl0s.fsf@gmail.com> (raw)
In-Reply-To: 5928e34ffcfb51d4deee8b35ef474471@ltu.sld.cu

On Tue, Jan 14 2014,Alejandro Zamora Fonseca Alejandro Zamora Fonseca wrote:

> Hello!
> I´m a Emacs new user and I have a question.
> How I can auto-complete words and create 'macros'(code snipets rapid
> generation) like in Notepad++.?
>
> Thanks,
> Alejandro
>
>

try auto-complete which might be a bit more natural.  And I got this
snippet from the list here a long time ago.  TAB does some completions 

--8<---------------cut here---------------start------------->8---
;;;;re-using tab 
(defun indent-or-expand (arg) 
  "Either indent according to mode, or expand the word preceding 
point." 
  (interactive "*P") 
  (if (and 
       (or (bobp) (= ?w (char-syntax (char-before)))) 
       (or (eobp) (not (= ?w (char-syntax (char-after)))))) 
      (dabbrev-expand arg) 
    (indent-according-to-mode))) 
 
(defun my-tab-fix () 
  (local-set-key [tab] 'indent-or-expand)) 

(add-hook 'c-mode-hook          'my-tab-fix) 
(add-hook 'sh-mode-hook         'my-tab-fix) 
(add-hook 'text-mode-hook         'my-tab-fix) 
(add-hook 'emacs-lisp-mode-hook 'my-tab-fix) 
--8<---------------cut here---------------end--------------->8---


[snipped 8 lines]



 sivaram
 -- 




  reply	other threads:[~2014-01-15  2:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 19:27 About Emacs features Alejandro Zamora Fonseca
2014-01-15  2:41 ` Sivaram Neelakantan [this message]
2014-01-27 20:23 ` Ken Goldman
2014-01-29  2:39   ` Pete Ley
     [not found] <mailman.11821.1389641073.10748.help-gnu-emacs@gnu.org>
2014-01-13 19:30 ` Emanuel Berg
2014-01-13 21:40 ` Emanuel Berg
2014-01-13 21:54   ` Damien Wyart
2014-01-13 21:59     ` Damien Wyart
2014-01-16 13:32 ` Javier

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=87bnzedl0s.fsf@gmail.com \
    --to=nsivaram.net@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.