sbbs.el

Check-in [aa9e221e24]
Login
Overview
Comment:Add separate face for post headers
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: aa9e221e241b2c3a025a6bd25caa053cd4748754e78758f3ef563495af6bc81d
User & Date: zge on 2020-10-07 17:09:51
Other Links: branch diff | manifest | tags
Context
2020-10-07
17:19
Add a "/" as initial content when prompting to open a board check-in: 43bf3542e7 user: zge tags: master, trunk
17:09
Add separate face for post headers check-in: aa9e221e24 user: zge tags: master, trunk
2020-06-18
13:11
Fixed URL handeling with ","-ranges check-in: df55ff6293 user: zge tags: master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified sbbs.el from [e334160be5] to [e87c43e082].

    76     76   (defface sbbs--variable-pitch
    77     77     (if (x-list-fonts "Mona-")
    78     78         '((nil :font "Mona"
    79     79                :inherit variable-pitch))
    80     80       '((nil :inherit variable-pitch)))
    81     81     "Face for code blocks in threads.")
    82     82   
           83  +(defface sbbs--post-header-face
           84  +  '((nil :extend t
           85  +         :inherit highlight))
           86  +  "Face for post headers in the thread view.")
           87  +
    83     88    ;; VARIABLES
    84     89   
    85     90   (defvar-local sbbs--board nil
    86     91     "Buffer local reference to current board.
    87     92   
    88     93   See `sbbs-make-board'.")
    89     94   
................................................................................
   344    349     "Prepare and Insert header and contents of POST at point."
   345    350     (let ((start (point)))
   346    351       (insert (format "#%d\t%s" (car post)
   347    352                       (cdr (assq 'date (cdr post)))))
   348    353       (when (cdr (assq 'vip (cdr post)))
   349    354         (insert " (VIP)"))
   350    355       (newline 2)
   351         -    (add-text-properties start (1- (point)) '(face highlight))
          356  +    (add-text-properties start (1- (point)) '(face sbbs--post-header-face))
   352    357       (set-text-properties (1- (point)) (point) nil)
   353    358       (sbbs--insert-sxml (cdr (assq 'content (cdr post))))
   354    359       (add-text-properties start (point) (list 'sbbs-thread-nr (car post)))))
   355    360   
   356    361   (defun sbbs--uncover-spoiler ()
   357    362     ""
   358    363     (cond ((eq (get-text-property (point) 'face) 'sbbs--spoiler-face)
................................................................................
   624    629   (defun sbbs-read-next (arg)
   625    630     "Move point ARG posts forward."
   626    631     (interactive "p")
   627    632     (dotimes (_ arg)
   628    633       (end-of-line)
   629    634       (catch 'found
   630    635         (while (search-forward-regexp "^#" nil t)
   631         -        (when (and (eq 'highlight (get-text-property (point) 'face))
          636  +        (when (and (eq 'sbbs--post-header-face (get-text-property (point) 'face))
   632    637                      (not (get-text-property (point) 'invisible)))
   633    638             (throw 'found t)))))
   634    639     (beginning-of-line)
   635    640     (when sbbs-recenter-to-top
   636    641       (set-window-start (selected-window) (point))))
   637    642   
   638    643   (defun sbbs-read-previous (arg)
   639    644     "Move point ARG posts backwards."
   640    645     (interactive "p")
   641    646     (dotimes (_ arg)
   642    647       (catch 'found
   643    648         (while (search-backward-regexp "^#" nil t)
   644         -        (when (and (eq 'highlight (get-text-property (point) 'face))
          649  +        (when (and (eq 'sbbs--post-header-face (get-text-property (point) 'face))
   645    650                      (not (get-text-property (point) 'invisible)))
   646    651             (throw 'found t)))))
   647    652     (beginning-of-line)
   648    653     (when sbbs-recenter-to-top
   649    654       (set-window-start (selected-window) (point))))
   650    655   
   651    656   ;;;###autoload