* Removing faces when yanking to comint
@ 2011-01-30 21:40 Earl Wagner
2011-01-31 20:54 ` Tim X
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Earl Wagner @ 2011-01-30 21:40 UTC (permalink / raw)
To: help-gnu-emacs
Hi all,
I often copy and yank lines from other buffers into the shell (running
in shell-mode, extended from comint-mode I think). These lines often
have face attributes such as specific colors for comments, strings,
etc. The problem is that they preserve these colors when run as
commands. Then, every time I retrieve and re-run the comint-input
command, it retains its original face.
Is there anyway to strip the face attributes from text yanked in the
shell (comint-mode)?
Thanks for any help with this.
-Earl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Removing faces when yanking to comint
2011-01-30 21:40 Removing faces when yanking to comint Earl Wagner
@ 2011-01-31 20:54 ` Tim X
2011-01-31 22:18 ` Kevin Rodgers
[not found] ` <mailman.4.1296512287.9907.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 4+ messages in thread
From: Tim X @ 2011-01-31 20:54 UTC (permalink / raw)
To: help-gnu-emacs
Earl Wagner <dont.spam.earl@gmail.com> writes:
> Hi all,
>
> I often copy and yank lines from other buffers into the shell (running
> in shell-mode, extended from comint-mode I think). These lines often
> have face attributes such as specific colors for comments, strings,
> etc. The problem is that they preserve these colors when run as
> commands. Then, every time I retrieve and re-run the comint-input
> command, it retains its original face.
>
> Is there anyway to strip the face attributes from text yanked in the
> shell (comint-mode)?
>
Maybe have a look at the variable yank-excluded-properties
,----[ C-h v yank-excluded-properties RET ]
| yank-excluded-properties is a variable defined in `simple.el'.
| Its value is
| (read-only invisible intangible field mouse-face help-echo local-map keymap yank-handler follow-link fontified)
|
|
| Documentation:
| Text properties to discard when yanking.
| The value should be a list of text properties to discard or t,
| which means to discard all text properties.
|
| You can customize this variable.
|
| This variable was introduced, or its default value was changed, in
| version 22.1 of Emacs.
|
| [back]
`----
Tim
--
tcross (at) rapttech dot com dot au
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Removing faces when yanking to comint
2011-01-30 21:40 Removing faces when yanking to comint Earl Wagner
2011-01-31 20:54 ` Tim X
@ 2011-01-31 22:18 ` Kevin Rodgers
[not found] ` <mailman.4.1296512287.9907.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2011-01-31 22:18 UTC (permalink / raw)
To: help-gnu-emacs
On 1/30/11 2:40 PM, Earl Wagner wrote:
> Hi all,
>
> I often copy and yank lines from other buffers into the shell (running
> in shell-mode, extended from comint-mode I think). These lines often
> have face attributes such as specific colors for comments, strings,
> etc. The problem is that they preserve these colors when run as
> commands. Then, every time I retrieve and re-run the comint-input
> command, it retains its original face.
>
> Is there anyway to strip the face attributes from text yanked in the
> shell (comint-mode)?
How about:
(add-hook 'shell-mode-hook
(lambda () (set (make-local-variable 'yank-excluded-properties) t)))
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Removing faces when yanking to comint
[not found] ` <mailman.4.1296512287.9907.help-gnu-emacs@gnu.org>
@ 2011-02-01 1:13 ` Earl Wagner
0 siblings, 0 replies; 4+ messages in thread
From: Earl Wagner @ 2011-02-01 1:13 UTC (permalink / raw)
To: help-gnu-emacs
Kevin, Tim,
Yes, that's just what I was looking for. Thanks!
-Earl
On Jan 31, 5:18 pm, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> On 1/30/11 2:40 PM, Earl Wagner wrote:
>
...
> How about:
>
> (add-hook 'shell-mode-hook
> (lambda () (set (make-local-variable 'yank-excluded-properties) t)))
>
> --
> Kevin Rodgers
> Denver, Colorado, USA
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-01 1:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-30 21:40 Removing faces when yanking to comint Earl Wagner
2011-01-31 20:54 ` Tim X
2011-01-31 22:18 ` Kevin Rodgers
[not found] ` <mailman.4.1296512287.9907.help-gnu-emacs@gnu.org>
2011-02-01 1:13 ` Earl Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).