[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/editorconfig-cc be0973c580 291/351: Fix for coding-syst
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/editorconfig-cc be0973c580 291/351: Fix for coding-system set when remote files do not exist (#250) |
Date: |
Thu, 13 Jun 2024 18:39:03 -0400 (EDT) |
branch: scratch/editorconfig-cc
commit be0973c580676249119adaabc8d2645abccac40c
Author: 10sr <8.slashes@gmail.com>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Fix for coding-system set when remote files do not exist (#250)
---
editorconfig.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/editorconfig.el b/editorconfig.el
index d09329d504..29d0f4e6b3 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -630,6 +630,18 @@ F is that function, and FILENAME and ARGS are arguments
passed to F."
(when (and props
;; filename has already been checked
(not (editorconfig--disabled-for-majormode major-mode)))
+ (when (and (file-remote-p filename)
+ (not (local-variable-p 'buffer-file-coding-system))
+ (not (file-exists-p filename))
+ coding-system
+ (not (eq coding-system
+ 'undecided)))
+ ;; When file path indicates it is a remote file and it actually
+ ;; does not exists, `buffer-file-coding-system' will not be set.
+ ;; (Does not call `insert-file-contents'?)
+ ;; For that case, explicitly set this value so that saving will
be done
+ ;; with expected coding system.
+ (set-buffer-file-coding-system coding-system))
(setq editorconfig-properties-hash props)
(editorconfig-set-variables props)
(condition-case err
- [nongnu] scratch/editorconfig-cc 5986c305c9 167/351: Remove .info and add .texi, (continued)
- [nongnu] scratch/editorconfig-cc 5986c305c9 167/351: Remove .info and add .texi, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 7b762043d6 176/351: Add commented allow_failure, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 4185bcfac2 210/351: Call -hack-properties-functions in editorconfig-apply, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 2cfbec79f9 216/351: Update core-test submodule, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 2ba007601a 219/351: Add document for editorconfig-trim-whitespaces-mode, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc f2d4539bae 228/351: Refactor handle lib, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc b303bfd220 211/351: Add test for -hack-properties-functions, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 8688e1d3bf 230/351: Revert "Add support for Emacs24.5", Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 5f5a7bf03d 237/351: Update commentary section, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 8cf419254d 246/351: Do not update submodule when running tests, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc be0973c580 291/351: Fix for coding-system set when remote files do not exist (#250),
Stefan Monnier <=
- [nongnu] scratch/editorconfig-cc 9bfade9437 257/351: Use dist: trusty, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 0e299b7528 278/351: Silence byte-compiler warnings (#235), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc cf012776b4 306/351: Use new implementation by default (#263), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 0f2c33d11a 282/351: Update README 2 (#225), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 1969dd74da 271/351: Add conf-mode abbrev-table definitions (#220), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 4b25e6b404 275/351: Update CHANGELOG, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 1ff99f3eff 310/351: tests(build.yml): Use latest minor version number (#274), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 06b57e1fb7 309/351: Add emacs 28.1 to test target (#270), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 0f54515c82 325/351: Load subr-x when compiling (#302), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 217ede58d6 328/351: Revert "Update version string", Stefan Monnier, 2024/06/13