all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* key binding for highlighting
@ 2009-07-31 19:52 sam jesse
  0 siblings, 0 replies; 3+ messages in thread
From: sam jesse @ 2009-07-31 19:52 UTC (permalink / raw
  To: help-gnu-emacs

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

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: key binding for highlighting
       [not found] <mailman.3599.1249071631.2239.help-gnu-emacs@gnu.org>
@ 2009-07-31 21:41 ` Richard Riley
  2009-07-31 23:34   ` sam jesse
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Riley @ 2009-07-31 21:41 UTC (permalink / raw
  To: help-gnu-emacs

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: key binding for highlighting
  2009-07-31 21:41 ` key binding for highlighting Richard Riley
@ 2009-07-31 23:34   ` sam jesse
  0 siblings, 0 replies; 3+ messages in thread
From: sam jesse @ 2009-07-31 23:34 UTC (permalink / raw
  To: Richard Riley; +Cc: help-gnu-emacs

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-31 23:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2009-07-31 19:52 sam jesse

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.