From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Need help with emacs clipboard. Date: Wed, 14 Jan 2015 13:46:10 -0700 Message-ID: <20150114125645795909310@bob.proulx.com> References: <20150113212722522787447@bob.proulx.com> <87egqxb9q0.fsf@reader.local.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1421268399 9325 80.91.229.3 (14 Jan 2015 20:46:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Jan 2015 20:46:39 +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 Jan 14 21:46:33 2015 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 1YBUpl-00016t-Fb for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jan 2015 21:46:33 +0100 Original-Received: from localhost ([::1]:48045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBUpk-0006lF-Qz for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jan 2015 15:46:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBUpX-0006lA-58 for help-gnu-emacs@gnu.org; Wed, 14 Jan 2015 15:46:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBUpS-0003iU-5t for help-gnu-emacs@gnu.org; Wed, 14 Jan 2015 15:46:19 -0500 Original-Received: from joseki.proulx.com ([216.17.153.58]:58222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBUpR-0003hb-1k for help-gnu-emacs@gnu.org; Wed, 14 Jan 2015 15:46:14 -0500 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 82A3B2186F for ; Wed, 14 Jan 2015 13:46:10 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 5012B2DC42; Wed, 14 Jan 2015 13:46:10 -0700 (MST) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87egqxb9q0.fsf@reader.local.lan> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102068 Archived-At: Hi Harry, Harry Putnam wrote: > Bob Proulx writes: > > This won't help you because you want the opposite but just to post my > > example this is what I do to configure emacs to be usable on the X > > desktop using the primary selection. > > > > (setq transient-mark-mode nil) > > (setq select-active-regions nil) ; default is nil in 23, t in 24 > > (setq mouse-drag-copy-region t) ; default is t in 23, nil in 24 > > (setq x-select-enable-primary t) ; default is nil in 23, t in 24 > > (setq x-select-enable-clipboard nil) ; default is nil in 23, t in 24 > > (setq x-select-enable-clipboard-manager nil) ; new in 24, default is t > > Bob, just slipped in here to see if I could get you to show how to put > all that into a single statement that does all those things with one > command. I am sorry but there isn't one. If you want each of those items then you need each of those items. > I'm thinking to be able to turn it off and on quickly. This isn't something you would turn on and off. Why does it need to be one single statement? It isn't something one puts on a command line command. It is a part of a much larger configuration. This configuration normally goes into your emacs config, traditionally your ~/.emacs file although now available to configure other places too. It doesn't make any sense to change this while the emacs is running. I can't imagine a need for it but to turn this into an interactively callable function it would be something like this: (defun my-set-modes () "Set my modes." (interactive) (setq transient-mark-mode nil) (setq select-active-regions nil) (setq mouse-drag-copy-region t) (setq x-select-enable-primary t) (setq x-select-enable-clipboard nil) (setq x-select-enable-clipboard-manager nil)) Then you could call it with M-x my-set-modes. But I don't think it is a useful thing as a function like that. I will leave it to the reader to create the opposite function to set the opposite values for those. I am not recommending any of this but simply providing it because you asked for it specifically. > Sorry I'm so horribly lazy but staggering around with that has > resulted in a visit to the emergency room for paren-mania. They only > had one real treatment that worked... lots of morphine. I am not sure there is a cure for paren-mania. However I think morphine is the wrong cure. Instead I suggest sunshine and a good fiction novel in the park. Computers are here to help us. If working at the computer isn't a help then time to get away and do something completely different. Emacs is programmed with lisp and lisp, along with many other languages, uses one set of parens per function call. Most languages use one set of parens per function all. Ruby and Python are eschewing parens these days but I still like them. They make it easy for me to see and delineate functions calls. Lisp is on the other side of the syntax from C languages. Instead of calling a function foo(param) like it does in C in lisp the function is called (foo parm). That first parentheses is what starts the function call and not what starts the argument list. A very tiny difference. But then there is the named variable too. Basically in a C language the first parameter is the first parameter and the second is the second and so forth. In Ruby and Python it is more typical to name them so that we can order them differently. Maybe instead of having twenty parameters only give the ones that are different from the default value. Where do you think Ruby and Python got that paradigm from? They got it from lisp where it is typical to name parameters. Therefore (setq x-select-enable-primary t) in a C language would be set_x_select_enable_primary(t). Something like that would work and does in C all of the time. But in lisp it is easier and simply to have a generic setter function like setq (short for set the params quoted literally) and then pass in both the name of the variable and the value of the variable and have it set it. And so we have things like (setq x-select-enable-primary t). It isn't really that much different from saying X_SELECT_ENABLE_PRIMARY=true if it were written in shell code for example. Or was a windows .ini format file. Or many other possibilties. No need for paren-noia. Simply divide and conquer. Break down the characters into sets of things. Understand each part individually. It all makes sense and isn't so bad. Really! :-) Bob