summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-02-21 19:59:25 +0100
committerUlrich Müller <ulm@gentoo.org>2023-02-21 20:09:54 +0100
commit3788f2faefd279bc4d1f42a0e87fdbac910aa0eb (patch)
tree49047bdb4f1712dd7599bd9330a219cf5cdb6330
parentUse UTC dates in gentoo-newsitem-mode and glep-mode (diff)
downloadebuild-mode-3788f2faefd279bc4d1f42a0e87fdbac910aa0eb.tar.gz
ebuild-mode-3788f2faefd279bc4d1f42a0e87fdbac910aa0eb.tar.bz2
ebuild-mode-3788f2faefd279bc4d1f42a0e87fdbac910aa0eb.zip
Check if utf-8 coding system exists
* ebuild-mode.el (ebuild-repo-mode): Check if coding system utf-8-unix exists; it doesn't in XEmacs 21.4. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog3
-rw-r--r--ebuild-mode.el4
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 393f1ae..31717d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2023-02-21 Ulrich Müller <ulm@gentoo.org>
+ * ebuild-mode.el (ebuild-repo-mode): Check if coding system
+ utf-8-unix exists; it doesn't in XEmacs 21.4.
+
* gentoo-newsitem-mode.el (gentoo-newsitem-insert-skeleton): Call
ebuild-mode-time-string, so that the date is in the UTC time zone.
* glep-mode.el (glep-mode-update-last-modified)
diff --git a/ebuild-mode.el b/ebuild-mode.el
index 2c9ce14..f16be60 100644
--- a/ebuild-mode.el
+++ b/ebuild-mode.el
@@ -777,7 +777,9 @@ This will be added to the `write-contents-functions' hook."
"Minor mode for files in an ebuild repository."
:lighter " Repo"
:keymap ebuild-repo-mode-map
- (setq buffer-file-coding-system 'utf-8-unix)
+ (if (ignore-errors (check-coding-system 'utf-8-unix))
+ ;; utf-8-unix doesn't exist in XEmacs 21.4
+ (setq buffer-file-coding-system 'utf-8-unix))
(if (not (featurep 'xemacs))
(add-hook 'write-contents-functions 'ebuild-repo-mode-before-save t t)
;; make-local-hook gives a byte-compiler warning in GNU Emacs