I'm having trouble getting this function to work right (or properly set the alist). I have Onedrive who's main directory is a symlink and I'd like to keep /Library/CloudStorage urls from being shown throughout Emacs.(macos) The default-dirctory is showing how I want it to.
​
As I understand buffer-file-truename should be using abbrev-file-alist via abbreviate-file-name function to do this.
I've narrowed my issue down to this function not abbreviating urls.
​
abbrev-file-alist value:
(("\\\\\`'/Users/username/Library/CloudStorage/OneDrive" . "/Users/username/OneDrive"))
Function:
(abbreviate-file-name "/Users/username/Library/CloudStorage/OneDrive")
Returns:
"\~/Library/CloudStorage/OneDrive"
Function:
(abbreviate-file-name "\~/Library/CloudStorage/OneDrive")
Returns:
"\~/Library/CloudStorage/OneDrive"
​
Does anyone know what may be wrong with my list?
EDIT: The fix to make my Onedrive dirs always show symlinked/abbreviated paths:
(setq-default abbrev-mode t)
(setq find-file-visit-truename nil)
(setq directory-abbrev-alist (cons '("\\`/Users/username/Library/CloudStorage/OneDrive/" . "/Users/username/OneDrive") directory-abbrev-alist))
; Figured I'd add that the below addition to the alist wasn't necessary.
;(setq directory-abbrev-alist (cons '("\\`~/Library/CloudStorage/OneDrive/" . "~/OneDrive/") directory-abbrev-alist))