From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How to test if the current line contains only white-spache? Date: Thu, 19 Nov 2015 16:20:34 +0100 Message-ID: <87bnaqvwvx.fsf@mbork.pl> References: <87r3js7e8l.fsf@linux-qg7d.fritz.box> <874mgnystc.fsf@point.pointsman.de> <87d1v67nwo.fsf@linux-qg7d.fritz.box> <877fle6qnc.fsf@linux-qg7d.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447946486 29732 80.91.229.3 (19 Nov 2015 15:21:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2015 15:21:26 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Rolf Ade Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 16:21:18 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 1ZzR1O-00040F-Dn for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2015 16:21:14 +0100 Original-Received: from localhost ([::1]:42385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzR1N-0001vR-Pj for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2015 10:21:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzR13-0001tS-MM for help-gnu-emacs@gnu.org; Thu, 19 Nov 2015 10:20:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzR0y-0000VD-Nc for help-gnu-emacs@gnu.org; Thu, 19 Nov 2015 10:20:53 -0500 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:52039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzR0y-0000U1-Gm for help-gnu-emacs@gnu.org; Thu, 19 Nov 2015 10:20:48 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id D558E8F2003; Thu, 19 Nov 2015 16:20:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Czpu13H-ztn9; Thu, 19 Nov 2015 16:20:43 +0100 (CET) Original-Received: from localhost (c76-224.wmi.amu.edu.pl [150.254.76.224]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 3C82E8F2002; Thu, 19 Nov 2015 16:20:42 +0100 (CET) User-agent: mu4e 0.9.15; emacs 25.0.50.1 In-reply-to: <877fle6qnc.fsf@linux-qg7d.fritz.box> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:5e00:2:52::8 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:108137 Archived-At: On 2015-11-19, at 14:54, Rolf Ade wrote: > Yes, this is, what my instinct also telling me. But this instinct was > trained by other programming languages and environments. I'm aware, that > it may be not applicable to emacs lisp / emacs. And you're right: it's not. > Discussing programming concepts at such 'meta level' is difficult. But > maybe some may express their thinking about this. Is this 'moving point > around' in emacs lisp programming code the "right thing" to do [...] Yes it is. See e.g. answers to this question: http://emacs.stackexchange.com/questions/2120/how-to-insert-text-after-point (not the same case, but similar) or many definitions in Emacs core. You can e.g. grep for `save-excursion' in simple.el and other places. A few highlights: check the definitions of `line-number-at-pos', `kill-line', `insert-buffer', `next-line', `mark-word' and many others. It turns out that e.g. this is quite a common idiom: (save-excursion (move-point-someplace-of-interest) (point)) Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University