all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* missing "/" in value of user-emacs-directory when using --init-directory flag
@ 2022-11-29 17:55 Yilkal Argaw
  2022-11-29 18:11 ` Yilkal Argaw
  2022-11-29 18:20 ` Eli Zaretskii
  0 siblings, 2 replies; 17+ messages in thread
From: Yilkal Argaw @ 2022-11-29 17:55 UTC (permalink / raw)
  To: Emacs Devel

In my configs I use (concat user-emacs-directory "somedirectory or
file") to refer to files with respect to emacs. When loading emacs
with the option --init-directory this
this string is not separated by a backslash since the value
user-emacs-directory does not have a backslash on the end of it. This
might break previous configs so it should be standardized to contain
the same string value in both cases.



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

* Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 17:55 missing "/" in value of user-emacs-directory when using --init-directory flag Yilkal Argaw
@ 2022-11-29 18:11 ` Yilkal Argaw
  2022-11-29 18:20 ` Eli Zaretskii
  1 sibling, 0 replies; 17+ messages in thread
From: Yilkal Argaw @ 2022-11-29 18:11 UTC (permalink / raw)
  To: Emacs Devel

> In my configs I use (concat user-emacs-directory "somedirectory or
> file") to refer to files with respect to emacs. When loading emacs
> with the option --init-directory this
> this string is not separated by a backslash since the value
> user-emacs-directory does not have a backslash on the end of it. This
> might break previous configs so it should be standardized to contain
> the same string value in both cases.

I meant forward-slash when I said back slash sorry generally
"user-emacs-directory" sould contain something like ".emacs.d/"
instead of ".emacs.d".

On Tue, Nov 29, 2022 at 5:55 PM Yilkal Argaw
<yilkalargawworkneh@gmail.com> wrote:
>
> In my configs I use (concat user-emacs-directory "somedirectory or
> file") to refer to files with respect to emacs. When loading emacs
> with the option --init-directory this
> this string is not separated by a backslash since the value
> user-emacs-directory does not have a backslash on the end of it. This
> might break previous configs so it should be standardized to contain
> the same string value in both cases.



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

* Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 17:55 missing "/" in value of user-emacs-directory when using --init-directory flag Yilkal Argaw
  2022-11-29 18:11 ` Yilkal Argaw
@ 2022-11-29 18:20 ` Eli Zaretskii
  2022-11-29 18:56   ` [External] : " Drew Adams
  2022-12-02 13:20   ` Robin Tarsiger
  1 sibling, 2 replies; 17+ messages in thread
From: Eli Zaretskii @ 2022-11-29 18:20 UTC (permalink / raw)
  To: Yilkal Argaw; +Cc: emacs-devel

> From: Yilkal Argaw <yilkalargawworkneh@gmail.com>
> Date: Tue, 29 Nov 2022 17:55:45 +0000
> 
> In my configs I use (concat user-emacs-directory "somedirectory or
> file") to refer to files with respect to emacs. When loading emacs
> with the option --init-directory this
> this string is not separated by a backslash since the value
> user-emacs-directory does not have a backslash on the end of it. This
> might break previous configs so it should be standardized to contain
> the same string value in both cases.

Don't use 'concat' for file names; use expand-file-name instead.



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

* RE: [External] : Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 18:20 ` Eli Zaretskii
@ 2022-11-29 18:56   ` Drew Adams
  2022-11-29 19:01     ` Greg Farough
  2022-12-02 13:20   ` Robin Tarsiger
  1 sibling, 1 reply; 17+ messages in thread
From: Drew Adams @ 2022-11-29 18:56 UTC (permalink / raw)
  To: Eli Zaretskii, Yilkal Argaw; +Cc: emacs-devel@gnu.org

> Don't use 'concat' for file names; use expand-file-name instead.

This seems to be a fairly common question/misstep.
I wonder if it might be worthwhile to mention this
in the doc string of `concat'.  That's the most
likely string-manipulation function to be (mis)used
for file-name manipulation.




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

* Re: [External] : Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 18:56   ` [External] : " Drew Adams
@ 2022-11-29 19:01     ` Greg Farough
  2022-11-29 20:08       ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Greg Farough @ 2022-11-29 19:01 UTC (permalink / raw)
  To: emacs-devel

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

On Tue, Nov 29 2022, Drew Adams <drew.adams@oracle.com> wrote:

>> Don't use 'concat' for file names; use expand-file-name instead.
>
> This seems to be a fairly common question/misstep.
> I wonder if it might be worthwhile to mention this
> in the doc string of `concat'.  That's the most
> likely string-manipulation function to be (mis)used
> for file-name manipulation.

I've been using Emacs for years and just learned this today from Eli's
message, so, probably.

No one ever said that I was using Emacs _well_, though.

-g

-- 
"We carry a new world here, in our hearts. That world is growing in
this minute."

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [External] : Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 19:01     ` Greg Farough
@ 2022-11-29 20:08       ` Stefan Monnier
  2022-11-29 20:58         ` Greg Farough
                           ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Stefan Monnier @ 2022-11-29 20:08 UTC (permalink / raw)
  To: Greg Farough; +Cc: emacs-devel

> No one ever said that I was using Emacs _well_, though.

Maybe we could tweak the byte-compiler so it emits congratulatory
messages for every 10-or-so uses of `expand-file-name`?


        Stefan




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

* Re: [External] : Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 20:08       ` Stefan Monnier
@ 2022-11-29 20:58         ` Greg Farough
  2022-11-29 21:54         ` Juanma Barranquero
  2022-11-29 23:02         ` Drew Adams
  2 siblings, 0 replies; 17+ messages in thread
From: Greg Farough @ 2022-11-29 20:58 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Tue, Nov 29 2022, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>> No one ever said that I was using Emacs _well_, though.
>
> Maybe we could tweak the byte-compiler so it emits congratulatory
> messages for every 10-or-so uses of `expand-file-name`?

Sounds good to me! : )

-g

-- 
"We carry a new world here, in our hearts. That world is growing in
this minute."



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

* Re: [External] : Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 20:08       ` Stefan Monnier
  2022-11-29 20:58         ` Greg Farough
@ 2022-11-29 21:54         ` Juanma Barranquero
  2022-11-29 23:04           ` Drew Adams
  2022-11-29 23:02         ` Drew Adams
  2 siblings, 1 reply; 17+ messages in thread
From: Juanma Barranquero @ 2022-11-29 21:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Greg Farough, emacs-devel

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

No, we need a new emacs-feedback library, with an user option to select
'positive-reinforcement or 'passive-aggresive minor modes.

[-- Attachment #2: Type: text/html, Size: 240 bytes --]

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

* RE: [External] : Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 20:08       ` Stefan Monnier
  2022-11-29 20:58         ` Greg Farough
  2022-11-29 21:54         ` Juanma Barranquero
@ 2022-11-29 23:02         ` Drew Adams
  2022-12-02 22:47           ` Richard Stallman
  2 siblings, 1 reply; 17+ messages in thread
From: Drew Adams @ 2022-11-29 23:02 UTC (permalink / raw)
  To: Stefan Monnier, Greg Farough; +Cc: emacs-devel@gnu.org

> > No one ever said that I was using Emacs _well_, though.
> 
> Maybe we could tweak the byte-compiler so it emits congratulatory
> messages for every 10-or-so uses of `expand-file-name`?

That's if option `reinforcement' is contains
symbol `positive'.  If the list value contains
`negative' then it can emit warnings to impose
appropriate penalties (TBD).  If both then both.



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

* RE: [External] : Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 21:54         ` Juanma Barranquero
@ 2022-11-29 23:04           ` Drew Adams
  0 siblings, 0 replies; 17+ messages in thread
From: Drew Adams @ 2022-11-29 23:04 UTC (permalink / raw)
  To: Juanma Barranquero, Stefan Monnier; +Cc: Greg Farough, emacs-devel@gnu.org

> No, we need a new emacs-feedback library, with
> an user option to select 'positive-reinforcement
> or 'passive-aggresive minor modes.

Our mails overlapped.  Clearly we sometimes think
alike.  But I vote for a single option, with
multiple possibilities.

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

* Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 18:20 ` Eli Zaretskii
  2022-11-29 18:56   ` [External] : " Drew Adams
@ 2022-12-02 13:20   ` Robin Tarsiger
  2022-12-12  3:41     ` Yilkal Argaw
  1 sibling, 1 reply; 17+ messages in thread
From: Robin Tarsiger @ 2022-12-02 13:20 UTC (permalink / raw)
  To: Eli Zaretskii, Yilkal Argaw; +Cc: emacs-devel

Eli Zaretskii wrote:
>> From: Yilkal Argaw <yilkalargawworkneh@gmail.com>
>>
>> In my configs I use (concat user-emacs-directory "somedirectory or
>> file") to refer to files with respect to emacs. When loading emacs
>> with the option --init-directory this
>> this string is not separated by a backslash since the value
>> user-emacs-directory does not have a backslash on the end of it. This
>> might break previous configs so it should be standardized to contain
>> the same string value in both cases.
> 
> Don't use 'concat' for file names; use expand-file-name instead.

While that's as may be in general, the docstring for user-emacs-directory
(in my Emacs 28.2) states "Note that this should end with a directory
separator." specifically, which I take to be part of the variable contract.
Doesn't that imply that it is Emacs's responsibility to handle that aspect
if setting user-emacs-directory based on a file name that may not satisfy
that predicate?

-RTT




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

* Re: [External] : Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-11-29 23:02         ` Drew Adams
@ 2022-12-02 22:47           ` Richard Stallman
  2022-12-03  6:47             ` Yuri Khan
  0 siblings, 1 reply; 17+ messages in thread
From: Richard Stallman @ 2022-12-02 22:47 UTC (permalink / raw)
  To: Drew Adams; +Cc: monnier, gregf, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Maybe we could tweak the byte-compiler so it emits congratulatory
  > > messages for every 10-or-so uses of `expand-file-name`?

  > That's if option `reinforcement' is contains
  > symbol `positive'.  If the list value contains
  > `negative' then it can emit warnings to impose
  > appropriate penalties (TBD).  If both then both.

How about a flag to make `concat' detect that you're doing
file name concatenation and enter the debugger?

THat sounds like an absurd exaggeration, but it
might be a useful debugging feature, for real.
We would not ever want it on by default.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





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

* Re: [External] : Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-12-02 22:47           ` Richard Stallman
@ 2022-12-03  6:47             ` Yuri Khan
  0 siblings, 0 replies; 17+ messages in thread
From: Yuri Khan @ 2022-12-03  6:47 UTC (permalink / raw)
  To: rms; +Cc: Drew Adams, monnier, gregf, emacs-devel

On Sat, 3 Dec 2022 at 05:49, Richard Stallman <rms@gnu.org> wrote:

>   > > Maybe we could tweak the byte-compiler so it emits congratulatory
>   > > messages for every 10-or-so uses of `expand-file-name`?
>
>   > That's if option `reinforcement' is contains
>   > symbol `positive'.  If the list value contains
>   > `negative' then it can emit warnings to impose
>   > appropriate penalties (TBD).  If both then both.
>
> How about a flag to make `concat' detect that you're doing
> file name concatenation and enter the debugger?

You’re dangerously close to inventing a type system ;)



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

* Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-12-02 13:20   ` Robin Tarsiger
@ 2022-12-12  3:41     ` Yilkal Argaw
  2022-12-12 12:23       ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Yilkal Argaw @ 2022-12-12  3:41 UTC (permalink / raw)
  To: Robin Tarsiger; +Cc: Eli Zaretskii, emacs-devel

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

>
> While that's as may be in general, the docstring for user-emacs-directory
> (in my Emacs 28.2) states "Note that this should end with a directory
> separator." specifically, which I take to be part of the variable contract.
> Doesn't that imply that it is Emacs's responsibility to handle that aspect
> if setting user-emacs-directory based on a file name that may not satisfy
> that predicate?
>
> -RTT


Correct.  consistency and standardization on such matters is better for
overall user experience.

[-- Attachment #2: Type: text/html, Size: 731 bytes --]

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

* Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-12-12  3:41     ` Yilkal Argaw
@ 2022-12-12 12:23       ` Eli Zaretskii
  2022-12-12 18:04         ` Yilkal Argaw
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2022-12-12 12:23 UTC (permalink / raw)
  To: Yilkal Argaw; +Cc: rtt, emacs-devel

> From: Yilkal Argaw <yilkalargawworkneh@gmail.com>
> Date: Mon, 12 Dec 2022 03:41:17 +0000
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> 
>  While that's as may be in general, the docstring for user-emacs-directory
>  (in my Emacs 28.2) states "Note that this should end with a directory
>  separator." specifically, which I take to be part of the variable contract.
>  Doesn't that imply that it is Emacs's responsibility to handle that aspect
>  if setting user-emacs-directory based on a file name that may not satisfy
>  that predicate?
> 
>  -RTT
> 
> Correct.  consistency and standardization on such matters is better for overall user experience.

The issue was fixed more than a week ago, so I'm unsure what is the
purpose of this post.  We are consistent.



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

* Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-12-12 12:23       ` Eli Zaretskii
@ 2022-12-12 18:04         ` Yilkal Argaw
  2022-12-12 18:13           ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Yilkal Argaw @ 2022-12-12 18:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rtt, emacs-devel

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

>
> The issue was fixed more than a week ago, so I'm unsure what is the
> purpose of this post.  We are consistent.


Sorry I didn't see anything regarding a patch or a commit to fix the issue
in the thread. Sorry about that.

On Mon, Dec 12, 2022 at 12:23 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Yilkal Argaw <yilkalargawworkneh@gmail.com>
> > Date: Mon, 12 Dec 2022 03:41:17 +0000
> > Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> >
> >  While that's as may be in general, the docstring for
> user-emacs-directory
> >  (in my Emacs 28.2) states "Note that this should end with a directory
> >  separator." specifically, which I take to be part of the variable
> contract.
> >  Doesn't that imply that it is Emacs's responsibility to handle that
> aspect
> >  if setting user-emacs-directory based on a file name that may not
> satisfy
> >  that predicate?
> >
> >  -RTT
> >
> > Correct.  consistency and standardization on such matters is better for
> overall user experience.
>
> The issue was fixed more than a week ago, so I'm unsure what is the
> purpose of this post.  We are consistent.
>

[-- Attachment #2: Type: text/html, Size: 1863 bytes --]

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

* Re: missing "/" in value of user-emacs-directory when using --init-directory flag
  2022-12-12 18:04         ` Yilkal Argaw
@ 2022-12-12 18:13           ` Eli Zaretskii
  0 siblings, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2022-12-12 18:13 UTC (permalink / raw)
  To: Yilkal Argaw; +Cc: rtt, emacs-devel

> From: Yilkal Argaw <yilkalargawworkneh@gmail.com>
> Date: Mon, 12 Dec 2022 18:04:10 +0000
> Cc: rtt@dasyatidae.com, emacs-devel@gnu.org
> 
>  The issue was fixed more than a week ago, so I'm unsure what is the
>  purpose of this post.  We are consistent.
> 
> Sorry I didn't see anything regarding a patch or a commit to fix the issue in the thread. Sorry about that.

See commit 401f76cc3d.



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

end of thread, other threads:[~2022-12-12 18:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-29 17:55 missing "/" in value of user-emacs-directory when using --init-directory flag Yilkal Argaw
2022-11-29 18:11 ` Yilkal Argaw
2022-11-29 18:20 ` Eli Zaretskii
2022-11-29 18:56   ` [External] : " Drew Adams
2022-11-29 19:01     ` Greg Farough
2022-11-29 20:08       ` Stefan Monnier
2022-11-29 20:58         ` Greg Farough
2022-11-29 21:54         ` Juanma Barranquero
2022-11-29 23:04           ` Drew Adams
2022-11-29 23:02         ` Drew Adams
2022-12-02 22:47           ` Richard Stallman
2022-12-03  6:47             ` Yuri Khan
2022-12-02 13:20   ` Robin Tarsiger
2022-12-12  3:41     ` Yilkal Argaw
2022-12-12 12:23       ` Eli Zaretskii
2022-12-12 18:04         ` Yilkal Argaw
2022-12-12 18:13           ` Eli Zaretskii

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.