From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marc Tfardy Newsgroups: gmane.emacs.help Subject: Re: copy-word-from-line-above Date: Thu, 18 Jan 2007 21:50:44 +0100 Message-ID: <51a4kbF1j2eebU1@mid.individual.net> References: <1169142712.291197.26770@a75g2000cwd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1169156548 27324 80.91.229.12 (18 Jan 2007 21:42:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2007 21:42:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 18 22:42:25 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H7f1X-00073h-MA for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2007 22:42:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7f1Y-0005yQ-FO for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2007 16:42:20 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-X-Trace: individual.net Z5kwuKdwngEDO9ypo5weswiatUuESi2qRAPHfTAfiSGUUgzFMS User-Agent: Thunderbird 1.5 (X11/20051201) In-Reply-To: <1169142712.291197.26770@a75g2000cwd.googlegroups.com> Original-Xref: shelby.stanford.edu gnu.emacs.help:144830 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40436 Archived-At: HS wrote: > Hello! > Does anyone have a function that copies words from the line above, word > after word ? > I'd like this function so I could have something like this: > > double int xxx; > > Then I'd just put the cursor under that line, press (for example) > twice and would be in this state: > > double int xxx; > double int > > then I would continue adding the new variable. Not exactly what you looking for, but a simple macro do a similar job: C-a ;; beginning-of-line C-p ;; previous-line C-SPC ;; set-mark-command C-e ;; end-of-line M-w ;; kill-ring-save C-a ;; beginning-of-line C-n ;; next-line C-y ;; yank or: (fset 'duplicate-last-line [?\C-a ?\C-p ?\C- ?\C-e ?\M-w ?\C-a ?\C-n ?\C-y]) This macro duplcates whole previous line. The point is on the end of the line. Now you can press (one or more times ) M-DEL and continue editing. regards Marc