unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Karl Voit <devnull@Karl-Voit.at>
To: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <2016-06-09T11-43-44@devnull.Karl-Voit.at> (raw)
In-Reply-To: 20160519083835.GB20522@tuxteam.de

* <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	other threads:[~2016-06-09 10:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18 11:07 Operating on yanked region Karl Voit
2016-05-18 11:30 ` Yuri Khan
2016-05-18 12:13   ` Emacs 24.5.1 has wrong charset on yanked text with Windows (was: Operating on yanked region) Karl Voit
2016-05-18 12:31     ` tomas
2016-05-18 15:53       ` Karl Voit
2016-05-18 18:14         ` Eli Zaretskii
2016-05-18 20:30           ` Karl Voit
2016-05-19  4:28             ` Eli Zaretskii
2016-05-19  8:38         ` tomas
2016-06-09 10:10           ` Karl Voit [this message]
2016-06-09 10:18             ` tomas
2016-05-18 13:25     ` Yuri Khan
2016-05-18 18:02   ` Operating on yanked region Eli Zaretskii
2016-05-18 17:59 ` Eli Zaretskii
2016-06-09  9:43   ` Karl Voit
2016-06-09 12:33     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2016-06-09T11-43-44@devnull.Karl-Voit.at \
    --to=devnull@karl-voit.at \
    --cc=help-gnu-emacs@gnu.org \
    --cc=news1142@Karl-Voit.at \
    /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.
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).