]> code.delx.au - dotfiles/commitdiff
emacs/bash: improve launching, don't use emacs inside screen
authorJames Bunton <jamesbunton@delx.net.au>
Sun, 26 Jun 2016 02:01:22 +0000 (12:01 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Sun, 26 Jun 2016 02:02:01 +0000 (12:02 +1000)
.bash/environment
.bash/interactive
.local/share/applications/emacs.desktop [new file with mode: 0644]

index 2956ea31ad28d2c9e16d93404680435f82ecf28a..924a595d0014960ba0c7c4d6d020777ea1fa58fd 100644 (file)
@@ -20,8 +20,15 @@ export EMAIL="James Bunton <jamesbunton@delx.net.au>"
 if emacsclient --version &> /dev/null; then
     export ALTERNATE_EDITOR="vim"
     export EDITOR="emacsclient --create-frame"
+    export EDITORBG="emacsclient --create-frame --no-wait"
+
+    # Disable emacs inside screen
+    if [[ "$TERM" == screen* ]]; then
+        export EMACS_SERVER_FILE=
+    fi
 else
     export EDITOR="vim"
+    export EDITORBG="vim"
 fi
 
 # Expand any symbolic links in the TMPDIR environment variable
index 33944562b7f2c8bd6cd10c515e828a9be719a863..556eea18baa241edbacc1842a112a312ae743d58 100644 (file)
@@ -143,13 +143,12 @@ function mcd {
 # Usage: editf somefile
 # Does a recursive search of the current directory for somefile, then edits it
 function editf {
-    find . -iname "${1}" -exec $EDITOR '{}' +
+    find . -iname "${1}" -exec $EDITORBG '{}' +
 }
 
-# Usage: edit somefile
-# Opens the provided file(s) with $EDITOR
+# Usage: edit somefile [otherfiles ...]
 function edit {
-    $EDITOR "$@"
+    $EDITORBG "$@"
 }
 
 # Sets the nice and ionice priorities for the current shell to the lowest values
diff --git a/.local/share/applications/emacs.desktop b/.local/share/applications/emacs.desktop
new file mode 100644 (file)
index 0000000..eb26556
--- /dev/null
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=Emacs
+GenericName=Text Editor
+Comment=Edit text
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
+Exec=emacsclient --create-frame --no-wait %F
+Icon=emacs
+Type=Application
+Terminal=false
+Categories=Development;TextEditor;
+StartupWMClass=Emacs
+Keywords=Text;Editor;