From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Voit Newsgroups: gmane.emacs.help Subject: Operating on yanked region Date: Wed, 18 May 2016 13:07:12 +0200 Organization: www.karl-voit.at Message-ID: <2016-05-18T13-02-10@devnull.Karl-Voit.at> Reply-To: Karl Voit NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1463569694 25833 80.91.229.3 (18 May 2016 11:08:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 May 2016 11:08:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 18 13:08:05 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b2zKe-0007YJ-PL for geh-help-gnu-emacs@m.gmane.org; Wed, 18 May 2016 13:08:04 +0200 Original-Received: from localhost ([::1]:44267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2zKe-0002jm-01 for geh-help-gnu-emacs@m.gmane.org; Wed, 18 May 2016 07:08:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2zKB-0002jA-6n for help-gnu-emacs@gnu.org; Wed, 18 May 2016 07:07:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2zK6-00044o-U6 for help-gnu-emacs@gnu.org; Wed, 18 May 2016 07:07:35 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:35243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2zK6-00043M-Aa for help-gnu-emacs@gnu.org; Wed, 18 May 2016 07:07:30 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b2zK1-0007Cp-4N for help-gnu-emacs@gnu.org; Wed, 18 May 2016 13:07:25 +0200 Original-Received: from friends.grml.info ([136.243.234.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 May 2016 13:07:25 +0200 Original-Received: from news1142 by friends.grml.info with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 May 2016 13:07:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: friends.grml.info X-GPG-Key: http://www.Karl-Voit.at/Karl_Voit_GnuPG_public_key.gpg X-Registered-Linux-User: 224337 X-Confession: Pastafarian http://www.venganza.org/ User-Agent: slrn/pre1.0.0-18 (Linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110045 Archived-At: Hi! When I paste text from a Windows application to my Emacs (running mainly Org-mode), I get wrong charset. For correcting such wrong character sets, I want to write a function that corrects the charset. Additionally, I want to add some search&replace stuff to convert Outlook-list items to Org-mode list items. So this is, what I want to achieve: 1. clipboard-yank 2. operate following things on the yanked region: 1. recode-region (from mule.el) - from: windows-1252 - to: latin-1 2. replace list items 3. replace enum items 4. paste from clipboard How can I work with the newly yanked region after clipboard-yank? With a construct I named "with-region" the structure should follow following concept: (defun my-convert-windows-region () (with-region (clipboard-yank) (recode-region ...) (string-replace ...) (string-replace ...) ) ) How can I accomplish this with Elisp in reality? -- 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