From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: Re: fill comma separated list Date: Thu, 02 Jun 2016 17:47:48 +0000 Message-ID: References: <31550a04-e2c8-4169-9818-b392379237af@googlegroups.com> <87r3cf8rx4.fsf@yale.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1464889726 24219 80.91.229.3 (2 Jun 2016 17:48:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Jun 2016 17:48:46 +0000 (UTC) To: "Jorge A. Alfaro-Murillo" , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 02 19:48:45 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 1b8Wjc-0005sX-80 for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Jun 2016 19:48:44 +0200 Original-Received: from localhost ([::1]:49557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Wjb-0003gg-Et for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Jun 2016 13:48:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Wj2-0003gH-GU for help-gnu-emacs@gnu.org; Thu, 02 Jun 2016 13:48:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8Wj0-0002Kl-1Q for help-gnu-emacs@gnu.org; Thu, 02 Jun 2016 13:48:07 -0400 Original-Received: from mail-oi0-x22e.google.com ([2607:f8b0:4003:c06::22e]:36748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Wis-0002Il-Ts for help-gnu-emacs@gnu.org; Thu, 02 Jun 2016 13:48:05 -0400 Original-Received: by mail-oi0-x22e.google.com with SMTP id j1so88955309oih.3 for ; Thu, 02 Jun 2016 10:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=k6kolN2/vxb4Hq1KPa3t9qQxXDnrHbdtqHT54ECK9dg=; b=Xf/cHgLfj4WWGWmEn70a1RnovKhGqmRR+fM8DgE07beutxPvEHa+jrsaAVlHfZvav7 6u6iw8MnZGGQJxNy2vQZrlbLvZ4ggv2qXaM00fWUoWtrKDqaewjghmeBAwroEgt7EIRg WSXnCU6c13y5WsOGou2f6+kxJpDwbpAdz96U02MvEdl6MY4i4Bvq87BHUZK91tnr2mXm Ilm5z9N5XQo151+f3avPrBuMl4toQ+rqn0u32sDIvKt7JCGge/1e5T8/dkDVdrYANmfj weZ3dNfOCeFox6wajoLHlfPinyVKaxTCnDvZ+umABIeclRXrU12eTut/YHao0lUcpOy8 KNMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=k6kolN2/vxb4Hq1KPa3t9qQxXDnrHbdtqHT54ECK9dg=; b=VV1Wk8p1LjHlMZkMmiIbC8UavJH/S+txwtP6IVZQrj19dGXC2A8nAeYdyyE8FNYLBb WtyCeI5Ow28w0UKAjJHLq2NQpWGcBZQbgIkdQdWgc8PBcO2gzoOpqW/uCujLwG4FjaS9 LoC93VAUpljPS29mKk+4ML44qYFkBofmGNyndftUIn7+GvyT1FbnFs9Na9mPsIy0Gri2 V1r4l5mXC/N0xZWJKAttIcEn6F0/tAiuiK5dv5kxvwepf+RQmHzCbDPjUwlc8E2a/XRT DKORYu4RjQ7ISWI8Bg4Ewn5utJOfYltBShbL88hJfcojZFqLCc6W0VlpeoRm6CRk0BIj vJAQ== X-Gm-Message-State: ALyK8tK0T5H9zZnhJznBxF13R0eaQojtVs7hJ6fJbZeNkvkZ6cVcdrXgWF21DbQCoUo8ovX4gRmeQqDVi1cRyA== X-Received: by 10.157.5.209 with SMTP id 75mr7425906otd.60.1464889678293; Thu, 02 Jun 2016 10:47:58 -0700 (PDT) In-Reply-To: <87r3cf8rx4.fsf@yale.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::22e X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:110264 Archived-At: On Thu, Jun 2, 2016 at 1:14 PM Jorge A. Alfaro-Murillo < jorge.alfaro-murillo@yale.edu> wrote: > > Let's play emacs golf: (I assume no whitespace and cursor at the > initial 5): > > F3 C-e C-d C-e C-d C-e C-n C-a F4 C-0 > F4 > > 14 key strokes. > http://i.imgur.com/dTdQRiG.gifv Only the C-n key is not shown logged in the gif. But here is what I did With cursor at the initial 5, (1) F3 (2,3) M-4 M-^ (In fact, I have bound the functionality of C-u M-^ to C-j [see below]) (4,5) M-4 M-^ (6) C-n (7,8) M-0 F4 (you do not need to hit F4 and then do M-0 F4) 8 keys (10 keys, if adding the 2 spaces) I count M-4/M-0 as single keystrokes as I use the Alt key, not Esc. That should be OK? :) ===== If interested, I bind C-j to below: (defun modi/pull-up-line () "Join the following line onto the current one (analogous to `C-e', `C-d') or `C-u M-^' or `C-u M-x join-line'. If the current line is a comment and the pulled-up line is also a comment, remove the comment characters from that line." (interactive) (join-line -1) ;; If the current line is a comment (when (nth 4 (syntax-ppss)) ;; Remove the comment prefix chars from the pulled-up line if present (save-excursion ;; Delete all comment-start and space characters (while (looking-at (concat "\\s<" ; comment-start char as per syntax table "\\|" (substring comment-start 0 1) ; first char of `comment-start' "\\|" "\\s-")) ; extra spaces (delete-forward-char 1)) (insert-char ? )))) ; insert space -- -- Kaushal Modi