Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

emacs - Standardordner

1 view
Skip to first unread message

Clemens Schüller

unread,
Feb 22, 2020, 5:20:55 AM2/22/20
to
Hallo zusammen!

Ich hab hier das - leicht nervige - Problem, dass emacs bei C-x C-f oder
C-x d _immer_ / als Standardordner vorgibt, ich will aber ~/ haben.

In der .emacs steht

--8<---------------cut here---------------start------------->8---
(setq default-directory "/Users/mente/")
--8<---------------cut here---------------end--------------->8---

Aber, ausgewertet wird es wohl nicht, denn:


--8<---------------cut here---------------start------------->8---
default-directory is a variable defined in ‘C source code’.
Its value is "/"
Local in buffer *unsent posting on de.comp.editoren*; global value is nil

Automatically becomes permanently buffer-local when set.
This variable is safe as a file local variable if its value
satisfies the predicate ‘stringp’.
Probably introduced at or before Emacs version 1.11.

Documentation:
Name of default directory of current buffer.
It should be an absolute directory name; on GNU and Unix systems,
these names start with ‘/’ or ‘~’ and end with ‘/’.
To interactively change the default directory, use command ‘cd’.
--8<---------------cut here---------------end--------------->8---


Was kann man hier machen?
--
Beste Grüße, Clemens Schüller

Stefan Wiens

unread,
Feb 22, 2020, 6:23:30 AM2/22/20
to
Clemens Schüller <cs.u...@mailbox.org> writes:

> Ich hab hier das - leicht nervige - Problem, dass emacs bei C-x C-f oder
> C-x d _immer_ / als Standardordner vorgibt, ich will aber ~/ haben.
>
> In der .emacs steht
>
>
> (setq default-directory "/Users/mente/")
>
>
> Aber, ausgewertet wird es wohl nicht, denn:
>
>
>
> default-directory is a variable defined in ‘C source code’.
> Its value is "/"
> Local in buffer *unsent posting on de.comp.editoren*; global value is nil
>
> Automatically becomes permanently buffer-local when set.
> This variable is safe as a file local variable if its value
> satisfies the predicate ‘stringp’.
> Probably introduced at or before Emacs version 1.11.
>
> Documentation:
> Name of default directory of current buffer.
> It should be an absolute directory name; on GNU and Unix systems,
> these names start with ‘/’ or ‘~’ and end with ‘/’.
> To interactively change the default directory, use command ‘cd’.
>
>
>
> Was kann man hier machen?

vielleicht

(setq-default default-directory "~/")

(Hinweis in elisp.info: 11.10.1 Introduction to Buffer-Local Variables)
--
Stefan

Clemens Schüller

unread,
Feb 22, 2020, 6:32:05 AM2/22/20
to
Servus!
Nein, tut auch nicht:

--8<---------------cut here---------------start------------->8---
default-directory is a variable defined in ‘C source code’.
Its value is "/"
Local in buffer *GNU Emacs*; global value is "~/"

Automatically becomes permanently buffer-local when set.
This variable is safe as a file local variable if its value
satisfies the predicate ‘stringp’.
Probably introduced at or before Emacs version 1.11.

Documentation:
Name of default directory of current buffer.
It should be an absolute directory name; on GNU and Unix systems,
these names start with ‘/’ or ‘~’ and end with ‘/’.
To interactively change the default directory, use command ‘cd’.
--8<---------------cut here---------------end--------------->8---

Helmut Waitzmann

unread,
Feb 22, 2020, 12:34:24 PM2/22/20
to
Clemens Schüller <cs.u...@mailbox.org>:
>Stefan Wiens schrieb am 22. Feb. 2020 um 12:23:
>> Clemens Schüller <cs.u...@mailbox.org> writes:

>> (setq-default default-directory "~/")
>>
>> (Hinweis in elisp.info: 11.10.1 Introduction to Buffer-Local Variables)
>>
>
>Nein, tut auch nicht:
>

Tut immerhin, was es soll, denn „global value is "~/"“ (nur
scheint das nichts zu nützen):

>--8<---------------cut here---------------start------------->8---
>default-directory is a variable defined in ‘C source code’.
>Its value is "/"
>Local in buffer *GNU Emacs*; global value is "~/"
>
> Automatically becomes permanently buffer-local when set.
> This variable is safe as a file local variable if its value
> satisfies the predicate ‘stringp’.
> Probably introduced at or before Emacs version 1.11.
>
>Documentation:
>Name of default directory of current buffer.
>It should be an absolute directory name; on GNU and Unix systems,
>these names start with ‘/’ or ‘~’ and end with ‘/’.
>To interactively change the default directory, use command ‘cd’.
>--8<---------------cut here---------------end--------------->8---

Ich habe leider keine Erklärung für das bemängelte Verhalten, nur
ein paar Fragen, die vielleicht helfen, die Ursache zu finden:

In welchem Arbeitsverzeichnis startest du den Emacs?


Hast du vielleicht in der Emacs‐Konfiguration irgendwo ein
„cd“‐Kommando stehen?

Wie verhält sich der Emacs, wenn du ihn mit der Option
„--no-init-file“ startest?

Und wenn du zusätzlich noch die Option „--no-site-file“
hinzunimmst?

