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.

1  2  3  4 
dot/emacs
el/dot-emacs.el

diff --combined dot/emacs
index 115c65af5ebbf560648aa40143a9588aec513653,88399932083e0d2eddd9b18d943312b09050d70c,2bb33180e74249bb99955e56f1efd0dc95050fbf,2bb33180e74249bb99955e56f1efd0dc95050fbf..370cfeefca76b75202f1c4d134f4a3e0dceaee88
+++ b/dot/emacs
    ;; Postscript printing.
    
    (setq ps-paper-type 'a4
- --      ps-print-color-p nil
- --      ps-landscape-mode t
- --      ps-number-of-columns 2
- --      ps-font-family 'Courier
- --      ps-font-size 6.5)
+ ++      ps-print-only-one-header t
+ ++      ps-print-color-p t
+ ++      ps-landscape-mode t ps-number-of-columns 4
+ ++      ps-line-number t ps-line-number-step 5 ps-line-number-start 5
+ ++      ps-zebra-stripes nil ps-zebra-stripe-height 5
+ ++      ps-spool-duplex t ps-spool-tumble nil ps-spool-config 'setpagedevice
+ ++      ps-top-margin (* 12 (/ 72 25.4))
+ ++      ps-bottom-margin (* 16 (/ 72 25.4))
+ ++      ps-header-offset (* 8 (/ 72 25.4))
+ ++      ps-left-margin (* 12 (/ 72 25.4))
+ ++      ps-right-margin (* 12 (/ 72 25.4))
+ ++      ps-inter-column (* 4 (/ 72 25.4))
+ ++      ps-font-family 'CourierCondensed ps-font-size '(4.5 . 5.16)
+ ++      ps-line-number-font 'Palatino ps-line-number-font-size 3
+ ++      ps-header-font-family 'Helvetica
+ ++    ps-header-title-font-size '(8 . 10)
+ ++    ps-header-font-size '(6 . 8))
    
    ;; Splash screen stuff.
    
      (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)
diff --combined el/dot-emacs.el
index c1beb947de9f414598c6ddf130e39073d6691b63,1782095422ac5e2d3191e96126b321f5ff192d30,61578ce58f1f6bb3f7c4998cbd279234a787a691,705143ef5be5bb788074be2948ef2be65bec4203..f164c40097701d0d7dccf5a34b8bbce7b095635d
@@@@@ -241,10 -241,6 -241,10 -241,10 +241,10 @@@@@ fringes is not taken out of the allowan
        (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
             (match . 1)
             (pad . ,(or mat 2))))))
    
+ ++;;;--------------------------------------------------------------------------
+ ++;;; Printing.
+ ++
+ ++;; Teach PostScript about a condensed variant of Courier.  I'm using 85% of
+ ++;; the usual width, which happens to match `mdwfonts', and David Carlisle's
+ ++;; `pslatex'.  (Once upon a time, I used 80%, but decided consistency with
+ ++;; `pslatex' was useful.)
+ ++(setq ps-user-defined-prologue "
+ ++/CourierCondensed /Courier
+ ++/CourierCondensed-Bold /Courier-Bold
+ ++/CourierCondensed-Oblique /Courier-Oblique
+ ++/CourierCondensed-BoldOblique /Courier-BoldOblique
+ ++  4 { findfont [0.85 0 0 1 0 0] makefont definefont pop } repeat
+ ++")
+ ++
+ ++;; Hack `ps-print''s settings.
+ ++(eval-after-load 'ps-print
+ ++  '(progn
+ ++
+ ++     ;; Notice that the comment-delimiters should be in italics too.
+ ++     (pushnew 'font-lock-comment-delimiter-face ps-italic-faces)
+ ++
+ ++     ;; Select more suitable colours for the main kinds of tokens.  The
+ ++     ;; colours set on the Emacs faces are chosen for use against a dark
+ ++     ;; background, and work very badly on white paper.
+ ++     (ps-extend-face '(font-lock-comment-face "darkgreen" nil italic))
+ ++     (ps-extend-face '(font-lock-comment-delimiter-face "darkgreen" nil italic))
+ ++     (ps-extend-face '(font-lock-string-face "RoyalBlue4" nil))
+ ++     (ps-extend-face '(mdw-punct-face "sienna" nil))
+ ++     (ps-extend-face '(mdw-number-face "OrangeRed3" nil))
+ ++
+ ++     ;; Teach `ps-print' about my condensed varsions of Courier.
+ ++     (setq ps-font-info-database
+ ++         (append '((CourierCondensed
+ ++                    (fonts (normal . "CourierCondensed")
+ ++                           (bold . "CourierCondensed-Bold")
+ ++                           (italic . "CourierCondensed-Oblique")
+ ++                           (bold-italic . "CourierCondensed-BoldOblique"))
+ ++                    (size . 10.0)
+ ++                    (line-height . 10.55)
+ ++                    (space-width . 5.1)
+ ++                    (avg-char-width . 5.1)))
+ ++                 (cl-remove 'CourierCondensed ps-font-info-database
+ ++                            :key #'car)))))
+ ++
+ ++;; Arrange to strip overlays from the buffer before we print .  This will
+ ++;; prevent `flyspell' from interfering with the printout.  (It would be less
+ ++;; bad if `ps-print' could merge the `flyspell' overlay face with the
+ ++;; underlying `font-lock' face, but it can't (and that seems hard).  So
+ ++;; instead we have this hack.
+ ++;;
+ ++;; The basic trick is to copy the relevant text from the buffer being printed
+ ++;; into a temporary buffer and... just print that.  The text properties come
+ ++;; with the text and end up in the new buffer, and the overlays get lost
+ ++;; along the way.  Only problem is that the headers identifying the file
+ ++;; being printed get confused, so remember the original buffer and reinstate
+ ++;; it when constructing the headers.
+ ++(defvar mdw-printing-buffer)
+ ++
+ ++(defadvice ps-generate-header
+ ++    (around mdw-use-correct-buffer () activate compile)
+ ++  "Print the correct name of the buffer being printed."
+ ++  (with-current-buffer mdw-printing-buffer
+ ++    ad-do-it))
+ ++
+ ++(defadvice ps-generate
+ ++    (around mdw-strip-overlays (buffer from to genfunc) activate compile)
+ ++  "Strip overlays -- in particular, from `flyspell' -- before printout."
+ ++  (with-temp-buffer
+ ++    (let ((mdw-printing-buffer buffer))
+ ++      (insert-buffer-substring buffer from to)
+ ++      (ad-set-arg 0 (current-buffer))
+ ++      (ad-set-arg 1 (point-min))
+ ++      (ad-set-arg 2 (point-max))
+ ++      ad-do-it)))
+ ++
    ;;;--------------------------------------------------------------------------
    ;;; Other common declarations.
    
                   (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)
@@@@@ -4623,7 -4678,7 -4623,8 -4623,7 +4699,8 @@@@@ align the other subforms beneath it.  O
                             (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))