[elpa] master c4a7d82 1/2: [gnugo imgen] New fit func to ignore bottom grid line
branch: master commit c4a7d820f87439e64f78d126dc34eaa96606566f Author: Thien-Thi Nguyen Commit: Thien-Thi Nguyen [gnugo imgen] New fit func to ignore bottom grid line * packages/gnugo/gnugo-imgen.el (gnugo-imgen--fit): New func. (gnugo-imgen-fit-window-height): Use ‘gnugo-imge--fit’. (gnugo-imgen-fit-window-height/no-grid-bottom): New func. --- packages/gnugo/gnugo-imgen.el | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/gnugo/gnugo-imgen.el b/packages/gnugo/gnugo-imgen.el index 0c7f720..5709d33 100644 --- a/packages/gnugo/gnugo-imgen.el +++ b/packages/gnugo/gnugo-imgen.el @@ -78,16 +78,27 @@ a square position on the board. A value less than 8 is taken as 8.") (interactive) (clrhash gnugo-imgen-cache)) +(defun gnugo-imgen--fit (board-size ignored-grid-lines) + (cl-destructuring-bind (L top R bot) + (window-inside-absolute-pixel-edges) +(ignore L R) +(/ (float (- bot top (* (frame-char-height) +ignored-grid-lines))) + board-size))) + (defun gnugo-imgen-fit-window-height (board-size) "Return the dimension (in pixels) of a square for BOARD-SIZE. This uses the TOP and BOTTOM components as returned by `window-inside-absolute-pixel-edges' and subtracts twice the `frame-char-height' (to leave space for the grid)." - (cl-destructuring-bind (L top R bot) - (window-inside-absolute-pixel-edges) -(ignore L R) -(/ (float (- bot top (* 2 (frame-char-height - board-size))) + (gnugo-imgen--fit board-size 2)) + +(defun gnugo-imgen-fit-window-height/no-grid-bottom (board-size) + "Return the dimension (in pixels) of a square for BOARD-SIZE. +This uses the TOP and BOTTOM components as returned by +`window-inside-absolute-pixel-edges' and subtracts the +`frame-char-height' (to leave top-line space for the grid)." + (gnugo-imgen--fit board-size 1)) (defconst gnugo-imgen-palette '((32 . :background) (?. . :grid-lines)
[elpa] master updated (c8a69c7 -> f58bcfb)
ttn pushed a change to branch master. from c8a69c7 New function gnorb-install-defaults new c4a7d82 [gnugo imgen] New fit func to ignore bottom grid line new f58bcfb [gnugo int] Gate ‘cursor-intangible-mode’ call precisely Summary of changes: packages/gnugo/gnugo-imgen.el | 21 - packages/gnugo/gnugo.el | 8 +++- 2 files changed, 23 insertions(+), 6 deletions(-)
[elpa] master f58bcfb 2/2: [gnugo int] Gate ‘cursor-intangible-mode’ call precisely
branch: master commit f58bcfb1a4022c030cd1ab1b749c8a3121a79c31 Author: Thien-Thi Nguyen Commit: Thien-Thi Nguyen [gnugo int] Gate ‘cursor-intangible-mode’ call precisely * packages/gnugo/gnugo.el (gnugo-board-mode): ...here, via ‘fboundp’. --- packages/gnugo/gnugo.el | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el index af3f3f0..abc4970 100644 --- a/packages/gnugo/gnugo.el +++ b/packages/gnugo/gnugo.el @@ -2169,10 +2169,16 @@ In this mode, keys do not self insert (see `gnugo-board-mode-map')." (setq font-lock-defaults '(gnugo-font-lock-keywords t) truncate-lines t) (add-hook 'kill-buffer-hook 'gnugo-cleanup nil t) - (if (eq gnugo--intangible 'cursor-intangible) + + ;; Previously, we used ‘(eq gnugo--intangible 'cursor-intangible)’ + ;; here, but (a) this is a bit quicker; and (b) we want to placate + ;; Emacs 24, which blurts out a "not known to be defined" warning. + ;; (Apparently it cannot infer equivalence of the two conditions.) + (if (fboundp 'cursor-intangible-mode) (cursor-intangible-mode 1) ;; Make sure ‘intangible’ DTRT in this buffer. (setq-local inhibit-point-motion-hooks nil)) + (setq-local gnugo-state (gnugo--mkht :size (1- 42))) (setq-local gnugo-btw nil) (add-to-list 'minor-mode-alist '(gnugo-btw gnugo-btw))
[elpa] master 9146039: load-dir: allow ignoring some files
branch: master commit 914603929f74df1d65dbe4f2065c8d996b3e18a0 Author: Ted Zlatanov Commit: Ted Zlatanov load-dir: allow ignoring some files * packages/load-dir/load-dir.el: Update copyright. (load-dir-ignored): New defcustom to ignore regexps; by default ignores .dir-locals. (load-dir-one): Use it. --- packages/load-dir/load-dir.el | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/load-dir/load-dir.el b/packages/load-dir/load-dir.el index 71b7dff..704f377 100644 --- a/packages/load-dir/load-dir.el +++ b/packages/load-dir/load-dir.el @@ -1,11 +1,11 @@ ;;; load-dir.el --- Load all Emacs Lisp files in a given directory -;; Copyright (C) 2011 Free Software Foundation, Inc +;; Copyright (C) 2011, 2017 Free Software Foundation, Inc ;; Authors: Teodor Zlatanov , ;; Ben Key ;; With-Help-From: Evans Winner , PJ Weisberg -;; Version: 0.0.3 +;; Version: 0.0.4 ;; Keywords: lisp, files, convenience ;; This file is part of GNU Emacs. @@ -62,6 +62,13 @@ :group 'load-dir :type 'boolean) +(defcustom load-dir-ignored '("\\.dir-locals") + "This list of regular expressions tells load-dir to ignore some filenames. +The match is a substring check against the whole filename." + :group 'load-dir + :tag "Ignore these regexps while loading a directory" + :type '(repeat :tag "Filename regexp" string)) + (defcustom load-dirs nil "This variable allows you to define which directories should be loaded. @@ -107,18 +114,22 @@ Clears the list of loaded files and just calls `load-dir-load'." Recurses into subdirectories if `load-dir-recursive' is t." (load-dir-debug "Loading Emacs Lisp code from %s" dir) (let ((suffixes (get-load-suffixes))) -(dolist (f (and (file-exists-p dir) -(file-directory-p dir) -(directory-files dir t))) - (when (and (not (file-directory-p f)) - (member (file-name-extension f t) suffixes)) -(setq f (file-name-sans-extension f)) -(if (member f load-dir-loaded) -(load-dir-debug "Skipping %s, it's already loaded." f) +(dolist (full (and (file-exists-p dir) + (file-directory-p dir) + (directory-files dir t))) + (when (and (not (file-directory-p full)) + (member (file-name-extension full t) suffixes)) +(setq f (file-name-sans-extension full)) +(cond + ((member f load-dir-loaded) + (load-dir-debug "Skipping %s, it's already loaded." f)) + ((cl-some (lambda (regexp) (string-match-p regexp full)) load-dir-ignored) + (load-dir-debug "Ignoring %s as per `load-dir-ignored'." full)) + (t (if load-dir-ignore-errors (with-demoted-errors (load f)) (load f)) - (add-to-list 'load-dir-loaded f + (add-to-list 'load-dir-loaded f) (when load-dir-recursive (dolist (f (directory-files dir t directory-files-no-dot-files-regexp))
[elpa] master updated (9146039 -> 4dfaa46)
girzel pushed a change to branch master. from 9146039 load-dir: allow ignoring some files new 941118a Fix autoloads for BBDB functions new ee1185e Remove useless use of progn, update usage status function new 4dfaa46 Fix creation of nngnorb/nnir groups Summary of changes: packages/gnorb/gnorb-bbdb.el | 16 ++-- packages/gnorb/gnorb-gnus.el | 48 ++- packages/gnorb/gnorb-org.el | 10 ++--- packages/gnorb/gnorb-registry.el | 37 +- packages/gnorb/gnorb-utils.el| 15 packages/gnorb/nngnorb.el| 82 +++- 6 files changed, 100 insertions(+), 108 deletions(-)
[elpa] master ee1185e 2/3: Remove useless use of progn, update usage status function
branch: master commit ee1185e0fd5b9bd304cb23d985d3228242e68bc6 Author: Eric Abrahamsen Commit: Eric Abrahamsen Remove useless use of progn, update usage status function * packages/gnorb/gnorb-registry.el (gnorb-report-tracking-usage): Not necessary. Also `gnorb-refresh-usage-status' needs to accept optional arguments. --- packages/gnorb/gnorb-registry.el | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/packages/gnorb/gnorb-registry.el b/packages/gnorb/gnorb-registry.el index 0e588d7..7c9f687 100644 --- a/packages/gnorb/gnorb-registry.el +++ b/packages/gnorb/gnorb-registry.el @@ -212,25 +212,24 @@ key." registry to track message/heading associations. Reports the number of tracked messages, the number of tracked headings, and how much of the registry is occupied." (interactive) - (progn -(pop-to-buffer - (get-buffer-create "*Gnorb Usage*") - '(nil . ((window-height . 10 -(gnorb-refresh-usage-status) -(special-mode) -(setq revert-buffer-function #'gnorb-refresh-usage-status) -(local-set-key (kbd "d") (lambda () - (interactive) - (progn -(gnorb-flush-dead-associations) -(gnorb-refresh-usage-status -(local-set-key (kbd "D") (lambda () - (interactive) - (progn -(gnorb-flush-dead-associations t) -(gnorb-refresh-usage-status)) - -(defun gnorb-refresh-usage-status () + (pop-to-buffer + (get-buffer-create "*Gnorb Usage*") + '(nil . ((window-height . 10 + (gnorb-refresh-usage-status) + (special-mode) + (setq revert-buffer-function #'gnorb-refresh-usage-status) + (local-set-key (kbd "d") (lambda () +(interactive) +(progn + (gnorb-flush-dead-associations) + (gnorb-refresh-usage-status + (local-set-key (kbd "D") (lambda () +(interactive) +(progn + (gnorb-flush-dead-associations t) + (gnorb-refresh-usage-status) + +(defun gnorb-refresh-usage-status (&optional _ignore-auto _noconfirm) "Clear and re-format the *Gnorb Usage* buffer." (let ((messages (length (gnorb-registry-tracked-messages))) (headings (length (gnorb-registry-tracked-headings)))
[elpa] master 4dfaa46 3/3: Fix creation of nngnorb/nnir groups
branch: master commit 4dfaa46497aac97abfbdefcc3429c7951afbc917 Author: Eric Abrahamsen Commit: Eric Abrahamsen Fix creation of nngnorb/nnir groups * packages/gnorb/gnorb-gnus.el (gnorb-gnus-search-messages): We were locating the nngnorb server incorrectly, and also feeding it to nnir incorrectly. This was preventing persistent groups from working correctly. * packages/gnorb/nngnorb.el (nnir-run-gnorb): Streamline the searching process. This should eliminate some redundancy, hopefully going a bit faster. * packages/gnorb/gnorb-utils.el (gnorb-msg-id-to-group): Do not cache article numbers in the registry -- numbers are not consistent across Gnus installations. This may slow down searches somewhat, unfortunately, but nnir's own caching mechanisms should help. --- packages/gnorb/gnorb-gnus.el | 48 ++--- packages/gnorb/gnorb-utils.el | 15 packages/gnorb/nngnorb.el | 82 --- 3 files changed, 65 insertions(+), 80 deletions(-) diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el index dd46351..e500bd4 100644 --- a/packages/gnorb/gnorb-gnus.el +++ b/packages/gnorb/gnorb-gnus.el @@ -669,40 +669,30 @@ server. There must be an active \"nngnorb\" server for this to work." (interactive) (require 'nnir) - (let ((nnir-address -(or (gnus-method-to-server '(nngnorb)) -(user-error - "Please add a \"nngnorb\" backend to your gnus installation."))) - name method spec) -(when (version= "5.13" gnus-version-number) - (with-no-warnings ; All these variables are available. - (setq nnir-current-query nil - nnir-current-server nil - nnir-current-group-marked nil - nnir-artlist nil))) -;; In 24.4, the group name is mostly decorative, but in 24.3, the -;; actual query is held there. -(setq name (if (version= "5.13" gnus-version-number) - (concat "nnir:" (prin1-to-string `((query ,str -(if persist -(read-string - (format "Name for group (default %s): " head-text) - nil head-text t) - (concat "gnorb-" str -(setq method (if (version= "5.13" gnus-version-number) -(list 'nnir nnir-address) - (list 'nnir "Gnorb"))) -(setq spec - (list - (cons 'nnir-specs (list (cons 'nnir-query-spec `((query . ,str))) - (cons 'nnir-group-spec `((,nnir-address nil) - (cons 'nnir-artlist nil))) + (let* ((nnir-address + (or (catch 'found + (dolist (s gnus-server-method-cache) + (when (eq 'nngnorb (cadr s)) + (throw 'found (car s) + (user-error + "Please add a \"nngnorb\" backend to your gnus installation."))) +(name (if persist + (read-string + (format "Name for group (default %s): " head-text) + nil nil head-text) +(concat "gnorb-" str))) +(method (list 'nnir nnir-address)) +(spec (list + (cons 'nnir-specs (list (cons 'nnir-query-spec `((query . ,str))) + (cons 'nnir-group-spec `((,nnir-address ,(list name)) + (cons 'nnir-artlist nil))) +nnir-current-query nnir-current-server nnir-current-group-marked nnir-artlist) (if persist (progn (switch-to-buffer gnus-group-buffer) (gnus-group-make-group name method nil spec) (gnus-group-select-group)) - (gnus-group-read-ephemeral-group name method nil ret nil nil spec + (gnus-group-read-ephemeral-group name method nil ret nil nil spec (defun gnorb-gnus-summary-mode-hook () "Check if we've entered a Gnorb-generated group, and activate diff --git a/packages/gnorb/gnorb-utils.el b/packages/gnorb/gnorb-utils.el index 14fb981..60e57b4 100644 --- a/packages/gnorb/gnorb-utils.el +++ b/packages/gnorb/gnorb-utils.el @@ -507,14 +507,13 @@ methods?" (not (string-match-p "\\(nnir\\|nnvirtual\\|UNKNOWN\\)" -server-group))) - (setq check - (ignore-errors - (gnus-request-head msg-id server-group))) - (when check - (gnus-registry-set-id-key msg-id 'group (list server-group)) - (gnus-registry-set-id-key msg-id 'artno (list (cdr check))) - (throw 'found (car check))) +server-group)) + (setq check +(ignore-errors + (gnus-request-head msg-id server-group + + (gnus-registry-set-id-key msg-id
[elpa] master 941118a 1/3: Fix autoloads for BBDB functions
branch: master commit 941118a4eb26e1a0e5538ef7f7d10fbcef40571e Author: Eric Abrahamsen Commit: Eric Abrahamsen Fix autoloads for BBDB functions * packages/gnorb/gnorb-bbdb.el: We're no longer requiring anything directly, only autoloading. This will allow users to install Gnorb without having BBDB installed at all -- though they can still trigger errors by using autoloaded Gnorb functions that depend on BBDB. I suppose I could be very tidy and catch those errors. * packages/gnorb/gnorb-org.el: Fix existing autoloads -- pointing at wrong file. --- packages/gnorb/gnorb-bbdb.el | 16 +--- packages/gnorb/gnorb-org.el | 10 -- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/packages/gnorb/gnorb-bbdb.el b/packages/gnorb/gnorb-bbdb.el index d391e3a..5fa4116 100644 --- a/packages/gnorb/gnorb-bbdb.el +++ b/packages/gnorb/gnorb-bbdb.el @@ -27,9 +27,19 @@ ;;; Code: -(require 'bbdb) -(require 'bbdb-com) -(require 'bbdb-mua) +;; Don't explicity require BBDB libraries. BBDB is the "weakest leg" +;; of the Gnorb tripod: it has the least functionality, and many +;; people are using Gnorb without BBDB. So don't require, only +;; autoload. + +;; (require 'bbdb) +;; (require 'bbdb-com) +;; (require 'bbdb-mua) + +(autoload 'bbdb-do-records "bbdb-com") +(autoload 'bbdb-completing-read-record "bbdb-com") +(autoload 'bbdb-current-record "bbdb") + (require 'gnorb-utils) (require 'cl-lib) diff --git a/packages/gnorb/gnorb-org.el b/packages/gnorb/gnorb-org.el index c99cfff..51eb715 100644 --- a/packages/gnorb/gnorb-org.el +++ b/packages/gnorb/gnorb-org.el @@ -32,17 +32,15 @@ (defvar bbdb-buffer-name) (defvar message-alternative-emails) -;; This many autoloads means either we should require bbdb outright, -;; or something needs refactoring. (autoload 'gnorb-bbdb-configure-posting-styles "gnorb-bbdb") (autoload 'gnorb-registry-org-id-search "gnorb-registry") -(autoload 'bbdb-completing-read-record "bbdb") +(autoload 'bbdb-completing-read-record "bbdb-com") (autoload 'bbdb-record-name "bbdb") -(autoload 'bbdb-message-search "bbdb") -(autoload 'bbdb-mail-address "bbdb") +(autoload 'bbdb-message-search "bbdb-com") +(autoload 'bbdb-mail-address "bbdb-com") (autoload 'bbdb-record-xfield "bbdb") (autoload 'bbdb-records "bbdb") -(autoload 'bbdb-search "bbdb") +(autoload 'bbdb-search "bbdb-com") (autoload 'bbdb-display-records "bbdb") (defgroup gnorb-org nil