Wird dem Emacs Zugriff auf das Verzeichnis „~/“ und die Datei
„~/.emacs“ erlaubt?

Clemens Schüller

unread,
Feb 22, 2020, 12:49:29 PM2/22/20
to
Servus!
Dieser emacs rennt auf einem iMac, ist aus den git Sourcen gebaut und
wird über Spotlight gestartet.

Eines ist aber interessant - wenn ich den emacs aus dem Terminal raus
starte, passen die "Werte"

--8<---------------cut here---------------start------------->8---
default-directory is a variable defined in ‘C source code’.
Its value is "~/"
Local in buffer *GNU Emacs*; global value is "~/"

Automatically becomes permanently buffer-local when set.
This variable is safe as a file local variable if its value
satisfies the predicate ‘stringp’.
Probably introduced at or before Emacs version 1.11.

Documentation:
Name of default directory of current buffer.
It should be an absolute directory name; on GNU and Unix systems,
these names start with ‘/’ or ‘~’ and end with ‘/’.
To interactively change the default directory, use command ‘cd’.
--8<---------------cut here---------------end--------------->8---


> Hast du vielleicht in der Emacs‐Konfiguration irgendwo ein
> „cd“‐Kommando stehen?

Ein schnelles grep hat nichts gefunden.


> Wie verhält sich der Emacs, wenn du ihn mit der Option
> „--no-init-file“ startest?
>
> Und wenn du zusätzlich noch die Option „--no-site-file“ hinzunimmst?

Siehe oben


> Wird dem Emacs Zugriff auf das Verzeichnis „~/“ und die Datei
> „~/.emacs“ erlaubt?

Wenn ich die Pfade mit der Hand "reinprügle" kann ich die
Verzeichnisse/Dateien problemlos öffnen.

Helmut Waitzmann

unread,
Feb 22, 2020, 5:20:57 PM2/22/20
to
Clemens Schüller <cs.u...@mailbox.org>:
>Helmut Waitzmann schrieb am 22. Feb. 2020 um 18:34:
>

>> Ich habe leider keine Erklärung für das bemängelte Verhalten,
>> nur ein paar Fragen, die vielleicht helfen, die Ursache zu
>> finden:
>>
>> In welchem Arbeitsverzeichnis startest du den Emacs?
>>
>
>Dieser emacs rennt auf einem iMac, ist aus den git Sourcen gebaut
>und wird über Spotlight gestartet.

In welchem Arbeitsverzeichnis startet Spotlight den Emacs?


>Eines ist aber interessant - wenn ich den emacs aus dem Terminal
>raus starte, passen die "Werte"

Aus dem Terminal raus starten?  Du meinst, von einem interaktiven
Shell, das in dem Terminal läuft?

Dann könntest du mal die Probe machen und in dem Terminal das
Kommando „pwd“ eintippen.  Was kommt heraus?

Vermutung:  Man müsste es hinbekommen, dass Spotlight den Emacs im
richtigen Arbeitsverzeichnis startet, und das Problem ist behoben.

Ob das geht, weiß ich nicht.  Spotlight ist mir kein Begriff.

Stefan Reuther

unread,
Feb 23, 2020, 3:45:19 AM2/23/20
to
Am 22.02.2020 um 23:20 schrieb Helmut Waitzmann:
> Vermutung:  Man müsste es hinbekommen, dass Spotlight den Emacs im
> richtigen Arbeitsverzeichnis startet, und das Problem ist behoben.
>
> Ob das geht, weiß ich nicht.  Spotlight ist mir kein Begriff.

Im Zweifelsfalls ein Einzeiler-Shellscript `cd $HOME && emacs` und das
starten.


Stefan

Stefan Wiens

unread,
Feb 23, 2020, 6:01:38 AM2/23/20
to
Helmut Waitzmann <nn.th...@xoxy.net> writes:

> Clemens Schüller <cs.u...@mailbox.org>:
>>Stefan Wiens schrieb am 22. Feb. 2020 um 12:23:
>>> Clemens Schüller <cs.u...@mailbox.org> writes:
>
>>> (setq-default default-directory "~/")
>>>
>>> (Hinweis in elisp.info: 11.10.1 Introduction to Buffer-Local
>>> Variables)
>>>
>>
>> Nein, tut auch nicht:
>>
>
> Tut immerhin, was es soll, denn „global value is "~/"“ (nur scheint
> das nichts zu nützen):

Sieht so aus. Bei mir funktioniert es schließlich auch ohne global
value. Anscheinend wird (in buffer.c) default-directory mit dem Resultat
von get_current_dir_name(3) initialisiert. Emacs muss also aus dem
richtigen working directory gestartet werden.

--
Stefan

Clemens Schüller

unread,
Feb 23, 2020, 3:22:49 PM2/23/20
to
Servus!
Hab mittlerweile einen Shell Einzeiler geschrieben und auf den Desktop
gelegt. Damit wird ~/ als Startverzeichnis festgelegt.


Jetzt muss ich nur noch rausfinden, wie ich emacs beibringe, magit als
Default VCS zu verwenden. Momentan eiert er zw. vc-git und Egg herum.

Any hints?


Danke Euch allen
0 new messages