Dr. Werner Fink 2024-05-07 07:41:34 +00:00 committed by Git OBS Bridge
parent 38db9f4b28
commit a9866b8bc4
4 changed files with 123 additions and 0 deletions

91
dinbrief.patch Normal file
View File

@ -0,0 +1,91 @@
Update dinbrief class
Nowadays UTF-8 is standard, also port the features of the letter class
to dinbrief class.
---
style/dinbrief.el | 45 ++++++++++++++++++++++++++++++++-------------
1 file changed, 32 insertions(+), 13 deletions(-)
--- style/dinbrief.el
+++ style/dinbrief.el 2024-05-07 07:10:38.580274545 +0000
@@ -32,14 +32,26 @@
(require 'tex)
(require 'latex)
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+ "font-latex"
+ (keywords class))
+
+(defvar LaTeX-dinbrief-class-options
+ '("10pt" "11pt" "12pt" "norm" "a4paper" "a5paper" "b5paper"
+ "letterpaper" "legalpaper" "executivepaper" "twoside"
+ "addresshigh" "addressstd" "onecolumn" "twocolumn")
+ "Package options for the letter class.")
+
(TeX-add-style-hook
"dinbrief"
(lambda ()
- (add-hook 'LaTeX-document-style-hook
- #'LaTeX-dinbrief-style)
(LaTeX-add-environments
'("letter" LaTeX-dinbrief-env-recipient)
"dinquote")
+ (add-hook 'LaTeX-document-style-hook
+ #'LaTeX-dinbrief-style)
+ (setq LaTeX-default-document-environment "letter")
(TeX-add-symbols
'("address" "Absender")
'("postremark" "Postvermerk")
@@ -61,7 +73,22 @@
'("backaddress" "Retouradresse")
'("signature" "Unterschrift")
'("opening" "Anrede")
- '("closing" "Schluss")))
+ '("closing" "Schluss"))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("subject" "{")
+ ("address" "{")
+ ("signature" "{")
+ ("opening" "{")
+ ("closing" "{")
+ ("location" "{")
+ ("handling" "{")
+ ("cc" "{")
+ ("encl" "{")
+ ("ps" "{"))
+ 'function)))
TeX-dialect)
(defmacro LaTeX-dinbrief-insert (&rest args)
@@ -78,16 +105,8 @@
(open-line 2)
(indent-relative-first-indent-point)
(LaTeX-dinbrief-insert TeX-esc "usepackage"
- LaTeX-optop "latin1,utf8" LaTeX-optcl
- TeX-grop "inputenc" TeX-grcl)
- (newline-and-indent)
- (LaTeX-dinbrief-insert TeX-esc "usepackage"
- LaTeX-optop "T1" LaTeX-optcl
- TeX-grop "fontenc" TeX-grcl)
- (indent-relative-first-indent-point)
- (LaTeX-dinbrief-insert TeX-esc "usepackage"
TeX-grop "ngerman" TeX-grcl))
- (TeX-run-style-hooks "inputenc" "fontenc" "ngerman"))
+ (TeX-run-style-hooks "ngerman"))
(defun LaTeX-dinbrief-env-recipient (environment)
"Insert ENVIRONMENT and prompt for recipient and address."
@@ -246,7 +265,7 @@
(let ((ctime-string (current-time-string))
(month-alist '(("Jan" . "Januar")
("Feb" . "Februar")
- ("Mar" . "M\\\"arz")
+ ("Mar" . "März")
("Apr" . "April")
("May" . "Mai")
("Jun" . "Juni")

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue May 7 07:38:33 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Add patch dinbrief.patch
* Modernize this class to use by e.g. default UTF-8
- Add patch initial-reset.patch
(Re)enable initial buffer reset at creation time of the
document class
-------------------------------------------------------------------
Wed Mar 27 10:37:32 UTC 2024 - Dr. Werner Fink <werner@suse.de>

View File

@ -57,6 +57,8 @@ URL: https://www.gnu.org/software/auctex
Patch0: dvips.patch
Patch1: auctex-13.1-expand.patch
Patch2: ignore-errors.patch
Patch3: initial-reset.patch
Patch4: dinbrief.patch
BuildArch: noarch
%description
@ -82,6 +84,8 @@ you cannot use this package for XEmacs.
%patch -P0
%patch -P1
%patch -P2
%patch -P3
%patch -P4
%build
unset ${!LC_*}

19
initial-reset.patch Normal file
View File

@ -0,0 +1,19 @@
Enable initial reset for LaTeX classes to load the class mode
at creation of the document. The declared variable is called
LaTeX-global-class-files and not TeX-global-class-files.
---
latex.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- latex.el
+++ latex.el 2024-05-07 06:47:32.754527641 +0000
@@ -2706,7 +2706,7 @@ Initialized once at the first time you p
May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
;; Add the variable to `TeX-normal-mode-reset-list':
-(add-to-list 'TeX-normal-mode-reset-list 'TeX-global-class-files)
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-global-class-files)
(defcustom TeX-arg-input-file-search t
"If `TeX-arg-input-file' should search for files.