unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10897: copy-directory create new directory when copying a symlink
@ 2012-02-27  8:47 Thierry Volpiatto
  2012-02-27  9:11 ` Lars Magne Ingebrigtsen
                   ` (3 more replies)
  0 siblings, 4 replies; 35+ messages in thread
From: Thierry Volpiatto @ 2012-02-27  8:47 UTC (permalink / raw)
  To: 10897

Hi all,
when copying a directory symlink to another directory, the behavior of
'cp' is to create a new symlink in this directory:

--8<---------------cut here---------------start------------->8---
thierry@thierry-MM061:~ $ mkdir ~/Test
thierry@thierry-MM061:~ $ mkdir ~/tmp/Test1
thierry@thierry-MM061:~ $ ln -s ~/tmp/Test1 ~/tmp/foo
thierry@thierry-MM061:~ $ cp -r ~/tmp/foo ~/Test
thierry@thierry-MM061:~ $ ls -l ~/Test
total 0
lrwxrwxrwx   1 thierry        thierry  23 2012-02-27 09:08 foo -> /home/thierry/tmp/Test1
--8<---------------cut here---------------end--------------->8---

It is not what's copy-directory does:

--8<---------------cut here---------------start------------->8---
(copy-directory "~/tmp/foo" "~/Test" nil t)
=>
thierry@thierry-MM061:~ $ ls -l ~/Test
total 4
drwxrwxr-x   2 thierry        thierry  4096 2012-02-27 09:11 foo
--8<---------------cut here---------------end--------------->8---

NOTE:
I am not sending this bug-report via report-emacs-bug due to its last
silly modifications.

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 






^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2012-02-27  8:47 bug#10897: copy-directory create new directory when copying a symlink Thierry Volpiatto
@ 2012-02-27  9:11 ` Lars Magne Ingebrigtsen
  2012-02-27  9:30   ` Thierry Volpiatto
  2020-08-25 12:47 ` bug#10897: copy-directory create new directory when copying a symlink Lars Ingebrigtsen
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 35+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-02-27  9:11 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> I am not sending this bug-report via report-emacs-bug due to its last
> silly modifications.

Which ones?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2012-02-27  9:11 ` Lars Magne Ingebrigtsen
@ 2012-02-27  9:30   ` Thierry Volpiatto
  2012-02-27 10:32     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 35+ messages in thread
From: Thierry Volpiatto @ 2012-02-27  9:30 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10897

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>> I am not sending this bug-report via report-emacs-bug due to its last
>> silly modifications.
>
> Which ones?
I just want to 'C-c C-c' like before, I don't want to be asked what to
do as I don't know what answering.

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2012-02-27  9:30   ` Thierry Volpiatto
@ 2012-02-27 10:32     ` Lars Magne Ingebrigtsen
  2012-02-27 15:22       ` Thierry Volpiatto
  2012-03-03  8:42       ` bug#10897: sending mail via report-emacs-bug Thierry Volpiatto
  0 siblings, 2 replies; 35+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-02-27 10:32 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

>>> I am not sending this bug-report via report-emacs-bug due to its last
>>> silly modifications.
>>
>> Which ones?
> I just want to 'C-c C-c' like before, I don't want to be asked what to
> do as I don't know what answering.

`report-emacs-bugs' hasn't changed (much) with regards to sending email.
But Emacs itself has changed wrt Email sending.  As you seem to be
sending your email with Emacs, I'm not quite sure what you mean.

Unless you're sending your bug reports with "emacs -Q"?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2012-02-27 10:32     ` Lars Magne Ingebrigtsen
@ 2012-02-27 15:22       ` Thierry Volpiatto
  2012-03-09 23:07         ` Lars Magne Ingebrigtsen
  2012-03-03  8:42       ` bug#10897: sending mail via report-emacs-bug Thierry Volpiatto
  1 sibling, 1 reply; 35+ messages in thread
From: Thierry Volpiatto @ 2012-02-27 15:22 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10897

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>>>> I am not sending this bug-report via report-emacs-bug due to its last
>>>> silly modifications.
>>>
>>> Which ones?
>> I just want to 'C-c C-c' like before, I don't want to be asked what to
>> do as I don't know what answering.
>
> `report-emacs-bugs' hasn't changed (much) with regards to sending email.
> But Emacs itself has changed wrt Email sending.  As you seem to be
> sending your email with Emacs, I'm not quite sure what you mean.
I had to choose for "mail client" "nntp"(not sure) and something else I
don't remember.
I choose "mail client" and I end with something like "no method provided"

> Unless you're sending your bug reports with "emacs -Q"?
No.

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-02-27 10:32     ` Lars Magne Ingebrigtsen
  2012-02-27 15:22       ` Thierry Volpiatto
@ 2012-03-03  8:42       ` Thierry Volpiatto
  2012-03-03  8:49         ` Eli Zaretskii
  2012-03-03 14:33         ` Lars Magne Ingebrigtsen
  1 sibling, 2 replies; 35+ messages in thread
From: Thierry Volpiatto @ 2012-03-03  8:42 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10897

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>>>> I am not sending this bug-report via report-emacs-bug due to its last
>>>> silly modifications.
>>>
>>> Which ones?
>> I just want to 'C-c C-c' like before, I don't want to be asked what to
>> do as I don't know what answering.
>
> `report-emacs-bugs' hasn't changed (much) with regards to sending email.
> But Emacs itself has changed wrt Email sending.
Maybe I am wrong because I can't try without sending a bug-report, so
correct me if so.
It seem that `report-emacs-bug' is using the value of
`send-mail-function' when sending bug reports even if the buffer is a
message buffer.
The new value of `send-mail-function' is `mailclient-send-it'.
Which is not what I want.
Why the value of `message-send-mail-function' isn't used there?
I set here `message-send-mail-function' to `smtpmail-send-it'.

