(select-window win)))
(defun mdw-set-frame-width (columns &optional width)
+ "Set the current frame to be the correct width for COLUMNS columns.
+
+If WIDTH is non-nil, then it provides the width for the new columns. (This
+can be set interactively with a prefix argument.)"
(interactive "nColumns:
P")
(setq width (if width (prefix-numeric-value width)
This is sadly necessary because Emacs 26 is broken in this regard.")
+(defvar mdw-frame-colour-alist
+ '((black . ("#000000" . "#ffffff"))
+ (red . ("#2a0000" . "#ffffff"))
+ (green . ("#002a00" . "#ffffff"))
+ (blue . ("#00002a" . "#ffffff")))
+ "*Alist mapping symbol names to (FOREGROUND . BACKGROUND) colour pairs.")
+
+(defun mdw-set-frame-colour (colour &optional frame)
+ (interactive "xColour name or (FOREGROUND . BACKGROUND) pair:
+")
+ (when (and colour (symbolp colour))
+ (let ((entry (assq colour mdw-frame-colour-alist)))
+ (unless entry (error "Unknown colour `%s'" colour))
+ (setf colour (cdr entry))))
+ (set-frame-parameter frame 'background-color (car colour))
+ (set-frame-parameter frame 'foreground-color (cdr colour)))
+
;; Don't raise windows unless I say so.
(defvar mdw-inhibit-raise-frame nil
(statement-cont . +)
(statement-case-intro . +)))
-(mdw-define-c-style mdw-trustonic-basic-c (mdw-c)
+(mdw-define-c-style mdw-trustonic-c (mdw-c)
(c-basic-offset . 4)
- (comment-column . 0)
(c-indent-comment-alist (anchored-comment . (column . 0))
(end-block . (space . 1))
(cpp-end-block . (space . 1))
(other . (space . 1)))
(c-offsets-alist (access-label . -2)))
-(mdw-define-c-style mdw-trustonic-c (mdw-trustonic-basic-c)
+(mdw-define-c-style mdw-trustonic-alec-c (mdw-trustonic-c)
+ (comment-column . 0)
(c-offsets-alist (arglist-cont-nonempty . mdw-c-indent-arglist-nested)))
(defun mdw-set-default-c-style (modes style)
(current-column))))
;; Don't really care about this.
- (when (and (eq lisp-indent-backquote-substitution-mode 'corrected))
+ (when (and (boundp 'lisp-indent-backquote-substitution-mode)
+ (eq lisp-indent-backquote-substitution-mode 'corrected))
(save-excursion
(goto-char (elt state 1))
(cl-incf loop-indentation
(setq ad-return-value
(list
- (cond ((not (lisp-extended-loop-p (elt state 1)))
+ (cond ((condition-case ()
+ (save-excursion
+ (goto-char (elt state 1))
+ (forward-char 1)
+ (forward-sexp 2)
+ (backward-sexp 1)
+ (not (looking-at "\\(:\\|\\sw\\)")))
+ (error nil))
(+ baseline-indent lisp-simple-loop-indentation))
((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
(+ baseline-indent lisp-loop-keyword-indentation))