ca0acf31ef163fd2a6bf562c9b9d6077975b41f8

Author
Carlo Sala <carlosalag@protonmail.com>
Committer
Carlo Sala <carlosalag@protonmail.com>
Date

Message

fix(emacs): make `alternate-editor` work for emacs >28

Closes #11441

Diff

 1diff --git a/plugins/emacs/README.md b/plugins/emacs/README.md
 2index c8e33b5ab485428fb6ec83b3525513bc6422dc42..8ed4a14733078cd8a073fc85c525a4b7bb98d07e 100644
 3--- a/plugins/emacs/README.md
 4+++ b/plugins/emacs/README.md
 5@@ -25,6 +25,6 @@ The plugin uses a custom launcher (which we'll call here `$EMACS_LAUNCHER`) that
 6 | e      | `emacs`                                            | Same as emacs alias                                            |
 7 | te     | `$EMACS_LAUNCHER -nw`                              | Open terminal emacsclient                                      |
 8 | eeval  | `$EMACS_LAUNCHER --eval`                           | Same as `M-x eval` but from outside Emacs                      |
 9-| eframe | `emacsclient --alternate-editor "" --create-frame` | Create new X frame                                             |
10+| eframe | `emacsclient --alternate-editor="" --create-frame` | Create new X frame                                             |
11 | efile  | -                                                  | Print the path to the file open in the current buffer          |
12 | ecd    | -                                                  | Print the directory of the file open in the the current buffer |
13diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh
14index fede5b0c4c76023932b4544e60d8515bc5931560..4747f035b9d5b74d01e316512d518b87f001613a 100644
15--- a/plugins/emacs/emacs.plugin.zsh
16+++ b/plugins/emacs/emacs.plugin.zsh
17@@ -32,7 +32,7 @@ alias te="$EMACS_PLUGIN_LAUNCHER -nw"
18 # same than M-x eval but from outside Emacs.
19 alias eeval="$EMACS_PLUGIN_LAUNCHER --eval"
20 # create a new X frame
21-alias eframe='emacsclient --alternate-editor "" --create-frame'
22+alias eframe='emacsclient --alternate-editor="" --create-frame'
23 
24 # Emacs ANSI Term tracking
25 if [[ -n "$INSIDE_EMACS" ]]; then
26diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh
27index 96893c932751bd5c7646ecf3a624d5f8411498d5..172c0ae9630bfbc2721a340a84435bea050567e1 100755
28--- a/plugins/emacs/emacsclient.sh
29+++ b/plugins/emacs/emacsclient.sh
30@@ -15,11 +15,11 @@ emacsfun() {
31 
32   # Only create another X frame if there isn't one present
33   if [ -z "$frames" -o "$frames" = nil ]; then
34-    emacsclient --alternate-editor "" --create-frame "$@"
35+    emacsclient --alternate-editor="" --create-frame "$@"
36     return $?
37   fi
38 
39-  emacsclient --alternate-editor "" "$@"
40+  emacsclient --alternate-editor="" "$@"
41 }
42 
43 # Adapted from https://github.com/davidshepherd7/emacs-read-stdin/blob/master/emacs-read-stdin.sh