mirror of https://github.com/djcb/mu.git
mu4e: implement mu4e--file-name-concat
This commit is contained in:
parent
fb8502ae4e
commit
abf0e259a2
|
@ -94,7 +94,6 @@ marked as read-only, or non-nil otherwise."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Messages, warnings and errors
|
;;; Messages, warnings and errors
|
||||||
(defun mu4e-format (frm &rest args)
|
(defun mu4e-format (frm &rest args)
|
||||||
"Create [mu4e]-prefixed string based on format FRM and ARGS."
|
"Create [mu4e]-prefixed string based on format FRM and ARGS."
|
||||||
|
@ -458,5 +457,23 @@ Or go to the top level if there is none."
|
||||||
"Set VAR to VAL if VAR is nil."
|
"Set VAR to VAL if VAR is nil."
|
||||||
`(unless ,var (setq ,var ,val)))
|
`(unless ,var (setq ,var ,val)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;;; Misc
|
||||||
|
(defun mu4e--file-name-concat (directory &rest components)
|
||||||
|
"Append COMPONENTS to DIRECTORY and return the resulting string.
|
||||||
|
Elements in COMPONENTS must be a string or nil. DIRECTORY or the
|
||||||
|
non-final elements in COMPONENTS may or may not end with a slash
|
||||||
|
-- if they don’t end with a slash, a slash will be inserted
|
||||||
|
before concatenating.
|
||||||
|
|
||||||
|
Compatibility function for Emacs 28's `file-name-concat'."
|
||||||
|
(mapconcat
|
||||||
|
(lambda (part)
|
||||||
|
(if (string= (substring part -1) "/")
|
||||||
|
(substring part 0 -1)
|
||||||
|
part))
|
||||||
|
(cons directory components) "/"))
|
||||||
|
|
||||||
(provide 'mu4e-helpers)
|
(provide 'mu4e-helpers)
|
||||||
;;; mu4e-helpers.el ends here
|
;;; mu4e-helpers.el ends here
|
||||||
|
|
Loading…
Reference in New Issue