[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font faces across a copy and paste

From: Jambunathan K
Subject: Re: font faces across a copy and paste
Date: Tue, 30 Jul 2013 19:06:27 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> When I try to "write" in *shell* buffer a command and re-use one and
> have to insert some addition text I just copy&yank, then
> • C-a does not put the cursor to the beginning of the command, just right of 
> the prompt
> • C-e does not put the cursor to the end of the command line
> • C-k does not kill to the end of the command line
> • and RET does not send the whole command but only the portion between the 
> prompt and the cursor.
> C-a, C-e, C-k stop working at boundaries of different text properties.

A cursory look suggests that the following snippet will do the trick

    (setq inhibit-field-text-motion t)


    (info "(elisp) Word Motion")

Ofcourse, you could cook up a defadvice that let binds the above
variable to t so that point movement happens in an "un-constrained"


Notes to self:

1. M-x shell
2. M-h, C-w
3. C-x b *scratch* 
4. M-x font-lock-mode  (Disable font-lock-mode)
5. C-y
6. C-a
7. C-u C-x =

   The help buffer shows following text properties.

   There are text properties here:
     face                 font-lock-string-face
     front-sticky         (field inhibit-line-move-field-capture)
     inhibit-line-move-field-capture t
     rear-nonsticky       t

8. A simple source code search for `inhibit-line-move-field-capture'
   yields hits in - simple.el, ielm.el and comint.el - which in turn
   hint at

      C-h f constrain-to-field

   which makes mention of

     C-h v inhibit-field-text-motion

reply via email to

[Prev in Thread] Current Thread [Next in Thread]