chiark / gitweb /
Merge remote-tracking branches 'spirit', 'crybaby' and 'staging'
authorMark Wooding <mdw@distorted.org.uk>
Thu, 20 May 2021 18:08:06 +0000 (19:08 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 20 May 2021 18:08:06 +0000 (19:08 +0100)
* spirit:
  firefox/stylus/stackoverflow.com.css: Add style for Stackmumble.
  firefox/stylus/wikimedia.org.css: Apply Mediawiki styling at the client side.
  firefox/stylus/tvtropes.com.css: Make the text be actually white.
  firefox/stylus/salsa.debian.org.css: Focus style changes more carefully.
  firefox/stylus/salsa.debian.org.css: Reformat the body style.
  bin/, Makefile: Add some scripts for doing stuff to remote machines.
  dot/emacs: Reconfigure PostScript printing of buffers.
  el/dot-emacs.el: Fix fontification in printouts.
  el/dot-emacs.el: Print buffers in a condensed version of Courier.
  el/dot-emacs.el: Don't print `flyspell' overlays.
  firefox/chrome-userContent.css: Remove (invisible) borders round monospace.
  firefox/chrome-userContent.css: Set headings in sans.
  firefox/searchplugins/: Add some search engine definitions.
  bin/mdw-build: Prepare for a world where `mdw-setup' doesn't exist any more.

* crybaby:
  el/dot-emacs.el: Fix `loop' indentation for older Emacsen.
  bin/hyperspec: Track changes to Emacs hyperspec internals.

* staging:
  firefox/stylus.slack.com.css: Kick Slack styling some more.
  el/dot-emacs.el: Rename the Trustonic C styles.

bin/hyperspec
dot/emacs
el/dot-emacs.el
firefox/stylus/slack.com.css

index 9f902fe5cfb2d6f39ac94d00e4285818d4dc7767..507910cf9a1f791ca625166049375e124f0e8aa6 100755 (executable)
@@ -44,6 +44,9 @@
                          signal))))
     (fset 'message original-message)))
 
+;; No.
+(setq kill-emacs-hook nil)
+
 ;;;--------------------------------------------------------------------------
 ;;; Utilities.
 
 ;;;--------------------------------------------------------------------------
 ;;; Look up a string and find its URL in the Hyperspec.
 
+(defmacro some-var (&rest vars)
+  (let ((v (gensym)))
+    `(let ((,v (find-if #'boundp ',vars)))
+       (if ,v (symbol-value ,v)
+        (error "huh")))))
+
 (defun hyperspec-urls (key)
   "Return a list of hyperspec URLs corresponding to KEY."
   (let ((urls nil)
        (lookups (list (list (downcase key)
-                            common-lisp-hyperspec-symbols
+                            (some-var common-lisp-hyperspec--symbols
+                                      common-lisp-hyperspec-symbols)
                             #'(lambda (values)
                                 (mapcar (lambda (value)
                                           (concat common-lisp-hyperspec-root
                                                   value))
                                         values)))
                       (list (downcase key)
-                            common-lisp-hyperspec-issuex-symbols
+                            (some-var common-lisp-hyperspec--issuex-symbols
+                                      common-lisp-hyperspec-issuex-symbols)
                             #'(lambda (value)
                                 (list (concat common-lisp-hyperspec-root
                                               "Issues/"
                                               value)))))))
     (when (= (aref key 0) ?~)
       (push (list (substring key 1)
-                 common-lisp-hyperspec-format-characters
+                 (some-var common-lisp-hyperspec--format-characters
+                           common-lisp-hyperspec-format-characters)
                  #'(lambda (values)
-                     (mapcar #'common-lisp-hyperspec-section values)))
+                     (mapcar #'common-lisp-hyperspec-section
+                             values)))
            lookups))
     (dolist (lookup lookups)
       (let* ((name (car lookup))
-            (obarray (cadr lookup))
+            (table (cadr lookup))
             (format (car (cddr lookup)))
-            (symbol (intern-soft name obarray)))
-       (when (and symbol (boundp symbol))
-         (setq urls (nconc urls
-                           (funcall format (symbol-value symbol)))))))
+            (value (cond ((vectorp table)
+                          (let ((symbol (intern-soft name table)))
+                            (and symbol
+                                 (boundp symbol)
+                                 (symbol-value symbol))))
+                         ((hash-table-p table)
+                          (gethash name table))
+                         (t
+                          (error "what even?")))))
+       (when value
+         (setq urls (nconc urls (funcall format value))))))
     urls))
 
-(defun good-symbols (obarray &optional filter)
-  "Return the list of bound symbols in OBARRAY for which FILTER returns
+(defun good-symbols (table &optional filter)
+  "Return the list of bound symbols in TABLE for which FILTER returns
 non-nil; FILTER defaults to always-true if unspecified."
   (let ((syms nil))
-    (mapatoms (lambda (sym)
-               (when (and (boundp sym)
-                          (or (not filter)
-                              (funcall filter sym)))
-                 (setq syms (cons sym syms))))
-             obarray)
+    (cond ((vectorp table)
+          (mapatoms (lambda (sym)
+                      (when (and (boundp sym)
+                                 (or (not filter)
+                                     (funcall filter sym)))
+                        (push (symbol-name sym) syms)))
+                    table))
+         ((hash-table-p table)
+          (maphash (lambda (key value)
+                     (when (or (not filter) (funcall filter key))
+                       (push key syms)))
+                   table))
+         (t
+          (error "what even?")))
     (sort syms #'string<)))
 
 (defun hyperspec-keys ()
   "Return the list of all valid hyperspec lookup keys.  Useful for
 completion."
-  (nconc (good-symbols common-lisp-hyperspec-symbols)
+  (nconc (good-symbols (some-var common-lisp-hyperspec--symbols
+                                common-lisp-hyperspec-symbols))
         (mapcar #'(lambda (name)
-                    (format "~%s" name))
-                (good-symbols common-lisp-hyperspec-format-characters
-                              #'(lambda (sym)
-                                  (= (length (symbol-name sym)) 1))))
-        (good-symbols common-lisp-hyperspec-issuex-symbols)))
+                    (format "~%c" (aref name 0)))
+                (good-symbols (some-var common-lisp-hyperspec--format-characters
+                                        common-lisp-hyperspec-format-characters)
+                              #'(lambda (name)
+                                  (and (>= (length name) 3)
+                                       (= (aref name 2) ?-)
+                                       (let ((ch (aref name 0)))
+                                         (= ch (downcase ch)))))))
+        (good-symbols (some-var common-lisp-hyperspec--issuex-symbols
+                                common-lisp-hyperspec-issuex-symbols))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Parse the command line.
index 88399932083e0d2eddd9b18d943312b09050d70c..370cfeefca76b75202f1c4d134f4a3e0dceaee88 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
   (global-set-key [?\C-c ?v ?i] 'vm-visit-imap-folder)
   (global-set-key [?\C-c ?v ?m] 'vm-visit-folder)
   (global-set-key [?\C-c ?v ?v] 'mdw-auto-revert)
+  (global-set-key [?\C-c ?w ?b] 'w3m-bookmark-view)
+  (global-set-key [?\C-c ?w ?c] 'mdw-set-frame-colour)
   (global-set-key [?\C-c ?w ?d] 'mdw-divvy-window)
   (global-set-key [?\C-c ?w ?h] 'windmove-left)
   (global-set-key [?\C-c ?w ?j] 'windmove-down)
index 1782095422ac5e2d3191e96126b321f5ff192d30..f164c40097701d0d7dccf5a34b8bbce7b095635d 100644 (file)
@@ -241,6 +241,10 @@ (defun mdw-divvy-window (&optional width)
     (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)
@@ -259,6 +263,23 @@ (defvar mdw-frame-width-fudge
 
 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
@@ -2185,16 +2206,16 @@                    (defun-open . (add 0 c-indent-one-line-block))
                   (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)
@@ -4678,7 +4699,8 @@ (defadvice common-lisp-loop-part-indentation
                             (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
@@ -4707,7 +4729,14 @@ (defadvice common-lisp-loop-part-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))
index 3d0e8ecf57fa2ac0ecd920b5feb7dc4af8530fe2..a3f4a60b6e9e6f7957d23e928dc1a61db2c3619e 100644 (file)
@@ -26,11 +26,19 @@ body,
 .p-ia__sidebar_header__user__name,
 .p-ia__view_header .p-classic_nav__model__title__name,
 .c-message_list__unread_divider__label,
-.p-rich_text_block 
+.p-rich_text_block, .c-message_attachment__body,
+.c-pillow_file__description,
+.p-section_block, .p-call_subtype__title,
+.p-call_subtype__status, .p-call_subtype__description,
+.c-button
        { font-size: 11px !important; }
+.c-pillow_file__title { font-size: 12px !important; }
 body { font-family: sans-serif !important; }
 code, pre {
        font-family: monospace !important;
        font-size: 9px !important;
+       border: none;
+       padding: 0;
+       tab-size: 8; -webkit-tab-size: 8; -moz-tab-size: 8;
 }
 /*@END*/