commit 56c8551219ecace0157ce813733adf8eecb38c32 (HEAD, refs/remotes/origin/master) Author: Tino Calancha Date: Fri Jul 8 17:22:56 2016 +0900 Copy buffer names to kill ring * ibuf-ext.el (ibuffer-copy-buffername-as-kill): New command. * lisp/ibuffer (ibuffer-mode-map): Bound it to 'B'. ;* etc/NEWS: Add entry for this new feature. diff --git a/etc/NEWS b/etc/NEWS index f9fbe03..54b62f0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -199,6 +199,10 @@ same as in modes where the character is not whitespace. ** Ibuffer --- +*** A new command 'ibuffer-copy-buffername-as-kill'; bound +to 'B'. + +--- *** New command 'ibuffer-change-marks'; bound to '* c'. --- diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 2444dac..6102e1f 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1462,6 +1462,23 @@ You can then feed the file name(s) to other commands with \\[yank]." (kill-new result) (message "%s" result)))) +;;;###autoload +(defun ibuffer-copy-buffername-as-kill () + "Copy buffer names of marked buffers into the kill ring. +The names are separated by a space. +You can then feed the file name(s) to other commands with \\[yank]." + (interactive) + (if (zerop (ibuffer-count-marked-lines)) + (message "No buffers marked; use 'm' to mark a buffer") + (let ((res "")) + (ibuffer-map-marked-lines + #'(lambda (buf _mark) + (setq res (concat res (buffer-name buf) " ")))) + (when (not (zerop (length res))) + (setq res (substring res 0 -1))) + (kill-new res) + (message res)))) + (defun ibuffer-mark-on-buffer (func &optional ibuffer-mark-on-buffer-mark group) (let ((count (ibuffer-map-lines diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index fde1757..37f72bc 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -586,6 +586,7 @@ directory, like `default-directory'." (define-key map (kbd "k") 'ibuffer-do-kill-lines) (define-key map (kbd "w") 'ibuffer-copy-filename-as-kill) + (define-key map (kbd "B") 'ibuffer-copy-buffername-as-kill) (define-key map (kbd "RET") 'ibuffer-visit-buffer) (define-key map (kbd "e") 'ibuffer-visit-buffer) commit 0e6fa2ddf76a1d702d836db3786ec1e34f7dcf54 Author: Tino Calancha Date: Fri Jul 8 11:22:34 2016 +0900 Remove just input mark * lisp/ibuffer.el (ibuffer-unmark-all): When MARK is not ?\r remove just MARK. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 4f266d9..fde1757 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1345,6 +1345,12 @@ With optional ARG, make read-only only if ARG is not negative." (lambda (_buf _mark) (ibuffer-set-mark-1 ?\s) t))) + ((not (char-equal mark ?\r)) + (ibuffer-map-lines + (lambda (_buf _mark) + (when (char-equal _mark mark) + (ibuffer-set-mark-1 ?\s)) + t))) (t (ibuffer-map-lines (lambda (_buf mark) commit 9bf31d1d3f35880c652f76509d1e27d33e454121 Author: Tino Calancha Date: Fri Jul 8 10:55:22 2016 +0900 Ibuffer change marks * lisp/ibuffer.el (ibuffer-change-marks): New command. (ibuffer-mode-map): Bind it to '* c'. (ibuffer-mode-groups-popup): Update menus. (ibuffer-mode): Update mode doc. ; * etc/NEWS: Add entry for this new feature. diff --git a/etc/NEWS b/etc/NEWS index deb1889..f9fbe03 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -199,6 +199,9 @@ same as in modes where the character is not whitespace. ** Ibuffer --- +*** New command 'ibuffer-change-marks'; bound to '* c'. + +--- *** A new command 'ibuffer-mark-by-locked' to mark all locked buffers; bound to '% L'. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index d67f95f..4f266d9 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -480,6 +480,7 @@ directory, like `default-directory'." (define-key map (kbd "DEL") 'ibuffer-unmark-backward) (define-key map (kbd "M-DEL") 'ibuffer-unmark-all) (define-key map (kbd "* *") 'ibuffer-unmark-all) + (define-key map (kbd "* c") 'ibuffer-change-marks) (define-key map (kbd "U") 'ibuffer-unmark-all-marks) (define-key map (kbd "* M") 'ibuffer-mark-by-mode) (define-key map (kbd "* m") 'ibuffer-mark-modified-buffers) @@ -724,6 +725,9 @@ directory, like `default-directory'." (define-key-after map [menu-bar mark toggle-marks] '(menu-item "Toggle marks" ibuffer-toggle-marks :help "Unmark marked buffers, and mark unmarked buffers")) + (define-key-after map [menu-bar mark change-marks] + '(menu-item "Change marks" ibuffer-change-marks + :help "Change OLD mark for marked buffers with NEW")) (define-key-after map [menu-bar mark mark-forward] '(menu-item "Mark" ibuffer-mark-forward :help "Mark the buffer at point")) @@ -1379,6 +1383,24 @@ group." (message "%s buffers marked" count)) (ibuffer-redisplay t)) +(defun ibuffer-change-marks (&optional old new) + "Change all OLD marks to NEW marks. +OLD and NEW are both characters used to mark buffers." + (interactive + (let* ((cursor-in-echo-area t) + (old (progn (message "Change (old mark): ") (read-char))) + (new (progn (message "Change %c marks to (new mark): " old) + (read-char)))) + (list old new))) + (if (or (eq old ?\r) (eq new ?\r)) + (ding) + (let ((count + (ibuffer-map-lines + (lambda (_buf mark) + (when (eq mark old) + (ibuffer-set-mark new) t))))) + (message "%s marks changed" count)))) + (defsubst ibuffer-get-region-and-prefix () (let ((arg (prefix-numeric-value current-prefix-arg))) (if (use-region-p) (list (region-beginning) (region-end) arg) @@ -2457,6 +2479,7 @@ Marking commands: `\\[ibuffer-mark-forward]' - Mark the buffer at point. `\\[ibuffer-toggle-marks]' - Unmark all currently marked buffers, and mark all unmarked buffers. + `\\[ibuffer-change-marks]' - Change the mark used on marked buffers. `\\[ibuffer-unmark-forward]' - Unmark the buffer at point. `\\[ibuffer-unmark-backward]' - Unmark the buffer at point, and move to the previous line. commit ee7bc988603ca16e6ef37fbbc377d82db37954c0 Author: Alan Third Date: Sun Jun 26 00:10:50 2016 +0100 Prevent NS event loop being re-entered (bug#11049) * nsterm.m (ns_read_socket, ns_select): Return -1 if already in event loop instead of aborting. diff --git a/src/nsterm.m b/src/nsterm.m index bd477a4..a6160ed 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4098,6 +4098,9 @@ in certain situations (rapid incoming events). NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_read_socket"); + if (apploopnr > 0) + return -1; /* Already within event loop. */ + #ifdef HAVE_NATIVE_FS check_native_fs (); #endif @@ -4182,6 +4185,9 @@ in certain situations (rapid incoming events). NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_select"); + if (apploopnr > 0) + return -1; /* Already within event loop. */ + #ifdef HAVE_NATIVE_FS check_native_fs (); #endif commit 5508f06f3283b4129cd70340a58ba608cc810d4e Author: Alan Third Date: Thu Jul 7 20:42:11 2016 +0100 Fix some deprecated functions * src/nsterm.m (firstRectForCharacterRange): In OS X >10.6 replace convertBaseToScreen with convertRectToScreen. * src/nsmenu.m (ns_update_menubar): Remove attachedMenu, deprecated in OS X 10.2, and always seems to return nil. diff --git a/src/nsmenu.m b/src/nsmenu.m index 7d340e8..10dfe8a 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -136,12 +136,6 @@ menu = [[EmacsMenu alloc] initWithTitle: ns_app_name]; needsSet = YES; } - else - { /* close up anything on there */ - id attMenu = [menu attachedMenu]; - if (attMenu != nil) - [attMenu close]; - } #if NSMENUPROFILE ftime (&tb); diff --git a/src/nsterm.m b/src/nsterm.m index 4027f5c..bd477a4 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6191,8 +6191,14 @@ - (NSRect)firstRectForCharacterRange: (NSRange)theRange +FRAME_LINE_HEIGHT (emacsframe)); pt = [self convertPoint: pt toView: nil]; +#if !defined (NS_IMPL_COCOA) || \ + MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 pt = [[self window] convertBaseToScreen: pt]; rect.origin = pt; +#else + rect.origin = pt; + rect = [[self window] convertRectToScreen: rect]; +#endif return rect; } commit 42ac8f5723a6a1e70cca39d08c222f595828d34d Author: Aaron Jensen Date: Thu Jul 7 19:46:57 2016 +0100 Disable App Nap (bug#22993) * nextstep/templates/Info.plist.in: Insert AppNap disable code. Copyright-paperwork-exempt: yes diff --git a/nextstep/templates/Info.plist.in b/nextstep/templates/Info.plist.in index dcd2fe3..889a070 100644 --- a/nextstep/templates/Info.plist.in +++ b/nextstep/templates/Info.plist.in @@ -675,5 +675,7 @@ along with GNU Emacs. If not, see . NSAppleScriptEnabled YES + LSAppNapIsDisabled + commit 0e8d3445a73bc190b0203b2571999ea5f5116ef2 Merge: 7f8e742 44517b2 Author: Michael Albinus Date: Thu Jul 7 18:51:00 2016 +0200 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit 7f8e742833e058fa41c273ff35351b02b6e8d42b Author: Michael Albinus Date: Thu Jul 7 18:50:24 2016 +0200 Fix an error in Tramp for rsync * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Make it work for "rsync". (tramp-make-copy-program-file-name): Apply `directory-file-name'. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 606572b..430c1c1 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2375,19 +2375,17 @@ The method used must be an out-of-band method." (aset v 3 localname) ;; Check which ones of source and target are Tramp files. - (setq source (if t1 - (tramp-make-copy-program-file-name v) - (shell-quote-argument filename)) - target (funcall + (setq source (funcall (if (and (file-directory-p filename) - (string-equal - (file-name-nondirectory filename) - (file-name-nondirectory newname))) - 'file-name-directory + (not (file-exists-p newname))) + 'file-name-as-directory 'identity) - (if t2 + (if t1 (tramp-make-copy-program-file-name v) - (shell-quote-argument newname)))) + (shell-quote-argument filename))) + target (if t2 + (tramp-make-copy-program-file-name v) + (shell-quote-argument newname))) ;; Check for host and port number. We cannot use ;; `tramp-file-name-port', because this returns also @@ -5102,7 +5100,7 @@ Return ATTR." (let ((method (tramp-file-name-method vec)) (user (tramp-file-name-user vec)) (host (tramp-file-name-real-host vec)) - (localname (tramp-file-name-localname vec))) + (localname (directory-file-name (tramp-file-name-localname vec)))) (when (string-match tramp-ipv6-regexp host) (setq host (format "[%s]" host))) (unless (string-match "ftp$" method) commit 44517b21abc4c243cdc7df264c629d592d9fb4cf Author: Tino Calancha Date: Fri Jul 8 01:34:35 2016 +0900 Ibuffer: Mark locked buffers * lisp/ibuf-ext.el (ibuffer-locked-buffer-p): New defun. (ibuffer-mark-by-locked): New command. (ibuffer-mode-map): Bind it to '% L'; update menus. (ibuffer-mode): Update mode doc. ;* etc/NEWS: Add NEWS entry for these changes and previous two commits. diff --git a/etc/NEWS b/etc/NEWS index 87ffb43..deb1889 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -199,6 +199,15 @@ same as in modes where the character is not whitespace. ** Ibuffer --- +*** A new command 'ibuffer-mark-by-locked' to mark +all locked buffers; bound to '% L'. + +--- +*** A new option 'ibuffer-locked-char' to indicate +locked buffers; Ibuffer shows a new column displaying +'ibuffer-locked-char' for locked buffers. + +--- *** A new command 'ibuffer-unmark-all-marks' to unmark all buffers without asking confirmation; bound to 'U'; 'ibuffer-do-replace-regexp' bound to 'r'. diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 72fa862..2444dac 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1484,6 +1484,24 @@ You can then feed the file name(s) to other commands with \\[yank]." #'(lambda (buf) (string-match regexp (buffer-name buf))))) +(defun ibuffer-locked-buffer-p (&optional buf) + "Return non-nil if BUF is locked. +When BUF nil, default to the buffer at current line." + (let ((_buffer (or buf (ibuffer-current-buffer))) + char) + (when _buffer + (with-current-buffer _buffer + (and (boundp 'emacs-lock-mode) emacs-lock-mode))))) + +;;;###autoload +(defun ibuffer-mark-by-locked () + "Mark all locked buffers." + (interactive) + (when (featurep 'emacs-lock) + (ibuffer-mark-on-buffer + (lambda (buf) + (ibuffer-locked-buffer-p buf))))) + ;;;###autoload (defun ibuffer-mark-by-mode-regexp (regexp) "Mark all buffers whose major mode matches REGEXP." diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index ff1eb8b..d67f95f 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -556,6 +556,7 @@ directory, like `default-directory'." (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp) (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp) (define-key map (kbd "% g") 'ibuffer-mark-by-content-regexp) + (define-key map (kbd "% L") 'ibuffer-mark-by-locked) (define-key map (kbd "C-t") 'ibuffer-visit-tags-table) @@ -782,6 +783,9 @@ directory, like `default-directory'." '(menu-item "Mark by content (regexp)..." ibuffer-mark-by-content-regexp :help "Mark buffers whose content matches a regexp")) + (define-key-after map [menu-bar mark mark-by-locked] + '(menu-item "Mark by locked buffers..." ibuffer-mark-by-locked + :help "Mark all locked buffers")) map)) @@ -2476,6 +2480,7 @@ Marking commands: `\\[ibuffer-mark-by-mode-regexp]' - Mark buffers by their major mode, using a regexp. `\\[ibuffer-mark-by-file-name-regexp]' - Mark buffers by their filename, using a regexp. `\\[ibuffer-mark-by-content-regexp]' - Mark buffers by their content, using a regexp. + `\\[ibuffer-mark-by-locked]' - Mark all locked buffers. Filtering commands: commit 9d70e4da7402e5a89db6a1b175b917cd3fb37e36 Author: Tino Calancha Date: Fri Jul 8 01:15:54 2016 +0900 * lisp/ibuffer.el: Add face for locked buffers diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index a8eba8d..ff1eb8b 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -160,7 +160,8 @@ elisp byte-compiler." (null buffer-file-name)) italic) (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face) - (35 (derived-mode-p 'dired-mode) font-lock-function-name-face)) + (35 (derived-mode-p 'dired-mode) font-lock-function-name-face) + (40 (and (boundp 'emacs-lock-mode) emacs-lock-mode) ibuffer-locked-buffer)) "An alist describing how to fontify buffers. Each element should be of the form (PRIORITY FORM FACE), where PRIORITY is an integer, FORM is an arbitrary form to evaluate in the @@ -1733,6 +1734,15 @@ If point is on a group name, this function operates on that group." (defvar ibuffer-inline-columns nil) +(defface ibuffer-locked-buffer + '((((background dark)) (:foreground "RosyBrown")) + (t (:foreground "brown4"))) + "*Face used for locked buffers in Ibuffer." + :version "25.2" + :group 'ibuffer + :group 'font-lock-highlighting-faces) +(defvar ibuffer-locked-buffer 'ibuffer-locked-buffer) + (define-ibuffer-column mark (:name " " :inline t) (string mark)) @@ -1741,7 +1751,8 @@ If point is on a group name, this function operates on that group." (string ibuffer-read-only-char) " ")) -(define-ibuffer-column locked (:name "L" :inline t) +(define-ibuffer-column locked + (:name "L" :inline t :props ('font-lock-face 'ibuffer-locked-buffer)) (if (and (boundp 'emacs-lock-mode) emacs-lock-mode) (string ibuffer-locked-char) " ")) commit 56277b81507aac393419339ac5fea9248811c235 Author: Tino Calancha Date: Fri Jul 8 01:13:55 2016 +0900 * lisp/ibuffer.el: Add mark for locked buffers diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index ae22bd7..a8eba8d 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -71,7 +71,8 @@ and filter displayed buffers by various criteria." :version "22.1" :group 'convenience) -(defcustom ibuffer-formats '((mark modified read-only " " (name 18 18 :left :elide) +(defcustom ibuffer-formats '((mark modified read-only locked + " " (name 18 18 :left :elide) " " (size 9 -1 :right) " " (mode 16 16 :left :elide) " " filename-and-process) (mark " " (name 16 -1) " " filename)) @@ -137,6 +138,7 @@ value for this variable would be Using \\[ibuffer-switch-format], you can rotate the display between the specified formats in the list." + :version "25.2" :type '(repeat sexp) :group 'ibuffer) @@ -280,6 +282,12 @@ Note that this specialized filtering occurs before real filtering." :type 'character :group 'ibuffer) +(defcustom ibuffer-locked-char ?L + "The character to display for locked buffers." + :version "25.2" + :type 'character + :group 'ibuffer) + (defcustom ibuffer-deletion-char ?D "The character to display for buffers marked for deletion." :type 'character @@ -1733,6 +1741,11 @@ If point is on a group name, this function operates on that group." (string ibuffer-read-only-char) " ")) +(define-ibuffer-column locked (:name "L" :inline t) + (if (and (boundp 'emacs-lock-mode) emacs-lock-mode) + (string ibuffer-locked-char) + " ")) + (define-ibuffer-column modified (:name "M" :inline t) (if (buffer-modified-p) (string ibuffer-modified-char) commit ee554d94f61d0032f7bdbe28841ac8c3d3cabe43 Author: Tino Calancha Date: Fri Jul 8 00:57:40 2016 +0900 ;* etc/NEWS (Ibuffer): Update entry according with last commit diff --git a/etc/NEWS b/etc/NEWS index cc14c7a..87ffb43 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -205,7 +205,7 @@ all buffers without asking confirmation; bound to --- *** A new command `ibuffer-mark-by-content-regexp' to mark buffers -whose content matches a regexp; bound to '% c' and '% g'. +whose content matches a regexp; bound to '% g'. --- *** Two new options `ibuffer-never-search-content-name' and commit 1650d7102ae8ea943e4197b7d91198640f0e0ff6 Author: Tino Calancha Date: Thu Jul 7 23:59:45 2016 +0900 Remove duplicate binding * lisp/ibuffer.el (ibuffer-mode-map): 'ibuffer-mark-by-content-regexp' just bound to '% g'. As suggested in: http://lists.gnu.org/archive/html/emacs-devel/2016-07/msg00165.html diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index c6ea1b8..ae22bd7 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -546,7 +546,6 @@ directory, like `default-directory'." (define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp) (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp) (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp) - (define-key map (kbd "% c") 'ibuffer-mark-by-content-regexp) (define-key map (kbd "% g") 'ibuffer-mark-by-content-regexp) (define-key map (kbd "C-t") 'ibuffer-visit-tags-table) commit 1583b569eb327e8d37581ac5ddc1eddc83685535 Author: Tino Calancha Date: Thu Jul 7 17:49:02 2016 +0900 Ibuffer: Drop needless binding * lisp/ibuffer.el (ibuffer-mark-interactive): 'inhibit-read-only' already bound to 't' inside 'ibuffer-set-mark'. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 2f875f4..c6ea1b8 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1410,15 +1410,14 @@ If point is on a group name, this function operates on that group." (require 'ibuf-ext) (ibuffer-mark-on-buffer #'identity mark it)) (ibuffer-forward-line 0 t) - (let ((inhibit-read-only t)) - (while (> arg 0) - (ibuffer-set-mark mark) - (ibuffer-forward-line 1 t) - (setq arg (1- arg))) - (while (< arg 0) - (ibuffer-forward-line -1 t) - (ibuffer-set-mark mark) - (setq arg (1+ arg)))))) + (while (> arg 0) + (ibuffer-set-mark mark) + (ibuffer-forward-line 1 t) + (setq arg (1- arg))) + (while (< arg 0) + (ibuffer-forward-line -1 t) + (ibuffer-set-mark mark) + (setq arg (1+ arg))))) (defun ibuffer-set-mark (mark) (ibuffer-assert-ibuffer-mode) commit 1efb208032164d21d2feb8c62b445878d3f5141c Author: Phillip Lord Date: Mon Jun 27 21:36:44 2016 +0100 Run tests from non-byte compiled files * test/Makefile.in: Eval non-byte-compiled files for tests. diff --git a/test/Makefile.in b/test/Makefile.in index 7ebc0de..33e625f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -106,14 +106,17 @@ else SELECTOR_ACTUAL=$(SELECTOR_EXPENSIVE) endif +## Byte-compile all test files to test for errors (unless explicitly +## told not to), but then evaluate the un-byte-compiled files, because +## they give cleaner stacktraces. +## Beware: it approximates 'no-byte-compile', so watch out for false-positives! %.log: %.el - @if grep '^;.*no-byte-compile: t' $< > /dev/null; then \ - loadfile=$<; \ - else \ - loadfile=$ /dev/null; then \ + ${MAKE} $$elc; \ fi; \ + loadfile=$<; \ echo Testing $$loadfile; \ stat=OK ; \ ${MKDIR_P} $(dir $@) ; \