* Re: [Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633)
[not found] ` <20180228012156.38869207B1@vcs0.savannah.gnu.org>
@ 2018-02-28 2:03 ` Stefan Monnier
2018-02-28 3:33 ` Noam Postavsky
2018-02-28 7:55 ` Michael Albinus
0 siblings, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2018-02-28 2:03 UTC (permalink / raw)
To: Noam Postavsky; +Cc: Fabián E. Gallina, Michael Albinus, emacs-devel
> Since python.el is distributed via GNU ELPA, it should be functional
> in earlier Emacs versions. Also fix some compile warnings.
Thanks.
I have a few questions, tho:
> + (unless (fboundp 'file-local-name)
Regarding this function, [ I understand you didn't write this code, so
the question is not necessarily for you ] I see it's used as follows:
(file-name (expand-file-name (file-local-name file-name)))
(temp-file-name (when temp-file-name
(expand-file-name
(file-local-name temp-file-name)))))
I don't understand how/why it makes sense to apply expand-file-name on
its return value. Shouldn't this be
(file-name (file-local-name (expand-file-name file-name)))
(temp-file-name (when temp-file-name
(file-local-name
(expand-file-name temp-file-name)))))
?
> + "
> +Overlapping strings detected (start=%d, last-end=%d)")
You can put a \ at the end of the first line to avoid inserting
a newline in the string's content.
> - (set (make-local-variable 'prettify-symbols-alist)
> - python--prettify-symbols-alist)
> + (when (and (boundp 'prettify-symbols-alist)
> + (boundp 'python--prettify-symbols-alist))
> + (set (make-local-variable 'prettify-symbols-alist)
> + python--prettify-symbols-alist))
Setting prettify-symbols-alist when it's not defined should be harmless.
So I'm curious what was the motivation behind the (boundp
'prettify-symbols-alist) test?
Could we replace it with a (defvar prettify-symbols-alist)?
[ As for python--prettify-symbols-alist, it's defined above, so it will
always be 'boundp'. ]
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633)
2018-02-28 2:03 ` [Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633) Stefan Monnier
@ 2018-02-28 3:33 ` Noam Postavsky
2018-02-28 5:10 ` Stefan Monnier
2018-02-28 7:55 ` Michael Albinus
1 sibling, 1 reply; 5+ messages in thread
From: Noam Postavsky @ 2018-02-28 3:33 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Fabián E. Gallina, Michael Albinus, Emacs developers
On Tue, Feb 27, 2018 at 9:03 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> + "
>> +Overlapping strings detected (start=%d, last-end=%d)")
>
> You can put a \ at the end of the first line to avoid inserting
> a newline in the string's content.
Oops. I meant to do that, but somehow the backslash disappeared on me
(a paredit boosted typo, I guess).
>> - (set (make-local-variable 'prettify-symbols-alist)
>> - python--prettify-symbols-alist)
>> + (when (and (boundp 'prettify-symbols-alist)
>> + (boundp 'python--prettify-symbols-alist))
>> + (set (make-local-variable 'prettify-symbols-alist)
>> + python--prettify-symbols-alist))
>
> Setting prettify-symbols-alist when it's not defined should be harmless.
> So I'm curious what was the motivation behind the (boundp
> 'prettify-symbols-alist) test?
> Could we replace it with a (defvar prettify-symbols-alist)?
Yeah, I was just going through the compiler warnings, so defvar could work too.
> [ As for python--prettify-symbols-alist, it's defined above, so it will
> always be 'boundp'. ]
Oh, I see, in Emacs 24, the compiler doesn't realize that
define-obsolete-variable-alias defines a variable, so it still warns
about it. Actually, we could just use the non-obsolete
python-prettify-symbols-alist name there, right?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633)
2018-02-28 3:33 ` Noam Postavsky
@ 2018-02-28 5:10 ` Stefan Monnier
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2018-02-28 5:10 UTC (permalink / raw)
To: Noam Postavsky; +Cc: Fabián E. Gallina, Michael Albinus, Emacs developers
> Oh, I see, in Emacs 24, the compiler doesn't realize that
> define-obsolete-variable-alias defines a variable, so it still warns
> about it. Actually, we could just use the non-obsolete
> python-prettify-symbols-alist name there, right?
Indeed, we should use the non-obsolete name (and I now see also that the
define-obsolete-variable-alias is placed after the defvar, whereas it
should always come *before* (so that, in case one of the two is already
set when we get to define-obsolete-variable-alias we can just "share"
that setting, whereas if we do it afterwards we end up having to choose
between two conflicting settings)).
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633)
2018-02-28 2:03 ` [Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633) Stefan Monnier
2018-02-28 3:33 ` Noam Postavsky
@ 2018-02-28 7:55 ` Michael Albinus
2018-03-02 3:15 ` Noam Postavsky
1 sibling, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2018-02-28 7:55 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Fabián E. Gallina, Noam Postavsky, emacs-devel
Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
> (file-name (expand-file-name (file-local-name file-name)))
> (temp-file-name (when temp-file-name
> (expand-file-name
> (file-local-name temp-file-name)))))
>
> I don't understand how/why it makes sense to apply expand-file-name on
> its return value. Shouldn't this be
>
> (file-name (file-local-name (expand-file-name file-name)))
> (temp-file-name (when temp-file-name
> (file-local-name
> (expand-file-name temp-file-name)))))
>
> ?
Yes. If, for example, file-name is "/ssh:user@host:~/what/ever", the
former forms might fail, because "~/what/ever" could be expanded
differently on local and remote hosts.
> Stefan
Best regards, Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633)
2018-02-28 7:55 ` Michael Albinus
@ 2018-03-02 3:15 ` Noam Postavsky
0 siblings, 0 replies; 5+ messages in thread
From: Noam Postavsky @ 2018-03-02 3:15 UTC (permalink / raw)
To: Michael Albinus; +Cc: Fabián E. Gallina, Stefan Monnier, Emacs developers
On Wed, Feb 28, 2018 at 2:55 AM, Michael Albinus <michael.albinus@gmx.de> wrote:
> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>
>> (file-name (expand-file-name (file-local-name file-name)))
>> (temp-file-name (when temp-file-name
>> (expand-file-name
>> (file-local-name temp-file-name)))))
>>
>> I don't understand how/why it makes sense to apply expand-file-name on
>> its return value. Shouldn't this be
>>
>> (file-name (file-local-name (expand-file-name file-name)))
>> (temp-file-name (when temp-file-name
>> (file-local-name
>> (expand-file-name temp-file-name)))))
>>
>> ?
>
> Yes. If, for example, file-name is "/ssh:user@host:~/what/ever", the
> former forms might fail, because "~/what/ever" could be expanded
> differently on local and remote hosts.
Thanks, I fixed this and the other issues Stefan pointed out.
[1: 4a09341921]: 2018-03-01 22:07:21 -0500
Fix issues turned up by previous python.el change
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4a0934192176fb8e372170f5f028edcf0f8cbdc3
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-03-02 3:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20180228012154.1636.19993@vcs0.savannah.gnu.org>
[not found] ` <20180228012156.38869207B1@vcs0.savannah.gnu.org>
2018-02-28 2:03 ` [Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633) Stefan Monnier
2018-02-28 3:33 ` Noam Postavsky
2018-02-28 5:10 ` Stefan Monnier
2018-02-28 7:55 ` Michael Albinus
2018-03-02 3:15 ` Noam Postavsky
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.