> As you seem to be sending your email with Emacs, I'm not quite sure
> what you mean.
>
> Unless you're sending your bug reports with "emacs -Q"?

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03  8:42       ` bug#10897: sending mail via report-emacs-bug Thierry Volpiatto
@ 2012-03-03  8:49         ` Eli Zaretskii
  2012-03-03  9:29           ` Thierry Volpiatto
  2012-03-03 14:33         ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 35+ messages in thread
From: Eli Zaretskii @ 2012-03-03  8:49 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: larsi, 10897

> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
> Date: Sat, 03 Mar 2012 09:42:24 +0100
> Cc: 10897@debbugs.gnu.org
> 
> I can't try without sending a bug-report

Why can't you? just edit the "To" address to your own, before actually
sending it, and Bob's your uncle.





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03  8:49         ` Eli Zaretskii
@ 2012-03-03  9:29           ` Thierry Volpiatto
  2012-03-03 10:04             ` Thierry Volpiatto
  2012-03-03 14:29             ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 35+ messages in thread
From: Thierry Volpiatto @ 2012-03-03  9:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: larsi, 10897

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
>> Date: Sat, 03 Mar 2012 09:42:24 +0100
>> Cc: 10897@debbugs.gnu.org
>> 
>> I can't try without sending a bug-report
>
> Why can't you? just edit the "To" address to your own, before actually
> sending it, and Bob's your uncle.
Of course :-), I can also change variable value.
But there is nothing to edit and this is not the problem.

Unless I have a Gnus session open, when I do M-x report-emacs-bug,
I am prompted for subject, I write subject, then RET and
"Subject" and "To" fields are empty, and when I do C-c C-c I have an
error like:

--8<---------------cut here---------------start------------->8---
Send this bug report to the Emacs maintainers? (y or n)  y
Sending...
message-send: No methods specified to send by
--8<---------------cut here---------------end--------------->8---

When a Gnus session is open and I do M-x report-emacs-bug, it works
normally. ("Subject" and "To" are completed.)

So I think this is a bug.

 
-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03  9:29           ` Thierry Volpiatto
@ 2012-03-03 10:04             ` Thierry Volpiatto
  2012-03-03 14:29             ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 35+ messages in thread
From: Thierry Volpiatto @ 2012-03-03 10:04 UTC (permalink / raw)
  To: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
>>> Date: Sat, 03 Mar 2012 09:42:24 +0100
>>> Cc: 10897@debbugs.gnu.org
>>> 
>>> I can't try without sending a bug-report
>>
>> Why can't you? just edit the "To" address to your own, before actually
>> sending it, and Bob's your uncle.
> Of course :-), I can also change variable value.
> But there is nothing to edit and this is not the problem.
>
> Unless I have a Gnus session open, when I do M-x report-emacs-bug,
> I am prompted for subject, I write subject, then RET and
> "Subject" and "To" fields are empty, and when I do C-c C-c I have an
> error like:
>
> Send this bug report to the Emacs maintainers? (y or n)  y
> Sending...
> message-send: No methods specified to send by
>
> When a Gnus session is open and I do M-x report-emacs-bug, it works
> normally. ("Subject" and "To" are completed.)
>
> So I think this is a bug.
I confirm it is a bug as this doesn't happen in 24.0.92, it start to bug
at beginning of 24.0.93 pretest.

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 






^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03  9:29           ` Thierry Volpiatto
  2012-03-03 10:04             ` Thierry Volpiatto
@ 2012-03-03 14:29             ` Lars Magne Ingebrigtsen
  2012-03-03 14:59               ` Thierry Volpiatto
  1 sibling, 1 reply; 35+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-03 14:29 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Unless I have a Gnus session open, when I do M-x report-emacs-bug,
> I am prompted for subject, I write subject, then RET and
> "Subject" and "To" fields are empty, and when I do C-c C-c I have an
> error like:

I'm unable to reproduce this bug with "emacs -Q" or just "emacs".  Do
you have some local customisations to your Message setup that wipes the
headers?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03  8:42       ` bug#10897: sending mail via report-emacs-bug Thierry Volpiatto
  2012-03-03  8:49         ` Eli Zaretskii
@ 2012-03-03 14:33         ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 35+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-03 14:33 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> It seem that `report-emacs-bug' is using the value of
> `send-mail-function' when sending bug reports even if the buffer is a
> message buffer.

