commit f248292ede3940dde5e4ac29d96f8a0294788b0a (HEAD, refs/remotes/origin/master) Author: Eli Barzilay Date: Sun Nov 29 15:24:27 2015 -0500 * lisp/calculator.el: more improvements and bugfixes. - Mark `calculator-paste-decimals' as obsolete. (It wasn't having an effect anyway.) - Simplify `calculator-number-to-string' by throwing most of the work onto `number-to-string', leaving just some tweaks for decimal inputs. This leads to some minor changes, for example, pasting "1x1" in hex mode would warn that "x" is ignored and result in "11" (and it wasn't done in decimal mode), whereas now it just ignores everything from the "x" and on and result in a "1" just like in decimal input mode. Also, overflows are left for `number-to-string' to deal with. - `calculator-paste' is very simple as a result. - Extend the simplified `calculator-paste': with a prefix argument it pastes a string as if the characters were entered. This can be used to reduce expressions, but note that it's a simple literal operation, so precedence can be messed, a number can be paster while entering a number, spaces and newlines matter, etc. - Fix a minor bug where "e+" in hex mode wouldn't use "+" as an operator. - Fix a bug in `calculator-put-value': avoid grouping in the display that is used to construct `calculator-curnum'. This would trigger when pasting or getting a value from a register in some radix mode with a large enough value. Another fix: make the output radix equal the input one, otherwise numbers could be converted twice. diff --git a/lisp/calculator.el b/lisp/calculator.el index 3d44b6d..f2e6a88 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -161,6 +161,8 @@ This makes it possible to paste big integers since they will be read as floats, otherwise the Emacs reader will fail on them." :type 'boolean :group 'calculator) +(make-obsolete-variable 'calculator-paste-decimals + "it is no longer used." nil) (defcustom calculator-copy-displayer nil "If non-nil, this is any value that can be used for @@ -855,39 +857,13 @@ The result should not exceed the screen width." "Convert the given STR to a number, according to the value of `calculator-input-radix'." (if calculator-input-radix - (let ((radix - (cdr (assq calculator-input-radix - '((bin . 2) (oct . 8) (hex . 16))))) - (i -1) (value 0) (new-value 0)) - ;; assume mostly valid input (e.g., characters in range) - (while (< (setq i (1+ i)) (length str)) - (setq new-value - (let* ((ch (upcase (aref str i))) - (n (cond ((< ch ?0) nil) - ((<= ch ?9) (- ch ?0)) - ((< ch ?A) nil) - ((<= ch ?Z) (- ch (- ?A 10))) - (t nil)))) - (if (and n (<= 0 n) (< n radix)) - (+ n (* radix value)) - (progn - (calculator-message - "Warning: Ignoring bad input character `%c'." ch) - (sit-for 1) - value)))) - (when (if (< new-value 0) (> value 0) (< value 0)) - (calculator-message "Warning: Overflow in input.")) - (setq value new-value)) - value) - (car (read-from-string - (cond ((equal "." str) "0.0") - ((string-match-p "[eE][+-]?$" str) (concat str "0")) - ((string-match-p "\\.[0-9]\\|[eE]" str) str) - ((string-match-p "\\." str) - ;; do this because Emacs reads "23." as an integer - (concat str "0")) - ((stringp str) (concat str ".0")) - (t "0.0")))))) + (string-to-number str (cadr (assq calculator-input-radix + '((bin 2) (oct 8) (hex 16))))) + (let* ((str (replace-regexp-in-string + "\\.\\([^0-9].*\\)?$" ".0\\1" str)) + (str (replace-regexp-in-string + "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str))) + (string-to-number str)))) (defun calculator-push-curnum () "Push the numeric value of the displayed number to the stack." @@ -1329,7 +1305,8 @@ Used with +/- for entering them as digits in numbers like 1e-3 (there is no need for negative numbers since these are handled by unary operators)." (interactive) - (if (and (not calculator-display-fragile) + (if (and (not calculator-input-radix) + (not calculator-display-fragile) calculator-curnum (string-match-p "[eE]$" calculator-curnum)) (calculator-digit) @@ -1497,25 +1474,27 @@ Used by `calculator-paste' and `get-register'." (or calculator-display-fragile (not (numberp (car calculator-stack))))) (calculator-clear-fragile) - (setq calculator-curnum (let ((calculator-displayer "%S")) - (calculator-number-to-string val))) + (setq calculator-curnum + (let ((calculator-displayer "%S") + (calculator-radix-grouping-mode nil) + (calculator-output-radix calculator-input-radix)) + (calculator-number-to-string val))) (calculator-update-display))) -(defun calculator-paste () - "Paste a value from the `kill-ring'." - (interactive) - (calculator-put-value - (let ((str (replace-regexp-in-string - "^ *\\(.+[^ ]\\) *$" "\\1" (current-kill 0)))) - (when (and (not calculator-input-radix) - calculator-paste-decimals - (string-match - "\\([0-9]+\\)\\(\\.[0-9]+\\)?\\(e[0-9]+\\)?" - str)) - (setq str (concat (or (match-string 1 str) "0") - (or (match-string 2 str) ".0") - (or (match-string 3 str) "")))) - (ignore-errors (calculator-string-to-number str))))) +(defun calculator-paste (arg) + "Paste a value from the `kill-ring'. + +With a prefix argument, paste the raw string as a sequence of key +presses, which can be used to paste expressions. Note that this +is literal; examples: spaces will store values, pasting \"1+2\" +will not produce 3 if it's done you're entering a number or after +a multiplication." + (interactive "P") + (let ((str (current-kill 0))) + (if arg + (setq unread-command-events + `(,@(listify-key-sequence str) ,@unread-command-events)) + (calculator-put-value (calculator-string-to-number str))))) (defun calculator-register-read-with-preview (prompt) "Similar to `register-read-with-preview' but for calculator commit 1b4570bc08b35ba98d48b3a8465948949cf5a31f Author: Eli Barzilay Date: Fri Nov 27 10:21:30 2015 -0500 * lisp/calculator.el: Re-do key bindings. Use a helper function that arranges a parent keymap that binds alternate case keys so if some letter key is unbound and it's un/shifted version is, it will get used. This makes the global-map trickery unnecessary. Also switch to passing strings that name keys through `kbd'. diff --git a/lisp/calculator.el b/lisp/calculator.el index 55ef461..3d44b6d 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -290,7 +290,7 @@ user-defined operators, use `calculator-user-operators' instead.") (defvar calculator-operators nil "The calculator operators, each a list with: -1. The key that is bound to for this operation, a string that is +1. The key(s) that is bound to for this operation, a string that is used with `kbd'; 2. The displayed symbol for this function; @@ -313,8 +313,8 @@ user-defined operators, use `calculator-user-operators' instead.") It it possible have a unary prefix version of a binary operator if it comes later in this list. If the list begins with the symbol `nobind', -then no key binding will take place -- this is only useful for -predefined keys. +then no key binding will take place -- this is only used for predefined +keys. Use `calculator-user-operators' to add operators to this list, see its documentation for an example.") @@ -371,74 +371,95 @@ Used for repeating operations in calculator-repR/L.") (list (cons ?e float-e) (cons ?p float-pi))) "The association list of calculator register values.") -(defvar calculator-saved-global-map nil - "Saved global key map.") - (defvar calculator-restart-other-mode nil "Used to hack restarting with the electric mode changed.") ;;;--------------------------------------------------------------------- ;;; Key bindings +(defun calculator-define-key (key cmd &optional map) + ;; arranges for unbound alphabetic keys to be used as their un/shifted + ;; versions if those are bound (mimics the usual Emacs global + ;; bindings) + (let* ((key (if (stringp key) (kbd key) key)) + (map (or map calculator-mode-map)) + (omap (keymap-parent map))) + (define-key map key cmd) + ;; "other" map, used for case-flipped bindings + (unless omap + (setq omap (make-sparse-keymap)) + (suppress-keymap omap t) + (set-keymap-parent map omap)) + (let ((m omap)) + ;; bind all case-flipped versions + (dotimes (i (length key)) + (let* ((c (aref key i)) + (k (vector c)) + (b (lookup-key m k)) + (defkey (lambda (x) + (define-key m k x) + (when (and (characterp c) + (or (<= ?A c ?Z) (<= ?a c ?z))) + (define-key m (vector (logxor 32 c)) x))))) + (cond ((= i (1- (length key))) + ;; prefer longer sequences + (unless (keymapp b) (funcall defkey cmd))) + ((keymapp b) (setq m b)) + (t (let ((sub (make-sparse-keymap))) + (funcall defkey sub) + (setq m sub))))))))) + (defvar calculator-mode-map (let ((map (make-sparse-keymap))) (suppress-keymap map t) - (define-key map "i" nil) - (define-key map "o" nil) - (let ((p - '((calculator-open-paren "[") - (calculator-close-paren "]") - (calculator-op-or-exp "+" "-" [kp-add] [kp-subtract]) - (calculator-digit "0" "1" "2" "3" "4" "5" "6" "7" "8" - "9" "a" "b" "c" "d" "f" - [kp-0] [kp-1] [kp-2] [kp-3] [kp-4] - [kp-5] [kp-6] [kp-7] [kp-8] [kp-9]) - (calculator-op [kp-divide] [kp-multiply]) - (calculator-decimal "." [kp-decimal]) - (calculator-exp "e") - (calculator-dec/deg-mode "D") - (calculator-set-register "s") - (calculator-get-register "g") - (calculator-radix-mode "H" "X" "O" "B") - (calculator-radix-input-mode "id" "ih" "ix" "io" "ib" - "iD" "iH" "iX" "iO" "iB") - (calculator-radix-output-mode "od" "oh" "ox" "oo" "ob" - "oD" "oH" "oX" "oO" "oB") - (calculator-rotate-displayer "'") - (calculator-rotate-displayer-back "\"") - (calculator-displayer-prev "{") - (calculator-displayer-next "}") - (calculator-saved-up [up] [?\C-p]) - (calculator-saved-down [down] [?\C-n]) - (calculator-quit "q" [?\C-g]) - (calculator-enter [enter] [linefeed] [kp-enter] - [return] [?\r] [?\n]) - (calculator-save-on-list " " [space]) - (calculator-clear-saved [?\C-c] [(control delete)]) - (calculator-save-and-quit [(control return)] - [(control kp-enter)]) - (calculator-paste [insert] [(shift insert)] - [paste] [mouse-2] [?\C-y]) - (calculator-clear [delete] [?\C-?] [?\C-d]) - (calculator-help [?h] [??] [f1] [help]) - (calculator-copy [(control insert)] [copy]) - (calculator-backspace [backspace]) - ))) - (while p - ;; reverse the keys so earlier definitions come last -- makes - ;; the more sensible bindings visible in the menu - (let ((func (caar p)) (keys (reverse (cdar p)))) - (while keys - (define-key map (car keys) func) - (setq keys (cdr keys)))) - (setq p (cdr p)))) + (dolist (x '((calculator-digit + "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" + "d" "f" "" "" "" "" "" + "" "" "" "" "") + (calculator-open-paren "[") + (calculator-close-paren "]") + (calculator-op-or-exp "+" "-" + "" "") + (calculator-op "" "") + (calculator-decimal "." "") + (calculator-exp "e") + (calculator-dec/deg-mode "D") + (calculator-set-register "s") + (calculator-get-register "g") + (calculator-radix-mode "H" "X" "O" "B") + (calculator-radix-input-mode "iD" "iH" "iX" "iO" "iB") + (calculator-radix-output-mode "oD" "oH" "oX" "oO" "oB") + (calculator-rotate-displayer "'") + (calculator-rotate-displayer-back "\"") + (calculator-displayer-prev "{") + (calculator-displayer-next "}") + (calculator-saved-up "" "C-p") + (calculator-saved-down "" "C-n") + (calculator-quit "q" "C-g") + (calculator-enter "" "" + "" "" + "RET" "LFD") + (calculator-save-on-list "SPC" "") + (calculator-clear-saved "C-c" "") + (calculator-save-and-quit "" "") + (calculator-paste "" "" + "" "" "C-y") + (calculator-clear "" "DEL" "C-d") + (calculator-help "h" "?" "" "") + (calculator-copy "" "") + (calculator-backspace "") + )) + ;; reverse the keys so earlier definitions come last -- makes the + ;; more sensible bindings visible in the menu + (dolist (k (reverse (cdr x))) + (calculator-define-key k (car x) map))) (if calculator-bind-escape - (progn (define-key map [?\e] 'calculator-quit) - (define-key map [escape] 'calculator-quit)) - (define-key map [?\e ?\e ?\e] 'calculator-quit)) + (progn (calculator-define-key "ESC" 'calculator-quit map) + (calculator-define-key "" 'calculator-quit map)) + (calculator-define-key "ESC ESC ESC" 'calculator-quit map)) ;; make C-h work in text-mode (unless window-system - (define-key map [?\C-h] 'calculator-backspace)) + (calculator-define-key "C-h" 'calculator-backspace map)) ;; set up a menu (when (and calculator-use-menu (not (boundp 'calculator-menu))) (let ((radix-selectors @@ -691,19 +712,14 @@ See the documentation for `calculator-mode' for more information." (if calculator-electric-mode (save-window-excursion (require 'electric) (message nil) ; hide load message - (let (old-g-map old-l-map - (old-buf (window-buffer (minibuffer-window))) + (let ((old-buf (window-buffer (minibuffer-window))) (echo-keystrokes 0) (garbage-collection-messages nil)) ; no gc msg when electric (set-window-buffer (minibuffer-window) calculator-buffer) (select-window (minibuffer-window)) (calculator-reset) (calculator-update-display) - (setq old-l-map (current-local-map) - old-g-map (current-global-map) - calculator-saved-global-map (current-global-map)) - (use-local-map nil) - (use-global-map calculator-mode-map) + (use-local-map calculator-mode-map) (run-hooks 'calculator-mode-hook) (unwind-protect (catch 'calculator-done @@ -714,9 +730,7 @@ See the documentation for `calculator-mode' for more information." nil (lambda (_x _y) (calculator-update-display)))) (set-window-buffer (minibuffer-window) old-buf) - (kill-buffer calculator-buffer) - (use-local-map old-l-map) - (use-global-map old-g-map)))) + (kill-buffer calculator-buffer)))) (progn (cond ((not (get-buffer-window calculator-buffer)) @@ -783,23 +797,11 @@ Defaults to 1." Adds MORE-OPS to `calculator-operator', called initially to handle `calculator-initial-operators' and `calculator-user-operators'." (let ((added-ops nil)) - (while more-ops - (unless (eq (caar more-ops) 'nobind) - (let ((i -1) (key (caar more-ops))) - ;; make sure the key is undefined, so it's easy to define - ;; prefix keys - (while (< (setq i (1+ i)) (length key)) - (unless (keymapp (lookup-key calculator-mode-map - (substring key 0 (1+ i)))) - (define-key calculator-mode-map (substring key 0 (1+ i)) - nil) - (setq i (length key)))) - (define-key calculator-mode-map key 'calculator-op))) - (push (if (eq (caar more-ops) 'nobind) - (cdar more-ops) - (car more-ops)) - added-ops) - (setq more-ops (cdr more-ops))) + (dolist (op more-ops) + (unless (eq (car op) 'nobind) + (calculator-define-key (car op) 'calculator-op)) + (push (if (eq (car op) 'nobind) (cdr op) op) + added-ops)) ;; added-ops come first, but in correct order (setq calculator-operators (append (nreverse added-ops) calculator-operators)))) @@ -1569,14 +1571,11 @@ registers." (if (eq last-command 'calculator-help) (let ((mode-name "Calculator") (major-mode 'calculator-mode) - (g-map (current-global-map)) (win (selected-window))) (require 'ehelp) (if (not calculator-electric-mode) (describe-mode) - (progn (use-global-map calculator-saved-global-map) - (electric-describe-mode) - (use-global-map g-map))) + (electric-describe-mode)) (select-window win) (message nil)) (let ((one (one-window-p t)) commit e875e68b325f1d621a21798d4c4244790ecaf77f Author: Eli Barzilay Date: Tue Nov 24 13:39:17 2015 -0500 * lisp/calculator.el: improve radix modes Fix prompt for some input radix with decimal output (eg, "BD" instead of the incorrect "B="); also, some minor docstring tweaks for these. diff --git a/lisp/calculator.el b/lisp/calculator.el index b1cda28..55ef461 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -621,16 +621,17 @@ argument. hex/oct/bin modes can be set for input and for display separately. Another toggle-able mode is for using degrees instead of radians for trigonometric functions. -The keys to switch modes are (`X' is shortcut for `H'): +The keys to switch modes are (both `H' and `X' are for hex): * `D' switch to all-decimal mode, or toggle degrees/radians * `B' `O' `H' `X' binary/octal/hexadecimal modes for input & display * `i' `o' followed by one of `D' `B' `O' `H' `X' (case insensitive) sets only the input or display radix mode The prompt indicates the current modes: -* \"D=\": degrees mode; -* \"?=\": (? is B/O/H) this is the radix for both input and output; -* \"=?\": (? is B/O/H) the display radix (when input is decimal); -* \"??\": (? is D/B/O/H) 1st char for input radix, 2nd for display. +* \"==\": decimal mode (using radians); +* \"D=\": decimal mode using degrees; +* \"?=\": ? is B/O/H, the radix for both input and output; +* \"=?\": ? is B/O/H, the display radix (with decimal input); +* \"??\": ? is D/B/O/H, 1st char for input radix, 2nd for display. Also, the quote key can be used to switch display modes for decimal numbers (double-quote rotates back), and the two brace characters @@ -831,7 +832,7 @@ The result should not exceed the screen width." (cond ((or in-r out-r) (concat (or in-r "=") (if (equal in-r out-r) "=" - (or out-r "=")))) + (or out-r "D")))) (calculator-deg "D=") (t "==")))) (expr @@ -1555,8 +1556,8 @@ registers." * I inverse the next trig function \ * \\='/\"/{/} - display/display args * D - switch to all-decimal, or toggle deg/rad mode -* B/O/H/X - binary/octal/hex mode for i/o (X is a shortcut for H) -* i/o - prefix for d/b/o/x - set only input/output modes +* B/O/H/X - binary/octal/hex mode for i/o (both H and X are for hex) +* i/o - prefix for D/B/O/X - set only input/output modes * enter/= - evaluate current expr. * s/g - set/get a register * space - evaluate & save on list * l/v - list total/average * up/down/C-p/C-n - browse saved * C-delete - clear all saved commit 5d74a02eb7c063aeea8f16ea2dcd4dd8b5ee85a1 Author: Eli Barzilay Date: Sun Nov 22 22:37:11 2015 -0500 * lisp/calculator.el: better reading of register names Use `register-read-with-preview' with a dynamically bound `register-alist' and a proper preview function to read register names. diff --git a/lisp/calculator.el b/lisp/calculator.el index 7ff1a33..b1cda28 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -1486,20 +1486,6 @@ Optional string argument KEYS will force using it as the keys entered." (kill-new (replace-regexp-in-string "^\\([^ ]+\\) *\\(\\[[0-9/]+\\]\\)? *$" "\\1" s)))))) -(defun calculator-set-register (reg) - "Set a register value for REG." - ;; FIXME: this should use `register-read-with-preview', but it uses - ;; calculator-registers rather than `register-alist'. (Maybe - ;; dynamically rebinding it will get blessed?) Also in to - ;; `calculator-get-register'. - (interactive "cRegister to store into: ") - (let* ((as (assq reg calculator-registers)) - (val (progn (calculator-enter) (car calculator-stack)))) - (if as - (setcdr as val) - (push (cons reg val) calculator-registers)) - (calculator-message "[%c] := %S" reg val))) - (defun calculator-put-value (val) "Paste VAL as if entered. Used by `calculator-paste' and `get-register'." @@ -1528,9 +1514,33 @@ Used by `calculator-paste' and `get-register'." (or (match-string 3 str) "")))) (ignore-errors (calculator-string-to-number str))))) +(defun calculator-register-read-with-preview (prompt) + "Similar to `register-read-with-preview' but for calculator +registers." + (let ((register-alist calculator-registers) + (register-preview-delay 1) + (register-preview-function + (lambda (r) + (format "%s: %s\n" + (single-key-description (car r)) + (calculator-number-to-string (cdr r)))))) + (register-read-with-preview prompt))) + +(defun calculator-set-register (reg) + "Set a register value for REG." + (interactive (list (calculator-register-read-with-preview + "Register to store value into: "))) + (let* ((as (assq reg calculator-registers)) + (val (progn (calculator-enter) (car calculator-stack)))) + (if as + (setcdr as val) + (push (cons reg val) calculator-registers)) + (calculator-message "[%c] := %S" reg val))) + (defun calculator-get-register (reg) "Get a value from a register REG." - (interactive "cRegister to get value from: ") + (interactive (list (calculator-register-read-with-preview + "Register to get value from: "))) (calculator-put-value (cdr (assq reg calculator-registers)))) (declare-function electric-describe-mode "ehelp" ()) commit fb9ed79c396ed6040a0def1a6da93809a31b6ebf Author: Eli Barzilay Date: Sun Nov 22 22:11:15 2015 -0500 * lisp/calculator.el: General improvements Use things like `when', `unless', and `push'. Improve `calculator-last-input' so it doesn't barf when hitting `F1' in non-electric mode. diff --git a/lisp/calculator.el b/lisp/calculator.el index 80b7c07..7ff1a33 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -65,7 +65,7 @@ Note that this requires easymenu. Must be set before loading." :group 'calculator) (defcustom calculator-unary-style 'postfix - "Value is either 'prefix or 'postfix. + "Value is either `prefix' or `postfix'. This determines the default behavior of unary operators." :type '(choice (const prefix) (const postfix)) :group 'calculator) @@ -195,9 +195,9 @@ For example, use this to define the golden ratio number: before you load calculator." :type '(repeat (cons character number)) :set (lambda (_ val) - (and (boundp 'calculator-registers) - (setq calculator-registers - (append val calculator-registers))) + (when (boundp 'calculator-registers) + (setq calculator-registers + (append val calculator-registers))) (setq calculator-user-registers val)) :group 'calculator) @@ -221,10 +221,10 @@ Examples: (\"tF\" mt-to-ft (/ X 0.3048) 1) (\"tM\" ft-to-mt (* X 0.3048) 1))) -* Using a function-like form is very simple: use `X' for the argument - (`Y' for the second in case of a binary operator), `TX' is a truncated +* Using a function-like form is simple: use `X' for the argument (`Y' + for a second one in case of a binary operator), `TX' is a truncated version of `X' and `F' for a recursive call. Here is a [very - inefficient] Fibonacci number calculation: + inefficient] Fibonacci number operator: (add-to-list \\='calculator-user-operators \\='(\"F\" fib @@ -290,7 +290,8 @@ user-defined operators, use `calculator-user-operators' instead.") (defvar calculator-operators nil "The calculator operators, each a list with: -1. The key that is bound to for this operation (usually a string); +1. The key that is bound to for this operation, a string that is + used with `kbd'; 2. The displayed symbol for this function; @@ -332,10 +333,10 @@ documentation for an example.") "A table to convert input characters to corresponding radix symbols.") (defvar calculator-output-radix nil - "The mode for display, one of: nil (decimal), 'bin, 'oct or 'hex.") + "The mode for display, one of: nil (decimal), `bin', `oct' or `hex'.") (defvar calculator-input-radix nil - "The mode for input, one of: nil (decimal), 'bin, 'oct or 'hex.") + "The mode for input, one of: nil (decimal), `bin', `oct' or `hex'.") (defvar calculator-deg nil "Non-nil if trig functions operate on degrees instead of radians.") @@ -436,7 +437,8 @@ Used for repeating operations in calculator-repR/L.") (define-key map [escape] 'calculator-quit)) (define-key map [?\e ?\e ?\e] 'calculator-quit)) ;; make C-h work in text-mode - (or window-system (define-key map [?\C-h] 'calculator-backspace)) + (unless window-system + (define-key map [?\C-h] 'calculator-backspace)) ;; set up a menu (when (and calculator-use-menu (not (boundp 'calculator-menu))) (let ((radix-selectors @@ -530,9 +532,9 @@ Used for repeating operations in calculator-repR/L.") ("Modes" ["Radians" (progn - (and (or calculator-input-radix calculator-output-radix) - (calculator-radix-mode "D")) - (and calculator-deg (calculator-dec/deg-mode))) + (when (or calculator-input-radix calculator-output-radix) + (calculator-radix-mode "D")) + (when calculator-deg (calculator-dec/deg-mode))) :keys "D" :style radio :selected (not (or calculator-input-radix @@ -540,9 +542,9 @@ Used for repeating operations in calculator-repR/L.") calculator-deg))] ["Degrees" (progn - (and (or calculator-input-radix calculator-output-radix) - (calculator-radix-mode "D")) - (or calculator-deg (calculator-dec/deg-mode))) + (when (or calculator-input-radix calculator-output-radix) + (calculator-radix-mode "D")) + (unless calculator-deg (calculator-dec/deg-mode))) :keys "D" :style radio :selected (and calculator-deg @@ -696,9 +698,9 @@ See the documentation for `calculator-mode' for more information." (select-window (minibuffer-window)) (calculator-reset) (calculator-update-display) - (setq old-l-map (current-local-map)) - (setq old-g-map (current-global-map)) - (setq calculator-saved-global-map (current-global-map)) + (setq old-l-map (current-local-map) + old-g-map (current-global-map) + calculator-saved-global-map (current-global-map)) (use-local-map nil) (use-global-map calculator-mode-map) (run-hooks 'calculator-mode-hook) @@ -781,23 +783,21 @@ Adds MORE-OPS to `calculator-operator', called initially to handle `calculator-initial-operators' and `calculator-user-operators'." (let ((added-ops nil)) (while more-ops - (or (eq (caar more-ops) 'nobind) - (let ((i -1) (key (caar more-ops))) - ;; make sure the key is undefined, so it's easy to define - ;; prefix keys - (while (< (setq i (1+ i)) (length key)) - (or (keymapp - (lookup-key calculator-mode-map - (substring key 0 (1+ i)))) - (progn - (define-key - calculator-mode-map (substring key 0 (1+ i)) nil) - (setq i (length key))))) - (define-key calculator-mode-map key 'calculator-op))) - (setq added-ops (cons (if (eq (caar more-ops) 'nobind) - (cdar more-ops) - (car more-ops)) - added-ops)) + (unless (eq (caar more-ops) 'nobind) + (let ((i -1) (key (caar more-ops))) + ;; make sure the key is undefined, so it's easy to define + ;; prefix keys + (while (< (setq i (1+ i)) (length key)) + (unless (keymapp (lookup-key calculator-mode-map + (substring key 0 (1+ i)))) + (define-key calculator-mode-map (substring key 0 (1+ i)) + nil) + (setq i (length key)))) + (define-key calculator-mode-map key 'calculator-op))) + (push (if (eq (caar more-ops) 'nobind) + (cdar more-ops) + (car more-ops)) + added-ops) (setq more-ops (cdr more-ops))) ;; added-ops come first, but in correct order (setq calculator-operators @@ -808,11 +808,11 @@ Adds MORE-OPS to `calculator-operator', called initially to handle (defun calculator-reset () "Reset calculator variables." - (or calculator-restart-other-mode - (setq calculator-stack nil - calculator-curnum nil - calculator-stack-display nil - calculator-display-fragile nil)) + (unless calculator-restart-other-mode + (setq calculator-stack nil + calculator-curnum nil + calculator-stack-display nil + calculator-display-fragile nil)) (setq calculator-restart-other-mode nil) (calculator-update-display)) @@ -911,9 +911,7 @@ If radix output mode is active, toggle digit grouping." (if (and new-disp (memq new-disp calculator-displayers)) (let ((tmp nil)) (while (not (eq (car calculator-displayers) new-disp)) - (setq tmp (cons (car calculator-displayers) tmp)) - (setq calculator-displayers - (cdr calculator-displayers))) + (push (pop calculator-displayers) tmp)) (setq calculator-displayers (nconc calculator-displayers (nreverse tmp)))) (nconc (cdr calculator-displayers) @@ -938,11 +936,11 @@ If radix output mode is active, increase the grouping size." (progn (setq calculator-radix-grouping-digits (1+ calculator-radix-grouping-digits)) (calculator-enter)) - (and (car calculator-displayers) - (let ((disp (caar calculator-displayers))) - (cond ((symbolp disp) (funcall disp 'left)) - ((and (consp disp) (eq 'std (car disp))) - (calculator-standard-displayer 'left))))))) + (when (car calculator-displayers) + (let ((disp (caar calculator-displayers))) + (cond ((symbolp disp) (funcall disp 'left)) + ((and (consp disp) (eq 'std (car disp))) + (calculator-standard-displayer 'left))))))) (defun calculator-displayer-next () "Send the current displayer function a `right' argument. @@ -954,11 +952,11 @@ If radix output mode is active, decrease the grouping size." (progn (setq calculator-radix-grouping-digits (max 2 (1- calculator-radix-grouping-digits))) (calculator-enter)) - (and (car calculator-displayers) - (let ((disp (caar calculator-displayers))) - (cond ((symbolp disp) (funcall disp 'right)) - ((and (consp disp) (eq 'std (car disp))) - (calculator-standard-displayer 'right))))))) + (when (car calculator-displayers) + (let ((disp (caar calculator-displayers))) + (cond ((symbolp disp) (funcall disp 'right)) + ((and (consp disp) (eq 'std (car disp))) + (calculator-standard-displayer 'right))))))) (defun calculator-remove-zeros (numstr) "Get a number string NUMSTR and remove unnecessary zeros. @@ -1003,10 +1001,10 @@ The special `left' and `right' symbols will make it change the current number of digits displayed (`calculator-number-digits')." (if (symbolp num) (cond ((eq num 'left) - (and (> calculator-number-digits 0) - (setq calculator-number-digits - (1- calculator-number-digits)) - (calculator-enter))) + (when (> calculator-number-digits 0) + (setq calculator-number-digits + (1- calculator-number-digits)) + (calculator-enter))) ((eq num 'right) (setq calculator-number-digits (1+ calculator-number-digits)) @@ -1054,7 +1052,7 @@ the `left' or `right' when one of the standard modes is used." (while (< i 0) (setq num (/ num 1000.0)) (setq exp (+ exp 3)) (setq i (1+ i)))))) - (or calculator-eng-tmp-show (setq calculator-eng-extra nil)) + (unless calculator-eng-tmp-show (setq calculator-eng-extra nil)) (let ((str (format (format "%%.%sf" calculator-number-digits) num))) (concat (let ((calculator-remove-zeros @@ -1206,7 +1204,7 @@ arguments." (DX (if (and X calculator-deg) (degrees-to-radians X) X)) (L calculator-saved-list) (fF `(calculator-funcall ',f x y)) - (fD `(if calculator-deg (* radians-to-degrees x) x))) + (fD `(if calculator-deg (radians-to-degrees x) x))) (eval `(cl-flet ((F (&optional x y) ,fF) (D (x) ,fD)) (let ((X ,X) (Y ,Y) (DX ,DX) (TX ,TX) (TY ,TY) (L ',L)) ,f)) @@ -1216,19 +1214,20 @@ arguments." ;;; Input interaction (defun calculator-last-input (&optional keys) - "Last char (or event or event sequence) that was read. -Use KEYS if given, otherwise use `this-command-keys'." - (let ((inp (or keys (this-command-keys)))) - (if (or (stringp inp) (not (arrayp inp))) + "Return the last key sequence that was used to invoke this command, or +the input KEYS. Uses the `function-key-map' translate keypad numbers to +plain ones." + (let* ((inp (or keys (this-command-keys))) + (inp (or (and (arrayp inp) (not (stringp inp)) + (lookup-key function-key-map inp)) + inp))) + (if (or (not inp) (stringp inp) (not (arrayp inp)) + (catch 'done ; any non-chars? + (dotimes (i (length inp)) + (unless (characterp (aref inp i)) (throw 'done t))) + nil)) inp - ;; Translates kp-x to x and [tries to] create a string to lookup - ;; operators; assume all symbols are translatable via - ;; `function-key-map'. This is needed because we have key - ;; bindings for kp-* (which might be the wrong thing to do) so - ;; they don't get translated in `this-command-keys'. - (concat (mapcar (lambda (k) - (if (numberp k) k (error "??bad key?? (%S)" k))) - (or (lookup-key function-key-map inp) inp)))))) + (concat inp)))) (defun calculator-clear-fragile (&optional op) "Clear the fragile flag if it was set, then maybe reset all. @@ -1270,7 +1269,7 @@ OP is the operator (if any) that caused this call." (calculator-update-display))) (defun calculator-exp () - "Enter an `E' exponent character, or a digit in hex input mode." + "Enter an exponent, or an \"E\" digit in hex input mode." (interactive) (cond (calculator-input-radix (calculator-digit)) @@ -1312,18 +1311,13 @@ Optional string argument KEYS will force using it as the keys entered." (throw 'op-error nil)) (push op calculator-stack) (calculator-reduce-stack (calculator-op-prec op)) - (and (= (length calculator-stack) 1) - (numberp (car calculator-stack)) - ;; the display is fragile if it contains only one number - (setq calculator-display-fragile t) - ;; add number to the saved-list - calculator-add-saved - (if (= 0 calculator-saved-ptr) - (setq calculator-saved-list - (cons (car calculator-stack) calculator-saved-list)) - (let ((p (nthcdr (1- calculator-saved-ptr) - calculator-saved-list))) - (setcdr p (cons (car calculator-stack) (cdr p)))))) + (when (and (= (length calculator-stack) 1) + (numberp (car calculator-stack))) + ;; the display is fragile if it contains only one number + (setq calculator-display-fragile t) + (when calculator-add-saved ; add number to the saved-list + (push (car calculator-stack) + (nthcdr calculator-saved-ptr calculator-saved-list)))) (calculator-update-display)))) (defun calculator-op-or-exp () @@ -1346,8 +1340,8 @@ operators)." (interactive) (calculator-push-curnum) (if (or calculator-input-radix calculator-output-radix) - (progn (setq calculator-input-radix nil) - (setq calculator-output-radix nil)) + (setq calculator-input-radix nil + calculator-output-radix nil) ;; already decimal -- toggle degrees mode (setq calculator-deg (not calculator-deg))) (calculator-update-display t)) @@ -1393,8 +1387,8 @@ Optional string argument KEYS will force using it as the keys entered." (defun calculator-clear-saved () "Clear the list of saved values in `calculator-saved-list'." (interactive) - (setq calculator-saved-list nil) - (setq calculator-saved-ptr 0) + (setq calculator-saved-list nil + calculator-saved-ptr 0) (calculator-update-display t)) (defun calculator-saved-move (n) @@ -1503,8 +1497,7 @@ Optional string argument KEYS will force using it as the keys entered." (val (progn (calculator-enter) (car calculator-stack)))) (if as (setcdr as val) - (setq calculator-registers - (cons (cons reg val) calculator-registers))) + (push (cons reg val) calculator-registers)) (calculator-message "[%c] := %S" reg val))) (defun calculator-put-value (val) @@ -1525,16 +1518,14 @@ Used by `calculator-paste' and `get-register'." (calculator-put-value (let ((str (replace-regexp-in-string "^ *\\(.+[^ ]\\) *$" "\\1" (current-kill 0)))) - (and (not calculator-input-radix) - calculator-paste-decimals - (string-match "\\([0-9]+\\)\\(\\.[0-9]+\\)?\\(e[0-9]+\\)?" - str) - (or (match-string 1 str) - (match-string 2 str) - (match-string 3 str)) - (setq str (concat (or (match-string 1 str) "0") - (or (match-string 2 str) ".0") - (or (match-string 3 str) "")))) + (when (and (not calculator-input-radix) + calculator-paste-decimals + (string-match + "\\([0-9]+\\)\\(\\.[0-9]+\\)?\\(e[0-9]+\\)?" + str)) + (setq str (concat (or (match-string 1 str) "0") + (or (match-string 2 str) ".0") + (or (match-string 3 str) "")))) (ignore-errors (calculator-string-to-number str))))) (defun calculator-get-register (reg) @@ -1551,7 +1542,8 @@ Used by `calculator-paste' and `get-register'." + - * / \\(div) %(rem) _(-X,postfix) ;(1/X,postfix) ^(exp) L(og) Q(sqrt) !(fact) S(in) C(os) T(an) |(or) #(xor) &(and) ~(not) * >/< repeats last binary operation with its 2nd (1st) arg as postfix op -* I inverses next trig function * \\='/\"/{} - display/display args +* I inverse the next trig function \ +* \\='/\"/{/} - display/display args * D - switch to all-decimal, or toggle deg/rad mode * B/O/H/X - binary/octal/hex mode for i/o (X is a shortcut for H) * i/o - prefix for d/b/o/x - set only input/output modes @@ -1569,12 +1561,11 @@ Used by `calculator-paste' and `get-register'." (g-map (current-global-map)) (win (selected-window))) (require 'ehelp) - (when calculator-electric-mode - (use-global-map calculator-saved-global-map)) - (if calculator-electric-mode - (electric-describe-mode) - (describe-mode)) - (when calculator-electric-mode (use-global-map g-map)) + (if (not calculator-electric-mode) + (describe-mode) + (progn (use-global-map calculator-saved-global-map) + (electric-describe-mode) + (use-global-map g-map))) (select-window win) (message nil)) (let ((one (one-window-p t)) commit f4ded42cf84ba349a7187d0f27ed8a9025b9b54c Author: Michael Albinus Date: Sun Nov 29 14:22:28 2015 +0100 ; Manual Cleanup of ChangeLog.2 diff --git a/ChangeLog.2 b/ChangeLog.2 index 8a3575a..3ebd2da 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -281,32 +281,6 @@ * src/lisp.h: Declare extern globals_of_kqueue and syms_of_kqueue. -2015-11-25 Michael Albinus - - Some final fixes in file notification before merging with master - - * lisp/filenotify.el (file-notify--rm-descriptor): Remove WHAT arg. - (file-notify-callback): Improve check for `stopped' event. Call - `file-notify-rm-watch' rather than `file-notify--rm-descriptor'. - (file-notify-add-watch): In case FILE is not a directory, call the - file monitor for the kqueue backend. Otherwise, call the - directory monitor for the upper directory. - - * src/inotify.c (inotifyevent_to_event): Extract file name from - watch_object if the event doesn't provide it. - (Finotify_add_watch): Add file name to watch_object. - - * test/automated/file-notify-tests.el (file-notify--test-timeout): - Use different timeouts for different libraries. - (file-notify--test-with-events): Suppress lock files. Flush - outstanding events before running the body. - (file-notify-test02-events, file-notify-test04-file-validity): Do - not skip cygwin tests. Add additional test for file creation. - Adapt expected result for different backends. - (file-notify-test03-autorevert): Some of the tests don't work for - w32notify. - (file-notify-test06-many-events): Rename into both directions. - 2015-11-24 Phillip Lord Update elisp-mode-tests for changed file location. commit 3c6aa32103336253895c2867d99302bcc05ba9fb Author: Michael Albinus Date: Sun Nov 29 14:10:54 2015 +0100 ; Manual Cleanup of ChangeLog.2 diff --git a/ChangeLog.2 b/ChangeLog.2 index d779565..8a3575a 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -66,97 +66,6 @@ 2015-11-25 Michael Albinus - Mention kqueue in NEWS - -2015-11-25 Michael Albinus - - Merge from scratch/kqueue - - bec57a4 Some final fixes in file notification before merging with master - 0247489 Rework file notifications, kqueue has problems with directory monitors - 5154781 Continie with pending events - 6b490c0 Improve loops in file-notify-test06-many-events - c8e266f Handle more complex rename operation in kqueue - 5044bdf New test with a larger number of events. - 65ba5a9 Further fixes for kqueue. - 13f3508 Code cleanup of kqueue.c - 99aa855 Doc changes for kqueue - 8deebe1 Finish implementation in kqueue.c - 90d6c69 * lisp/filenotify.el (file-notify-add-watch): Fix thinko. - e95b309 More work on kqueue - 41d9bd0 Implement directory events - c571fc1 Build fixes for kqueue support. - e0a68f2 Continue kqueue implementation - 7543d1c Work on kqueue - e3354e2 Add kqueue support - c6457ce Minor fix to comment indentation and typo in last commit - b92307f linum-mode plays more nicely with other margin-setting extensions - 58e6235 * lisp/image-mode.el: Support encrypted file - 9375652 * lisp/progmodes/verilog-mode.el (verilog-save-buffer-state): Add backquote - 47f83b6 ; ChangeLog.2 fixes - 7cc233e * lisp/emacs-lisp/package.el: Fix a decoding issue - 5f9153f * lisp/emacs-lisp/package.el: Refactor -with-work-buffer-async - 353f5e7 * lisp/progmodes/verilog-mode.el: Use with-silent-modifications - 70f1fda ; Auto-commit of ChangeLog files. - ae0653b * CONTRIBUTE: Remove information about feature freeze. - 9459456 Merge branch 'release-process-lowercase' - 9a4aa0f Document the release process - f8cc14b * admin/release-process: Rename from admin/FOR-RELEASE. - dcd5877 gitmerge: Fix git log command - 2ac79ae gitmerge: Try to detect cherry-picks - 5f7a2a9 Increment Emacs version on master branch - ed2e7e2 Mention CONTRIBUTE in README - 9e00a02 Update verilog-mode.el to 2015-11-09-b121d60-vpo. - 138ad3d ; Fix warnings - 7126e9a ; Update xref-etags-mode for the latest change - 246d660 Use generic dispatch for xref backends - 31f6e93 Support rectangular regions for more commands - f103a27 Handle multiple matches on the same line; add highlighting - fe973fc Replace xref-match-bounds with xref-match-length - 92a5010 Merge from gnulib - 04ac097 Spruce up ftfont.c memory allocation - 4c4b520 Port recent XCB changes to 64-bit ‘long int’ - 4f0ce9c * src/undo.c (run_undoable_change): Now static. - 695a6f9 Remove support for ':timeout' from w32 tray notifications - a731c2f * test/automated/simple-test.el: Add test for bug#20698 (bug#21885) - 2b4c0c0 * lisp/progmodes/elisp-mode.el: Declare function `project-roots' - 66b9f7b * src/undo.c: Small fixes for previous change - 2fac30e Add a few more variables to redisplay--variables - 04f69f1 * lisp/loadup.el: Enlarge the size of the hash table to 80000. - e221d32 Fix point positioning after transposing with negative arg - 35f5afb Fix last change in shr.el - 508e77b Fix last change - d60ed3f Another fix for MinGW64 and Cygwin builds due to notifications - 805a39b Remove intern calls and XXX comments from Fx_export_frames - 9463abf shr: don't invoke unbound function (Bug#21895) - 6e5186e * test/automated/keymaps-test.el: Fix test to make it repeatable - 0c92826 * test/automated/cl-lib-tests.el (cl-lib-struct-constructors): Small fix - 39dbd1c : Tests for undo-auto functionality. - 20aa42e ; Merge branch 'fix/no-undo-boundary-on-secondary-buffer-change' - 44dfa86 The heuristic that Emacs uses to add an `undo-boundary' has been reworked, as it interacts poorly with functions on `post-command-hook' or `after-change-functions'. - d2f73db Bind [?\S-\ ] to previous line command in Dired-like modes. - c1bc6e5 Fix the MinGW64 and Cygwin-w32 builds - 1e363a8 Enable sorting of JSON object keys when encoding - 9dd7da9 * test/automated/keymap-tests.el: New test file - aa17de9 Speed up x_real_pos_and_offsets using XCB - a838c83 Enable use of XCB for checking window manager state - c7f2b6a Detect XCB and save a connection handle - e1c27db Reduce some data dependencies between X calls - 25e32bd Use color cache for creating bitmap - 851be0f Add "^" to the interactive specs of `dired-next/previous-line' - 055ca3a Sync with soap-client repository, version 3.0.2 - e0f64e7 CC Mode: Respect users' settings of open-paren-in-column-0-is-defun-start. - 952395d * lisp/obarray.el: Fix shadowed variables - 436d330 Avoid error in submitting a form with EWW - e887f6e ; * doc/lispref/os.texi: Fix indentation of sample code. - 51d840a Rename seq-p and map-p to seqp and mapp - 23036ba Rename obarray-p to obarrayp - 20aea42 Rename obarray-foreach to obarray-map - a3b2101 New file with obarray functions. - 9d43941 Implement tray notifications for MS-Windows - -2015-11-25 Michael Albinus - Some final fixes in file notification before merging with master * lisp/filenotify.el (file-notify--rm-descriptor): Remove WHAT arg. @@ -204,7 +113,7 @@ 2015-11-25 Michael Albinus - Continie with pending events + Continue with pending events * src/kqueue.c (pending_events): Remove global variable. (kqueue_compare_dir_list): Create `write' event for not used @@ -233,7 +142,7 @@ 2015-11-25 Wolfgang Jenkner - New test with a larger number of events. + New test with a larger number of events * test/automated/file-notify-tests.el (file-notify--test-with-events): Make timeout heuristically depend on the number of events. @@ -242,7 +151,7 @@ 2015-11-25 Michael Albinus - Further fixes for kqueue. + Further fixes for kqueue * lisp/filenotify.el (file-notify-callback): Raise also event if directory name matches. @@ -323,7 +232,7 @@ 2015-11-25 Wolfgang Jenkner - Build fixes for kqueue support. + Build fixes for kqueue support * src/kqueue.c (Fkqueue_add_watch): O_BINARY is not a POSIX open(3) flag. commit e81b0171262f43b7222ce4ce6a6eaddd42eed564 Author: Glenn Morris Date: Sun Nov 29 06:24:12 2015 -0500 ; Auto-commit of ChangeLog files. diff --git a/ChangeLog.2 b/ChangeLog.2 index c7054ac..d779565 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -1,3 +1,885 @@ +2015-11-28 Michael Albinus + + Fix a problem with gfilenotify in filenotify-tests.el + + * test/lisp/filenotify-tests.el + (file-notify--test-expected-events): Remove. + (file-notify--test-cleanup): Do not set that variable. + (file-notify--test-with-events): EVENTS can also be a list of lists. + (file-notify-test02-events, file-notify-test04-file-validity): + Adapt expected result. + +2015-11-28 Eli Zaretskii + + * .gitignore: Adjust to changes in 'test' directory structure. + +2015-11-28 Eli Zaretskii + + Fix test/manual/etags/Makefile + + * test/manual/etags/Makefile (ETAGS_PROG, CTAGS_PROG): Adjust to + changes in 'test' directory structure. + +2015-11-27 Phillip Lord + + Exclude resource dirs from search for tests. + + * test/Makefile.in: Test file locations are now found with find + rather than using finds native functions. + +2015-11-27 Phillip Lord + + Add test targets without directory names. + + * (test/Makefile.in): Extend test_template to add two targets for each + file. + +2015-11-27 Artur Malabarba + + * lisp/emacs-lisp/package.el: Require url-handlers + +2015-11-27 Phillip Lord + + Move elisp-mode-tests to new function names. + + * test/lisp/progmodes/elisp-mode-tests.el (find-defsdefun-c-defvar-c, + find-defs-defun-el-defvar-c): Call `elisp--xref-find-definitions'. + +2015-11-27 Juanma Barranquero + + * lisp/emacs-lisp/package.el: Declare `url-insert-buffer-contents' + +2015-11-26 Phillip Lord + + Merge branch 'feature/standard-test-location' + +2015-11-25 Stefan Monnier + + * lisp/emacs-lisp/eieio.el: Add some default implementations + + (standard-class): Mark it obsolete. + (slot-missing): Give it a default implementation. + (destructor): Simplify and mark it obsolete. + (object-print): Give it a default implementation. + (eieio-change-class): Rename from change-class. + (change-class): Redefine as obsolete alias. + +2015-11-25 Michael Albinus + + Mention kqueue in NEWS + +2015-11-25 Michael Albinus + + Merge from scratch/kqueue + + bec57a4 Some final fixes in file notification before merging with master + 0247489 Rework file notifications, kqueue has problems with directory monitors + 5154781 Continie with pending events + 6b490c0 Improve loops in file-notify-test06-many-events + c8e266f Handle more complex rename operation in kqueue + 5044bdf New test with a larger number of events. + 65ba5a9 Further fixes for kqueue. + 13f3508 Code cleanup of kqueue.c + 99aa855 Doc changes for kqueue + 8deebe1 Finish implementation in kqueue.c + 90d6c69 * lisp/filenotify.el (file-notify-add-watch): Fix thinko. + e95b309 More work on kqueue + 41d9bd0 Implement directory events + c571fc1 Build fixes for kqueue support. + e0a68f2 Continue kqueue implementation + 7543d1c Work on kqueue + e3354e2 Add kqueue support + c6457ce Minor fix to comment indentation and typo in last commit + b92307f linum-mode plays more nicely with other margin-setting extensions + 58e6235 * lisp/image-mode.el: Support encrypted file + 9375652 * lisp/progmodes/verilog-mode.el (verilog-save-buffer-state): Add backquote + 47f83b6 ; ChangeLog.2 fixes + 7cc233e * lisp/emacs-lisp/package.el: Fix a decoding issue + 5f9153f * lisp/emacs-lisp/package.el: Refactor -with-work-buffer-async + 353f5e7 * lisp/progmodes/verilog-mode.el: Use with-silent-modifications + 70f1fda ; Auto-commit of ChangeLog files. + ae0653b * CONTRIBUTE: Remove information about feature freeze. + 9459456 Merge branch 'release-process-lowercase' + 9a4aa0f Document the release process + f8cc14b * admin/release-process: Rename from admin/FOR-RELEASE. + dcd5877 gitmerge: Fix git log command + 2ac79ae gitmerge: Try to detect cherry-picks + 5f7a2a9 Increment Emacs version on master branch + ed2e7e2 Mention CONTRIBUTE in README + 9e00a02 Update verilog-mode.el to 2015-11-09-b121d60-vpo. + 138ad3d ; Fix warnings + 7126e9a ; Update xref-etags-mode for the latest change + 246d660 Use generic dispatch for xref backends + 31f6e93 Support rectangular regions for more commands + f103a27 Handle multiple matches on the same line; add highlighting + fe973fc Replace xref-match-bounds with xref-match-length + 92a5010 Merge from gnulib + 04ac097 Spruce up ftfont.c memory allocation + 4c4b520 Port recent XCB changes to 64-bit ‘long int’ + 4f0ce9c * src/undo.c (run_undoable_change): Now static. + 695a6f9 Remove support for ':timeout' from w32 tray notifications + a731c2f * test/automated/simple-test.el: Add test for bug#20698 (bug#21885) + 2b4c0c0 * lisp/progmodes/elisp-mode.el: Declare function `project-roots' + 66b9f7b * src/undo.c: Small fixes for previous change + 2fac30e Add a few more variables to redisplay--variables + 04f69f1 * lisp/loadup.el: Enlarge the size of the hash table to 80000. + e221d32 Fix point positioning after transposing with negative arg + 35f5afb Fix last change in shr.el + 508e77b Fix last change + d60ed3f Another fix for MinGW64 and Cygwin builds due to notifications + 805a39b Remove intern calls and XXX comments from Fx_export_frames + 9463abf shr: don't invoke unbound function (Bug#21895) + 6e5186e * test/automated/keymaps-test.el: Fix test to make it repeatable + 0c92826 * test/automated/cl-lib-tests.el (cl-lib-struct-constructors): Small fix + 39dbd1c : Tests for undo-auto functionality. + 20aa42e ; Merge branch 'fix/no-undo-boundary-on-secondary-buffer-change' + 44dfa86 The heuristic that Emacs uses to add an `undo-boundary' has been reworked, as it interacts poorly with functions on `post-command-hook' or `after-change-functions'. + d2f73db Bind [?\S-\ ] to previous line command in Dired-like modes. + c1bc6e5 Fix the MinGW64 and Cygwin-w32 builds + 1e363a8 Enable sorting of JSON object keys when encoding + 9dd7da9 * test/automated/keymap-tests.el: New test file + aa17de9 Speed up x_real_pos_and_offsets using XCB + a838c83 Enable use of XCB for checking window manager state + c7f2b6a Detect XCB and save a connection handle + e1c27db Reduce some data dependencies between X calls + 25e32bd Use color cache for creating bitmap + 851be0f Add "^" to the interactive specs of `dired-next/previous-line' + 055ca3a Sync with soap-client repository, version 3.0.2 + e0f64e7 CC Mode: Respect users' settings of open-paren-in-column-0-is-defun-start. + 952395d * lisp/obarray.el: Fix shadowed variables + 436d330 Avoid error in submitting a form with EWW + e887f6e ; * doc/lispref/os.texi: Fix indentation of sample code. + 51d840a Rename seq-p and map-p to seqp and mapp + 23036ba Rename obarray-p to obarrayp + 20aea42 Rename obarray-foreach to obarray-map + a3b2101 New file with obarray functions. + 9d43941 Implement tray notifications for MS-Windows + +2015-11-25 Michael Albinus + + Some final fixes in file notification before merging with master + + * lisp/filenotify.el (file-notify--rm-descriptor): Remove WHAT arg. + (file-notify-callback): Improve check for `stopped' event. Call + `file-notify-rm-watch' rather than `file-notify--rm-descriptor'. + (file-notify-add-watch): In case FILE is not a directory, call the + file monitor for the kqueue backend. Otherwise, call the + directory monitor for the upper directory. + + * src/inotify.c (inotifyevent_to_event): Extract file name from + watch_object if the event doesn't provide it. + (Finotify_add_watch): Add file name to watch_object. + + * test/automated/file-notify-tests.el (file-notify--test-timeout): + Use different timeouts for different libraries. + (file-notify--test-with-events): Suppress lock files. Flush + outstanding events before running the body. + (file-notify-test02-events, file-notify-test04-file-validity): Do + not skip cygwin tests. Add additional test for file creation. + Adapt expected result for different backends. + (file-notify-test03-autorevert): Some of the tests don't work for + w32notify. + (file-notify-test06-many-events): Rename into both directions. + +2015-11-25 Michael Albinus + + Rework file notifications, kqueue has problems with directory monitors + + * lisp/filenotify.el (file-notify-add-watch): Call the native + add-watch function on the file, not on the dir. + + * src/kqueue.c (kqueue_compare_dir_list): Make also bookkeeping + about already deleted entries. + + * test/automated/auto-revert-tests.el + (auto-revert-test01-auto-revert-several-files): Do not call "cp -f" + since this deletes the target file first. + + * test/automated/file-notify-tests.el (file-notify--test-event-test): + Make stronger checks. + (file-notify-test01-add-watch, file-notify-test02-events) + (file-notify-test04-file-validity, file-notify-test05-dir-validity): + Rewrite in order to call file monitors but directory monitors. + (file-notify-test06-many-events): Ler rename work in both directions. + +2015-11-25 Michael Albinus + + Continie with pending events + + * src/kqueue.c (pending_events): Remove global variable. + (kqueue_compare_dir_list): Create `write' event for not used + pending events. + (globals_of_kqueue): Remove initialization of pending_events. + +2015-11-25 Michael Albinus + + Improve loops in file-notify-test06-many-events + + * test/automated/file-notify-tests.el (file-notify-test06-many-events): + Use `read-event' pauses for the `write-file' loops; otherwise + events are lost in inotify and gfilenotify cases. + +2015-11-25 Michael Albinus + + Handle more complex rename operation in kqueue + + * src/kqueue.c (pending_events): New variable. + (kqueue_compare_dir_list): Handle more complex rename operation. + (globals_of_kqueue): Initialize pending_events. + + * test/automated/file-notify-tests.el (file-notify-test06-many-events): + Adapt expected events in the `rename-file' case. + (file-notify-test06-many-events-remote): Declare. + +2015-11-25 Wolfgang Jenkner + + New test with a larger number of events. + + * test/automated/file-notify-tests.el (file-notify--test-with-events): + Make timeout heuristically depend on the number of events. + + (file-notify-test06-many-events): Use it for new test. + +2015-11-25 Michael Albinus + + Further fixes for kqueue. + + * lisp/filenotify.el (file-notify-callback): Raise also event if + directory name matches. + (file-notify-add-watch): Add `create' to the flags for `kqueue'. + + * src/kqueue.c (kqueue_generate_event): Use watch_object as + argument instead of ident. Remove callback argument. Adapt + callees. Check actions whether they are monitored flags. + + * test/automated/file-notify-tests.el (file-notify--test-library): + New defun. + (file-notify-test00-availability, file-notify-test02-events) + (file-notify-test04-file-validity) + (file-notify-test05-dir-validity): Use it. + (file-notify-test02-events, file-notify-test04-file-validity): Add + `read-event' calls between different file actions, in order to + give the backends a chance to rais an event. Needed especially + for kqueue. In case of deleting a directory, there are two + `deleted' events. + +2015-11-25 Michael Albinus + + Code cleanup of kqueue.c + + * src/kqueue.c (kqueue_directory_listing): Skip "." and "..". + (kqueue_compare_dir_list): Do not loop when calling + directory_files_internal. Remove checks for "." and "..", this is + done in kqueue_directory_listing now. + (Fkqueue_add_watch): Check for proper emacs_open flags. + +2015-11-25 Michael Albinus + + Doc changes for kqueue + + * doc/lispref/os.texi (File Notifications): Add kqueue as backend. + Fix some glitches in the example. + +2015-11-25 Michael Albinus + + Finish implementation in kqueue.c + + * src/kqueue.c (kqueue_directory_listing, kqueue_callback): + Simplify access to list. + (kqueue_compare_dir_list): Simplify access to list. Raise + `delete' event if directory does not exist any longer. Otherwise, + wait until directory contents has changed. Fix error in check. + +2015-11-25 Michael Albinus + + * lisp/filenotify.el (file-notify-add-watch): Fix thinko. + +2015-11-25 Michael Albinus + + More work on kqueue + + * lisp/filenotify.el (file-notify-callback): Handle also the + `rename' event from kqueue. + (file-notify-add-watch): Do not register an entry twice. + + * src/kqueue.c (kqueue_directory_listing): New function. + (kqueue_generate_event): New argument FILE1. Adapt callees. + (kqueue_compare_dir_list): Rewrite in order to make it more robust. + +2015-11-25 Michael Albinus + + Implement directory events + + * lisp/filenotify.el (file-notify-handle-event) + (file-notify-callback): Remove traces. + + * src/kqueue.c: Include . + (kqueue_generate_event, kqueue_compare_dir_list): New functions. + (kqueue_callback): Use them. Call kevent() with a zero timeout. + (Fkqueue_add_watch): Adapt docstring. Support directory events. + Compute initial directory listing. Close file descriptor in case + of errors. + (syms_of_kqueue): Declare Qcreate. + +2015-11-25 Wolfgang Jenkner + + Build fixes for kqueue support. + + * src/kqueue.c (Fkqueue_add_watch): O_BINARY is not a POSIX open(3) + flag. + + * configure.ac (HAVE_KQUEUE): There is no pkg-config module for native + kqueue on *BSD. + +2015-11-25 Michael Albinus + + Continue kqueue implementation + + * lisp/filenotify.el (file-notify-handle-event) + (file-notify-callback): Enable trace messages. + + * src/kqueue.c: Include also . + (kqueue_callback): Remove watch in case of NOTE_DELETE or NOTE_RENAME. + (Fkqueue_rm_watch, Fkqueue_valid_p): New functions. + (syms_of_kqueue): Add them. + +2015-11-25 Michael Albinus + + Work on kqueue + + * lisp/filenotify.el (file-notify--library) + (file-notify-descriptors, file-notify-callback) + (file-notify-add-watch, file-notify-rm-watch) + (file-notify-valid-p): Add kqueue support. + + * src/keyboard.c (make_lispy_event): Check also for HAVE_KQUEUE. + +2015-11-25 Michael Albinus + + Add kqueue support + + * configure.ac (--with-file-notification): Add kqueue. + (top): Remove special test for "${HAVE_NS}" and + ${with_file_notification}, this is handled inside gfilenotify + tests. Add kqueue tests. Use NOTIFY_CFLAGS and NOTIFY_LIBS + instead of library specific variables. + + * src/Makefile.in: Use NOTIFY_CFLAGS and NOTIFY_LIBS. + + * src/emacs.c (main): Call globals_of_kqueue and syms_of_kqueue. + + * src/kqueue.c: New file. + + * src/lisp.h: Declare extern globals_of_kqueue and syms_of_kqueue. + +2015-11-25 Michael Albinus + + Some final fixes in file notification before merging with master + + * lisp/filenotify.el (file-notify--rm-descriptor): Remove WHAT arg. + (file-notify-callback): Improve check for `stopped' event. Call + `file-notify-rm-watch' rather than `file-notify--rm-descriptor'. + (file-notify-add-watch): In case FILE is not a directory, call the + file monitor for the kqueue backend. Otherwise, call the + directory monitor for the upper directory. + + * src/inotify.c (inotifyevent_to_event): Extract file name from + watch_object if the event doesn't provide it. + (Finotify_add_watch): Add file name to watch_object. + + * test/automated/file-notify-tests.el (file-notify--test-timeout): + Use different timeouts for different libraries. + (file-notify--test-with-events): Suppress lock files. Flush + outstanding events before running the body. + (file-notify-test02-events, file-notify-test04-file-validity): Do + not skip cygwin tests. Add additional test for file creation. + Adapt expected result for different backends. + (file-notify-test03-autorevert): Some of the tests don't work for + w32notify. + (file-notify-test06-many-events): Rename into both directions. + +2015-11-24 Phillip Lord + + Update elisp-mode-tests for changed file location. + + * test/lisp/progmodes/elisp-mode-tests.el: + +2015-11-24 Phillip Lord + + Exclude manual tests from Makefile + + * test/Makefile.in: + +2015-11-24 Phillip Lord + + Move package test files to new directory. + + * test/lisp/emacs-lisp/package-tests.el: Update resoruce file location. + * test/data/package: Moved to test/lisp/emacs-lisp/package-resources + +2015-11-24 Phillip Lord + + Restore delete Makefiles and fix .gitignore. + + * .gitignore: Update Makefiles to changed locations + * test/lisp/progmodes/flymake-resources/Makefile, + test/manual/etags/Makefile, + test/manual/etags/make-src/Makefile, + test/manual/indent/Makefile: Restored and moved to new location. + +2015-11-24 Phillip Lord + + Test infrastructure: updates after directory move + + * (test/Makefile.in): Support directories several levels deep. + * (test/data/flymake): Rename to test/lisp/progmodes/flymake-resources. + * (test/lisp/progmodes/flymake-tests.el): Support renamed resource directory. + +2015-11-24 Phillip Lord + + Rename all test files to reflect source layout. + + * CONTRIBUTE,Makefile.in,configure.ac: Update to reflect + test directory moves. + * test/file-organisation.org: New file. + * test/automated/Makefile.in + test/automated/data/decompress/foo.gz + test/automated/data/epg/pubkey.asc + test/automated/data/epg/seckey.asc + test/automated/data/files-bug18141.el.gz + test/automated/data/flymake/test.c + test/automated/data/flymake/test.pl + test/automated/data/package/archive-contents + test/automated/data/package/key.pub + test/automated/data/package/key.sec + test/automated/data/package/multi-file-0.2.3.tar + test/automated/data/package/multi-file-readme.txt + test/automated/data/package/newer-versions/archive-contents + test/automated/data/package/newer-versions/new-pkg-1.0.el + test/automated/data/package/newer-versions/simple-single-1.4.el + test/automated/data/package/package-test-server.py + test/automated/data/package/signed/archive-contents + test/automated/data/package/signed/archive-contents.sig + test/automated/data/package/signed/signed-bad-1.0.el + test/automated/data/package/signed/signed-bad-1.0.el.sig + test/automated/data/package/signed/signed-good-1.0.el + test/automated/data/package/signed/signed-good-1.0.el.sig + test/automated/data/package/simple-depend-1.0.el + test/automated/data/package/simple-single-1.3.el + test/automated/data/package/simple-single-readme.txt + test/automated/data/package/simple-two-depend-1.1.el + test/automated/abbrev-tests.el + test/automated/auto-revert-tests.el + test/automated/calc-tests.el + test/automated/icalendar-tests.el + test/automated/character-fold-tests.el + test/automated/comint-testsuite.el + test/automated/descr-text-test.el + test/automated/electric-tests.el + test/automated/cl-generic-tests.el + test/automated/cl-lib-tests.el + test/automated/eieio-test-methodinvoke.el + test/automated/eieio-test-persist.el + test/automated/eieio-tests.el + test/automated/ert-tests.el + test/automated/ert-x-tests.el + test/automated/generator-tests.el + test/automated/let-alist.el + test/automated/map-tests.el + test/automated/advice-tests.el + test/automated/package-test.el + test/automated/pcase-tests.el + test/automated/regexp-tests.el + test/automated/seq-tests.el + test/automated/subr-x-tests.el + test/automated/tabulated-list-test.el + test/automated/thunk-tests.el + test/automated/timer-tests.el + test/automated/epg-tests.el + test/automated/eshell.el + test/automated/faces-tests.el + test/automated/file-notify-tests.el + test/automated/auth-source-tests.el + test/automated/gnus-tests.el + test/automated/message-mode-tests.el + test/automated/help-fns.el + test/automated/imenu-test.el + test/automated/info-xref.el + test/automated/mule-util.el + test/automated/isearch-tests.el + test/automated/json-tests.el + test/automated/bytecomp-tests.el + test/automated/coding-tests.el + test/automated/core-elisp-tests.el + test/automated/decoder-tests.el + test/automated/files.el + test/automated/font-parse-tests.el + test/automated/lexbind-tests.el + test/automated/occur-tests.el + test/automated/process-tests.el + test/automated/syntax-tests.el + test/automated/textprop-tests.el + test/automated/undo-tests.el + test/automated/man-tests.el + test/automated/completion-tests.el + test/automated/dbus-tests.el + test/automated/newsticker-tests.el + test/automated/sasl-scram-rfc-tests.el + test/automated/tramp-tests.el + test/automated/obarray-tests.el + test/automated/compile-tests.el + test/automated/elisp-mode-tests.el + test/automated/f90.el + test/automated/flymake-tests.el + test/automated/python-tests.el + test/automated/ruby-mode-tests.el + test/automated/subword-tests.el + test/automated/replace-tests.el + test/automated/simple-test.el + test/automated/sort-tests.el + test/automated/subr-tests.el + test/automated/reftex-tests.el + test/automated/sgml-mode-tests.el + test/automated/tildify-tests.el + test/automated/thingatpt.el + test/automated/url-future-tests.el + test/automated/url-util-tests.el + test/automated/add-log-tests.el + test/automated/vc-bzr.el + test/automated/vc-tests.el + test/automated/xml-parse-tests.el + test/BidiCharacterTest.txt + test/biditest.el + test/cedet/cedet-utests.el + test/cedet/ede-tests.el + test/cedet/semantic-ia-utest.el + test/cedet/semantic-tests.el + test/cedet/semantic-utest-c.el + test/cedet/semantic-utest.el + test/cedet/srecode-tests.el + test/cedet/tests/test.c + test/cedet/tests/test.el + test/cedet/tests/test.make + test/cedet/tests/testdoublens.cpp + test/cedet/tests/testdoublens.hpp + test/cedet/tests/testfriends.cpp + test/cedet/tests/testjavacomp.java + test/cedet/tests/testnsp.cpp + test/cedet/tests/testpolymorph.cpp + test/cedet/tests/testspp.c + test/cedet/tests/testsppcomplete.c + test/cedet/tests/testsppreplace.c + test/cedet/tests/testsppreplaced.c + test/cedet/tests/testsubclass.cpp + test/cedet/tests/testsubclass.hh + test/cedet/tests/testtypedefs.cpp + test/cedet/tests/testvarnames.c + test/etags/CTAGS.good + test/etags/ETAGS.good_1 + test/etags/ETAGS.good_2 + test/etags/ETAGS.good_3 + test/etags/ETAGS.good_4 + test/etags/ETAGS.good_5 + test/etags/ETAGS.good_6 + test/etags/a-src/empty.zz + test/etags/a-src/empty.zz.gz + test/etags/ada-src/2ataspri.adb + test/etags/ada-src/2ataspri.ads + test/etags/ada-src/etags-test-for.ada + test/etags/ada-src/waroquiers.ada + test/etags/c-src/a/b/b.c + test/etags/c-src/abbrev.c + test/etags/c-src/c.c + test/etags/c-src/dostorture.c + test/etags/c-src/emacs/src/gmalloc.c + test/etags/c-src/emacs/src/keyboard.c + test/etags/c-src/emacs/src/lisp.h + test/etags/c-src/emacs/src/regex.h + test/etags/c-src/etags.c + test/etags/c-src/exit.c + test/etags/c-src/exit.strange_suffix + test/etags/c-src/fail.c + test/etags/c-src/getopt.h + test/etags/c-src/h.h + test/etags/c-src/machsyscalls.c + test/etags/c-src/machsyscalls.h + test/etags/c-src/sysdep.h + test/etags/c-src/tab.c + test/etags/c-src/torture.c + test/etags/cp-src/MDiagArray2.h + test/etags/cp-src/Range.h + test/etags/cp-src/burton.cpp + test/etags/cp-src/c.C + test/etags/cp-src/clheir.cpp.gz + test/etags/cp-src/clheir.hpp + test/etags/cp-src/conway.cpp + test/etags/cp-src/conway.hpp + test/etags/cp-src/fail.C + test/etags/cp-src/functions.cpp + test/etags/cp-src/screen.cpp + test/etags/cp-src/screen.hpp + test/etags/cp-src/x.cc + test/etags/el-src/TAGTEST.EL + test/etags/el-src/emacs/lisp/progmodes/etags.el + test/etags/erl-src/gs_dialog.erl + test/etags/f-src/entry.for + test/etags/f-src/entry.strange.gz + test/etags/f-src/entry.strange_suffix + test/etags/forth-src/test-forth.fth + test/etags/html-src/algrthms.html + test/etags/html-src/index.shtml + test/etags/html-src/software.html + test/etags/html-src/softwarelibero.html + test/etags/lua-src/allegro.lua + test/etags/objc-src/PackInsp.h + test/etags/objc-src/PackInsp.m + test/etags/objc-src/Subprocess.h + test/etags/objc-src/Subprocess.m + test/etags/objcpp-src/SimpleCalc.H + test/etags/objcpp-src/SimpleCalc.M + test/etags/pas-src/common.pas + test/etags/perl-src/htlmify-cystic + test/etags/perl-src/kai-test.pl + test/etags/perl-src/yagrip.pl + test/etags/php-src/lce_functions.php + test/etags/php-src/ptest.php + test/etags/php-src/sendmail.php + test/etags/prol-src/natded.prolog + test/etags/prol-src/ordsets.prolog + test/etags/ps-src/rfc1245.ps + test/etags/pyt-src/server.py + test/etags/tex-src/gzip.texi + test/etags/tex-src/nonewline.tex + test/etags/tex-src/testenv.tex + test/etags/tex-src/texinfo.tex + test/etags/y-src/atest.y + test/etags/y-src/cccp.c + test/etags/y-src/cccp.y + test/etags/y-src/parse.c + test/etags/y-src/parse.y + test/indent/css-mode.css + test/indent/js-indent-init-dynamic.js + test/indent/js-indent-init-t.js + test/indent/js-jsx.js + test/indent/js.js + test/indent/latex-mode.tex + test/indent/modula2.mod + test/indent/nxml.xml + test/indent/octave.m + test/indent/pascal.pas + test/indent/perl.perl + test/indent/prolog.prolog + test/indent/ps-mode.ps + test/indent/ruby.rb + test/indent/scheme.scm + test/indent/scss-mode.scss + test/indent/sgml-mode-attribute.html + test/indent/shell.rc + test/indent/shell.sh + test/redisplay-testsuite.el + test/rmailmm.el + test/automated/buffer-tests.el + test/automated/cmds-tests.el + test/automated/data-tests.el + test/automated/finalizer-tests.el + test/automated/fns-tests.el + test/automated/inotify-test.el + test/automated/keymap-tests.el + test/automated/print-tests.el + test/automated/libxml-tests.el + test/automated/zlib-tests.el: Files Moved. + +2015-11-20 Michael Albinus + + Rework file notifications, kqueue has problems with directory monitors + + * lisp/filenotify.el (file-notify-add-watch): Call the native + add-watch function on the file, not on the dir. + + * src/kqueue.c (kqueue_compare_dir_list): Make also bookkeeping + about already deleted entries. + + * test/automated/auto-revert-tests.el + (auto-revert-test01-auto-revert-several-files): Do not call "cp -f" + since this deletes the target file first. + + * test/automated/file-notify-tests.el (file-notify--test-event-test): + Make stronger checks. + (file-notify-test01-add-watch, file-notify-test02-events) + (file-notify-test04-file-validity, file-notify-test05-dir-validity): + Rewrite in order to call file monitors but directory monitors. + (file-notify-test06-many-events): Ler rename work in both directions. + +2015-11-19 Michael Albinus + + Continie with pending events + + * src/kqueue.c (pending_events): Remove global variable. + (kqueue_compare_dir_list): Create `write' event for not used + pending events. + (globals_of_kqueue): Remove initialization of pending_events. + +2015-11-19 Michael Albinus + + Improve loops in file-notify-test06-many-events + + * test/automated/file-notify-tests.el (file-notify-test06-many-events): + Use `read-event' pauses for the `write-file' loops; otherwise + events are lost in inotify and gfilenotify cases. + +2015-11-19 Michael Albinus + + Handle more complex rename operation in kqueue + + * src/kqueue.c (pending_events): New variable. + (kqueue_compare_dir_list): Handle more complex rename operation. + (globals_of_kqueue): Initialize pending_events. + + * test/automated/file-notify-tests.el (file-notify-test06-many-events): + Adapt expected events in the `rename-file' case. + (file-notify-test06-many-events-remote): Declare. + +2015-11-18 Wolfgang Jenkner + + New test with a larger number of events. + + * test/automated/file-notify-tests.el (file-notify--test-with-events): + Make timeout heuristically depend on the number of events. + + (file-notify-test06-many-events): Use it for new test. + +2015-11-18 Michael Albinus + + Further fixes for kqueue. + + * lisp/filenotify.el (file-notify-callback): Raise also event if + directory name matches. + (file-notify-add-watch): Add `create' to the flags for `kqueue'. + + * src/kqueue.c (kqueue_generate_event): Use watch_object as + argument instead of ident. Remove callback argument. Adapt + callees. Check actions whether they are monitored flags. + + * test/automated/file-notify-tests.el (file-notify--test-library): + New defun. + (file-notify-test00-availability, file-notify-test02-events) + (file-notify-test04-file-validity) + (file-notify-test05-dir-validity): Use it. + (file-notify-test02-events, file-notify-test04-file-validity): Add + `read-event' calls between different file actions, in order to + give the backends a chance to rais an event. Needed especially + for kqueue. In case of deleting a directory, there are two + `deleted' events. + +2015-11-17 Michael Albinus + + Code cleanup of kqueue.c + + * src/kqueue.c (kqueue_directory_listing): Skip "." and "..". + (kqueue_compare_dir_list): Do not loop when calling + directory_files_internal. Remove checks for "." and "..", this is + done in kqueue_directory_listing now. + (Fkqueue_add_watch): Check for proper emacs_open flags. + +2015-11-16 Michael Albinus + + Doc changes for kqueue + + * doc/lispref/os.texi (File Notifications): Add kqueue as backend. + Fix some glitches in the example. + +2015-11-16 Michael Albinus + + Finish implementation in kqueue.c + + * src/kqueue.c (kqueue_directory_listing, kqueue_callback): + Simplify access to list. + (kqueue_compare_dir_list): Simplify access to list. Raise + `delete' event if directory does not exist any longer. Otherwise, + wait until directory contents has changed. Fix error in check. + +2015-11-16 Michael Albinus + + * lisp/filenotify.el (file-notify-add-watch): Fix thinko. + +2015-11-15 Michael Albinus + + More work on kqueue + + * lisp/filenotify.el (file-notify-callback): Handle also the + `rename' event from kqueue. + (file-notify-add-watch): Do not register an entry twice. + + * src/kqueue.c (kqueue_directory_listing): New function. + (kqueue_generate_event): New argument FILE1. Adapt callees. + (kqueue_compare_dir_list): Rewrite in order to make it more robust. + +2015-11-14 Michael Albinus + + Implement directory events + + * lisp/filenotify.el (file-notify-handle-event) + (file-notify-callback): Remove traces. + + * src/kqueue.c: Include . + (kqueue_generate_event, kqueue_compare_dir_list): New functions. + (kqueue_callback): Use them. Call kevent() with a zero timeout. + (Fkqueue_add_watch): Adapt docstring. Support directory events. + Compute initial directory listing. Close file descriptor in case + of errors. + (syms_of_kqueue): Declare Qcreate. + +2015-11-11 Wolfgang Jenkner + + Build fixes for kqueue support. + + * src/kqueue.c (Fkqueue_add_watch): O_BINARY is not a POSIX open(3) + flag. + + * configure.ac (HAVE_KQUEUE): There is no pkg-config module for native + kqueue on *BSD. + +2015-11-11 Michael Albinus + + Continue kqueue implementation + + * lisp/filenotify.el (file-notify-handle-event) + (file-notify-callback): Enable trace messages. + + * src/kqueue.c: Include also . + (kqueue_callback): Remove watch in case of NOTE_DELETE or NOTE_RENAME. + (Fkqueue_rm_watch, Fkqueue_valid_p): New functions. + (syms_of_kqueue): Add them. + +2015-11-11 Michael Albinus + + Work on kqueue + + * lisp/filenotify.el (file-notify--library) + (file-notify-descriptors, file-notify-callback) + (file-notify-add-watch, file-notify-rm-watch) + (file-notify-valid-p): Add kqueue support. + + * src/keyboard.c (make_lispy_event): Check also for HAVE_KQUEUE. + +2015-11-11 Michael Albinus + + Add kqueue support + + * configure.ac (--with-file-notification): Add kqueue. + (top): Remove special test for "${HAVE_NS}" and + ${with_file_notification}, this is handled inside gfilenotify + tests. Add kqueue tests. Use NOTIFY_CFLAGS and NOTIFY_LIBS + instead of library specific variables. + + * src/Makefile.in: Use NOTIFY_CFLAGS and NOTIFY_LIBS. + + * src/emacs.c (main): Call globals_of_kqueue and syms_of_kqueue. + + * src/kqueue.c: New file. + + * src/lisp.h: Declare extern globals_of_kqueue and syms_of_kqueue. + 2015-11-21 Wilson Snyder verilog-mode.el: Commentary and fix pre-Emacs 21 behavior. @@ -19132,7 +20014,7 @@ This file records repository revisions from commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to -commit ea78129522f428888607151e4f91ade1f4839f3f (inclusive). +commit 9a2363ec04c24a6959902da9b8eff2f1559ab3e0 (inclusive). See ChangeLog.1 for earlier changes. ;; Local Variables: