From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#24103: 25.1.50; Add white space separator when appending string Date: Fri, 29 Jul 2016 23:29:50 +0900 (JST) Message-ID: References: <83h9b8rbq4.fsf@gnu.org> <83eg6cr2yb.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1469802639 1270 80.91.229.3 (29 Jul 2016 14:30:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jul 2016 14:30:39 +0000 (UTC) Cc: 24103@debbugs.gnu.org, Tino Calancha To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 29 16:30:28 2016 Return-path: Envelope-to: geb-bug-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 1bT8nz-000558-Bw for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Jul 2016 16:30:27 +0200 Original-Received: from localhost ([::1]:59861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT8nt-0006I6-7S for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Jul 2016 10:30:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT8nf-0006Aj-Un for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 10:30:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bT8nb-0004eb-Gh for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 10:30:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT8nb-0004eE-D9 for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 10:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bT8nb-00049L-1K for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 10:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Jul 2016 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24103 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24103-submit@debbugs.gnu.org id=B24103.146980260115921 (code B ref 24103); Fri, 29 Jul 2016 14:30:02 +0000 Original-Received: (at 24103) by debbugs.gnu.org; 29 Jul 2016 14:30:01 +0000 Original-Received: from localhost ([127.0.0.1]:50844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bT8nZ-00048j-2k for submit@debbugs.gnu.org; Fri, 29 Jul 2016 10:30:01 -0400 Original-Received: from mail-pa0-f45.google.com ([209.85.220.45]:34745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bT8nY-00048W-0K for 24103@debbugs.gnu.org; Fri, 29 Jul 2016 10:30:00 -0400 Original-Received: by mail-pa0-f45.google.com with SMTP id fi15so31869994pac.1 for <24103@debbugs.gnu.org>; Fri, 29 Jul 2016 07:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=+1H+N8/0OKaWVzzjEptlJjltvu16P0DwV3yfM8VADWM=; b=HaPyKG5dT9XNORt4AVAgDkTmZcefOPfK+Iq5c0oQ3c1IVcE1Se27J20KCVBSqjTWdS iCvRHHpMKB9Tw3FIBXNJXzNYBWS/v+P0sqX49T5PPBjeItEhFuHCiQJ8wE/NPrDwhJ2L oWhgxRPhkwu3X0IoZiVVyNRQCsudgOlvNohRlgy7uCiHYGbmcnrAnrET/XD+kqZ2C9if 2S4V56YJhn20a+bc4QaNdORBoxU+0Dfxopji7LaPb8S1xaom+CjVeWe8YcFJRY397jGD CdBGYXw9YR6Wc3WY7oumyTdiTys3Eu0w+7nDWxSbN9GNXYLElvhjhKqB9WT4agL+nc3U OL8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=+1H+N8/0OKaWVzzjEptlJjltvu16P0DwV3yfM8VADWM=; b=biAI2XEzdP6hBoozCk2gIUsyUmt0TIX/a9iYEn1JcLFNsCM/z8A1WbCtPxDrain0uY MZ6lpkHA9rIkDsVhpHcruikK3AMFMbvW7RwwDGZqMkSsA5upWgAiEryaEzT0LYFaH94v iuiDfEeNP95FEDsvnwvpGVn8pjTp5QWgpJ9D+hmlg0Jdq/J2D5IsCk7A9xS8yGX2QZsz 9k6nvMHG0JKJJiA1LWMnlbcPsLvRBJZ+QARSStuAL+4ORGvN3XZixpUV3trWlu7U01qA 3EouGXjlsd4Dzg3+hXWmZ7tQawpSp0iBSkengv5RiShIVUi784oTna19gHve/2tsxbz0 e1/w== X-Gm-Message-State: AEkoousfFfevJILmagekZmifgFItiheBUNkfs5ZM5jaLCMSXEWJwGdrbLJPighBfWEgprA== X-Received: by 10.66.74.133 with SMTP id t5mr70286724pav.114.1469802593988; Fri, 29 Jul 2016 07:29:53 -0700 (PDT) Original-Received: from calancha-pc ([103.5.140.187]) by smtp.gmail.com with ESMTPSA id w76sm25542338pfd.69.2016.07.29.07.29.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jul 2016 07:29:53 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <83eg6cr2yb.fsf@gnu.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121683 Archived-At: On Fri, 29 Jul 2016, Eli Zaretskii wrote: >> The command provide a nice way to do that as mentioned in the doc string: >> C-u 0 w > > No, that produces the absolute names of files in the directory shown > by Dired, whereas what I meant is constructing a name of a file in > another directory by concatenating a directory killed in another kill > command and the file name killed by 'w'. Agreed. It might be useful. >> From: Tino Calancha >> Date: Fri, 29 Jul 2016 19:27:30 +0900 (JST) >> cc: Tino Calancha , 24103@debbugs.gnu.org > Sorry, I don't understand: which part of the fix you suggest to skip, > and what will be left then? So, the patch now fix the II) in the report: it prevent to change the kill ring when the string is empty. The command name and the doc string suggest the usage is about copying file names. I would prefer if this command have effect just when point is: 1) on a line showing a subdir name for instance: (dired-subdir-min) 2) on a line showing a file from the dired listing on a line displaying a file or subddir name for instance, (progn (goto-char (dired-subdir-min)) (dired-goto-next-file) (point)) Currently the command is enabled whatever is the point in the Dired buffer. As a consequence, the command put a "" in the kill ring if the command is called with the point in one position other than 1) 2) for instance: 3) (progn (goto-char (dired-subdir-min)) (forward-line 1) (point)) I would propose in order of preference: A) Do not change the kill ring when the command is called with point in a position like 3) (See patch below). B) Update the doc string alerting that the command is responsive even if there is no filename/subdir accesible: the kill ring will get "" in that cases. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From c7c1312e4acf942742e387a474d368266b48dc99 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Fri, 29 Jul 2016 23:06:16 +0900 Subject: [PATCH] Copy just non-empty strings to kill-ring * lisp/dired.el (dired-copy-filename-as-kill): Do not change the kill ring when the string is empty. (Bug#24103). --- lisp/dired.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 5d14291..7ead087 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2467,10 +2467,11 @@ dired-copy-filename-as-kill 'no-dir (prefix-numeric-value arg)))) (dired-get-marked-files 'no-dir)) " ")))) - (if (eq last-command 'kill-region) - (kill-append string nil) - (kill-new string)) - (message "%s" string))) + (unless (string= string "") + (if (eq last-command 'kill-region) + (kill-append string nil) + (kill-new string)) + (message "%s" string)))) ;; Keeping Dired buffers in sync with the filesystem and with each other -- 2.8.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GNU Emacs 25.1.50 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6) of 2016-07-28 Repository revision: 4a5b6e621c68172bb69d60fe8a76932f7c779f81