diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-02-11 18:49:51 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-02-11 18:49:51 -0500 |
commit | e72c0dd2e8909019cfa6118353652b2299f0d16c (patch) | |
tree | ee5f5455fd0f46064fec2bbc92b345d38b575e73 /.config/bash/rc.d | |
parent | 83c71bfd686ae36b0483a8278303de7e5fe4924d (diff) | |
parent | 0283ec58b3f4e179c0d8f57e5fc9ecb6e7750e17 (diff) |
Merge branch 'master' into gluglugt60-par/master
Diffstat (limited to '.config/bash/rc.d')
-rw-r--r-- | .config/bash/rc.d/10_hist.sh | 2 | ||||
-rw-r--r-- | .config/bash/rc.d/90_emacs.sh | 22 |
2 files changed, 15 insertions, 9 deletions
diff --git a/.config/bash/rc.d/10_hist.sh b/.config/bash/rc.d/10_hist.sh index d7c6bfc..6b2c4f1 100644 --- a/.config/bash/rc.d/10_hist.sh +++ b/.config/bash/rc.d/10_hist.sh @@ -2,7 +2,7 @@ # don't overwrite GNU Midnight Commander's setting of `ignorespace'. HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups -HISTFILE=${XDG_CACHE_HOME}/bash/history +HISTFILE=${XDG_DATA_HOME}/bash/history HISTTIMEFORMAT='[%Y-%m-%d %H:%M] ' HISTSIZE=5000 shopt -s histappend # append to the history file, don't overwrite it diff --git a/.config/bash/rc.d/90_emacs.sh b/.config/bash/rc.d/90_emacs.sh index 79d5e61..90e771c 100644 --- a/.config/bash/rc.d/90_emacs.sh +++ b/.config/bash/rc.d/90_emacs.sh @@ -35,17 +35,23 @@ if [[ $TERM == eterm* ]]; then # before the hostname is set, otherwise it will set # (default-directory) to an invalid TRAMP string. # - # Because the hostname is compared to (system-name) to - # check if it is localhost, "$(hostname -f)" may need - # to be used instead of $HOSTNAME, if - # $HOSTNAME/$(hostname) doesn't return a qualified - # domain. - local hostname=$HOSTNAME - [[ $hostname = *.* ]] || hostname="$(hostname -f)" + # The hostname is compared to (system-name) to check + # if it is localhost. In Emacs 25, (system-name) is + # just gethostname(2), and in Bash 4.2, $HOSTNAME is + # also just gethostname(2). + # + # As an aside, Emacs and Bash deal with hostnames > + # 255 bytes differently. They both use 255 bytes for + # the initial call, but Bash won't retry with a bigger + # limit, but Emacs will. I don't care, because + # besides such long hostnames being uncommon, Linux's + # HOST_NAME_MAX on i686 and x86_64 is only 64, so it's + # actually impossible. IDK about other kernels or + # architectures. printf '\eAnSiT%s %s\n' \ u "$USER" \ c "$PWD" \ - h "$hostname" + h "$HOSTNAME" } # Set the shell's X11 display (emacs -> shell) _emacs_set_shell_DISPLAY() { |