My personal dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openinemacs 664B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. file=$1
  3. line=$2
  4. col=$3
  5. emacsclient -n -e \
  6. "(progn
  7. ;; Load the file
  8. (find-file \"$file\")
  9. ;; Jump to the same point as in IntelliJ
  10. ;; Unfortunately, IntelliJ doesn't always supply the values
  11. ;; depending on where the open is invoked from; e.g. keyboard
  12. ;; works, tab context doesn't
  13. (when (not (string= \"\" \"$line\"))
  14. (goto-char (point-min))
  15. (forward-line (1- $2))
  16. (forward-char (1- $3)))
  17. ;; Raise/focus our window; depends on the windowing system
  18. (if (string-equal system-type \"darwin\")
  19. (ns-do-applescript \"tell application \\\"Emacs\\\" to activate\")
  20. (raise-frame))
  21. ;; Automatically pick up changes made in IntelliJ
  22. (auto-revert-mode t))"