------------------------------------------------------------ revno: 116488 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-02-20 00:25:12 -0800 message: Rework previous doc/emacs change * doc/emacs/search.texi (Special Isearch): Mention invisible text. * doc/emacs/text.texi (Outline Visibility): Mention `M-s i' in isearch. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-02-20 08:14:20 +0000 +++ doc/emacs/ChangeLog 2014-02-20 08:25:12 +0000 @@ -1,6 +1,7 @@ 2014-02-20 Glenn Morris * search.texi (Special Isearch): Mention invisible text. + * text.texi (Outline Visibility): Mention `M-s i' in isearch. 2014-02-18 Glenn Morris === modified file 'doc/emacs/search.texi' --- doc/emacs/search.texi 2014-02-20 08:14:20 +0000 +++ doc/emacs/search.texi 2014-02-20 08:25:12 +0000 @@ -247,14 +247,8 @@ @cindex invisible text, searching for @kindex M-s i @r{(Incremental search)} @findex isearch-toggle-invisible -@vindex search-invisible - Some Emacs modes hide certain text by making it invisible. For -example, Outline major mode (@pxref{Outline Mode}). By default, -incremental search will search for matches in text hidden by Outline -mode (and some other modes), and make the text visible if it finds a match. -To toggle whether or not invisible text is searched, type -@kbd{M-s i} (@code{isearch-toggle-invisible}). To change the default -for future searches, customize the option @code{search-invisible}. + To toggle whether or not invisible text is searched, type +@kbd{M-s i} (@code{isearch-toggle-invisible}). @xref{Outline Search}. To search for a newline character, type @kbd{C-j}. === modified file 'doc/emacs/text.texi' --- doc/emacs/text.texi 2014-02-11 06:34:29 +0000 +++ doc/emacs/text.texi 2014-02-20 08:25:12 +0000 @@ -1124,12 +1124,17 @@ numeric argument @var{n}, it hides everything except the top @var{n} levels of heading lines. +@anchor{Outline Search} @findex reveal-mode +@vindex search-invisible When incremental search finds text that is hidden by Outline mode, it makes that part of the buffer visible. If you exit the search at -that position, the text remains visible. You can also automatically -make text visible as you navigate in it by using Reveal mode (@kbd{M-x -reveal-mode}), a buffer-local minor mode. +that position, the text remains visible. To toggle whether or not +an active incremental search can match hidden text, type @kbd{M-s i}. +To change the default for future searches, customize the option +@code{search-invisible}. You can also automatically make text visible +as you navigate in it by using Reveal mode (@kbd{M-x reveal-mode}), a +buffer-local minor mode. @node Outline Views @subsection Viewing One Outline in Multiple Views ------------------------------------------------------------ revno: 116487 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-02-20 00:14:20 -0800 message: Some doc for search-invisible * doc/emacs/search.texi (Special Isearch): Mention invisible text. * lisp/isearch.el (search-invisible): Doc fix. * etc/NEWS: Related edit. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-02-18 18:15:29 +0000 +++ doc/emacs/ChangeLog 2014-02-20 08:14:20 +0000 @@ -1,3 +1,7 @@ +2014-02-20 Glenn Morris + + * search.texi (Special Isearch): Mention invisible text. + 2014-02-18 Glenn Morris * trouble.texi (Contributing) [WWW_GNU_ORG]: Link to === modified file 'doc/emacs/search.texi' --- doc/emacs/search.texi 2014-02-08 06:51:42 +0000 +++ doc/emacs/search.texi 2014-02-20 08:14:20 +0000 @@ -244,6 +244,18 @@ delete the upper-case character from the search string, it ceases to have this effect. @xref{Search Case}. +@cindex invisible text, searching for +@kindex M-s i @r{(Incremental search)} +@findex isearch-toggle-invisible +@vindex search-invisible + Some Emacs modes hide certain text by making it invisible. For +example, Outline major mode (@pxref{Outline Mode}). By default, +incremental search will search for matches in text hidden by Outline +mode (and some other modes), and make the text visible if it finds a match. +To toggle whether or not invisible text is searched, type +@kbd{M-s i} (@code{isearch-toggle-invisible}). To change the default +for future searches, customize the option @code{search-invisible}. + To search for a newline character, type @kbd{C-j}. To search for non-@acronym{ASCII} characters, use one of the @@ -1047,6 +1059,7 @@ performed by the replace commands (@pxref{Replace}) and the minibuffer history matching commands (@pxref{Minibuffer History}). +@c isearch-toggle-case-fold Typing @kbd{M-c} within an incremental search toggles the case sensitivity of that search. The effect does not extend beyond the current incremental search to the next one, but it does override the === modified file 'etc/NEWS' --- etc/NEWS 2014-02-20 07:38:47 +0000 +++ etc/NEWS 2014-02-20 08:14:20 +0000 @@ -766,9 +766,7 @@ *** `C-x 8 RET' in Isearch mode reads a character by its Unicode name and adds it to the search string. -*** `M-s i' in Isearch mode toggles the variable `isearch-invisible' -between nil and the value of the option `search-invisible' (or `open' -when it's nil). +*** `M-s i' in Isearch mode toggles whether search matches invisible text. *** `query-replace' skips invisible text when `search-invisible' is nil, and opens overlays with hidden text when `search-invisible' is `open'. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-20 04:45:19 +0000 +++ lisp/ChangeLog 2014-02-20 08:14:20 +0000 @@ -1,3 +1,7 @@ +2014-02-20 Glenn Morris + + * isearch.el (search-invisible): Doc fix. + 2014-02-20 W. Trevor King (tiny change) * term/xterm.el (xterm--version-handler): Adapt to xterm-280's output === modified file 'lisp/isearch.el' --- lisp/isearch.el 2014-02-10 01:34:22 +0000 +++ lisp/isearch.el 2014-02-20 08:14:20 +0000 @@ -137,6 +137,12 @@ an overlay having an `invisible' property and that overlay has a property `isearch-open-invisible', then incremental search will show the contents. \(This applies when using `outline.el' and `hideshow.el'.) + +To temporarily change the value for an active incremental search, +use \\\\[isearch-toggle-invisible]. + +See also the related option `isearch-hide-immediately'. + See also `reveal-mode' if you want overlays to automatically be opened whenever point is in one of them." :type '(choice (const :tag "Match hidden text" t) ------------------------------------------------------------ revno: 116486 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-02-19 23:38:47 -0800 message: Some doc for defalias-fset-function * doc/lispref/functions.texi (Defining Functions): Mention defalias-fset-function. * src/data.c (Fdefalias): Doc fix. * etc/NEWS: Related edit. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-02-17 02:12:50 +0000 +++ doc/lispref/ChangeLog 2014-02-20 07:38:47 +0000 @@ -1,3 +1,7 @@ +2014-02-20 Glenn Morris + + * functions.texi (Defining Functions): Mention defalias-fset-function. + 2014-02-17 Glenn Morris * minibuf.texi (Text from Minibuffer): Update read-regexp details. === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2014-01-10 19:40:32 +0000 +++ doc/lispref/functions.texi 2014-02-20 07:38:47 +0000 @@ -592,6 +592,11 @@ of @var{name}. Otherwise, any documentation provided by @var{definition} is used. +@cindex defalias-fset-function property +Internally, @code{defalias} normally uses @code{fset} to set the definition. +If @var{name} has a @code{defalias-fset-function} property, however, +the associated value is used as a function to call in place of @code{fset}. + The proper place to use @code{defalias} is where a specific function name is being defined---especially where that name appears explicitly in the source file being loaded. This is because @code{defalias} records === modified file 'etc/NEWS' --- etc/NEWS 2014-02-19 08:34:45 +0000 +++ etc/NEWS 2014-02-20 07:38:47 +0000 @@ -1094,8 +1094,10 @@ Generic commands are interactive functions whose implementation can be selected among several alternatives, as a matter of user preference. -** The `defalias-fset-function' property lets you catch `defalias' -calls, and redirect them to your own function, instead of `fset'. ++++ +** If you give a symbol a `defalias-fset-function' property, `defalias' +on that symbol will use the associated value as a function to call +in place of `fset'. +++ ** New variable `enable-dir-local-variables'. === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-19 17:32:29 +0000 +++ src/ChangeLog 2014-02-20 07:38:47 +0000 @@ -1,3 +1,7 @@ +2014-02-20 Glenn Morris + + * data.c (Fdefalias): Doc fix. + 2014-02-19 Eli Zaretskii * xdisp.c (display_line): Fix horizontal scrolling of large images === modified file 'src/data.c' --- src/data.c 2014-01-31 09:41:54 +0000 +++ src/data.c 2014-02-20 07:38:47 +0000 @@ -738,6 +738,10 @@ The optional third argument DOCSTRING specifies the documentation string for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string determined by DEFINITION. + +Internally, this normally uses `fset', but if SYMBOL has a +`defalias-fset-function' property, the associated value is used instead. + The return value is undefined. */) (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) { ------------------------------------------------------------ revno: 116485 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16657 author: W. Trevor King committer: Stefan Monnier branch nick: trunk timestamp: Wed 2014-02-19 23:45:19 -0500 message: * lisp/term/xterm.el (xterm--version-handler): Adapt to xterm-280's output. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-19 21:04:06 +0000 +++ lisp/ChangeLog 2014-02-20 04:45:19 +0000 @@ -1,3 +1,8 @@ +2014-02-20 W. Trevor King (tiny change) + + * term/xterm.el (xterm--version-handler): Adapt to xterm-280's output + (bug#16657). + 2014-02-19 Juanma Barranquero * frameset.el (frameset-restore): Delay removing an old frame's === modified file 'lisp/term/xterm.el' --- lisp/term/xterm.el 2014-01-01 07:43:34 +0000 +++ lisp/term/xterm.el 2014-02-20 04:45:19 +0000 @@ -500,8 +500,9 @@ ;; see if by using a longer timeout we get rid of most issues. (while (and (setq chr (read-event nil nil 2)) (not (equal chr ?c))) (setq str (concat str (string chr)))) - (when (string-match "0;\\([0-9]+\\);0" str) - (let ((version (string-to-number (match-string 1 str)))) + ;; Since xterm-280, the terminal type (NUMBER1) is now 41 instead of 0. + (when (string-match "\\([0-9]+\\);\\([0-9]+\\);0" str) + (let ((version (string-to-number (match-string 2 str)))) ;; If version is 242 or higher, assume the xterm supports ;; reporting the background color (TODO: maybe earlier ;; versions do too...) ------------------------------------------------------------ revno: 116484 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2014-02-19 22:04:06 +0100 message: lisp/frameset.el (frameset-restore): Remove duplicate ids only when needed. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-19 19:24:32 +0000 +++ lisp/ChangeLog 2014-02-19 21:04:06 +0000 @@ -1,3 +1,8 @@ +2014-02-19 Juanma Barranquero + + * frameset.el (frameset-restore): Delay removing an old frame's + duplicate id until the new frame has been correctly created. + 2014-02-19 Michael Albinus * net/tramp.el (tramp-handle-make-symbolic-link): New defun. === modified file 'lisp/frameset.el' --- lisp/frameset.el 2014-02-19 11:01:35 +0000 +++ lisp/frameset.el 2014-02-19 21:04:06 +0000 @@ -1116,7 +1116,7 @@ (force-display (if (functionp force-display) (funcall force-display frame-cfg window-cfg) force-display)) - frame to-tty) + frame to-tty duplicate) ;; Only set target if forcing displays and the target display is different. (cond ((frameset-keep-original-display-p force-display) (setq frameset--target-display nil)) @@ -1134,16 +1134,14 @@ (or (eq force-display :delete) (and to-tty (eq (cdr (assq 'minibuffer frame-cfg)) 'only)))) - ;; If keeping non-reusable frames, and the frameset--id of one of them - ;; matches the id of a frame being restored (because, for example, the - ;; frameset has already been read in the same session), remove the - ;; frameset--id from the non-reusable frame, which is not useful anymore. - (when (and other-frames - (or (eq reuse-frames :keep) (consp reuse-frames))) - (let ((dup (frameset-frame-with-id (frameset-cfg-id frame-cfg) - other-frames))) - (when dup - (set-frame-parameter dup 'frameset--id nil)))) + ;; To avoid duplicating frame ids after restoration, we note any + ;; existing frame whose id matches a frame configuration in the + ;; frameset. Once the frame config is properly restored, we can + ;; reset the old frame's id to nil. + (setq duplicate (and other-frames + (or (eq reuse-frames :keep) (consp reuse-frames)) + (frameset-frame-with-id (frameset-cfg-id frame-cfg) + other-frames))) ;; Restore minibuffers. Some of this stuff could be done in a filter ;; function, but it would be messy because restoring minibuffers affects ;; global state; it's best to do it here than add a bunch of global @@ -1177,6 +1175,9 @@ (setq frame (frameset--restore-frame frame-cfg window-cfg (or filters frameset-filter-alist) force-onscreen)) + ;; Now reset any duplicate frameset--id + (when (and duplicate (not (eq frame duplicate))) + (set-frame-parameter duplicate 'frameset--id nil)) ;; Set default-minibuffer if required. (when default (setq default-minibuffer-frame frame)))) (error ------------------------------------------------------------ revno: 116483 committer: Michael Albinus branch nick: trunk timestamp: Wed 2014-02-19 20:31:02 +0100 message: * trampver.texi: Update release number. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-02-19 08:34:45 +0000 +++ doc/misc/ChangeLog 2014-02-19 19:31:02 +0000 @@ -1,3 +1,7 @@ +2014-02-19 Michael Albinus + + * trampver.texi: Update release number. + 2014-02-19 Glenn Morris * remember.texi: Copyedits. === modified file 'doc/misc/trampver.texi' --- doc/misc/trampver.texi 2014-02-16 17:23:00 +0000 +++ doc/misc/trampver.texi 2014-02-19 19:31:02 +0000 @@ -8,7 +8,7 @@ @c In the Tramp CVS, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.2.9 +@set trampver 2.2.9-24.4 @c Other flags from configuration @set instprefix /usr/local ------------------------------------------------------------ revno: 116482 committer: Michael Albinus branch nick: trunk timestamp: Wed 2014-02-19 20:28:32 +0100 message: * automated/tramp-tests.el (tramp-test17-insert-directory): Make first line "total 123" optional. (tramp-test20-file-modes, tramp-test22-file-times) (tramp-test26-process-file, tramp-test27-start-file-process) (tramp-test28-shell-command): Skip for tramp-gvfs.el and tramp-smb.el. (tramp-test20-file-modes): Check for "root" only when there is an explicit user name. (tramp-test21-file-links): Handle "... not supported" error. (tramp-test22-file-times): Skip for "don't know" return values. (tramp-test26-process-file, tramp-test28-shell-command): Remove color escape sequences. (tramp-test28-shell-command): Use `accept-process-output' rather than `sit-for'. (tramp-test30-utf8): Set coding system `utf-8'. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-02-17 07:05:44 +0000 +++ test/ChangeLog 2014-02-19 19:28:32 +0000 @@ -1,3 +1,21 @@ +2014-02-19 Michael Albinus + + * automated/tramp-tests.el (tramp-test17-insert-directory): + Make first line "total 123" optional. + (tramp-test20-file-modes, tramp-test22-file-times) + (tramp-test26-process-file, tramp-test27-start-file-process) + (tramp-test28-shell-command): Skip for tramp-gvfs.el and + tramp-smb.el. + (tramp-test20-file-modes): Check for "root" only when there is an + explicit user name. + (tramp-test21-file-links): Handle "... not supported" error. + (tramp-test22-file-times): Skip for "don't know" return values. + (tramp-test26-process-file, tramp-test28-shell-command): + Remove color escape sequences. + (tramp-test28-shell-command): Use `accept-process-output' rather + than `sit-for'. + (tramp-test30-utf8): Set coding system `utf-8'. + 2014-02-17 Michael Albinus * automated/tramp-tests.el (tramp-test28-shell-command): Perform === modified file 'test/automated/tramp-tests.el' --- test/automated/tramp-tests.el 2014-02-17 07:05:44 +0000 +++ test/automated/tramp-tests.el 2014-02-19 19:28:32 +0000 @@ -822,7 +822,8 @@ (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p) (goto-char (point-min)) (should - (looking-at-p "total +[[:digit:]]+\n.+ \\.\n.+ \\.\\.\n.+ foo$")))) + (looking-at-p + "\\(total +[[:digit:]]+\n\\)?.+ \\.\n.+ \\.\\.\n.+ foo$")))) (ignore-errors (delete-directory tmp-name1 'recursive))))) (ert-deftest tramp-test18-file-attributes () @@ -905,6 +906,11 @@ "Check `file-modes'. This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (skip-unless (tramp--test-enabled)) + (skip-unless + (not + (memq + (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) + '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) (tramp-cleanup-connection (tramp-dissect-file-name tramp-test-temporary-file-directory) nil 'keep-password) @@ -922,7 +928,8 @@ (should (= (file-modes tmp-name) #o444)) (should-not (file-executable-p tmp-name)) ;; A file is always writable for user "root". - (unless (string-equal (file-remote-p tmp-name 'user) "root") + (when (and (stringp (file-remote-p tmp-name 'user)) + (not (string-equal (file-remote-p tmp-name 'user) "root"))) (should-not (file-writable-p tmp-name)))) (ignore-errors (delete-file tmp-name))))) @@ -941,7 +948,15 @@ (progn (write-region "foo" nil tmp-name1) (should (file-exists-p tmp-name1)) - (make-symbolic-link tmp-name1 tmp-name2) + ;; Method "smb" supports `make-symbolic-link' only if the + ;; remote host has CIFS capabilities. tramp-adb.el and + ;; tramp-gvfs.el do not support symbolic links at all. + (condition-case err + (make-symbolic-link tmp-name1 tmp-name2) + (file-error + (skip-unless + (not (string-equal (error-message-string err) + "make-symbolic-link not supported"))))) (should (file-symlink-p tmp-name2)) (should-error (make-symbolic-link tmp-name1 tmp-name2)) (make-symbolic-link tmp-name1 tmp-name2 'ok-if-already-exists) @@ -983,6 +998,11 @@ (ert-deftest tramp-test22-file-times () "Check `set-file-times' and `file-newer-than-file-p'." (skip-unless (tramp--test-enabled)) + (skip-unless + (not + (memq + (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) + '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) (tramp-cleanup-connection (tramp-dissect-file-name tramp-test-temporary-file-directory) nil 'keep-password) @@ -997,6 +1017,9 @@ (should (consp (nth 5 (file-attributes tmp-name1)))) ;; '(0 0) means don't know, and will be replaced by `current-time'. (set-file-times tmp-name1 '(0 1)) + ;; Dumb busyboxes are not able to return the date correctly. + ;; They say "don't know. + (skip-unless (not (equal (nth 5 (file-attributes tmp-name1)) '(0 0)))) (should (equal (nth 5 (file-attributes tmp-name1)) '(0 1))) (write-region "bla" nil tmp-name2) (should (file-exists-p tmp-name2)) @@ -1077,6 +1100,11 @@ (ert-deftest tramp-test26-process-file () "Check `process-file'." (skip-unless (tramp--test-enabled)) + (skip-unless + (not + (memq + (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) + '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) (tramp-cleanup-connection (tramp-dissect-file-name tramp-test-temporary-file-directory) nil 'keep-password) @@ -1096,6 +1124,10 @@ (should (zerop (process-file "ls" nil t nil (file-name-nondirectory tmp-name)))) + ;; `ls' could produce colorized output. + (goto-char (point-min)) + (while (re-search-forward tramp-color-escape-sequence-regexp nil t) + (replace-match "" nil nil)) (should (string-equal (format "%s\n" (file-name-nondirectory tmp-name)) @@ -1105,6 +1137,11 @@ (ert-deftest tramp-test27-start-file-process () "Check `start-file-process'." (skip-unless (tramp--test-enabled)) + (skip-unless + (not + (memq + (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) + '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) (tramp-cleanup-connection (tramp-dissect-file-name tramp-test-temporary-file-directory) nil 'keep-password) @@ -1153,6 +1190,11 @@ (ert-deftest tramp-test28-shell-command () "Check `shell-command'." (skip-unless (tramp--test-enabled)) + (skip-unless + (not + (memq + (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) + '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) (tramp-cleanup-connection (tramp-dissect-file-name tramp-test-temporary-file-directory) nil 'keep-password) @@ -1165,6 +1207,10 @@ (should (file-exists-p tmp-name)) (shell-command (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer)) + ;; `ls' could produce colorized output. + (goto-char (point-min)) + (while (re-search-forward tramp-color-escape-sequence-regexp nil t) + (replace-match "" nil nil)) (should (string-equal (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) @@ -1176,11 +1222,15 @@ (should (file-exists-p tmp-name)) (async-shell-command (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer)) - (sit-for 1 'nodisplay) + (accept-process-output (get-buffer-process (current-buffer)) 1) (while (ignore-errors (memq (process-status (get-buffer-process (current-buffer))) '(run open))) - (sit-for 1 'nodisplay)) + (accept-process-output (get-buffer-process (current-buffer)) 1)) + ;; `ls' could produce colorized output. + (goto-char (point-min)) + (while (re-search-forward tramp-color-escape-sequence-regexp nil t) + (replace-match "" nil nil)) (should (string-equal (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) @@ -1194,11 +1244,11 @@ (process-send-string (get-buffer-process (current-buffer)) (format "%s\n" (file-name-nondirectory tmp-name))) - (sit-for 1 'nodisplay) + (accept-process-output (get-buffer-process (current-buffer)) 1) (while (ignore-errors (memq (process-status (get-buffer-process (current-buffer))) '(run open))) - (sit-for 1 'nodisplay)) + (accept-process-output (get-buffer-process (current-buffer)) 1)) (should (string-equal (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) @@ -1260,6 +1310,8 @@ nil 'keep-password) (let ((tmp-name (tramp--test-make-temp-name)) + (coding-system-for-read 'utf-8) + (coding-system-for-write 'utf-8) (arabic "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت") (chinese "银河系漫游指南系列") (russian "Автостопом по гала́ктике")) @@ -1293,10 +1345,10 @@ ;; * set-file-selinux-context ;; * Fix `tramp-test17-insert-directory' for -;; `ls-lisp-insert-directory' ("plink" and friends). -;; * Fix `tramp-test27-start-file-process' on MS Windows -;; (`process-send-eof'?). -;; * Fix `tramp-test29-utf8' on MS Windows. +;; `ls-lisp-insert-directory' ("plink" and friends, tramp-gvfs.el). +;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). +;; * Fix `tramp-test28-shell-command' on MS Windows (`process-send-eof'?). +;; * Fix `tramp-test30-utf8' on MS Windows. Seems to be in `directory-files'. (defun tramp-test-all (&optional interactive) "Run all tests for \\[tramp]." ------------------------------------------------------------ revno: 116481 committer: Michael Albinus branch nick: trunk timestamp: Wed 2014-02-19 20:24:32 +0100 message: Some Tramp minor fixes, found during test campaign. * net/tramp-adb.el (tramp-adb-file-name-handler-alist) [make-symbolic-link]: Use `tramp-handle-make-symbolic-link'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [make-symbolic-link]: Use `tramp-handle-make-symbolic-link'. (tramp-gvfs-maybe-open-connection): Set always connection properties, even if target is mounted already. * net/tramp-sh.el (tramp-color-escape-sequence-regexp): Set tramp-autoload cookie. (tramp-get-remote-touch): New defun. (tramp-sh-handle-set-file-times): Use it. (tramp-sh-handle-directory-files-and-attributes): Use `tramp-handle-directory-files-and-attributes' if neither stat nor perl are available on the remote host. * net/tramp-smb.el (tramp-smb-handle-insert-directory): Mark trailing "/". Write long listing only when "l" belongs to the switches. * net/tramp.el (tramp-handle-make-symbolic-link): New defun. (tramp-check-cached-permissions): Call `file-attributes' if the cache is empty. * net/trampver.el: Update release number. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-19 11:01:35 +0000 +++ lisp/ChangeLog 2014-02-19 19:24:32 +0000 @@ -1,3 +1,30 @@ +2014-02-19 Michael Albinus + + * net/tramp.el (tramp-handle-make-symbolic-link): New defun. + (tramp-check-cached-permissions): Call `file-attributes' if the + cache is empty. + + * net/tramp-adb.el (tramp-adb-file-name-handler-alist) + [make-symbolic-link]: Use `tramp-handle-make-symbolic-link'. + + * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) + [make-symbolic-link]: Use `tramp-handle-make-symbolic-link'. + (tramp-gvfs-maybe-open-connection): Set always connection + properties, even if target is mounted already. + + * net/tramp-sh.el (tramp-color-escape-sequence-regexp): + Set tramp-autoload cookie. + (tramp-get-remote-touch): New defun. + (tramp-sh-handle-set-file-times): Use it. + (tramp-sh-handle-directory-files-and-attributes): + Use `tramp-handle-directory-files-and-attributes' if neither stat + nor perl are available on the remote host. + + * net/tramp-smb.el (tramp-smb-handle-insert-directory): Mark trailing + "/". Write long listing only when "l" belongs to the switches. + + * net/trampver.el: Update release number. + 2014-02-19 Juanma Barranquero * frameset.el (frameset--reuse-frame): Remove workaround for bug#16793. === modified file 'lisp/net/tramp-adb.el' --- lisp/net/tramp-adb.el 2014-01-01 07:43:34 +0000 +++ lisp/net/tramp-adb.el 2014-02-19 19:24:32 +0000 @@ -140,7 +140,7 @@ (make-auto-save-file-name . tramp-handle-make-auto-save-file-name) (make-directory . tramp-adb-handle-make-directory) (make-directory-internal . ignore) - (make-symbolic-link . ignore) + (make-symbolic-link . tramp-handle-make-symbolic-link) (process-file . tramp-adb-handle-process-file) (rename-file . tramp-adb-handle-rename-file) (set-file-acl . ignore) === modified file 'lisp/net/tramp-gvfs.el' --- lisp/net/tramp-gvfs.el 2014-01-01 07:43:34 +0000 +++ lisp/net/tramp-gvfs.el 2014-02-19 19:24:32 +0000 @@ -457,7 +457,7 @@ (make-auto-save-file-name . tramp-handle-make-auto-save-file-name) (make-directory . tramp-gvfs-handle-make-directory) (make-directory-internal . ignore) - (make-symbolic-link . ignore) + (make-symbolic-link . tramp-handle-make-symbolic-link) (process-file . ignore) (rename-file . tramp-gvfs-handle-rename-file) (set-file-acl . ignore) @@ -1547,19 +1547,19 @@ ;; is marked with the fuse-mountpoint "/". We shall react. (when (string-equal (tramp-get-file-property vec "/" "fuse-mountpoint" "") "/") - (tramp-error vec 'file-error "FUSE mount denied")) + (tramp-error vec 'file-error "FUSE mount denied"))))) - ;; In `tramp-check-cached-permissions', the connection - ;; properties {uig,gid}-{integer,string} are used. We set - ;; them to their local counterparts. - (tramp-set-connection-property - vec "uid-integer" (tramp-get-local-uid 'integer)) - (tramp-set-connection-property - vec "gid-integer" (tramp-get-local-gid 'integer)) - (tramp-set-connection-property - vec "uid-string" (tramp-get-local-uid 'string)) - (tramp-set-connection-property - vec "gid-string" (tramp-get-local-gid 'string)))))) + ;; In `tramp-check-cached-permissions', the connection properties + ;; {uig,gid}-{integer,string} are used. We set them to their local + ;; counterparts. + (with-tramp-connection-property + vec "uid-integer" (tramp-get-local-uid 'integer)) + (with-tramp-connection-property + vec "gid-integer" (tramp-get-local-gid 'integer)) + (with-tramp-connection-property + vec "uid-string" (tramp-get-local-uid 'string)) + (with-tramp-connection-property + vec "gid-string" (tramp-get-local-gid 'string))) (defun tramp-gvfs-send-command (vec command &rest args) "Send the COMMAND with its ARGS to connection VEC. === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2014-02-10 13:54:33 +0000 +++ lisp/net/tramp-sh.el 2014-02-19 19:24:32 +0000 @@ -60,6 +60,7 @@ :group 'tramp :type 'string) +;;;###tramp-autoload (defconst tramp-color-escape-sequence-regexp "\e[[;0-9]+m" "Escape sequences produced by the \"ls\" command.") @@ -1305,22 +1306,29 @@ "Like `set-file-times' for Tramp files." (if (tramp-tramp-file-p filename) (with-parsed-tramp-file-name filename nil - (tramp-flush-file-property v localname) - (let ((time (if (or (null time) (equal time '(0 0))) - (current-time) - time)) - ;; With GNU Emacs, `format-time-string' has an optional - ;; parameter UNIVERSAL. This is preferred, because we - ;; could handle the case when the remote host is located - ;; in a different time zone as the local host. - (utc (not (featurep 'xemacs)))) - (tramp-send-command-and-check - v (format "%s touch -t %s %s" - (if utc "env TZ=UTC" "") - (if utc - (format-time-string "%Y%m%d%H%M.%S" time t) - (format-time-string "%Y%m%d%H%M.%S" time)) - (tramp-shell-quote-argument localname))))) + (when (tramp-get-remote-touch v) + (tramp-flush-file-property v localname) + (let ((time (if (or (null time) (equal time '(0 0))) + (current-time) + time)) + ;; With GNU Emacs, `format-time-string' has an + ;; optional parameter UNIVERSAL. This is preferred, + ;; because we could handle the case when the remote + ;; host is located in a different time zone as the + ;; local host. + (utc (not (featurep 'xemacs)))) + (tramp-send-command-and-check + v (format + "%s %s %s %s" + (if utc "env TZ=UTC" "") + (tramp-get-remote-touch v) + (if (tramp-get-connection-property v "touch-t" nil) + (format "-t %s" + (if utc + (format-time-string "%Y%m%d%H%M.%S" time t) + (format-time-string "%Y%m%d%H%M.%S" time))) + "") + (tramp-shell-quote-argument localname)))))) ;; We handle also the local part, because in older Emacsen, ;; without `set-file-times', this function is an alias for this. @@ -1562,39 +1570,45 @@ (defun tramp-sh-handle-directory-files-and-attributes (directory &optional full match nosort id-format) "Like `directory-files-and-attributes' for Tramp files." - (unless id-format (setq id-format 'integer)) - (when (file-directory-p directory) - (setq directory (expand-file-name directory)) - (let* ((temp - (copy-tree - (with-parsed-tramp-file-name directory nil - (with-tramp-file-property - v localname - (format "directory-files-and-attributes-%s" id-format) - (save-excursion - (mapcar - (lambda (x) - (cons (car x) - (tramp-convert-file-attributes v (cdr x)))) - (cond - ((tramp-get-remote-stat v) - (tramp-do-directory-files-and-attributes-with-stat - v localname id-format)) - ((tramp-get-remote-perl v) - (tramp-do-directory-files-and-attributes-with-perl - v localname id-format))))))))) - result item) - - (while temp - (setq item (pop temp)) - (when (or (null match) (string-match match (car item))) - (when full - (setcar item (expand-file-name (car item) directory))) - (push item result))) - - (if nosort - result - (sort result (lambda (x y) (string< (car x) (car y)))))))) + (if (with-parsed-tramp-file-name directory nil + (not (or (tramp-get-remote-stat v) (tramp-get-remote-perl v)))) + (tramp-handle-directory-files-and-attributes + directory full match nosort id-format) + + ;; Do it directly. + (unless id-format (setq id-format 'integer)) + (when (file-directory-p directory) + (setq directory (expand-file-name directory)) + (let* ((temp + (copy-tree + (with-parsed-tramp-file-name directory nil + (with-tramp-file-property + v localname + (format "directory-files-and-attributes-%s" id-format) + (save-excursion + (mapcar + (lambda (x) + (cons (car x) + (tramp-convert-file-attributes v (cdr x)))) + (cond + ((tramp-get-remote-stat v) + (tramp-do-directory-files-and-attributes-with-stat + v localname id-format)) + ((tramp-get-remote-perl v) + (tramp-do-directory-files-and-attributes-with-perl + v localname id-format))))))))) + result item) + + (while temp + (setq item (pop temp)) + (when (or (null match) (string-match match (car item))) + (when full + (setcar item (expand-file-name (car item) directory))) + (push item result))) + + (if nosort + result + (sort result (lambda (x y) (string< (car x) (car y))))))))) (defun tramp-do-directory-files-and-attributes-with-perl (vec localname &optional id-format) @@ -4999,6 +5013,30 @@ (tramp-message vec 5 "Finding a suitable `trash' command") (tramp-find-executable vec "trash" (tramp-get-remote-path vec)))) +(defun tramp-get-remote-touch (vec) + (with-tramp-connection-property vec "touch" + (tramp-message vec 5 "Finding a suitable `touch' command") + (let ((result (tramp-find-executable + vec "touch" (tramp-get-remote-path vec))) + (tmpfile + (make-temp-name + (expand-file-name + tramp-temp-name-prefix (tramp-get-remote-tmpdir vec))))) + ;; Busyboxes do support the "-t" option only when they have been + ;; built with the DESKTOP config option. Let's check it. + (when result + (tramp-set-connection-property + vec "touch-t" + (tramp-send-command-and-check + vec + (format + "%s -t %s %s" + result + (format-time-string "%Y%m%d%H%M.%S" (current-time)) + (tramp-file-name-handler 'file-remote-p tmpfile 'localname)))) + (delete-file tmpfile)) + result))) + (defun tramp-get-remote-gvfs-monitor-dir (vec) (with-tramp-connection-property vec "gvfs-monitor-dir" (tramp-message vec 5 "Finding a suitable `gvfs-monitor-dir' command") === modified file 'lisp/net/tramp-smb.el' --- lisp/net/tramp-smb.el 2014-01-01 07:43:34 +0000 +++ lisp/net/tramp-smb.el 2014-02-19 19:24:32 +0000 @@ -929,6 +929,10 @@ "Like `insert-directory' for Tramp files." (setq filename (expand-file-name filename)) (unless switches (setq switches "")) + ;; Mark trailing "/". + (when (and (zerop (length (file-name-nondirectory filename))) + (not full-directory-p)) + (setq switches (concat switches "F"))) (if full-directory-p ;; Called from `dired-add-entry'. (setq filename (file-name-as-directory filename)) @@ -991,38 +995,41 @@ (mapc (lambda (x) (when (not (zerop (length (nth 0 x)))) - (let ((attr - (when (tramp-smb-get-stat-capability v) - (ignore-errors - (file-attributes filename 'string))))) + (when (string-match "l" switches) + (let ((attr + (when (tramp-smb-get-stat-capability v) + (ignore-errors + (file-attributes filename 'string))))) + (insert + (format + "%10s %3d %-8s %-8s %8s %s " + (or (nth 8 attr) (nth 1 x)) ; mode + (or (nth 1 attr) 1) ; inode + (or (nth 2 attr) "nobody") ; uid + (or (nth 3 attr) "nogroup") ; gid + (or (nth 7 attr) (nth 2 x)) ; size + (format-time-string + (if (tramp-time-less-p + (tramp-time-subtract (current-time) (nth 3 x)) + tramp-half-a-year) + "%b %e %R" + "%b %e %Y") + (nth 3 x)))))) ; date + + ;; We mark the file name. The inserted name could be + ;; from somewhere else, so we use the relative file name + ;; of `default-directory'. + (let ((start (point))) (insert (format - "%10s %3d %-8s %-8s %8s %s " - (or (nth 8 attr) (nth 1 x)) ; mode - (or (nth 1 attr) 1) ; inode - (or (nth 2 attr) "nobody") ; uid - (or (nth 3 attr) "nogroup") ; gid - (or (nth 7 attr) (nth 2 x)) ; size - (format-time-string - (if (tramp-time-less-p - (tramp-time-subtract (current-time) (nth 3 x)) - tramp-half-a-year) - "%b %e %R" - "%b %e %Y") - (nth 3 x)))) ; date - ;; We mark the file name. The inserted name could be - ;; from somewhere else, so we use the relative file - ;; name of `default-directory'. - (let ((start (point))) - (insert - (format - "%s\n" - (file-relative-name - (expand-file-name - (nth 0 x) (file-name-directory filename))))) - (put-text-property start (1- (point)) 'dired-filename t)) - (forward-line) - (beginning-of-line)))) + "%s\n" + (file-relative-name + (expand-file-name + (nth 0 x) (file-name-directory filename)) + (when full-directory-p (file-name-directory filename))))) + (put-text-property start (1- (point)) 'dired-filename t)) + (forward-line) + (beginning-of-line))) entries))))) (defun tramp-smb-handle-make-directory (dir &optional parents) === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-01-17 18:24:09 +0000 +++ lisp/net/tramp.el 2014-02-19 19:24:32 +0000 @@ -3150,6 +3150,13 @@ (delete-file local-copy))))) t))) +(defun tramp-handle-make-symbolic-link + (filename linkname &optional ok-if-already-exists) + "Like `make-symbolic-link' for Tramp files." + (with-parsed-tramp-file-name + (if (tramp-tramp-file-p filename) filename linkname) nil + (tramp-error v 'file-error "make-symbolic-link not supported"))) + (defun tramp-handle-shell-command (command &optional output-buffer error-buffer) "Like `shell-command' for Tramp files." @@ -3819,9 +3826,17 @@ (or result (let ((file-attr - (tramp-get-file-property - vec (tramp-file-name-localname vec) - (concat "file-attributes-" suffix) nil)) + (or + (tramp-get-file-property + vec (tramp-file-name-localname vec) + (concat "file-attributes-" suffix) nil) + (file-attributes + (tramp-make-tramp-file-name + (tramp-file-name-method vec) + (tramp-file-name-user vec) + (tramp-file-name-host vec) + (tramp-file-name-localname vec)) + suffix))) (remote-uid (tramp-get-connection-property vec (concat "uid-" suffix) nil)) === modified file 'lisp/net/trampver.el' --- lisp/net/trampver.el 2014-02-16 17:23:00 +0000 +++ lisp/net/trampver.el 2014-02-19 19:24:32 +0000 @@ -31,7 +31,7 @@ ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.2.9" +(defconst tramp-version "2.2.9-24.4" "This version of Tramp.") ;;;###tramp-autoload @@ -44,7 +44,7 @@ (= emacs-major-version 21) (>= emacs-minor-version 4))) "ok" - (format "Tramp 2.2.9 is not fit for %s" + (format "Tramp 2.2.9-24.4 is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) ------------------------------------------------------------ revno: 116480 fixes bug: http://debbugs.gnu.org/16806 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-02-19 19:32:29 +0200 message: Fix bug #16806 with horizontal scrolling of images when fringes are disabled. src/xdisp.c (display_line): Fix horizontal scrolling of large images when fringes are turned off. This comes at a price of not displaying the truncation/continuation glyphs in this case. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-19 17:26:14 +0000 +++ src/ChangeLog 2014-02-19 17:32:29 +0000 @@ -1,5 +1,10 @@ 2014-02-19 Eli Zaretskii + * xdisp.c (display_line): Fix horizontal scrolling of large images + when fringes are turned off. This comes at a price of not + displaying the truncation/continuation glyphs in this case. + (Bug#16806) + * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: If CreateDIBSection returns an error indication, zero out *ximg after destroying the image. This avoids crashes in memory allocations === modified file 'src/xdisp.c' --- src/xdisp.c 2014-02-08 03:46:53 +0000 +++ src/xdisp.c 2014-02-19 17:32:29 +0000 @@ -20119,7 +20119,12 @@ /* If we truncate lines, we are done when the last displayed glyphs reach past the right margin of the window. */ if (it->line_wrap == TRUNCATE - && (FRAME_WINDOW_P (it->f) && WINDOW_RIGHT_FRINGE_WIDTH (it->w) + && ((FRAME_WINDOW_P (it->f) + /* Images are preprocessed in produce_image_glyph such + that they are cropped at the right edge of the + window, so an image glyph will always end exactly at + last_visible_x, even if there's no right fringe. */ + && (WINDOW_RIGHT_FRINGE_WIDTH (it->w) || it->what == IT_IMAGE)) ? (it->current_x >= it->last_visible_x) : (it->current_x > it->last_visible_x))) { @@ -20152,19 +20157,26 @@ i = row->used[TEXT_AREA] - (i + 1); } - it->current_x = x_before; - if (!FRAME_WINDOW_P (it->f)) + /* produce_special_glyphs overwrites the last glyph, so + we don't want that if we want to keep that last + glyph, which means it's an image. */ + if (it->current_x > it->last_visible_x) { - for (n = row->used[TEXT_AREA]; i < n; ++i) + it->current_x = x_before; + if (!FRAME_WINDOW_P (it->f)) + { + for (n = row->used[TEXT_AREA]; i < n; ++i) + { + row->used[TEXT_AREA] = i; + produce_special_glyphs (it, IT_TRUNCATION); + } + } + else { row->used[TEXT_AREA] = i; produce_special_glyphs (it, IT_TRUNCATION); } - } - else - { - row->used[TEXT_AREA] = i; - produce_special_glyphs (it, IT_TRUNCATION); + it->hpos = hpos_before; } } else if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) @@ -20183,13 +20195,13 @@ goto at_end_of_line; } it->current_x = x_before; + it->hpos = hpos_before; } row->truncated_on_right_p = 1; it->continuation_lines_width = 0; reseat_at_next_visible_line_start (it, 0); row->ends_at_zv_p = FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n'; - it->hpos = hpos_before; break; } } @@ -20203,9 +20215,12 @@ && IT_CHARPOS (*it) != CHARPOS (row->start.pos)) { if (!FRAME_WINDOW_P (it->f) - || (row->reversed_p - ? WINDOW_RIGHT_FRINGE_WIDTH (it->w) - : WINDOW_LEFT_FRINGE_WIDTH (it->w)) == 0) + || (((row->reversed_p + ? WINDOW_RIGHT_FRINGE_WIDTH (it->w) + : WINDOW_LEFT_FRINGE_WIDTH (it->w)) == 0) + /* Don't let insert_left_trunc_glyphs overwrite the + first glyph of the row if it is an image. */ + && row->glyphs[TEXT_AREA]->type != IMAGE_GLYPH)) insert_left_trunc_glyphs (it); row->truncated_on_left_p = 1; } ------------------------------------------------------------ revno: 116479 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-02-19 19:26:14 +0200 message: Avoid crashes on MS-Windows when JPEG images are too large. src/image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: If CreateDIBSection returns an error indication, zero out *ximg after destroying the image. This avoids crashes in memory allocations due to the fact that some of the callers also call x_destroy_x_image, which will attempt to free an already free'd block of memory. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-18 10:52:00 +0000 +++ src/ChangeLog 2014-02-19 17:26:14 +0000 @@ -1,3 +1,12 @@ +2014-02-19 Eli Zaretskii + + * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: If + CreateDIBSection returns an error indication, zero out *ximg after + destroying the image. This avoids crashes in memory allocations + due to the fact that some of the callers also call + x_destroy_x_image, which will attempt to free an already free'd + block of memory. + 2014-02-18 Martin Rudalics * widget.c (update_various_frame_slots): Don't set === modified file 'src/image.c' --- src/image.c 2014-02-12 07:50:24 +0000 +++ src/image.c 2014-02-19 17:26:14 +0000 @@ -2019,6 +2019,7 @@ XSETINT (errcode, err); image_error ("Unable to create bitmap, error code %d", errcode, Qnil); x_destroy_x_image (*ximg); + *ximg = NULL; return 0; } ------------------------------------------------------------ revno: 116478 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2014-02-19 12:01:35 +0100 message: lisp/frameset.el (frameset--reuse-frame): Remove workaround for bug#16793. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-19 09:54:35 +0000 +++ lisp/ChangeLog 2014-02-19 11:01:35 +0000 @@ -1,3 +1,7 @@ +2014-02-19 Juanma Barranquero + + * frameset.el (frameset--reuse-frame): Remove workaround for bug#16793. + 2014-02-19 Martin Rudalics * window.el (window-state-put): Allow WINDOW to refer to an === modified file 'lisp/frameset.el' --- lisp/frameset.el 2014-02-18 17:33:37 +0000 +++ lisp/frameset.el 2014-02-19 11:01:35 +0000 @@ -932,11 +932,7 @@ (setq frame (frameset--find-frame-if nil display)))) ;; If found, remove from the list. (when frame - (setq frameset--reuse-list (delq frame frameset--reuse-list)) - ;; Workaround for feature/bug#16793 - (let ((root (frame-root-window frame))) - (unless (window-live-p root) - (delete-other-windows-internal (frame-first-window root) root)))) + (setq frameset--reuse-list (delq frame frameset--reuse-list))) frame)) (defun frameset--initial-params (parameters) ------------------------------------------------------------ revno: 116477 committer: martin rudalics branch nick: trunk timestamp: Wed 2014-02-19 10:54:35 +0100 message: In window-state-put allow WINDOW to refer to an internal window (Bug#16793). * window.el (window-state-put): Allow WINDOW to refer to an internal window (Bug#16793). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-19 08:34:45 +0000 +++ lisp/ChangeLog 2014-02-19 09:54:35 +0000 @@ -1,3 +1,8 @@ +2014-02-19 Martin Rudalics + + * window.el (window-state-put): Allow WINDOW to refer to an + internal window (Bug#16793). + 2014-02-19 Glenn Morris * textmodes/remember.el: Move provide statement to end. === modified file 'lisp/window.el' --- lisp/window.el 2014-02-10 01:34:22 +0000 +++ lisp/window.el 2014-02-19 09:54:35 +0000 @@ -5026,14 +5026,32 @@ "Put window state STATE into WINDOW. STATE should be the state of a window returned by an earlier invocation of `window-state-get'. Optional argument WINDOW must -specify a live window and defaults to the selected one. +specify a valid window and defaults to the selected one. If +WINDOW is not live, replace WINDOW by a live one before putting +STATE into it. Optional argument IGNORE non-nil means ignore minimum window sizes and fixed size restrictions. IGNORE equal `safe' means windows can get as small as `window-safe-min-height' and `window-safe-min-width'." (setq window-state-put-stale-windows nil) - (setq window (window-normalize-window window t)) + (setq window (window-normalize-window window)) + + ;; When WINDOW is internal, reduce it to a live one to put STATE into, + ;; see Bug#16793. + (unless (window-live-p window) + (let ((root (frame-root-window window))) + (if (eq window root) + (setq window (frame-first-window root)) + (setq root window) + (setq window (catch 'live + (walk-window-subtree + (lambda (window) + (when (window-live-p window) + (throw 'live window))) + root)))) + (delete-other-windows-internal window root))) + (let* ((frame (window-frame window)) (head (car state)) ;; We check here (1) whether the total sizes of root window of ------------------------------------------------------------ revno: 116476 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-02-19 00:34:45 -0800 message: Some remember doc * doc/misc/remember.texi: Copyedits. (Quick Start): No need for manual autoloads. Mention remember-notes. (Function Reference): Update arguments. Add new commands. * lisp/textmodes/remember.el: Set maintainer to emacs-devel according to remember.texi. Move provide statement to end. (remember-mode-map, remember-notes-mode-map, remember-notes-mode) (remember-notes): Doc fixes. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-02-18 08:09:51 +0000 +++ doc/misc/ChangeLog 2014-02-19 08:34:45 +0000 @@ -1,3 +1,9 @@ +2014-02-19 Glenn Morris + + * remember.texi: Copyedits. + (Quick Start): No need for manual autoloads. Mention remember-notes. + (Function Reference): Update arguments. Add new commands. + 2014-02-18 Glenn Morris * remember.texi (copying): Bump remember mode version. === modified file 'doc/misc/remember.texi' --- doc/misc/remember.texi 2014-02-18 08:09:51 +0000 +++ doc/misc/remember.texi 2014-02-19 08:34:45 +0000 @@ -96,8 +96,8 @@ There are many different databases out there---and good ones---which this mode is not trying to replace. Rather, it's how that data gets there that's the question. Most of the time, we just want to say -"Remember so-and-so's phone number, or that I have to buy dinner for the -cats tonight." That's the FACT@. How it's stored is really the +``Remember so-and-so's phone number, or that I have to buy dinner for the +cats tonight.'' That's the FACT@. How it's stored is really the computer's problem. But at this point in time, it's most definitely also the user's problem, and sometimes so laboriously so that people just let data slip, rather than expend the effort to record it. @@ -175,7 +175,7 @@ @itemize @item -Type @kbd{M-x remember}. The @samp{*Remember*} buffer should be +Type @kbd{M-x remember}. The @file{*Remember*} buffer should be displayed. @item @@ -185,7 +185,7 @@ @item Type @kbd{C-c C-c} (@code{remember-finalize}) to save the note and close -the @samp{*Remember*} buffer. +the @file{*Remember*} buffer. @end itemize By default, @code{remember-finalize} saves the note in @file{~/emacs.d/notes}. @@ -194,7 +194,7 @@ to the end. To remember a region of text, use the universal prefix. @kbd{C-u M-x -remember} displays a @samp{*Remember*} buffer with the region as the +remember} displays a @file{*Remember*} buffer with the region as the initial contents. As a simple beginning, you can start by using the Text File backend, @@ -203,26 +203,23 @@ end of the file. Every so often, you can move the data that gets appended there into other files, or reorganize your document. -You can also store remembered data in other backends. -(@pxref{Backends}) +You can also store remembered data in other backends. @xref{Backends}. -Here is one way to map the remember functions in your @file{.emacs} to +Here is one way to map the remember functions in your init file to very accessible keystrokes facilities using the mode: @lisp -(autoload 'remember ``remember'' nil t) -(autoload 'remember-region ``remember'' nil t) - (define-key global-map (kbd " r") 'remember) (define-key global-map (kbd " R") 'remember-region) @end lisp By default, remember uses the first annotation returned by @code{remember-annotation-functions}. To include all of the annotations, -set @code{remember-run-all-annotation-functions-flag} to non-nil. +set @code{remember-run-all-annotation-functions-flag} to a +non-@code{nil} value. @defopt remember-run-all-annotation-functions-flag -Non-nil means use all annotations returned by +Non-@code{nil} means use all annotations returned by @code{remember-annotation-functions}. @end defopt @@ -237,17 +234,32 @@ (call-interactively 'remember))) @end lisp +@cindex notes +The @code{remember-notes} command creates a @dfn{notes} buffer that +visits the file specified by the option @code{remember-data-file}. +The option @code{remember-notes-buffer-name} specifies the name of the +buffer. The buffer uses @code{remember-notes-initial-major-mode} and +@code{remember-notes-mode} minor mode. Use @kbd{C-c C-c} to save +and bury the buffer. The command @code{save-some-buffers} saves this +buffer without asking. This function is a suitable setting for +@code{initial-buffer-choice}. + + @node Function Reference @chapter Function Reference @file{remember.el} defines the following interactive functions: -@defun remember initial +@defun remember &optional initial Remember an arbitrary piece of data. With a prefix, it will use the region as @var{initial}. @end defun -@defun remember-region beg end +@defun remember-other-frame &optional initial +Like @code{remember}, but uses a new frame. +@end defun + +@defun remember-region &optional beg end If called from within the remember buffer, @var{beg} and @var{end} are ignored, and the entire buffer will be remembered. If called from any other buffer, that region, plus any context information specific to @@ -263,13 +275,37 @@ Remember the contents of the current buffer. @end defun +@defun remember-destroy +Destroy the current remember buffer. +@end defun + @defun remember-mode -This enters the major mode for output from @command{remember}. This +This enters the major mode for output from @code{remember}. This buffer is used to collect data that you want remember. Just hit @kbd{C-c C-c} when you're done entering, and it will go ahead and file the data for latter retrieval, and possible indexing. @end defun +@defun remember-notes &optional switch-to +This returns the notes buffer, creating it if needed, and switches +to it if called interactively (or if @var{switch-to} is non-@code{nil}). +The notes buffer visits @code{remember-data-file}, and +is named @code{remember-notes-buffer-name}. It uses +@code{remember-notes-initial-major-mode} and @code{remember-notes-mode} +minor mode. +@end defun + +@defun remember-notes-mode &optional arg +This is a minor mode for the notes buffer. It sets +@code{buffer-save-without-query} so that @code{save-some-buffers} will +save the notes buffer without asking. Use @kbd{C-c C-c} to +run the command @code{remember-notes-save-and-bury-buffer}. +@end defun + +@defun remember-notes-save-and-bury-buffer +Save (if it is modified) and bury the current buffer. +@end defun + @node Keystrokes @chapter Keystroke Reference @@ -277,14 +313,12 @@ @table @kbd -@item C-c C-c (`remember-finalize') -Remember the contents of the current buffer. - -@item C-c C-k (`remember-destroy') -Destroy the current *Remember* buffer. - -@item C-x C-s (`remember-finalize') -Remember the contents of the current buffer. +@item C-c C-c +@itemx C-x C-s +Remember the contents of the current buffer (`remember-finalize'). + +@item C-c C-k +Destroy the current @file{*Remember*} buffer (`remember-destroy'). @end table @@ -359,7 +393,7 @@ @defopt remember-diary-file File for extracted diary entries. -If this is nil, then @code{diary-file} will be used instead." +If this is @code{nil}, then @code{diary-file} will be used instead. @end defopt @node Mailbox === modified file 'etc/NEWS' --- etc/NEWS 2014-02-18 08:09:51 +0000 +++ etc/NEWS 2014-02-19 08:34:45 +0000 @@ -713,13 +713,9 @@ ** Remember -*** The new command `remember-notes' creates a buffer that is saved on -`kill-emacs'. You can think of it as a *scratch* buffer whose content -is preserved. In fact, it was designed as a replacement for *scratch* -buffer and can be used that way by setting `initial-buffer-choice' to -`remember-notes' and `remember-notes-buffer-name' to "*scratch*". -Without the second change, the *scratch* buffer will still be there -for notes that do not need to be preserved. ++++ +*** The new command `remember-notes' creates a buffer that is saved on exit. +You can use it as a more permanent *scratch* buffer. +++ *** Remember can now store notes in separate files. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-18 18:14:36 +0000 +++ lisp/ChangeLog 2014-02-19 08:34:45 +0000 @@ -1,3 +1,9 @@ +2014-02-19 Glenn Morris + + * textmodes/remember.el: Move provide statement to end. + (remember-mode-map, remember-notes-mode-map, remember-notes-mode) + (remember-notes): Doc fixes. + 2014-02-18 Stefan Monnier * delsel.el (delete-char): Restore incorrectly erased property === modified file 'lisp/textmodes/remember.el' --- lisp/textmodes/remember.el 2014-02-18 08:09:51 +0000 +++ lisp/textmodes/remember.el 2014-02-19 08:34:45 +0000 @@ -3,6 +3,7 @@ ;; Copyright (C) 1999-2001, 2003-2014 Free Software Foundation, Inc. ;; Author: John Wiegley +;; Maintainer: emacs-devel@gnu.org ;; Created: 29 Mar 1999 ;; Version: 2.0 ;; Keywords: data memory todo pim @@ -178,8 +179,6 @@ ;;; Code: -(provide 'remember) - (defconst remember-version "2.0" "This version of remember.") @@ -230,6 +229,8 @@ :type 'boolean :group 'remember) +;; See below for more user variables. + ;;; Internal Variables: (defvar remember-buffer "*Remember*" @@ -553,7 +554,7 @@ (define-key map "\C-c\C-c" 'remember-finalize) (define-key map "\C-c\C-k" 'remember-destroy) map) - "Keymap used in Remember mode.") + "Keymap used in `remember-mode'.") (define-derived-mode remember-mode indented-text-mode "Remember" "Major mode for output from \\[remember]. @@ -599,10 +600,14 @@ (let ((map (make-sparse-keymap))) (define-key map "\C-c\C-c" 'remember-notes-save-and-bury-buffer) map) - "Keymap used in remember-notes mode.") + "Keymap used in `remember-notes-mode'.") (define-minor-mode remember-notes-mode - "Minor mode for the `remember-notes' buffer." + "Minor mode for the `remember-notes' buffer. +This sets `buffer-save-without-query' so that `save-some-buffers' will +save the notes buffer without asking. + +\\{remember-notes-mode-map}" nil nil nil (cond (remember-notes-mode @@ -612,29 +617,25 @@ ;;;###autoload (defun remember-notes (&optional switch-to) - "Creates notes buffer and switches to it if called interactively. - -If a notes buffer created by a previous invocation of this -function already exist, it will be returned. Otherwise a new -buffer will be created whose content will be read from file -pointed by `remember-data-file'. If a buffer visiting this file -already exist, that buffer will be used instead of creating a new -one (see `find-file-noselect' function for more details). - -Name of the created buffer is taken from `remember-notes-buffer-name' -variable and if a buffer with that name already exist (but was not -created by this function), it will be first killed. -\\ -`remember-notes-mode' is active in the notes buffer which by default -contains only one \\[save-and-bury-buffer] binding which saves and -buries the buffer. - -Function returns notes buffer. When called interactively, -switches to it as well. - -Notes buffer is meant for keeping random notes which you'd like to -preserve across Emacs restarts. The notes will be stored in the -`remember-data-file'." + "Return the notes buffer, creating it if needed, and maybe switch to it. +This buffer is for notes that you want to preserve across Emacs sessions. +The notes are saved in `remember-data-file'. + +If a buffer is already visiting that file, just return it. + +Otherwise, create the buffer, and rename it to `remember-notes-buffer-name', +unless a buffer of that name already exists. Set the major mode according +to `remember-notes-initial-major-mode', and enable `remember-notes-mode' +minor mode. + +Use \\\\[remember-notes-save-and-bury-buffer] to save and bury the notes buffer. + +Interactively, or if SWITCH-TO is non-nil, switch to the buffer. +Return the buffer. + +Set `initial-buffer-choice' to `remember-notes' to visit your notes buffer +when Emacs starts. Set `remember-notes-buffer-name' to \"*scratch*\" +to turn the *scratch* buffer into your notes buffer." (interactive "p") (let ((buf (or (find-buffer-visiting remember-data-file) (with-current-buffer (find-file-noselect remember-data-file) @@ -662,4 +663,6 @@ nil) t)) +(provide 'remember) + ;;; remember.el ends here