commit df7774be39af76d3072a0278ef815a47bf50dfe9 (HEAD, refs/remotes/origin/master) Author: Tino Calancha Date: Mon Jul 11 14:34:49 2016 +0900 Dired always read file system * dired.el (dired-always-read-filesystem): Add new option. (dired-mark-files-containing-regexp): Use it (Bug#22694). * doc/emacs/dired.texi: Mention it in the manual. * test/lisp/dired-tests.el (dired-test-bug22694): Add test. ;* etc/NEWS: Add entry for this change. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 486e92a..2cda51a 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -550,13 +550,16 @@ Mark (with @samp{*}) all files whose @emph{contents} contain a match for the regular expression @var{regexp} (@code{dired-mark-files-containing-regexp}). This command is like @kbd{% m}, except that it searches the file contents instead of the file -name. Note that if a file is visited in an Emacs buffer, this command -will look in the buffer without revisiting the file, so the results +name. Note that if a file is visited in an Emacs buffer, +and @code{dired-always-read-filesystem} is @code{nil} (the default), this +command will look in the buffer without revisiting the file, so the results might be inconsistent with the file on disk if its contents has changed since it was last visited. If you don't want this, you may wish reverting the files you have visited in your buffers, or turning on the @code{auto-revert} mode in those buffers, before invoking this -command. @xref{Reverting}. +command. @xref{Reverting}. If you prefer that this command always revisit +the file, without having to revert the file or enable @code{auto-revert} +mode, you might want to set @code{dired-always-read-filesystem} to non-@code{nil}. @item C-/ @itemx C-x u diff --git a/etc/NEWS b/etc/NEWS index 6aef73a..c58349c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -243,6 +243,14 @@ whose content matches a regexp; bound to '% g'. ** Dired +++ +*** A New option 'dired-always-read-filesystem' default to nil. +If non-nil, buffers visiting files are reverted before search them; +for instance, in 'dired-mark-files-containing-regexp' a non-nil value +of this option means the file is revisited in a temporary buffer; +this temporary buffer is the actual buffer searched: the original buffer +visiting the file is not modified. + ++++ *** In wdired, when editing files to contain slash characters, the resulting directories are automatically created. Whether to do this is controlled by the 'wdired-create-parent-directories' variable. diff --git a/lisp/dired.el b/lisp/dired.el index d078478..5d14291 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -255,6 +255,18 @@ new Dired buffers." :version "24.4" :group 'dired) +(defcustom dired-always-read-filesystem nil + "Non-nil means revert buffers visiting files before searching them. + By default, commands like `dired-mark-files-containing-regexp' will + search any buffers visiting the marked files without reverting them, + even if they were changed on disk. When this option is non-nil, such + buffers are always reverted in a temporary buffer before searching + them: the search is performed on the temporary buffer, the original + buffer visiting the file is not modified." + :type 'boolean + :version "25.2" + :group 'dired) + ;; Internal variables (defvar dired-marker-char ?* ; the answer is 42 @@ -3359,7 +3371,8 @@ object files--just `.o' will mark more than you might think." A prefix argument means to unmark them instead. `.' and `..' are never marked. -Note that if a file is visited in an Emacs buffer, this command will +Note that if a file is visited in an Emacs buffer, and +`dired-always-read-filesystem' is nil, this command will look in the buffer without revisiting the file, so the results might be inconsistent with the file on disk if its contents has changed since it was last visited." @@ -3379,7 +3392,7 @@ since it was last visited." (message "Checking %s" fn) ;; For now we do it inside emacs ;; Grep might be better if there are a lot of files - (if prebuf + (if (and prebuf (not dired-always-read-filesystem)) (with-current-buffer prebuf (save-excursion (goto-char (point-min)) diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index 3efe259..d66a9ca 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -31,5 +31,24 @@ (symbol-function 'dired-jump)))) +(ert-deftest dired-test-bug22694 () + "Test for http://debbugs.gnu.org/22694 ." + (let* ((dir (expand-file-name "bug22694" default-directory)) + (file "test") + (full-name (expand-file-name file dir)) + (regexp "bar") + (dired-always-read-filesystem t)) + (make-directory dir) + (with-temp-file full-name (insert "foo")) + (find-file-noselect full-name) + (dired dir) + (with-temp-file full-name (insert "bar")) + (dired-mark-files-containing-regexp regexp) + (unwind-protect + (should (equal (dired-get-marked-files nil nil nil 'distinguish-1-mark) + `(t ,full-name))) + ;; Clean up + (delete-directory dir 'recursive)))) + (provide 'dired-tests) ;; dired-tests.el ends here commit bfeda891a51178dd0032800ea4aef013c62bbe10 Author: YAMAMOTO Mitsuharu Date: Mon Jul 11 13:35:57 2016 +0900 * src/macfont.m (mac_font_shape): Make sure that total_advance is increasing. diff --git a/src/macfont.m b/src/macfont.m index 4e4daba..c799100 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -3767,6 +3767,7 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no { struct mac_glyph_layout *gl; CGPoint position; + CGFloat max_x; if (!RIGHT_TO_LEFT_P) gl = glbuf + range.location; @@ -3788,12 +3789,13 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no CTRunGetGlyphs (ctrun, range, &gl->glyph_id); CTRunGetPositions (ctrun, range, &position); + max_x = position.x + CTRunGetTypographicBounds (ctrun, range, + NULL, NULL, NULL); + max_x = max (max_x, total_advance); gl->advance_delta = position.x - total_advance; gl->baseline_delta = position.y; - gl->advance = (gl->advance_delta - + CTRunGetTypographicBounds (ctrun, range, - NULL, NULL, NULL)); - total_advance += gl->advance; + gl->advance = max_x - total_advance; + total_advance = max_x; } if (RIGHT_TO_LEFT_P) commit 8dc4626a0bd13b8d256a9d0c44e321d2c3d702d7 Author: Tino Calancha Date: Mon Jul 11 11:30:48 2016 +0900 Avoid 'unused var' 'not left unused var' warnings * lisp/ibuffer.el (ibuffer-locked-buffer-p): Remove unused var 'char'. Rename used var '_buffer' to 'cbuffer'. * lisp/ibuf-ext.el (ibuffer-unmark-all): Rename used var '_mark' to cmark'. diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 6102e1f..3e4e0dc 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1504,10 +1504,9 @@ You can then feed the file name(s) to other commands with \\[yank]." (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 + (let ((cbuffer (or buf (ibuffer-current-buffer)))) + (when cbuffer + (with-current-buffer cbuffer (and (boundp 'emacs-lock-mode) emacs-lock-mode))))) ;;;###autoload diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 37f72bc..8e24629 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1348,8 +1348,8 @@ With optional ARG, make read-only only if ARG is not negative." t))) ((not (char-equal mark ?\r)) (ibuffer-map-lines - (lambda (_buf _mark) - (when (char-equal _mark mark) + (lambda (_buf cmark) + (when (char-equal cmark mark) (ibuffer-set-mark-1 ?\s)) t))) (t commit 244754e2b26f5790e96468ee710375e5ab314087 Author: Tino Calancha Date: Mon Jul 11 02:47:28 2016 +0900 * lisp/simple.el (shell-command, shell-command-on-region): Fix doc strings diff --git a/lisp/simple.el b/lisp/simple.el index ba026af..4d35d7c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3235,11 +3235,11 @@ Noninteractive callers can specify coding systems by binding The optional second argument OUTPUT-BUFFER, if non-nil, says to put the output in some other buffer. -If OUTPUT-BUFFER is a buffer or buffer name, put the output there. -If OUTPUT-BUFFER is not a buffer and not nil, -insert output in current buffer. (This cannot be done asynchronously.) -In either case, the buffer is first erased, and the output is -inserted after point (leaving mark after it). +If OUTPUT-BUFFER is a buffer or buffer name, erase that buffer +and insert the output there. +If OUTPUT-BUFFER is not a buffer and not nil, insert the output +in current buffer after point leaving mark after it. +(This cannot be done asynchronously). If the command terminates without error, but generates output, and you did not specify \"insert it in the current buffer\", @@ -3504,10 +3504,10 @@ Command Output*' is deleted. Optional fourth arg OUTPUT-BUFFER specifies where to put the command's output. If the value is a buffer or buffer name, -put the output there. If the value is nil, use the buffer -`*Shell Command Output*'. Any other value, excluding nil, -means to insert the output in the current buffer. In either case, -the output is inserted after point (leaving mark after it). +erase that buffer and insert the output there. +If the value is nil, use the buffer `*Shell Command Output*'. +Any other non-nil value means to insert the output in the +current buffer after START. Optional fifth arg REPLACE, if non-nil, means to insert the output in place of text from START to END, putting point and mark commit 9a8edcd9aba1650f68d7aea373bab65322585337 Author: Michael Albinus Date: Sun Jul 10 17:03:48 2016 +0200 Add a note how to use `tramp-own-remote-path' * doc/misc/tramp.texi (Inline methods, External methods) (Remote shell setup, Android shell setup) (Frequently Asked Questions, Frequently Asked Questions): Use @command and @samp consequently. (Remote programs): The remote shell must support the -l argument, in order to use `tramp-own-remote-path'. (Bug#23914) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index dc3ef23..e8c181b 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -565,7 +565,7 @@ remote host. @command{ssh} can also take extra parameters as port numbers. For example, a host on port 42 is specified as @file{host#42} (the real host name, a hash sign, then a port number). It is the same as passing -@code{-p 42} to the @command{ssh} command. +@samp{-p 42} to the @command{ssh} command. @item @option{telnet} @cindex method telnet @@ -832,7 +832,7 @@ Since SMB shares end in the @code{$} character, @value{tramp} must use substitutions. When @value{tramp} is not specific about the share name or uses the -generic remote directory @code{/}, @command{smbclient} returns all +generic remote directory @file{/}, @command{smbclient} returns all available shares. Since SMB authentication is based on each SMB share, @value{tramp} @@ -1666,13 +1666,16 @@ shown below for @value{tramp} to use when connecting. Another way to find the remote path is to use the path assigned to the remote user by the remote host. @value{tramp} does not normally retain -this remote path after logging. However, @code{tramp-own-remote-path} +this remote path after login. However, @code{tramp-own-remote-path} preserves the path value, which can be used to update @code{tramp-remote-path}. @lisp (add-to-list 'tramp-remote-path 'tramp-own-remote-path) @end lisp + +@strong{Note} that this works only if your remote @command{/bin/sh} +shell supports the login argument @samp{-l}. @end defopt When remote search paths are changed, local @value{tramp} caches must @@ -1864,7 +1867,7 @@ install and execute a listener as follows (see @code{tramp-methods}): @end example The above command-line syntax has changed with @command{busybox} -versions. If @command{nc} refuses the @command{-p} parameter, then +versions. If @command{nc} refuses the @samp{-p} parameter, then overwrite as follows: @lisp @@ -1892,9 +1895,9 @@ Applications such as @code{SSHDroid} that run @command{sshd} process on the Android device can accept any @option{ssh}-based methods provided these settings are adjusted: -@code{sh} must be specified for remote shell since Android devices do -not provide @code{/bin/sh}. @code{sh} will then invoke whatever shell is -installed on the device with this setting: +@command{sh} must be specified for remote shell since Android devices +do not provide @command{/bin/sh}. @command{sh} will then invoke +whatever shell is installed on the device with this setting: @lisp (add-to-list 'tramp-connection-properties @@ -2870,9 +2873,9 @@ To test if this is the case, open a remote shell and check if the output of @command{ls} is in color. To disable @acronym{ANSI} escape sequences from the remote hosts, -disable @option{--color=yes} or @option{--color=auto} in the remote -host's @file{.bashrc} or @file{.profile}. Turn this alias on and off -to see if file name completion works. +disable @samp{--color=yes} or @samp{--color=auto} in the remote host's +@file{.bashrc} or @file{.profile}. Turn this alias on and off to see +if file name completion works. @item File name completion does not work in directories with large number of @@ -2885,7 +2888,7 @@ shell's limit on length of command lines and hang. @value{tramp} uses globbing. To test if globbing hangs, open a shell on the remote host and then -run @samp{ls -d * ..?* > /dev/null}. +run @command{ls -d * ..?* > /dev/null}. When testing, ensure the remote shell is the same shell (@command{/bin/sh}, @command{ksh} or @command{bash}), that commit 04a7977f700fc46cf29d5a41bc7dcffef71044c6 Author: Alan Third Date: Sun Jul 10 10:18:40 2016 +0100 Remove App Nap setting from Info.plist (bug#22993) * nextstep/templates/Info.plist.in: Remove LSAppNapIsDisabled key since it doesn't actually disable app nap. diff --git a/nextstep/templates/Info.plist.in b/nextstep/templates/Info.plist.in index 889a070..dcd2fe3 100644 --- a/nextstep/templates/Info.plist.in +++ b/nextstep/templates/Info.plist.in @@ -675,7 +675,5 @@ along with GNU Emacs. If not, see . NSAppleScriptEnabled YES - LSAppNapIsDisabled -