Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magik-session-command: Expansion of environment variables using Windows %% nomenclature doesn't work #10

Open
ReinhardHahn opened this issue Jul 12, 2021 · 0 comments

Comments

@ReinhardHahn
Copy link
Contributor

ReinhardHahn commented Jul 12, 2021

The comment of the function magik-session states:

The command automatically expands environment variables using Windows %% and Unix $ and ${} nomenclature.

This is currently not true for the Windows %..%-nomenclature.

A possible solution would be to add the advice given within the misc-sw.el file of the former EMACS, delivered with SW 4.x:

(defadvice substitute-in-file-name (before handle-%-variables activate compile)
  "Handle %VARIABLE% Environment variables." 
  (let ((file (ad-get-arg 0)))
    (while (string-match "%\\([^%]+\\)%" file)
      (setq file
        (replace-match (concat "${" (match-string-no-properties 1 file) "}") t t file)))
    (ad-set-arg 0 file)))

The drawback would be, that this influences a general EMACS function, not only the functionality for the magik mode package.
Surely there would be other solutions without that drawback.

On the other hand, I don't see yet, why this function should be essential.

So I see three possible ways to handle this issue:

(a) Change the comment and the default value of magik-session-command-default in a way, that the %..%-Syntax is no longer included. It might be helpful to add a comment about this, in the README.md file

(b) Add a comment in the README.md file that describes, that a user may add the a.m. defadvice-code into his/her personal .emacs code, if he/she want to use it

(c) Add the missing funtionality to the magik-session function without changing behaviour of the global substitute-in-file-name function.

The solution (c) obviously would be the nicest, but I'd also agree with the other two.

@ReinhardHahn ReinhardHahn changed the title magik-session-command: Expansion of environment variables using Windows %% nomencalture doesn't work magik-session-command: Expansion of environment variables using Windows %% nomenclature doesn't work Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant