diff options
| author | Simeon Simeonov | 2025-06-02 05:49:33 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2025-06-02 05:49:33 +0200 |
| commit | 6e68f800d23cfad6223b2666f427d09d2868b255 (patch) | |
| tree | 37b21afa40e1ee6fdae844120290a2f82c2f814b | |
| parent | 8c2a9286007648582299e5e2dd90d876379e47e7 (diff) | |
Update emacs config and lua-mode
| -rw-r--r-- | .emacs | 34 | ||||
| -rw-r--r-- | .emacs.d/lisp/lua-mode.el | 28 | ||||
| -rw-r--r-- | .emacs.pure | 34 |
3 files changed, 80 insertions, 16 deletions
| @@ -55,6 +55,35 @@ | |||
| 55 | ;; vim-Scroll | 55 | ;; vim-Scroll |
| 56 | (setq scroll-conservatively 1) | 56 | (setq scroll-conservatively 1) |
| 57 | 57 | ||
| 58 | ;; European datatime format | ||
| 59 | (setq calendar-date-display-form | ||
| 60 | '((if dayname (concat dayname ", ")) day " " monthname " " year)) | ||
| 61 | (setq calendar-time-display-form | ||
| 62 | '(24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))) | ||
| 63 | |||
| 64 | ;; week starts on Monday | ||
| 65 | (setq calendar-week-start-day 1) | ||
| 66 | (setq org-agenda-start-on-weekday 1) | ||
| 67 | |||
| 68 | ;; display week numbers | ||
| 69 | (setq calendar-intermonth-text | ||
| 70 | '(propertize | ||
| 71 | (format "%2d" | ||
| 72 | (car | ||
| 73 | (calendar-iso-from-absolute | ||
| 74 | (calendar-absolute-from-gregorian (list month day year))))) | ||
| 75 | 'font-lock-face 'font-lock-warning-face)) | ||
| 76 | |||
| 77 | (setq calendar-intermonth-header | ||
| 78 | (propertize "Wnr" ; or e.g. "KW" in Germany | ||
| 79 | 'font-lock-face 'font-lock-keyword-face)) | ||
| 80 | |||
| 81 | |||
| 82 | ;; sunrise / sunset | ||
| 83 | ;; (setq calendar-latitude 59.98765) | ||
| 84 | ;; (setq calendar-longitude 10.98765) | ||
| 85 | ;; (setq calendar-location-name "Oslo") | ||
| 86 | |||
| 58 | ;; Various | 87 | ;; Various |
| 59 | (setq auto-save-default nil) | 88 | (setq auto-save-default nil) |
| 60 | (setq make-backup-files nil) | 89 | (setq make-backup-files nil) |
| @@ -76,8 +105,9 @@ | |||
| 76 | ;; Programming section | 105 | ;; Programming section |
| 77 | 106 | ||
| 78 | ;; Indentation | 107 | ;; Indentation |
| 79 | (setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil js-indent-level 4 sgml-basic-offset 4) | 108 | ;;(setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil js-indent-level 4 sgml-basic-offset 4) |
| 80 | ;;(setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil) | 109 | (setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil) |
| 110 | ;;(setq js-indent-level 2) | ||
| 81 | ;;(setq-default c-basic-offset 4 tab-width 4) | 111 | ;;(setq-default c-basic-offset 4 tab-width 4) |
| 82 | 112 | ||
| 83 | ;; Default coding style | 113 | ;; Default coding style |
diff --git a/.emacs.d/lisp/lua-mode.el b/.emacs.d/lisp/lua-mode.el index 6c524f5..be56111 100644 --- a/.emacs.d/lisp/lua-mode.el +++ b/.emacs.d/lisp/lua-mode.el | |||
| @@ -376,8 +376,8 @@ If the latter is nil, the keymap translates into `lua-mode-map' verbatim.") | |||
| 376 | "Keymap used in lua-mode buffers.") | 376 | "Keymap used in lua-mode buffers.") |
| 377 | 377 | ||
| 378 | (defvar lua-electric-flag t | 378 | (defvar lua-electric-flag t |
| 379 | "If t, electric actions (like automatic reindentation) will happen when an electric | 379 | "If t, electric actions will happen when an electric key like `{' is pressed. |
| 380 | key like `{' is pressed") | 380 | Automatic reindentation is an example of an electric action.") |
| 381 | (make-variable-buffer-local 'lua-electric-flag) | 381 | (make-variable-buffer-local 'lua-electric-flag) |
| 382 | 382 | ||
| 383 | (defcustom lua-prompt-regexp "[^\n]*\\(>[\t ]+\\)+$" | 383 | (defcustom lua-prompt-regexp "[^\n]*\\(>[\t ]+\\)+$" |
| @@ -1054,9 +1054,15 @@ found, returns point position, nil otherwise." | |||
| 1054 | Each token information entry is of the form: | 1054 | Each token information entry is of the form: |
| 1055 | KEYWORD FORWARD-MATCH-REGEXP BACKWARDS-MATCH-REGEXP TOKEN-TYPE | 1055 | KEYWORD FORWARD-MATCH-REGEXP BACKWARDS-MATCH-REGEXP TOKEN-TYPE |
| 1056 | KEYWORD is the token. | 1056 | KEYWORD is the token. |
| 1057 | FORWARD-MATCH-REGEXP is a regexp that matches all possible tokens when going forward. | 1057 | FORWARD-MATCH-REGEXP is a regexp that matches all possible tokens |
| 1058 | BACKWARDS-MATCH-REGEXP is a regexp that matches all possible tokens when going backwards. | 1058 | when going forward. |
| 1059 | TOKEN-TYPE determines where the token occurs on a statement. open indicates that the token appears at start, close indicates that it appears at end, middle indicates that it is a middle type token, and middle-or-open indicates that it can appear both as a middle or an open type.") | 1059 | BACKWARDS-MATCH-REGEXP is a regexp that matches all possible tokens |
| 1060 | when going backwards. | ||
| 1061 | TOKEN-TYPE determines where the token occurs on a statement. `open' | ||
| 1062 | indicates that the token appears at start, close indicates that it | ||
| 1063 | appears at end, `middle' indicates that it is a middle type token, | ||
| 1064 | and `middle-or-open' indicates that it can appear both as a middle | ||
| 1065 | or an open type.") | ||
| 1060 | 1066 | ||
| 1061 | (defconst lua-indentation-modifier-regexp | 1067 | (defconst lua-indentation-modifier-regexp |
| 1062 | ;; The absence of else is deliberate, since it does not modify the | 1068 | ;; The absence of else is deliberate, since it does not modify the |
| @@ -1442,14 +1448,12 @@ The criteria for a continuing statement are: | |||
| 1442 | 1448 | ||
| 1443 | 1449 | ||
| 1444 | (defun lua-is-continuing-statement-p (&optional parse-start) | 1450 | (defun lua-is-continuing-statement-p (&optional parse-start) |
| 1445 | "Returns non-nil if the line at PARSE-START should be indented as continuation line. | 1451 | "Return non-nil if line at PARSE-START is a continuation line. |
| 1446 | 1452 | ||
| 1447 | This true is when the line : | 1453 | This affects how it should be indented. A line is a continuation line if |
| 1448 | 1454 | - it is continuing a statement itself, or | |
| 1449 | * is continuing a statement itself | 1455 | - it starts with a 1+ block-closer tokens, an top-most block opener is on |
| 1450 | 1456 | a continuation line." | |
| 1451 | * starts with a 1+ block-closer tokens, an top-most block opener is on a continuation line | ||
| 1452 | " | ||
| 1453 | (save-excursion | 1457 | (save-excursion |
| 1454 | (if parse-start (goto-char parse-start)) | 1458 | (if parse-start (goto-char parse-start)) |
| 1455 | 1459 | ||
diff --git a/.emacs.pure b/.emacs.pure index 1f703c7..a4d0a17 100644 --- a/.emacs.pure +++ b/.emacs.pure | |||
| @@ -55,6 +55,35 @@ | |||
| 55 | ;; vim-Scroll | 55 | ;; vim-Scroll |
| 56 | (setq scroll-conservatively 1) | 56 | (setq scroll-conservatively 1) |
| 57 | 57 | ||
| 58 | ;; European datatime format | ||
| 59 | (setq calendar-date-display-form | ||
| 60 | '((if dayname (concat dayname ", ")) day " " monthname " " year)) | ||
| 61 | (setq calendar-time-display-form | ||
| 62 | '(24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))) | ||
| 63 | |||
| 64 | ;; week starts on Monday | ||
| 65 | (setq calendar-week-start-day 1) | ||
| 66 | (setq org-agenda-start-on-weekday 1) | ||
| 67 | |||
| 68 | ;; display week numbers | ||
| 69 | (setq calendar-intermonth-text | ||
| 70 | '(propertize | ||
| 71 | (format "%2d" | ||
| 72 | (car | ||
| 73 | (calendar-iso-from-absolute | ||
| 74 | (calendar-absolute-from-gregorian (list month day year))))) | ||
| 75 | 'font-lock-face 'font-lock-warning-face)) | ||
| 76 | |||
| 77 | (setq calendar-intermonth-header | ||
| 78 | (propertize "Wnr" ; or e.g. "KW" in Germany | ||
| 79 | 'font-lock-face 'font-lock-keyword-face)) | ||
| 80 | |||
| 81 | |||
| 82 | ;; sunrise / sunset | ||
| 83 | ;; (setq calendar-latitude 59.98765) | ||
| 84 | ;; (setq calendar-longitude 10.98765) | ||
| 85 | ;; (setq calendar-location-name "Oslo") | ||
| 86 | |||
| 58 | ;; Various | 87 | ;; Various |
| 59 | (setq auto-save-default nil) | 88 | (setq auto-save-default nil) |
| 60 | (setq make-backup-files nil) | 89 | (setq make-backup-files nil) |
| @@ -76,8 +105,9 @@ | |||
| 76 | ;; Programming section | 105 | ;; Programming section |
| 77 | 106 | ||
| 78 | ;; Indentation | 107 | ;; Indentation |
| 79 | (setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil js-indent-level 4 sgml-basic-offset 4) | 108 | ;;(setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil js-indent-level 4 sgml-basic-offset 4) |
| 80 | ;;(setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil) | 109 | (setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil) |
| 110 | ;;(setq js-indent-level 2) | ||
| 81 | ;;(setq-default c-basic-offset 4 tab-width 4) | 111 | ;;(setq-default c-basic-offset 4 tab-width 4) |
| 82 | 112 | ||
| 83 | ;; Default coding style | 113 | ;; Default coding style |
