commit 10a2239627bd5369bf46d013eb7cfbe27553c8d9 (HEAD, refs/remotes/origin/master) Author: Mark Oteiza Date: Wed Oct 19 23:59:04 2016 -0400 Derive dig-mode from special-mode * lisp/net/dig.el: Remove unused cl dependency. Remove top level mode-class assignment. (dig-mode-map): Unmap g, as dig has no notion of reverting the buffer. (dig-mode): Derive from special-mode. (dig-exit): Use quit-window instead. (dig): Use pop-to-buffer-same-window. Remove redundant assignments. (query-dig): Use pop-to-buffer-same-window. diff --git a/lisp/net/dig.el b/lisp/net/dig.el index 02cb627..338afca 100644 --- a/lisp/net/dig.el +++ b/lisp/net/dig.el @@ -36,8 +36,6 @@ ;;; Code: -(eval-when-compile (require 'cl)) - (defgroup dig nil "Dig configuration." :group 'comm) @@ -126,15 +124,13 @@ Buffer should contain output generated by `dig-invoke'." ;; `font-lock-defaults' buffer-local variable. (put 'dig-mode 'font-lock-defaults '(dig-font-lock-keywords t)) -(put 'dig-mode 'mode-class 'special) - (defvar dig-mode-map (let ((map (make-sparse-keymap))) - (suppress-keymap map) + (define-key map "g" nil) (define-key map "q" 'dig-exit) map)) -(define-derived-mode dig-mode nil "Dig" +(define-derived-mode dig-mode special-mode "Dig" "Major mode for displaying dig output." (buffer-disable-undo) (unless (featurep 'xemacs) @@ -148,7 +144,7 @@ Buffer should contain output generated by `dig-invoke'." (defun dig-exit () "Quit dig output buffer." (interactive) - (kill-buffer (current-buffer))) + (quit-window t)) ;;;###autoload (defun dig (domain &optional @@ -156,14 +152,12 @@ Buffer should contain output generated by `dig-invoke'." "Query addresses of a DOMAIN using dig, by calling `dig-invoke'. Optional arguments are passed to `dig-invoke'." (interactive "sHost: ") - (switch-to-buffer + (pop-to-buffer-same-window (dig-invoke domain query-type query-class query-option dig-option server)) (goto-char (point-min)) (and (search-forward ";; ANSWER SECTION:" nil t) (forward-line)) - (dig-mode) - (setq buffer-read-only t) - (set-buffer-modified-p nil)) + (dig-mode)) ;; named for consistency with query-dns in dns.el (defun query-dig (domain &optional @@ -175,7 +169,7 @@ Returns nil for domain/class/type queries that result in no data." (let ((buffer (dig-invoke domain query-type query-class query-option dig-option server))) (when buffer - (switch-to-buffer buffer) + (pop-to-buffer-same-window buffer) (let ((digger (dig-extract-rr domain query-type query-class))) (kill-buffer buffer) digger)))) commit eb610f270ea919107b10bb8ece200a87abac6e0e Author: Johan Bockgård Date: Tue Oct 18 22:28:17 2016 +0200 cl-defstruct: Fix debug spec and check of slot options * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Improve checking of slot option syntax. Fix debug spec. (Bug#24700) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index f5b7b82..0096e0a 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2590,8 +2590,7 @@ non-nil value, that slot cannot be set via `setf'. [":initial-offset" natnump])])] [&optional stringp] ;; All the above is for the following def-form. - &rest &or symbolp (symbolp def-form - &optional ":read-only" sexp)))) + &rest &or symbolp (symbolp &optional def-form &rest sexp)))) (let* ((name (if (consp struct) (car struct) struct)) (opts (cdr-safe struct)) (slots nil) @@ -2655,7 +2654,7 @@ non-nil value, that slot cannot be set via `setf'. (setq descs (nconc (make-list (car args) '(cl-skip-slot)) descs))) (t - (error "Slot option %s unrecognized" opt))))) + (error "Structure option %s unrecognized" opt))))) (unless (or include-name type) (setq include-name cl--struct-default-parent)) (when include-name (setq include (cl--struct-get-class include-name))) @@ -2711,7 +2710,7 @@ non-nil value, that slot cannot be set via `setf'. (let ((pos 0) (descp descs)) (while descp (let* ((desc (pop descp)) - (slot (car desc))) + (slot (pop desc))) (if (memq slot '(cl-tag-slot cl-skip-slot)) (progn (push nil slots) @@ -2721,7 +2720,7 @@ non-nil value, that slot cannot be set via `setf'. (error "Duplicate slots named %s in %s" slot name)) (let ((accessor (intern (format "%s%s" conc-name slot)))) (push slot slots) - (push (nth 1 desc) defaults) + (push (pop desc) defaults) ;; The arg "cl-x" is referenced by name in eg pred-form ;; and pred-check, so changing it is not straightforward. (push `(cl-defsubst ,accessor (cl-x) @@ -2736,7 +2735,9 @@ non-nil value, that slot cannot be set via `setf'. (if (= pos 0) '(car cl-x) `(nth ,pos cl-x)))) forms) - (if (cadr (memq :read-only (cddr desc))) + (when (cl-oddp (length desc)) + (error "Invalid options for slot %s in %s" slot name)) + (if (plist-get desc ':read-only) (push `(gv-define-expander ,accessor (lambda (_cl-do _cl-x) (error "%s is a read-only slot" ',accessor))) commit f52892fe01fec19860c198036fea1251b05ce18e Author: Johan Bockgård Date: Tue Oct 18 22:07:59 2016 +0200 isearch: Fix bug in defstruct syntax * lisp/isearch.el (isearch--state): Use correct form of defstruct slot options. (Bug#24685) diff --git a/lisp/isearch.el b/lisp/isearch.el index 0416b08..9418064 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1145,18 +1145,18 @@ REGEXP if non-nil says use the regexp search ring." (case-fold-search isearch-case-fold-search) (pop-fun (if isearch-push-state-function (funcall isearch-push-state-function)))))) - (string :read-only t) - (message :read-only t) - (point :read-only t) - (success :read-only t) - (forward :read-only t) - (other-end :read-only t) - (word :read-only t) - (error :read-only t) - (wrapped :read-only t) - (barrier :read-only t) - (case-fold-search :read-only t) - (pop-fun :read-only t)) + (string nil :read-only t) + (message nil :read-only t) + (point nil :read-only t) + (success nil :read-only t) + (forward nil :read-only t) + (other-end nil :read-only t) + (word nil :read-only t) + (error nil :read-only t) + (wrapped nil :read-only t) + (barrier nil :read-only t) + (case-fold-search nil :read-only t) + (pop-fun nil :read-only t)) (defun isearch--set-state (cmd) (setq isearch-string (isearch--state-string cmd)