[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/crux 1e591c5 031/112: Merge pull request #16 from jiegec/m
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/crux 1e591c5 031/112: Merge pull request #16 from jiegec/master |
Date: |
Wed, 11 Aug 2021 09:57:48 -0400 (EDT) |
branch: elpa/crux
commit 1e591c5a1ecfa99fcd67105a58b2e7d782abf969
Merge: 3042f6f 79e500e
Author: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Merge pull request #16 from jiegec/master
Add multiple choice with completion for shell init files
---
crux.el | 46 +++++++++++++++++++++++++++++++++++++---------
1 file changed, 37 insertions(+), 9 deletions(-)
diff --git a/crux.el b/crux.el
index 9ff1a7b..244344a 100644
--- a/crux.el
+++ b/crux.el
@@ -53,6 +53,31 @@
:type 'string
:group 'crux)
+(defcustom crux-shell-zsh-init-files '("$HOME/.zshrc" "$HOME/.zlogin"
"$HOME/.zprofile" "$HOME/.zshenv" "$HOME/.zlogout" "/etc/zshenv"
"/etc/zprofile" "/etc/zshrc" "/etc/zlogin" "/etc/zlogout" "$ZDOTDIR/.zshrc"
"$ZDOTDIR/.zlogin" "$ZDOTDIR/.zprofile" "$ZDOTIR/.zshenv" "$ZDOTDIR/.zlogout")
+ "The default init files of zsh."
+ :type 'list
+ :group 'crux)
+
+(defcustom crux-shell-bash-init-files '("$BASH_ENV" "$HOME/.bashrc"
"$HOME/.bash_profile" "$HOME/.bash_login" "$HOME/.profile" "$HOME/.bash_logout"
"/etc/bashrc" "/etc/bash_profile" "/etc/bash_login" "/etc/profile"
"/etc/bash_logout")
+ "The default init files of bash."
+ :type 'list
+ :group 'crux)
+
+(defcustom crux-shell-tcsh-init-files '("$HOME/.login" "$HOME/.cshrc"
"$HOME/.tcshrc" "$HOME/.logout" "/etc/csh.cshrc" "/etc/csh.login"
"/etc/csh.logout")
+ "The default init files of tcsh."
+ :type 'list
+ :group 'crux)
+
+(defcustom crux-shell-fish-init-files '("$HOME/.config/fish/config.fish"
"$XDG_CONFIG_HOME/fish/config.fish")
+ "The default init files of fish."
+ :type 'list
+ :group 'crux)
+
+(defcustom crux-shell-ksh-init-files '("$HOME/.profile" "$ENV" "/etc/profile")
+ "The default init files of ksh."
+ :type 'list
+ :group 'crux)
+
(defun crux-open-with (arg)
"Open visited file in default external program.
When in dired mode, open file under the cursor.
@@ -95,8 +120,8 @@ the current buffer."
"Create or visit a terminal buffer."
(interactive)
(crux-start-or-switch-to (lambda ()
- (ansi-term crux-shell (concat
crux-term-buffer-name "-term")))
- (format "*%s-term*" crux-term-buffer-name)))
+ (ansi-term crux-shell (concat
crux-term-buffer-name "-term")))
+ (format "*%s-term*" crux-term-buffer-name)))
(defun crux-indent-rigidly-and-copy-to-clipboard (begin end arg)
"Indent region between BEGIN and END by ARG columns and copy to clipboard."
@@ -352,13 +377,16 @@ Doesn't mess with special buffers."
(interactive)
(let* ((shell (car (reverse (split-string (getenv "SHELL") "/" t))))
(shell-init-file (cond
- ((string= "zsh" shell) ".zshrc")
- ((string= "bash" shell) ".bashrc")
- ((string= "tcsh" shell) ".login")
- ((string= "fish" shell) ".config/fish/config.fish")
- ((string-prefix-p "ksh" shell) ".profile")
- (t (error "Unknown shell")))))
- (find-file-other-window (expand-file-name shell-init-file (getenv
"HOME")))))
+ ((string= "zsh" shell) crux-shell-zsh-init-files)
+ ((string= "bash" shell) crux-shell-bash-init-files)
+ ((string= "tcsh" shell) crux-shell-tcsh-init-files)
+ ((string= "fish" shell) crux-shell-fish-init-files)
+ ((string-prefix-p "ksh" shell)
crux-shell-ksh-init-files)
+ (t (error "Unknown shell"))))
+ (candidates (cl-remove-if-not 'file-exists-p (mapcar
'substitute-in-file-name shell-init-file))))
+ (if (> (length candidates) 1)
+ (find-file-other-window (completing-read "Choose shell init file:"
candidates))
+ (find-file-other-window (car candidates)))))
;;
http://endlessparentheses.com/ispell-and-abbrev-the-perfect-auto-correct.html
(defun crux-ispell-word-then-abbrev (p)
- [nongnu] elpa/crux 32baf6a 064/112: Bump the development version, (continued)
- [nongnu] elpa/crux 32baf6a 064/112: Bump the development version, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux a71669e 033/112: Merge pull request #17 from jiegec/master, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux cf547b7 037/112: Typo Fix: Missed an s in transpose, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux a6e0a52 043/112: Define a minor mode for crux-reopen-as-root (#28), ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 2cdf266 069/112: Insert literal s-exp instead of printing in crux-eval-and-replace (#50), ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 2b4bf62 074/112: Give crux group to crux-reopen-as-root-mode, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 772123a 081/112: Support using any shell creating function with crux-visit-term-buffer, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux b401f45 050/112: [Fix #35] Replace a deprecated function, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux ad42bcf 053/112: Support make `crux-cleanup-buffer-or-region` support makefiles, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux e3c9714 055/112: Make crux-move-beginning-of-line function mode aware (#45), ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 1e591c5 031/112: Merge pull request #16 from jiegec/master,
ELPA Syncer <=
- [nongnu] elpa/crux ca62859 038/112: Merge pull request #22 from dgtized/fix-tranpose-typo, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux fde9d4b 044/112: Fix malformed header line, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 5b3c815 047/112: Release 0.3, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 3e03d72 049/112: Don't use dash.el function (#34), ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux b60d9f4 051/112: Fix a compilation warning, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 54cc9b8 056/112: Fix typo in crux-top-join-line, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 11096b9 058/112: Fix typo in keybindings (#47), ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux cedec52 063/112: Mark crux-recentf-ido-find-file as obsolete, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 66954bf 022/112: Mention crux-indent-defun, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 3042f6f 029/112: Add some contribution guidelines, ELPA Syncer, 2021/08/11