From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.help Subject: Re: copy-word-from-line-above Date: Wed, 24 Jan 2007 21:21:45 +0100 Message-ID: <87fya0dvl2.fsf@gmx.at> References: <1169142712.291197.26770@a75g2000cwd.googlegroups.com> <1169238317.347524.324700@m58g2000cwm.googlegroups.com> <1169396144.659778.206270@a75g2000cwd.googlegroups.com> <1169470945.549075.73090@51g2000cwl.googlegroups.com> <1169641168.728984.258820@a75g2000cwd.googlegroups.com> <1169660063.651858.123660@v33g2000cwv.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1169685642 16438 80.91.229.12 (25 Jan 2007 00:40:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Jan 2007 00:40:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 25 01:40:40 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 1H9sfQ-00056X-4U for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jan 2007 01:40:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9sfP-0000Ho-C2 for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jan 2007 19:40:39 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsserver.news.garr.it!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Original-Newsgroups: gnu.emacs.help Cancel-Lock: sha1:G6bH0yyAMZEJodE9Mo7C6exP/m4= Original-Lines: 23 Original-NNTP-Posting-Host: news-access-from.tuwien.ac.at Original-X-Trace: 1169670064 tunews.univie.ac.at 12384 192.35.241.118 Original-X-Complaints-To: abuse@tuwien.ac.at Original-Xref: shelby.stanford.edu gnu.emacs.help:145016 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:40620 Archived-At: "HS" writes: > insert-prior-line-word What about: (defun insert-word-above () (interactive) (let (word whitespace) (save-excursion (let ((col (current-column))) (forward-line -1) (move-to-column col)) (setq word (or (thing-at-point 'word) (error "No word above"))) (forward-word) (setq whitespace (or (thing-at-point 'whitespace) ""))) (insert word whitespace))) (global-set-key [f2] 'insert-word-above) All the best, Markus Triska