Hm...  ah, I see.  It's consulting `send-mail-function' (to see whether
it really needs to worry about the From header, which it doesn't need to
when we're going to send via mailclient) even in Message buffers.  And
that's wrong.  I'll fix that...

> Why the value of `message-send-mail-function' isn't used there?

It does use `message-send-mail-function' when actually sending, though,
so I don't see what the bug could be here...

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03 14:29             ` Lars Magne Ingebrigtsen
@ 2012-03-03 14:59               ` Thierry Volpiatto
  2012-03-03 15:05                 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 35+ messages in thread
From: Thierry Volpiatto @ 2012-03-03 14:59 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10897

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>> Unless I have a Gnus session open, when I do M-x report-emacs-bug,
>> I am prompted for subject, I write subject, then RET and
>> "Subject" and "To" fields are empty, and when I do C-c C-c I have an
>> error like:
>
> I'm unable to reproduce this bug with "emacs -Q" or just "emacs".  Do
> you have some local customisations to your Message setup that wipes the
> headers?
Maybe because in Emacs -Q the 'to' and 'subject' field are completed as
expected.

I use same configuration for Emacs-24.0.92 and 24.0.94 and behavior is
different. (i.e nothing in 'to' and 'subject' for 24.0.94)

Note: My Gnus configuration is not new and works fine since months (years).

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03 14:59               ` Thierry Volpiatto
@ 2012-03-03 15:05                 ` Lars Magne Ingebrigtsen
  2012-03-03 17:08                   ` Thierry Volpiatto
  0 siblings, 1 reply; 35+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-03 15:05 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> I use same configuration for Emacs-24.0.92 and 24.0.94 and behavior is
> different. (i.e nothing in 'to' and 'subject' for 24.0.94)
>
> Note: My Gnus configuration is not new and works fine since months (years).

Well, I'm not able to reproduce the bug.

So do you have anything in your setup that could clear the headers?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03 15:05                 ` Lars Magne Ingebrigtsen
@ 2012-03-03 17:08                   ` Thierry Volpiatto
  2012-03-03 17:20                     ` Thierry Volpiatto
  0 siblings, 1 reply; 35+ messages in thread
From: Thierry Volpiatto @ 2012-03-03 17:08 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10897

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>> I use same configuration for Emacs-24.0.92 and 24.0.94 and behavior is
>> different. (i.e nothing in 'to' and 'subject' for 24.0.94)
>>
>> Note: My Gnus configuration is not new and works fine since months (years).
>
> Well, I'm not able to reproduce the bug.
>
> So do you have anything in your setup that could clear the headers?
Ok I found:

--8<---------------cut here---------------start------------->8---
(defun gnus-msg-mail (&optional to subject other-headers continue
				switch-action yank-action send-actions return-action)
  "Start editing a mail message to be sent.
Like `message-mail', but with Gnus paraphernalia, particularly the
Gcc: header for archiving purposes.
If Gnus isn't running, a plain `message-mail' setup is used
instead."
  (interactive)
  (if (not (gnus-alive-p))
      (message-mail)


[...]
--8<---------------cut here---------------end--------------->8---

`compose-mail' is calling `gnus-msg-mail' which have changed and call
`message-mail' with no arguments unless a gnus session is alive.

Fallback to old version of `gnus-msg-mail' and all works fine.


--8<---------------cut here---------------start------------->8---
(defun gnus-msg-mail (&optional to subject other-headers continue
		      switch-action yank-action send-actions return-action)
  "Start editing a mail message to be sent.
Like `message-mail', but with Gnus paraphernalia, particularly the
Gcc: header for archiving purposes."
  (interactive)
  (let ((buf (current-buffer))
	mail-buf)
    (gnus-setup-message 'message
      (message-mail to subject other-headers continue
		    nil yank-action send-actions return-action))
    (when switch-action
      (setq mail-buf (current-buffer))
      (switch-to-buffer buf)
      (apply switch-action mail-buf nil)))
  ;; COMPOSEFUNC should return t if succeed.  Undocumented ???
  t)
--8<---------------cut here---------------end--------------->8---

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03 17:08                   ` Thierry Volpiatto
@ 2012-03-03 17:20                     ` Thierry Volpiatto
  2012-03-04 15:02                       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 35+ messages in thread
From: Thierry Volpiatto @ 2012-03-03 17:20 UTC (permalink / raw)
  To: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
>> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>>
>>> I use same configuration for Emacs-24.0.92 and 24.0.94 and behavior is
>>> different. (i.e nothing in 'to' and 'subject' for 24.0.94)
>>>
>>> Note: My Gnus configuration is not new and works fine since months (years).
>>
>> Well, I'm not able to reproduce the bug.
>>
>> So do you have anything in your setup that could clear the headers?
> Ok I found:
More exactly we need (if (not (gnus-alive-p))..., otherwise we fail with
error `gnus-setup-message' function not found.
So just need to call message-mail with args.
here a patch:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -486,7 +486,8 @@
 instead."
   (interactive)
   (if (not (gnus-alive-p))
-      (message-mail)
+      (message-mail to subject other-headers continue
+                    nil yank-action send-actions return-action)
     (let ((buf (current-buffer))
 	  mail-buf)
       (gnus-setup-message 'message
--8<---------------cut here---------------end--------------->8---

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 






^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-03 17:20                     ` Thierry Volpiatto
@ 2012-03-04 15:02                       ` Lars Magne Ingebrigtsen
  2012-03-05 13:58                         ` Thierry Volpiatto
  0 siblings, 1 reply; 35+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-04 15:02 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> More exactly we need (if (not (gnus-alive-p))..., otherwise we fail with
> error `gnus-setup-message' function not found.
> So just need to call message-mail with args.

D'oh.

Thanks for the patch; applied to No Gnus (and Emacs 24 later).

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: sending mail via report-emacs-bug
  2012-03-04 15:02                       ` Lars Magne Ingebrigtsen
@ 2012-03-05 13:58                         ` Thierry Volpiatto
  0 siblings, 0 replies; 35+ messages in thread
From: Thierry Volpiatto @ 2012-03-05 13:58 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10897

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>> More exactly we need (if (not (gnus-alive-p))..., otherwise we fail with
>> error `gnus-setup-message' function not found.
>> So just need to call message-mail with args.
>
> D'oh.
>
> Thanks for the patch; applied to No Gnus (and Emacs 24 later).
Now it is in Emacs 24 and works fine, thanks.

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2012-02-27 15:22       ` Thierry Volpiatto
@ 2012-03-09 23:07         ` Lars Magne Ingebrigtsen
  2012-03-10  6:08           ` Thierry Volpiatto
  0 siblings, 1 reply; 35+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-09 23:07 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> I had to choose for "mail client" "nntp"(not sure) and something else I
> don't remember.
> I choose "mail client" and I end with something like "no method provided"

Could you send a backtrace?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2012-03-09 23:07         ` Lars Magne Ingebrigtsen
@ 2012-03-10  6:08           ` Thierry Volpiatto
  0 siblings, 0 replies; 35+ messages in thread
From: Thierry Volpiatto @ 2012-03-10  6:08 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10897

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>> I had to choose for "mail client" "nntp"(not sure) and something else I
>> don't remember.
>> I choose "mail client" and I end with something like "no method provided"
>
> Could you send a backtrace?
I think its ok now.
What I did was trying to send the bug report with the "To" and "Subject"
not completed (didn't look at headers and just C-c C-c), so smtp or
something else was complaining and asking on what to do.
But now we have fixed "To" and "Subject" at startup of report-emacs-bug,
I think we can forget that.

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2012-02-27  8:47 bug#10897: copy-directory create new directory when copying a symlink Thierry Volpiatto
  2012-02-27  9:11 ` Lars Magne Ingebrigtsen
@ 2020-08-25 12:47 ` Lars Ingebrigtsen
  2020-10-13  2:33   ` Lars Ingebrigtsen
  2021-08-19 21:47 ` Marco Centurion
  2021-08-20  1:08 ` Marco Centurion
  3 siblings, 1 reply; 35+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-25 12:47 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 10897

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> when copying a directory symlink to another directory, the behavior of
> 'cp' is to create a new symlink in this directory:
>
> thierry@thierry-MM061:~ $ mkdir ~/Test
> thierry@thierry-MM061:~ $ mkdir ~/tmp/Test1
> thierry@thierry-MM061:~ $ ln -s ~/tmp/Test1 ~/tmp/foo
> thierry@thierry-MM061:~ $ cp -r ~/tmp/foo ~/Test
> thierry@thierry-MM061:~ $ ls -l ~/Test
> total 0
> lrwxrwxrwx   1 thierry        thierry  23 2012-02-27 09:08 foo -> /home/thierry/tmp/Test1
>
> It is not what's copy-directory does:
>
> (copy-directory "~/tmp/foo" "~/Test" nil t)
> =>
> thierry@thierry-MM061:~ $ ls -l ~/Test
> total 4
> drwxrwxr-x   2 thierry        thierry  4096 2012-02-27 09:11 foo

I'm unable to reproduce the bug using this recipe -- at the end of this,
I just have an empty ~/Test directory.

Which is also different from what cp -r does, but I'm not sure that's a
bug -- when you tell copy-directory to copy a symlink, I think it's
natural to dereference that symlink first?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2020-08-25 12:47 ` bug#10897: copy-directory create new directory when copying a symlink Lars Ingebrigtsen
@ 2020-10-13  2:33   ` Lars Ingebrigtsen
  2020-10-13  3:15     ` Glenn Morris
  0 siblings, 1 reply; 35+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-13  2:33 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 10897

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I'm unable to reproduce the bug using this recipe -- at the end of this,
> I just have an empty ~/Test directory.

More information was requested, but none was given, so I'm closing this
bug report.  If there's still problems in this area, please respond to
the debbugs address, and we'll reopen the report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2020-10-13  2:33   ` Lars Ingebrigtsen
@ 2020-10-13  3:15     ` Glenn Morris
  2020-10-13  3:19       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 35+ messages in thread
From: Glenn Morris @ 2020-10-13  3:15 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 10897, Thierry Volpiatto

Lars Ingebrigtsen wrote:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> I'm unable to reproduce the bug using this recipe -- at the end of this,
>> I just have an empty ~/Test directory.
>
> More information was requested, but none was given, so I'm closing this
> bug report.  If there's still problems in this area, please respond to
> the debbugs address, and we'll reopen the report.

I saw this had previously been tagged "confirmed".

The issue from the OP is reproducible in emacs-27, but changes in Emacs
since it was reported means one now needs to use:

(copy-directory "~/tmp/foo" "~/Test/" nil t)
                                   ^





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2020-10-13  3:15     ` Glenn Morris
@ 2020-10-13  3:19       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 35+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-13  3:19 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10897, Thierry Volpiatto

Glenn Morris <rgm@gnu.org> writes:

> The issue from the OP is reproducible in emacs-27, but changes in Emacs
> since it was reported means one now needs to use:
>
> (copy-directory "~/tmp/foo" "~/Test/" nil t)
>                                    ^

OK; reopening.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2012-02-27  8:47 bug#10897: copy-directory create new directory when copying a symlink Thierry Volpiatto
  2012-02-27  9:11 ` Lars Magne Ingebrigtsen
  2020-08-25 12:47 ` bug#10897: copy-directory create new directory when copying a symlink Lars Ingebrigtsen
@ 2021-08-19 21:47 ` Marco Centurion
  2021-08-20  1:08 ` Marco Centurion
  3 siblings, 0 replies; 35+ messages in thread
From: Marco Centurion @ 2021-08-19 21:47 UTC (permalink / raw)
  To: 10897

[-- Attachment #1: Type: text/plain, Size: 157 bytes --]

This patch seems to fix this issue. Turns out that the code didn't take
into consideration the case when the directory we want to copy is itself
a symlink.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bug#10897.patch --]
[-- Type: text/x-patch, Size: 3845 bytes --]

diff --git a/lisp/files.el b/lisp/files.el
index 875ac55316..424cf1bea0 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6193,42 +6193,48 @@ copy-directory
       (setq directory (directory-file-name (expand-file-name directory))
 	    newname (expand-file-name newname))
 
-      (cond ((not (directory-name-p newname))
-	     ;; If NEWNAME is not a directory name, create it;
-	     ;; that is where we will copy the files of DIRECTORY.
-	     (make-directory newname parents))
-	    ;; NEWNAME is a directory name.  If COPY-CONTENTS is non-nil,
-	    ;; create NEWNAME if it is not already a directory;
-	    ;; otherwise, create NEWNAME/[DIRECTORY-BASENAME].
-	    ((if copy-contents
-		 (or parents (not (file-directory-p newname)))
-	       (setq newname (concat newname
-				     (file-name-nondirectory directory))))
-	     (make-directory (directory-file-name newname) parents))
-	    (t (setq follow t)))
-
-      ;; Copy recursively.
-      (dolist (file
-	       ;; We do not want to copy "." and "..".
-	       (directory-files directory 'full
-				directory-files-no-dot-files-regexp))
-	(let ((target (concat (file-name-as-directory newname)
-			      (file-name-nondirectory file)))
-	      (filetype (car (file-attributes file))))
-	  (cond
-	   ((eq filetype t)       ; Directory but not a symlink.
-	    (copy-directory file target keep-time parents t))
-	   ((stringp filetype)    ; Symbolic link
-	    (make-symbolic-link filetype target t))
-	   ((copy-file file target t keep-time)))))
-
-      ;; Set directory attributes.
-      (let ((modes (file-modes directory))
-	    (times (and keep-time (file-attribute-modification-time
-				   (file-attributes directory))))
-	    (follow-flag (unless follow 'nofollow)))
-	(if modes (set-file-modes newname modes follow-flag))
-	(if times (set-file-times newname times follow-flag))))))
+      ;; If DIRECTORY is a symlink, create a NEWNAME symlink
+      ;; with the same target.
+      (if (file-symlink-p directory)
+	  (let ((target  (car (file-attributes directory))))
+	    (make-symbolic-link target newname t))
+        ;; Else proceed to copy as a regular directory
+        (cond ((not (directory-name-p newname))
+	       ;; If NEWNAME is not a directory name, create it;
+	       ;; that is where we will copy the files of DIRECTORY.
+	       (make-directory newname parents))
+	      ;; NEWNAME is a directory name.  If COPY-CONTENTS is non-nil,
+	      ;; create NEWNAME if it is not already a directory;
+	      ;; otherwise, create NEWNAME/[DIRECTORY-BASENAME].
+	      ((if copy-contents
+		   (or parents (not (file-directory-p newname)))
+	         (setq newname (concat newname
+				       (file-name-nondirectory directory))))
+	       (make-directory (directory-file-name newname) parents))
+	      (t (setq follow t)))
+
+        ;; Copy recursively.
+        (dolist (file
+	         ;; We do not want to copy "." and "..".
+	         (directory-files directory 'full
+				  directory-files-no-dot-files-regexp))
+	  (let ((target (concat (file-name-as-directory newname)
+			        (file-name-nondirectory file)))
+	        (filetype (car (file-attributes file))))
+	    (cond
+	     ((eq filetype t)       ; Directory but not a symlink.
+	      (copy-directory file target keep-time parents t))
+	     ((stringp filetype)    ; Symbolic link
+	      (make-symbolic-link filetype target t))
+	     ((copy-file file target t keep-time)))))
+
+        ;; Set directory attributes.
+        (let ((modes (file-modes directory))
+	      (times (and keep-time (file-attribute-modification-time
+				     (file-attributes directory))))
+	      (follow-flag (unless follow 'nofollow)))
+	  (if modes (set-file-modes newname modes follow-flag))
+	  (if times (set-file-times newname times follow-flag)))))))
 
 \f
 ;; At time of writing, only info uses this.

[-- Attachment #3: Type: text/plain, Size: 92 bytes --]


-- 
Marco Centurion
Unidad de Recursos Informáticos
Facultad de Ingeniería - UdelaR

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2012-02-27  8:47 bug#10897: copy-directory create new directory when copying a symlink Thierry Volpiatto
                   ` (2 preceding siblings ...)
  2021-08-19 21:47 ` Marco Centurion
@ 2021-08-20  1:08 ` Marco Centurion
  2021-08-20  5:51   ` Eli Zaretskii
  2021-08-20 13:44   ` Lars Ingebrigtsen
  3 siblings, 2 replies; 35+ messages in thread
From: Marco Centurion @ 2021-08-20  1:08 UTC (permalink / raw)
  To: 10897

[-- Attachment #1: Type: text/plain, Size: 536 bytes --]

I failed to document the new behaviour in the docstring.

The patch I sent didn't manage the creation of the new symlink correctly
either, as it created it with the same name as the target.  That is, in
the examples given the result was:

-------------------------
(copy-directory "~/tmp/foo" "~/Test" nil t)
=>
[mcenturion@localhost ~]$ ls -l Test
total 4
lrwxrwxrwx. 1 mcenturion mcenturion 26 ago 19 21:21 Test1 -> /home/mcenturion/tmp/Test1
-------------------------

This new patch corrects both mistakes.

Sorry for the misfire.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bug#10897.patch --]
[-- Type: text/x-patch, Size: 4384 bytes --]

diff --git a/lisp/files.el b/lisp/files.el
index 875ac55316..0bf8a2ea8d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6165,6 +6165,9 @@ copy-directory
 parent directories if they don't exist.  Interactively, this
 happens by default.
 
+If DIRECTORY is a symlink, create a symlink with the same target
+as DIRECTORY.
+
 If NEWNAME is a directory name, copy DIRECTORY as a subdirectory
 there.  However, if called from Lisp with a non-nil optional
 argument COPY-CONTENTS, copy the contents of DIRECTORY directly
@@ -6193,42 +6196,52 @@ copy-directory
       (setq directory (directory-file-name (expand-file-name directory))
 	    newname (expand-file-name newname))
 
-      (cond ((not (directory-name-p newname))
-	     ;; If NEWNAME is not a directory name, create it;
-	     ;; that is where we will copy the files of DIRECTORY.
-	     (make-directory newname parents))
-	    ;; NEWNAME is a directory name.  If COPY-CONTENTS is non-nil,
-	    ;; create NEWNAME if it is not already a directory;
-	    ;; otherwise, create NEWNAME/[DIRECTORY-BASENAME].
-	    ((if copy-contents
-		 (or parents (not (file-directory-p newname)))
-	       (setq newname (concat newname
-				     (file-name-nondirectory directory))))
-	     (make-directory (directory-file-name newname) parents))
-	    (t (setq follow t)))
-
-      ;; Copy recursively.
-      (dolist (file
-	       ;; We do not want to copy "." and "..".
-	       (directory-files directory 'full
-				directory-files-no-dot-files-regexp))
-	(let ((target (concat (file-name-as-directory newname)
-			      (file-name-nondirectory file)))
-	      (filetype (car (file-attributes file))))
-	  (cond
-	   ((eq filetype t)       ; Directory but not a symlink.
-	    (copy-directory file target keep-time parents t))
-	   ((stringp filetype)    ; Symbolic link
-	    (make-symbolic-link filetype target t))
-	   ((copy-file file target t keep-time)))))
-
-      ;; Set directory attributes.
-      (let ((modes (file-modes directory))
-	    (times (and keep-time (file-attribute-modification-time
-				   (file-attributes directory))))
-	    (follow-flag (unless follow 'nofollow)))
-	(if modes (set-file-modes newname modes follow-flag))
-	(if times (set-file-times newname times follow-flag))))))
+      ;; If DIRECTORY is a symlink, create a symlink with the same target.
+      (if (file-symlink-p directory)
+          (let ((target (car (file-attributes directory))))
+	    (if (directory-name-p newname)
+		(make-symbolic-link target
+				    (concat newname
+					    (file-name-nondirectory directory))
+				    t)
+	      (make-symbolic-link target newname t)))
+        ;; Else proceed to copy as a regular directory
+        (cond ((not (directory-name-p newname))
+	       ;; If NEWNAME is not a directory name, create it;
+	       ;; that is where we will copy the files of DIRECTORY.
+	       (make-directory newname parents))
+	      ;; NEWNAME is a directory name.  If COPY-CONTENTS is non-nil,
+	      ;; create NEWNAME if it is not already a directory;
+	      ;; otherwise, create NEWNAME/[DIRECTORY-BASENAME].
+	      ((if copy-contents
+		   (or parents (not (file-directory-p newname)))
+	         (setq newname (concat newname
+				       (file-name-nondirectory directory))))
+	       (make-directory (directory-file-name newname) parents))
+	      (t (setq follow t)))
+
+        ;; Copy recursively.
+        (dolist (file
+	         ;; We do not want to copy "." and "..".
+	         (directory-files directory 'full
+				  directory-files-no-dot-files-regexp))
+	  (let ((target (concat (file-name-as-directory newname)
+			        (file-name-nondirectory file)))
+	        (filetype (car (file-attributes file))))
+	    (cond
+	     ((eq filetype t)       ; Directory but not a symlink.
+	      (copy-directory file target keep-time parents t))
+	     ((stringp filetype)    ; Symbolic link
+	      (make-symbolic-link filetype target t))
+	     ((copy-file file target t keep-time)))))
+
+        ;; Set directory attributes.
+        (let ((modes (file-modes directory))
+	      (times (and keep-time (file-attribute-modification-time
+				     (file-attributes directory))))
+	      (follow-flag (unless follow 'nofollow)))
+	  (if modes (set-file-modes newname modes follow-flag))
+	  (if times (set-file-times newname times follow-flag)))))))
 
 \f
 ;; At time of writing, only info uses this.

[-- Attachment #3: Type: text/plain, Size: 92 bytes --]


-- 
Marco Centurion
Unidad de Recursos Informáticos
Facultad de Ingeniería - UdelaR

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-20  1:08 ` Marco Centurion
@ 2021-08-20  5:51   ` Eli Zaretskii
  2021-08-22 13:34     ` Michael Albinus
  2021-08-20 13:44   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 35+ messages in thread
From: Eli Zaretskii @ 2021-08-20  5:51 UTC (permalink / raw)
  To: Marco Centurion; +Cc: 10897

> From: Marco Centurion <mcenturion@fing.edu.uy>
> Date: Thu, 19 Aug 2021 22:08:30 -0300
> 
> I failed to document the new behaviour in the docstring.
> 
> The patch I sent didn't manage the creation of the new symlink correctly
> either, as it created it with the same name as the target.  That is, in
> the examples given the result was:
> 
> -------------------------
> (copy-directory "~/tmp/foo" "~/Test" nil t)
> =>
> [mcenturion@localhost ~]$ ls -l Test
> total 4
> lrwxrwxrwx. 1 mcenturion mcenturion 26 ago 19 21:21 Test1 -> /home/mcenturion/tmp/Test1
> -------------------------
> 
> This new patch corrects both mistakes.

Thanks.

FWIW, I think this feature should be controlled by a user option, at
least because it changes a very old behavior.  Also, on some systems
(MS-Windows, for example) creating a symlink requires non-default
privileges, so it could be a nuisance to force this on such users.





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-20  1:08 ` Marco Centurion
  2021-08-20  5:51   ` Eli Zaretskii
@ 2021-08-20 13:44   ` Lars Ingebrigtsen
  2021-08-20 14:29     ` Marco Centurion - URI
  1 sibling, 1 reply; 35+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-20 13:44 UTC (permalink / raw)
  To: Marco Centurion; +Cc: 10897

Marco Centurion <mcenturion@fing.edu.uy> writes:

> This new patch corrects both mistakes.

Thanks; applied to Emacs 28 (but I added the user option to control
this, as Eli suggested).

This change was small enough to apply without assigning copyright to the
FSF, but for future patches you want to submit, it might make sense to
get the paperwork started now, so that subsequent patches can be applied
speedily. Would you be willing to sign such paperwork?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-20 13:44   ` Lars Ingebrigtsen
@ 2021-08-20 14:29     ` Marco Centurion - URI
  2021-08-20 14:38       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 35+ messages in thread
From: Marco Centurion - URI @ 2021-08-20 14:29 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 10897

> This change was small enough to apply without assigning copyright to the
> FSF, but for future patches you want to submit, it might make sense to
> get the paperwork started now, so that subsequent patches can be applied
> speedily. Would you be willing to sign such paperwork?

Of course!  I'll email assign@gnu.org to get the paperwork going.

-- 
Marco Centurion
Unidad de Recursos Informáticos
Facultad de Ingeniería - UdelaR





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-20 14:29     ` Marco Centurion - URI
@ 2021-08-20 14:38       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 35+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-20 14:38 UTC (permalink / raw)
  To: Marco Centurion - URI; +Cc: 10897

Marco Centurion - URI <mcenturion@fing.edu.uy> writes:

>> This change was small enough to apply without assigning copyright to the
>> FSF, but for future patches you want to submit, it might make sense to
>> get the paperwork started now, so that subsequent patches can be applied
>> speedily. Would you be willing to sign such paperwork?
>
> Of course!  I'll email assign@gnu.org to get the paperwork going.

Great!

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-20  5:51   ` Eli Zaretskii
@ 2021-08-22 13:34     ` Michael Albinus
  2021-08-22 13:46       ` Eli Zaretskii
  0 siblings, 1 reply; 35+ messages in thread
From: Michael Albinus @ 2021-08-22 13:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Marco Centurion, 10897

Eli Zaretskii <eliz@gnu.org> writes:

> FWIW, I think this feature should be controlled by a user option, at
> least because it changes a very old behavior.  Also, on some systems
> (MS-Windows, for example) creating a symlink requires non-default
> privileges, so it could be a nuisance to force this on such users.

Hmm. Is this something we want also in Tramp?

Best regards, Michael.





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-22 13:34     ` Michael Albinus
@ 2021-08-22 13:46       ` Eli Zaretskii
  2021-08-22 14:58         ` Michael Albinus
  0 siblings, 1 reply; 35+ messages in thread
From: Eli Zaretskii @ 2021-08-22 13:46 UTC (permalink / raw)
  To: Michael Albinus; +Cc: mcenturion, 10897

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: Marco Centurion <mcenturion@fing.edu.uy>,  10897@debbugs.gnu.org
> Date: Sun, 22 Aug 2021 15:34:57 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > FWIW, I think this feature should be controlled by a user option, at
> > least because it changes a very old behavior.  Also, on some systems
> > (MS-Windows, for example) creating a symlink requires non-default
> > privileges, so it could be a nuisance to force this on such users.
> 
> Hmm. Is this something we want also in Tramp?

Which part, specifically?





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-22 13:46       ` Eli Zaretskii
@ 2021-08-22 14:58         ` Michael Albinus
  2021-08-22 16:47           ` Eli Zaretskii
  0 siblings, 1 reply; 35+ messages in thread
From: Michael Albinus @ 2021-08-22 14:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: mcenturion, 10897

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> > FWIW, I think this feature should be controlled by a user option, at
>> > least because it changes a very old behavior.  Also, on some systems
>> > (MS-Windows, for example) creating a symlink requires non-default
>> > privileges, so it could be a nuisance to force this on such users.
>>
>> Hmm. Is this something we want also in Tramp?
>
> Which part, specifically?

Copy a symbolic link as-is. Example:

--8<---------------cut here---------------start------------->8---
(make-directory "/ssh::/tmp/foo")
(write-region "baz" nil "/ssh::/tmp/foo/baz")
(make-symbolic-link "/ssh::/tmp/foo" "/ssh::/tmp/bar")
(copy-directory "/ssh::/tmp/bar" "/ssh::/tmp/bla")
--8<---------------cut here---------------end--------------->8---

Currently, this creates a new directory "/ssh::/tmp/bla", which contains
the file "baz". If the new user option copy-directory-create-symlink is
non-nil, this should create the symlink "/ssh::/tmp/bla", pointing to
"/tmp/foo".

There are many traps in implementation, especially in case DIRECTORY and
NEWNAME of copy-directory are located on different hosts. But first, we
shall decide whether such a feature is useful for Tramp files in general.

(I would say yes, with all pain I see in the implementation.)

Best regards, Michael.





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-22 14:58         ` Michael Albinus
@ 2021-08-22 16:47           ` Eli Zaretskii
  2021-08-22 17:13             ` Michael Albinus
  0 siblings, 1 reply; 35+ messages in thread
From: Eli Zaretskii @ 2021-08-22 16:47 UTC (permalink / raw)
  To: Michael Albinus; +Cc: mcenturion, 10897

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: mcenturion@fing.edu.uy,  10897@debbugs.gnu.org
> Date: Sun, 22 Aug 2021 16:58:16 +0200
> 
> >> Hmm. Is this something we want also in Tramp?
> >
> > Which part, specifically?
> 
> Copy a symbolic link as-is. Example:
> 
> --8<---------------cut here---------------start------------->8---
> (make-directory "/ssh::/tmp/foo")
> (write-region "baz" nil "/ssh::/tmp/foo/baz")
> (make-symbolic-link "/ssh::/tmp/foo" "/ssh::/tmp/bar")
> (copy-directory "/ssh::/tmp/bar" "/ssh::/tmp/bla")
> --8<---------------cut here---------------end--------------->8---
> 
> Currently, this creates a new directory "/ssh::/tmp/bla", which contains
> the file "baz". If the new user option copy-directory-create-symlink is
> non-nil, this should create the symlink "/ssh::/tmp/bla", pointing to
> "/tmp/foo".

Yes, sure.  We should support that with remote files as much as
possible.





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-22 16:47           ` Eli Zaretskii
@ 2021-08-22 17:13             ` Michael Albinus
  2021-08-22 18:48               ` Michael Albinus
  0 siblings, 1 reply; 35+ messages in thread
From: Michael Albinus @ 2021-08-22 17:13 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: mcenturion, 10897

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> Copy a symbolic link as-is. Example:
>>
>> --8<---------------cut here---------------start------------->8---
>> (make-directory "/ssh::/tmp/foo")
>> (write-region "baz" nil "/ssh::/tmp/foo/baz")
>> (make-symbolic-link "/ssh::/tmp/foo" "/ssh::/tmp/bar")
>> (copy-directory "/ssh::/tmp/bar" "/ssh::/tmp/bla")
>> --8<---------------cut here---------------end--------------->8---
>>
>> Currently, this creates a new directory "/ssh::/tmp/bla", which contains
>> the file "baz". If the new user option copy-directory-create-symlink is
>> non-nil, this should create the symlink "/ssh::/tmp/bla", pointing to
>> "/tmp/foo".
>
> Yes, sure.  We should support that with remote files as much as
> possible.

Will do. Thinking about, it makes only sense when both DIRECTORY and
NEWNAME are located on the same host. That's what I'm going to implement.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#10897: copy-directory create new directory when copying a symlink
  2021-08-22 17:13             ` Michael Albinus
@ 2021-08-22 18:48               ` Michael Albinus
  0 siblings, 0 replies; 35+ messages in thread
From: Michael Albinus @ 2021-08-22 18:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: mcenturion, 10897

Michael Albinus <michael.albinus@gmx.de> writes:

Hi Eli,

>>> Currently, this creates a new directory "/ssh::/tmp/bla", which contains
>>> the file "baz". If the new user option copy-directory-create-symlink is
>>> non-nil, this should create the symlink "/ssh::/tmp/bla", pointing to
>>> "/tmp/foo".
>>
>> Yes, sure.  We should support that with remote files as much as
>> possible.
>
> Will do. Thinking about, it makes only sense when both DIRECTORY and
> NEWNAME are located on the same host. That's what I'm going to implement.

Done. I've implemented it for all methods declared in tramp-sh.el; for
other methods it isn't relevant.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2021-08-22 18:48 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27  8:47 bug#10897: copy-directory create new directory when copying a symlink Thierry Volpiatto
2012-02-27  9:11 ` Lars Magne Ingebrigtsen
2012-02-27  9:30   ` Thierry Volpiatto
2012-02-27 10:32     ` Lars Magne Ingebrigtsen
2012-02-27 15:22       ` Thierry Volpiatto
2012-03-09 23:07         ` Lars Magne Ingebrigtsen
2012-03-10  6:08           ` Thierry Volpiatto
2012-03-03  8:42       ` bug#10897: sending mail via report-emacs-bug Thierry Volpiatto
2012-03-03  8:49         ` Eli Zaretskii
2012-03-03  9:29           ` Thierry Volpiatto
2012-03-03 10:04             ` Thierry Volpiatto
2012-03-03 14:29             ` Lars Magne Ingebrigtsen
2012-03-03 14:59               ` Thierry Volpiatto
2012-03-03 15:05                 ` Lars Magne Ingebrigtsen
2012-03-03 17:08                   ` Thierry Volpiatto
2012-03-03 17:20                     ` Thierry Volpiatto
2012-03-04 15:02                       ` Lars Magne Ingebrigtsen
2012-03-05 13:58                         ` Thierry Volpiatto
2012-03-03 14:33         ` Lars Magne Ingebrigtsen
2020-08-25 12:47 ` bug#10897: copy-directory create new directory when copying a symlink Lars Ingebrigtsen
2020-10-13  2:33   ` Lars Ingebrigtsen
2020-10-13  3:15     ` Glenn Morris
2020-10-13  3:19       ` Lars Ingebrigtsen
2021-08-19 21:47 ` Marco Centurion
2021-08-20  1:08 ` Marco Centurion
2021-08-20  5:51   ` Eli Zaretskii
2021-08-22 13:34     ` Michael Albinus
2021-08-22 13:46       ` Eli Zaretskii
2021-08-22 14:58         ` Michael Albinus
2021-08-22 16:47           ` Eli Zaretskii
2021-08-22 17:13             ` Michael Albinus
2021-08-22 18:48               ` Michael Albinus
2021-08-20 13:44   ` Lars Ingebrigtsen
2021-08-20 14:29     ` Marco Centurion - URI
2021-08-20 14:38       ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).