sbbs.el

Check-in [cc71172e18]
Login
Overview
Comment:Added sbbs-default-board option
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: cc71172e18256674b7cac883875f226b1c05528103015b03cbb9c8da561c1645
User & Date: zge on 2020-06-06 17:17:21
Other Links: branch diff | manifest | tags
Context
2020-06-08
10:26
Fix sbbs-compose-format when mark is before point check-in: a9ee28fa6d user: zge tags: master, trunk
2020-06-06
17:17
Added sbbs-default-board option check-in: cc71172e18 user: zge tags: master, trunk
16:28
Fix sbbs-compose-format on when region is active See http://textboard.org/prog/81/49 check-in: d5347562aa user: zge tags: master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified sbbs.el from [4c1b0d2eeb] to [fbf9317204].

    40     40     '(("textboard.org" ("sol" "prog") t)
    41     41       ("bbs.jp.net" ("mona") t))
    42     42     "List of SchemeBBS sites and boards."
    43     43     :type '(repeat (list (string :tag "Board Domain")
    44     44                          (repeat (string :tag "Board Name"))
    45     45                          (boolean :tag "Use TLS?"))))
    46     46   
           47  +(defcustom sbbs-default-board nil
           48  +  "Jump to first link after narrowing posts."
           49  +  :type '(choice (const :tag "None" nil)
           50  +                 (cons (string :tag "Board Domain")
           51  +                       (string :tag "Board Name"))))
           52  +
    47     53   (defcustom sbbs-jump-to-link t
    48     54     "Jump to first link after narrowing posts."
    49     55     :type 'boolean)
    50     56   
    51     57   (defcustom sbbs-recenter-to-top t
    52     58     "Move point to top of frame when moving through posts."
    53     59     :type 'boolean)
................................................................................
   131    137       boards))
   132    138   
   133    139   (defun sbbs-read-board ()
   134    140     "Read in a board using `completing-read'.
   135    141   
   136    142   The list will be generated using `sbbs-boards', and the result
   137    143   will be a board object generated with `sbbs-make-board'."
   138         -  (let (boards)
          144  +  (let (boards def)
   139    145       (dolist (b (sbbs--list-boards))
          146  +      (when (and sbbs-default-board
          147  +                 (string= (sbbs--board-domain b)
          148  +                          (car sbbs-default-board))
          149  +                 (string= (sbbs--board-name b)
          150  +                          (cdr sbbs-default-board)))
          151  +        (setq def b))
   140    152         (push (cons (format "/%s/ (%s)"
   141    153                             (sbbs--board-name b)
   142    154                             (sbbs--board-domain b))
   143    155                     b)
   144    156               boards))
   145         -    (cdr (assoc (completing-read "Board: " boards nil t) boards))))
          157  +    (let ((choice (completing-read
          158  +                   (if def
          159  +                       (format "Board (default %s/%s): "
          160  +                               (sbbs--board-domain def)
          161  +                               (sbbs--board-name def))
          162  +                     "Board: ")
          163  +                   boards nil nil nil nil def)))
          164  +      (if (stringp choice)
          165  +          (cdr (assoc choice boards))
          166  +        choice))))
   146    167   
   147    168    ;; UTILITY FUNCTIONS
   148    169   
   149    170   (defun sbbs--reload-thread (&optional _ignore-auto _noconfirm)
   150    171     "Function to reload an opened thread."
   151    172     (when sbbs--thread-id (sbbs-view-open sbbs--thread-id)))
   152    173