all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Russell <jorussel@cisco.com>
Subject: Re: Tip of the day: buffer navigation with global mark
Date: 07 Apr 2003 13:17:19 -0400	[thread overview]
Message-ID: <m3brzii5wg.fsf@debussy.cisco.com> (raw)
In-Reply-To: J1Yja.2175$py2.1674@twister.nyc.rr.com

Bruce Ingalls <bingalls@CUT-this-SPAM-BLOCK.fit-zones.com> writes:

> Here are some other suggestions:
> You might consider beginner & expert levels of Tip of the Day.
> For example, I do
> C-u 3 C-k
> C-y
> C-y
> all the time to copy 3 lines, but you'd be surprised at how many, even long
> term Emacs users, don't know this one.

How about this: 

(defun duplicate-line (&optional where)
  "Duplicate the line containing point."
  (interactive "d")
  (save-excursion
    (beginning-of-line)
    (let ((beg (point)))
      (end-of-line)
      (copy-region-as-kill beg (point)))
    (end-of-line)
    (if (eobp)
	(insert ?\n)
      (forward-line))
    (open-line 1)
    (yank)))

(define-key global-map [?whatever] 'duplicate-line)

John

PS Lifted this from some unknown .emacs file on the web, 
but I use it constantly.

  reply	other threads:[~2003-04-07 17:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-05 20:39 Tip of the day: buffer navigation with global mark Kai Großjohann
2003-04-06 10:43 ` maierh
2003-04-06 15:12 ` D. Goel
2003-04-06 15:51 ` Bruce Ingalls
2003-04-07 17:17   ` John Russell [this message]
2003-04-07 15:35 ` Tip of the day Robert Epprecht
2003-04-07 17:00   ` Kai Großjohann
2003-04-07 18:47   ` David Kastrup
2003-04-07 19:28     ` Robert Epprecht

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=m3brzii5wg.fsf@debussy.cisco.com \
    --to=jorussel@cisco.com \
    /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.