help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Emacs 24.5.1 has wrong charset on yanked text with Windows (was: Ope


From: Karl Voit
Subject: Re: Emacs 24.5.1 has wrong charset on yanked text with Windows (was: Operating on yanked region)
Date: Thu, 9 Jun 2016 12:10:57 +0200
User-agent: slrn/pre1.0.0-18 (Linux)

* <tomas@tuxteam.de> <tomas@tuxteam.de> wrote:
>
> On Wed, May 18, 2016 at 05:53:51PM +0200, Karl Voit wrote:
>> * <tomas@tuxteam.de> <tomas@tuxteam.de> wrote:
>
> [...]
>
>> I once set this to 'utf-8 in my init.el. The Emacs help further
>> suggests setting it to 'utf-16le-dos instead when running on
>> Windows. With switching to this setting, the clipboard gets yanked
>> properly! :-)
>
> That's interesting, since Eli says it shouldn't be necessary on
> Windows (and he sure knows a hell of a lot more about Emacs than
> I do, and much more so specifically about Emacs on windows).
>
> That'd mean that your Emacs is confused somehow, but why?

I just answered to Elis posting which should also answer the
question of my (faulty) configuration.

> [...]
>
>> Can you still show me how I yank and operate (string-replace) only
>> on the yanked text?
>
> I don't know exactly what you want to achieve (manual operation, or
> ultimately some automatism?), but you might start here:

What I want to achieve (I should have started with this one in the
first place): yanked text from Outlook had wrong charset (fixed!)
and a different syntax for list items. I am trying to automate it so
that I can paste to Org-mode and get Org-mode syntax for list items.
Therefore I want to search&replace within the yanked text to look
for Outlook bullet point snippets and replace them accordingly.

>  - after a (normal) yank, the last mark is at the start of the
>    yanked text and point at its end (but mark is not active).
>    So if you activate it, e.g. by
>
>      M-x eval-expression RET (activate-mark) RET
>
>    you get the just yanked stuff "selected". You'll have to
>    wrap some of that into commands to make it practical, though.
>    Season to taste.

Wow, this is great news. Thanks!

>  - there isn't, AFAIK, a hook hanging off the yank event itself
>    (a pity, IMHO), but if you somehow manage to attach the text
>    property named 'yank-handler (having as value a function +
>    arg provided by you), then this function gets the chance to
>    do its thing just after yanking.
>
>    Search for "yank-handler" in the Emacs Lisp manual. I'm a
>    bit pressed now, but if you nudge me I'd be willing to whip
>    up an example.

Cool help!

I am not sure if I want to modify yanking in general. I was thinking
of defining my-outlook-yank or similar that does the additional
stuff.

-- 
All in all, one of the most disturbing things today is the definitive
fact that the NSA, GCHQ, and many more government organizations are
massively terrorizing the freedom of us and the next generations.
                                                  http://Karl-Voit.at




reply via email to

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