From b20759f920f9a64a9a03f510f1ab785426d64af3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 13 Jul 2014 17:49:59 +0300 Subject: [PATCH 1/5] Fix bug #17986 with infloop in redisplay when default-directory is nil. src/xdisp.c (decode_mode_spec): Call file-remote-p on the current buffer's default-directory only if it is a string. lisp/bindings.el (mode-line-remote): If default-directory is not a string, don't call file-remote-p on it; instead state in the help-echo that it is nil. --- lisp/ChangeLog | 6 ++++++ lisp/bindings.el | 12 +++++++----- src/ChangeLog | 5 +++++ src/xdisp.c | 8 ++++++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e77058569d2..5f4c02c0670 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-07-13 Eli Zaretskii + + * bindings.el (mode-line-remote): If default-directory is not a + string, don't call file-remote-p on it; instead state in the + help-echo that it is nil. (Bug#17986) + 2014-07-12 Paul Eggert Fix bug: C-x v v discarded existing log message (Bug#17884). diff --git a/lisp/bindings.el b/lisp/bindings.el index 59aa3dfb3d3..911ab63e8d0 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -229,11 +229,13 @@ mnemonics of the following coding systems: 'help-echo (purecopy (lambda (window _object _point) (format "%s" (with-selected-window window - (concat - (if (file-remote-p default-directory) - "Current directory is remote: " - "Current directory is local: ") - default-directory))))))) + (if (stringp default-directory) + (concat + (if (file-remote-p default-directory) + "Current directory is remote: " + "Current directory is local: ") + default-directory) + "Current directory is nil"))))))) "Mode line construct to indicate a remote buffer.") ;;;###autoload (put 'mode-line-remote 'risky-local-variable t) diff --git a/src/ChangeLog b/src/ChangeLog index 9051d37fcef..ca31b10fb6a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-07-13 Eli Zaretskii + + * xdisp.c (decode_mode_spec): Call file-remote-p on the current + buffer's default-directory only if it is a string. (Bug#17986) + 2014-07-12 Eli Zaretskii * xdisp.c (display_line): Don't call FETCH_BYTE with argument less diff --git a/src/xdisp.c b/src/xdisp.c index 6918c4360d4..2f0683294fa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22907,8 +22907,12 @@ decode_mode_spec (struct window *w, register int c, int field_width, case '@': { ptrdiff_t count = inhibit_garbage_collection (); - Lisp_Object val = call1 (intern ("file-remote-p"), - BVAR (current_buffer, directory)); + Lisp_Object curdir = BVAR (current_buffer, directory); + Lisp_Object val = Qnil; + + if (STRINGP (curdir)) + val = call1 (intern ("file-remote-p"), curdir); + unbind_to (count, Qnil); if (NILP (val)) From be8b1ebb5c997dc37cdc789d4e9689913e2b1d12 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 14 Jul 2014 15:29:29 -0400 Subject: [PATCH 2/5] Tweak earlier vc-log-edit change * lisp/vc/vc-dispatcher.el (vc-log-edit): Do set up the log buffer if it was "empty", or used for a different set of files. Fixes: debbugs:17884 --- lisp/ChangeLog | 5 +++++ lisp/vc/vc-dispatcher.el | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5f4c02c0670..14ed03e7570 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-07-14 Glenn Morris + + * vc/vc-dispatcher.el (vc-log-edit): Do set up the log buffer + if it was "empty", or used for a different set of files. (Bug#17884) + 2014-07-13 Eli Zaretskii * bindings.el (mode-line-remote): If default-directory is not a diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 0445891ed55..4fd9691d2a2 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -591,12 +591,19 @@ NOT-URGENT means it is ok to continue if the user says not to save." ;; Set up key bindings for use while editing log messages +(declare-function log-edit-empty-buffer-p "log-edit" ()) + (defun vc-log-edit (fileset mode backend) "Set up `log-edit' for use on FILE." (setq default-directory (buffer-local-value 'default-directory vc-parent-buffer)) + (require 'log-edit) (log-edit 'vc-finish-logentry - (= (point-min) (point-max)) + ;; Setup a new log message if the log buffer is "empty", + ;; or was previously used for a different set of files. + (or (log-edit-empty-buffer-p) + (and (local-variable-p 'vc-log-fileset) + (not (equal vc-log-fileset fileset)))) `((log-edit-listfun . (lambda () ;; FIXME: Should expand the list ;; for directories. From 526e7132b8e2a51cdb6a5454280fae96ddac9078 Mon Sep 17 00:00:00 2001 From: Alvar Jesus Ibeas Martin Date: Tue, 15 Jul 2014 19:06:49 +0300 Subject: [PATCH 3/5] Fix bug #18025 with typos in Emacs Lisp Introduction manual. doc/lispintro/emacs-lisp-intro.texi (Variables, Buffer Names, if & or) (Symbols as Chest, fwd-para while): Fix typos. --- doc/lispintro/ChangeLog | 5 +++++ doc/lispintro/emacs-lisp-intro.texi | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog index ee3af3ff3d1..c1607487b6f 100644 --- a/doc/lispintro/ChangeLog +++ b/doc/lispintro/ChangeLog @@ -1,3 +1,8 @@ +2014-07-15 Álvar Jesús Ibeas Martín (tiny change) + + * emacs-lisp-intro.texi (Variables, Buffer Names, if & or) + (Symbols as Chest, fwd-para while): Fix typos. + 2014-06-29 Glenn Morris * emacs-lisp-intro.texi (Note for Novices, Finding More, Conclusion): diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 4c85e67f7f3..8ff57619c04 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -1700,7 +1700,7 @@ Another way to think about this is to imagine a symbol as being a chest of drawers. The function definition is put in one drawer, the value in another, and so on. What is put in the drawer holding the value can be changed without affecting the contents of the drawer holding the -function definition, and vice-verse. +function definition, and vice versa. @menu * fill-column Example:: @@ -2653,7 +2653,7 @@ functions; without the parentheses, the interpreter would attempt to evaluate the symbols as variables. @xref{Variables}.) In spite of the distinction between files and buffers, you will often -find that people refer to a file when they mean a buffer and vice-verse. +find that people refer to a file when they mean a buffer and vice versa. Indeed, most people say, ``I am editing a file,'' rather than saying, ``I am editing a buffer which I will soon save to a file.'' It is almost always clear from context what people mean. When dealing with @@ -5756,7 +5756,7 @@ so the true-or-false-test looks like this: @noindent @code{not} is a function that returns true if its argument is false and false if its argument is true. So if @code{(bufferp buffer)} -returns true, the @code{not} expression returns false and vice-verse: +returns true, the @code{not} expression returns false and vice versa: what is ``not true'' is false and what is ``not false'' is true. Using this test, the @code{if} expression works as follows: when the @@ -9805,7 +9805,7 @@ In an earlier section, I suggested that you might imagine a symbol as being a chest of drawers. The function definition is put in one drawer, the value in another, and so on. What is put in the drawer holding the value can be changed without affecting the contents of the -drawer holding the function definition, and vice-verse. +drawer holding the function definition, and vice versa. Actually, what is put in each drawer is the address of the value or function definition. It is as if you found an old chest in the attic, @@ -13235,7 +13235,7 @@ Consider what happens when there is no fill prefix. @noindent This @code{while} loop has us searching forward for @code{sp-parstart}, which is the combination of possible whitespace -with a the local value of the start of a paragraph or of a paragraph +with the local value of the start of a paragraph or of a paragraph separator. (The latter two are within an expression starting @code{\(?:} so that they are not referenced by the @code{match-beginning} function.) From 50426c32c91ff139de22f09bd378e859a7905c2b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 15 Jul 2014 19:11:33 +0300 Subject: [PATCH 4/5] etc/TODO: Minor updates. --- etc/TODO | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etc/TODO b/etc/TODO index 192136b0c29..85022a5598f 100644 --- a/etc/TODO +++ b/etc/TODO @@ -62,8 +62,7 @@ suitable for anyone from beginners to experts. ** Convert modes that use view-mode to be derived from special-mode instead. -** Major modes should have a menu entry. Examples of modes that do -not have one at the moment and probably should: text-mode, inferior-lisp-mode. +** Major modes should have a menu entry. ** Check if all items on the mode-line have a suitable tooltip for all modes. @@ -141,7 +140,9 @@ for users to customize. using a heuristic of some kind? ** Define recompute-arg and recompute-arg-if for fix_command to use. - See rms message of 11 Dec 05. + See rms message of 11 Dec 05 in + http://lists.gnu.org/archive/html/emacs-pretest-bug/2005-12/msg00165.html, + and the rest of that discussion. ** Height returned by frame-parameter ... and height given to make-frame does not mean the same thing. The former includes menu and From 61dcf9bc85b309e1fa052eb1e76698d4789f7f72 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 15 Jul 2014 21:28:42 -0700 Subject: [PATCH 5/5] * lisp/desktop.el (after-init-hook): Disable startup frame restoration in non-graphical situations. Fixes: debbugs:17693 --- lisp/ChangeLog | 5 +++++ lisp/desktop.el | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 14ed03e7570..0e82c4bbc46 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-07-16 Glenn Morris + + * desktop.el (after-init-hook): Disable startup frame restoration + in non-graphical situations. (Bug#17693) + 2014-07-14 Glenn Morris * vc/vc-dispatcher.el (vc-log-edit): Do set up the log buffer diff --git a/lisp/desktop.el b/lisp/desktop.el index 12207f3cdac..40e6b364e45 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1516,8 +1516,15 @@ If there are no buffers left to create, kill the timer." (setq command-line-args (delete key command-line-args)) (desktop-save-mode 0))) (when desktop-save-mode - (desktop-read) - (setq inhibit-startup-screen t)))) + ;; People don't expect emacs -nw, or --daemon, + ;; to create graphical frames (bug#17693). + ;; TODO perhaps there should be a separate value + ;; for desktop-restore-frames to control this startup behavior? + (let ((desktop-restore-frames (and desktop-restore-frames + initial-window-system + (not (daemonp))))) + (desktop-read) + (setq inhibit-startup-screen t))))) ;; So we can restore vc-dir buffers. (autoload 'vc-dir-mode "vc-dir" nil t)