all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: sam jesse <revrvr@gmail.com>
To: Richard Riley <rileyrgdev@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: key binding for highlighting
Date: Sat, 1 Aug 2009 09:34:34 +1000	[thread overview]
Message-ID: <cc0a0f5c0907311634k10bf5933o9c71015d122c9d47@mail.gmail.com> (raw)
In-Reply-To: <h4vose$n0m$1@rileyrgdev.eternal-september.org>

[-- Attachment #1: Type: text/plain, Size: 1995 bytes --]

using GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 2008-09-07 on SOFT-MJASON
under window XP.
the command to mark-word did not make the word at point.

after googleing, I found this code which suppose to be fired M-8 to make the
word, the next fire for the sentence and the 3rd fire for the whole
paragraph. but it is not working in my system.
please try on yours and report back. thx

;; by Nikolaj Schumacher, 2008-10-20. Released under GPL.
(defun semnav-up (arg)
  (interactive "p")
  (when (nth 3 (syntax-ppss))
    (if (> arg 0)
        (progn
          (skip-syntax-forward "^\"")
          (goto-char (1+ (point)))
          (decf arg))
      (skip-syntax-backward "^\"")
      (goto-char (1- (point)))
      (incf arg)))
  (up-list arg))

;; by Nikolaj Schumacher, 2008-10-20. Released under GPL.
(defun extend-selection (arg &optional incremental)
  "Select the current word.
Subsequent calls expands the selection to larger semantic unit."
  (interactive (list (prefix-numeric-value current-prefix-arg)
                     (or (and transient-mark-mode mark-active)
                         (eq last-command this-command))))
  (if incremental
      (progn
        (semnav-up (- arg))
        (forward-sexp)
        (mark-sexp -1))
    (if (> arg 1)
        (extend-selection (1- arg) t)
      (if (looking-at "\\=\\(\\s_\\|\\sw\\)*\\_>")
          (goto-char (match-end 0))
        (unless (memq (char-before) '(?\) ?\"))
          (forward-sexp)))
      (mark-sexp -1))))

(global-set-key (kbd "M-8") 'extend-selection)
; code end ********

On Sat, Aug 1, 2009 at 7:41 AM, Richard Riley <rileyrgdev@gmail.com> wrote:

> sam jesse <revrvr@gmail.com> writes:
>
> > Hi
> >
> > what do I need to put in my .emacs so that when I hit say F5 key, emacs
> highlights the word at the cursor?
> > I will try to apply the same for the sentence with F6 and the paragraph
> with F7.
> >
> > thanks
> >
>
> You might want mark-word.
>
> You can then extend the selection ot just delete/copy etc.
>

[-- Attachment #2: Type: text/html, Size: 2646 bytes --]

  reply	other threads:[~2009-07-31 23:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3599.1249071631.2239.help-gnu-emacs@gnu.org>
2009-07-31 21:41 ` key binding for highlighting Richard Riley
2009-07-31 23:34   ` sam jesse [this message]
2009-07-31 19:52 sam jesse

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=cc0a0f5c0907311634k10bf5933o9c71015d122c9d47@mail.gmail.com \
    --to=revrvr@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rileyrgdev@gmail.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.