From 1cbae532a06b6ca7d3317a8f4e8067d247dd901e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 6 Dec 2012 13:26:11 -0500 Subject: [PATCH 01/15] * doc/lispref/customize.texi (Variable Definitions): Mention the default :group for defcustoms. Fixes: debbugs:13093 --- doc/lispref/ChangeLog | 67 ++++++++++++++++++++------------------ doc/lispref/customize.texi | 4 ++- 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 702db101549..210897f6de3 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2012-12-06 Stefan Monnier + + * customize.texi (Variable Definitions): Mention the default :group + for defcustoms (bug#13093). + 2012-12-05 Chong Yidong * lists.texi (Plist Access): Move put example to Symbol Plists. @@ -17,7 +22,7 @@ * display.texi (Defining Faces): * sequences.texi (Char-Tables): Fix xref. - * keymaps.texi (Key Sequences): kbd is now a function. + * keymaps.texi (Key Sequences): `kbd' is now a function. * commands.texi (Using Interactive): Fix index entry. @@ -27,16 +32,14 @@ (Windows and Frames): Fix example. Move description of window-in-direction here. (Recombining Windows): Fix example. - (Buffers and Windows): Fix description of - replace-buffer-in-windows. + (Buffers and Windows): Fix description of replace-buffer-in-windows. (Switching Buffers): Reword. (Display Action Functions): Minor adjustments. (Choosing Window Options): Minor fixes. (Window History): Minor rewording. (Dedicated Windows): Correct and reword part describing how dedicatedness affects functions removing buffers or windows. - * buffers.texi (The Buffer List): Fix description of - bury-buffer. + * buffers.texi (The Buffer List): Fix description of bury-buffer. 2012-11-23 Chong Yidong @@ -97,8 +100,8 @@ * windows.texi (Choosing Window): Rewrite description of display-buffer-alist (Bug#12167). - (Display Action Functions): Mention inhibit-switch-frame. Fix - description of display-buffer-below-selected. Reorder actions. + (Display Action Functions): Mention inhibit-switch-frame. + Fix description of display-buffer-below-selected. Reorder actions. Add example (Bug#12848). 2012-11-15 Stefan Monnier @@ -188,11 +191,11 @@ switch-to-buffer-preserve-window-point. (Display Action Functions): Document window-height and window-width alist entries. - (Display Action Functions): Document - display-buffer-below-selected and + (Display Action Functions): + Document display-buffer-below-selected and display-buffer-in-previous-window. - (Quitting Windows): Document quit-restore-window. Rewrite - section. + (Quitting Windows): Document quit-restore-window. + Rewrite section. (Window Configurations): In window-state-get mention that argument window must be valid. (Window Parameters): Document quit-restore window parameter @@ -292,8 +295,8 @@ * minibuf.texi (Text from Minibuffer): Document read-regexp changes. - * nonascii.texi (Selecting a Representation): Document - set-buffer-multibyte changes. + * nonascii.texi (Selecting a Representation): + Document set-buffer-multibyte changes. * keymaps.texi (Toolkit Differences): Node deleted. (Easy Menu): New node. @@ -1065,8 +1068,8 @@ 2012-04-12 Jari Aalto - * processes.texi (Synchronous Processes): Mention - `default-directory' (bug#7515). + * processes.texi (Synchronous Processes): + Mention `default-directory' (bug#7515). 2012-04-09 Chong Yidong @@ -1089,8 +1092,8 @@ * minibuf.texi (Programmed Completion): Remove obsolete variable completion-annotate-function. - (Completion Variables): Rename from Completion Styles. Document - completion-extra-properties. Document completion-styles-alist + (Completion Variables): Rename from Completion Styles. + Document completion-extra-properties. Document completion-styles-alist change. (Reading File Names): minibuffer-local-filename-must-match-map is not used anymore. @@ -1225,8 +1228,8 @@ Minor clarifications. (Defining Faces): Copyedits. Update face example. (Attribute Functions): Mark set-face-foreground etc as commands. - (Face Remapping): Mention text-scale-adjust. Clarify - face-remapping-alist and related docs. + (Face Remapping): Mention text-scale-adjust. + Clarify face-remapping-alist and related docs. (Face Functions): Don't document make-face or copy-face. 2012-03-20 Chong Yidong @@ -1567,8 +1570,8 @@ (Syntax Properties): Document syntax-propertize-function and syntax-propertize-extend-region-functions. (Motion via Parsing): Clarify scan-lists. Fix indentation. - (Parser State): Update for the new "c" comment style. Fix - description of item 7 (comment style). + (Parser State): Update for the new "c" comment style. + Fix description of item 7 (comment style). * modes.texi (Minor Modes): Update how mode commands should treat arguments now. @@ -1646,9 +1649,9 @@ * debugging.texi (Debugging): Copyedits. Describe testcover, ERT. (Error Debugging): Note that debug-ignored-errors overrides list - values of debug-on-error too. Add xref to Signaling Errors. Note - that debug-on-signal is not customizable. Mention - condition-case-unless-debug. + values of debug-on-error too. Add xref to Signaling Errors. + Note that debug-on-signal is not customizable. + Mention condition-case-unless-debug. (Compilation Errors): Node deleted. * compile.texi (Compiler Errors): Move a paragraph here from @@ -1764,15 +1767,15 @@ 2012-02-04 Chong Yidong * functions.texi (What Is a Function): Add closures. Mention - "return value" terminology. Add xref for command-execute. Remove - unused "keystroke command" terminology. + "return value" terminology. Add xref for command-execute. + Remove unused "keystroke command" terminology. (Lambda Expressions): Give a different example than in the following subsection. Add xref to Anonymous Functions. (Function Documentation): Remove gratuitous markup. (Function Names): Move introductory text to `What Is a Function'. (Defining Functions): Fix defun argument spec. - (Anonymous Functions): Document lambda macro explicitly. Mention - effects on lexical binding. + (Anonymous Functions): Document lambda macro explicitly. + Mention effects on lexical binding. (Function Cells): Downplay direct usage of fset. (Closures): New node. (Inline Functions): Remove "open-code" terminology. @@ -1903,8 +1906,8 @@ * variables.texi (Variables, Local Variables, Void Variables): Edit to make the descriptions less specific to dynamic binding. (Local Variables): Default max-specpdl-size is now 1300. - (Defining Variables): Edits for lexical scoping. Delete - information about starting docstrings with *. De-document + (Defining Variables): Edits for lexical scoping. + Delete information about starting docstrings with *. De-document user-variable-p. (Tips for Defining): Remove an unimportant discussion of quitting in the middle of a load. @@ -1992,8 +1995,8 @@ 2012-01-06 Chong Yidong - * variables.texi (Directory Local Variables): Document - hack-dir-local-variables-non-file-buffer. + * variables.texi (Directory Local Variables): + Document hack-dir-local-variables-non-file-buffer. 2012-01-06 Glenn Morris diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 1fb8bb3e71a..14076fe9408 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -303,7 +303,9 @@ evaluate at any time. The argument @var{doc} specifies the documentation string for the variable. -Every @code{defcustom} should specify @code{:group} at least once. +If a @code{defcustom} does not specify any @code{:group}, the last group +defined with @code{defgroup} in the same file will be used. This way, most +@code{defcustom} do not need an explicit @code{:group}. When you evaluate a @code{defcustom} form with @kbd{C-M-x} in Emacs Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun} From 82e1f390ab57d782ec5d143d99119db03698bd4f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 6 Dec 2012 16:08:50 -0500 Subject: [PATCH 02/15] * lisp/emacs-lisp/cl.el, lisp/emacs-lisp/cl-lib.el: Move cl-unload-function and cl-load-hook where they belong. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/cl-lib.el | 8 -------- lisp/emacs-lisp/cl.el | 9 +++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a4f40e6a80d..7e63136bac8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-06 Stefan Monnier + + * emacs-lisp/cl.el, emacs-lisp/cl-lib.el: Move cl-unload-function and + cl-load-hook where they belong. + 2012-12-06 Chong Yidong * ffap.el (ffap-replace-file-component): Fix typo. diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 7b22c7aac41..c748b6b583b 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -113,12 +113,6 @@ printer proceeds to the next function on the list. This variable is not used at present, but it is defined in hopes that a future Emacs interpreter will be able to use it.") -(defun cl-unload-function () - "Stop unloading of the Common Lisp extensions." - (message "Cannot unload the feature `cl'") - ;; Stop standard unloading! - t) - ;;; Generalized variables. ;; These macros are defined here so that they ;; can safely be used in init files. @@ -747,8 +741,6 @@ If ALIST is non-nil, the new pairs are prepended to it." (provide 'cl-lib) -(run-hooks 'cl-load-hook) - ;; Local variables: ;; byte-compile-dynamic: t ;; End: diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 016967bc713..3d0ca476800 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -83,6 +83,12 @@ ;; (delete-region (1- (point)) (point))) ;; (save-buffer))))) +(defun cl-unload-function () + "Stop unloading of the Common Lisp extensions." + (message "Cannot unload the feature `cl'") + ;; Stop standard unloading! + t) + ;;; Aliases to cl-lib's features. (dolist (var '( @@ -737,4 +743,7 @@ You can replace this macro with `gv-letplace'." (list accessor temp)))) (provide 'cl) + +(run-hooks 'cl-load-hook) + ;;; cl.el ends here From 070261664710ac7af1c49b6a97ecfed2f17c9431 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 6 Dec 2012 16:41:32 -0500 Subject: [PATCH 03/15] Further rmail.el fix for bug#13066 * lisp/mail/rmail.el (rmail-maybe-display-summary): Preserve buffer, in case select-window changes it. --- lisp/ChangeLog | 5 +++++ lisp/mail/rmail.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7e63136bac8..2626c14c593 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-06 Glenn Morris + + * mail/rmail.el (rmail-maybe-display-summary): + Preserve buffer, in case select-window changes it. (Bug#13066) + 2012-12-06 Stefan Monnier * emacs-lisp/cl.el, emacs-lisp/cl-lib.el: Move cl-unload-function and diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 372b120046c..1b76b771f93 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -4194,6 +4194,7 @@ This has an effect only if a summary buffer exists." ;; Put the summary buffer back on the screen, if user wants that. (defun rmail-maybe-display-summary () (let ((selected (selected-window)) + (buffer (current-buffer)) window) ;; If requested, make sure the summary is displayed. (and rmail-summary-buffer (buffer-name rmail-summary-buffer) @@ -4215,7 +4216,8 @@ This has an effect only if a summary buffer exists." (progn (select-window window) (enlarge-window (- rmail-summary-window-size (window-height)))) - (select-window selected))))) + (select-window selected) + (set-buffer buffer))))) ;;;; *** Rmail Local Fontification *** From bf741d337c02852c06be4e8b995304b9df407839 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 7 Dec 2012 04:55:40 +0100 Subject: [PATCH 04/15] lisp/vc/vc-hooks.el (vc-state): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/vc/vc-hooks.el | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2626c14c593..17d339c4d78 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-12-07 Juanma Barranquero + + * vc/vc-hooks.el (vc-state): Doc fix. + 2012-12-06 Glenn Morris * mail/rmail.el (rmail-maybe-display-summary): diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index ef900cb5257..58de1c99368 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -438,8 +438,8 @@ For registered files, the possible values are: (defun vc-state (file &optional backend) "Return the version control state of FILE. -If FILE is not registered, this function always returns nil. -For registered files, the value returned is one of: +A return of nil from this function means we have no information on the +status of this file. Otherwise, the value returned is one of: 'up-to-date The working file is unmodified with respect to the latest version on the current branch, and not locked. @@ -491,10 +491,8 @@ For registered files, the value returned is one of: that any file with vc-state nil might be ignorable without VC knowing it. - 'unregistered The file is not under version control. + 'unregistered The file is not under version control." -A return of nil from this function means we have no information on the -status of this file." ;; Note: in Emacs 22 and older, return of nil meant the file was ;; unregistered. This is potentially a source of ;; backward-compatibility bugs. From 610251116cbe83cf8c56811f8e447a9b041ef24d Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Thu, 6 Dec 2012 23:31:24 -0500 Subject: [PATCH 05/15] * lisp/emacs-lisp/debug.el (debug): Fix hard-coded frame counts. Virtually backported from trunk. Fixes: debbugs:10025 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/debug.el | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 17d339c4d78..0c6093f5a9e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-07 Michael Heerdegen + + * emacs-lisp/debug.el (debug): Fix hard-coded frame counts (bug#10025). + Virtually backported from trunk. + 2012-12-07 Juanma Barranquero * vc/vc-hooks.el (vc-state): Doc fix. diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 6be30fc9164..579b223fcac 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -220,10 +220,10 @@ first will be printed into the backtrace buffer." (when (eq (car debugger-args) 'debug) ;; Skip the frames for backtrace-debug, byte-code, ;; and implement-debug-on-entry. - (backtrace-debug 4 t) + (backtrace-debug 3 t) ;; Place an extra debug-on-exit for macro's. - (when (eq 'lambda (car-safe (cadr (backtrace-frame 4)))) - (backtrace-debug 5 t))) + (when (eq 'lambda (car-safe (cadr (backtrace-frame 3)))) + (backtrace-debug 4 t))) (pop-to-buffer debugger-buffer `((display-buffer-reuse-window From 3a21537c13a64983fadbdf64c19b5822297e89cc Mon Sep 17 00:00:00 2001 From: Le Wang Date: Fri, 7 Dec 2012 00:00:04 -0500 Subject: [PATCH 06/15] * lisp/hilit-chg.el (hilit-chg-set-face-on-change): Don't burp in narrowed buffer. Fixes: debbugs:12361 --- lisp/ChangeLog | 7 +++++- lisp/hilit-chg.el | 64 ++++++++++++++++++++++++----------------------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0c6093f5a9e..3b7b62badc2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-07 Le Wang + + * hilit-chg.el (hilit-chg-set-face-on-change): Don't burp in + narrowed buffer (bug#12361). + 2012-12-07 Michael Heerdegen * emacs-lisp/debug.el (debug): Fix hard-coded frame counts (bug#10025). @@ -3341,7 +3346,7 @@ * calendar/cal-tex.el (cal-tex-weekly-common): Restore leading blank page. -2012-08-22 Le Wang (tiny change) +2012-08-22 Le Wang * misc.el (forward-to-word, backward-to-word): Activate or extend the region under `shift-select-mode'. (Bug#12231) diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index 0970ece9446..7b5e2b54300 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el @@ -569,37 +569,39 @@ This allows you to manually remove highlighting from uninteresting changes." highlight-changes-visible-mode) (hilit-chg-fixup beg end)) (highlight-save-buffer-state - (if (and (= beg end) (> leng-before 0)) - ;; deletion - (progn - ;; The eolp and bolp tests are a kludge! But they prevent - ;; rather nasty looking displays when deleting text at the end - ;; of line, such as normal corrections as one is typing and - ;; immediately makes a correction, and when deleting first - ;; character of a line. - ;; (if (= leng-before 1) - ;; (if (eolp) - ;; (setq beg-decr 0 end-incr 0) - ;; (if (bolp) - ;; (setq beg-decr 0)))) - ;; (setq beg (max (- beg beg-decr) (point-min))) - (setq end (min (+ end end-incr) (point-max))) - (setq type 'hilit-chg-delete)) - ;; Not a deletion. - ;; Most of the time the following is not necessary, but - ;; if the current text was marked as a deletion then - ;; the old overlay is still in effect, so if we add some - ;; text then remove the deletion marking, but set it to - ;; changed otherwise its highlighting disappears. - (if (eq (get-text-property end 'hilit-chg) 'hilit-chg-delete) - (progn - (put-text-property end (+ end 1) 'hilit-chg 'hilit-chg) - (if highlight-changes-visible-mode - (hilit-chg-fixup beg (+ end 1)))))) - (unless no-property-change - (put-text-property beg end 'hilit-chg type)) - (if (or highlight-changes-visible-mode no-property-change) - (hilit-chg-make-ov type beg end))))))) + (if (and (= beg end) (> leng-before 0)) + ;; deletion + (progn + ;; The eolp and bolp tests are a kludge! But they prevent + ;; rather nasty looking displays when deleting text at the end + ;; of line, such as normal corrections as one is typing and + ;; immediately makes a correction, and when deleting first + ;; character of a line. + ;; (if (= leng-before 1) + ;; (if (eolp) + ;; (setq beg-decr 0 end-incr 0) + ;; (if (bolp) + ;; (setq beg-decr 0)))) + ;; (setq beg (max (- beg beg-decr) (point-min))) + (setq end (min (+ end end-incr) (point-max))) + (setq type 'hilit-chg-delete)) + ;; Not a deletion. + ;; Most of the time the following is not necessary, but + ;; if the current text was marked as a deletion then + ;; the old overlay is still in effect. So if the user adds some + ;; text where she earlier deleted text, we have to remove the + ;; deletion marking, and replace it explicitly with a `changed' + ;; marking, otherwise its highlighting would disappear. + (if (eq (get-text-property end 'hilit-chg) 'hilit-chg-delete) + (save-restriction + (widen) + (put-text-property end (+ end 1) 'hilit-chg 'hilit-chg) + (if highlight-changes-visible-mode + (hilit-chg-fixup beg (+ end 1)))))) + (unless no-property-change + (put-text-property beg end 'hilit-chg type)) + (if (or highlight-changes-visible-mode no-property-change) + (hilit-chg-make-ov type beg end))))))) (defun hilit-chg-update () "Update a buffer's highlight changes when visibility changed." From 2cec368c81f0056f7d3f4ce9aa247ef56d3053a7 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 7 Dec 2012 10:45:03 +0100 Subject: [PATCH 07/15] Reword doc-string of Fcompare_buffer_substrings. * editfns.c (Fcompare_buffer_substrings): Reword doc-string. --- etc/NEWS | 4 ++++ src/ChangeLog | 4 ++++ src/editfns.c | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index a16bdcfd44a..4cf2e9d6da9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -701,6 +701,10 @@ depends on the graphical library. that substring is inserted literally even if the LITERAL arg is non-nil, instead of causing an error to be signaled. ++++ +** `select-window' now always makes the window's buffer current. +It does so even if the window was selected before. + +++ ** Docstrings starting with `*' no longer indicate user options. Only variables defined using `defcustom' are considered user options. diff --git a/src/ChangeLog b/src/ChangeLog index 106333ac8ed..f9edb039b1c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-12-07 Martin Rudalics + + * editfns.c (Fcompare_buffer_substrings): Reword doc-string. + 2012-12-05 Eli Zaretskii * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp diff --git a/src/editfns.c b/src/editfns.c index 8122ffdd0d4..f0f380329cf 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2650,10 +2650,10 @@ They default to the values of (point-min) and (point-max) in BUFFER. */) DEFUN ("compare-buffer-substrings", Fcompare_buffer_substrings, Scompare_buffer_substrings, 6, 6, 0, doc: /* Compare two substrings of two buffers; return result as number. -the value is -N if first string is less after N-1 chars, -+N if first string is greater after N-1 chars, or 0 if strings match. -Each substring is represented as three arguments: BUFFER, START and END. -That makes six args in all, three for each substring. +Return -N if first string is less after N-1 chars, +N if first string is +greater after N-1 chars, or 0 if strings match. Each substring is +represented as three arguments: BUFFER, START and END. That makes six +args in all, three for each substring. The value of `case-fold-search' in the current buffer determines whether case is significant or ignored. */) From 81d8cc5377be3560177ee576d314fe4331e275c3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 7 Dec 2012 17:28:20 +0200 Subject: [PATCH 08/15] Fix bug #13108 introduced by the fix to bug #12930. src/indent.c (Fvertical_motion): If a display string will be displayed on the left or the right margin, don't consider it as a factor in cursor positioning. --- src/ChangeLog | 6 ++++++ src/indent.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index f9edb039b1c..1cca404d2aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-12-07 Eli Zaretskii + + * indent.c (Fvertical_motion): If a display string will be + displayed on the left or the right margin, don't consider it as a + factor in cursor positioning. (Bug#13108) + 2012-12-07 Martin Rudalics * editfns.c (Fcompare_buffer_substrings): Reword doc-string. diff --git a/src/indent.c b/src/indent.c index 33322287c9d..eb105806542 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2034,7 +2034,11 @@ whether or not it is currently displayed in some window. */) const char *s = SSDATA (it.string); const char *e = s + SBYTES (it.string); - disp_string_at_start_p = it.string_from_display_prop_p; + /* If it.area is anything but TEXT_AREA, we need not bother + about the display string, as it doesn't affect cursor + positioning. */ + disp_string_at_start_p = + it.string_from_display_prop_p && it.area == TEXT_AREA; while (s < e) { if (*s++ == '\n') From 8d43bd30230ee2315aade40db688716679ebcf7c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 7 Dec 2012 17:52:40 +0200 Subject: [PATCH 09/15] Fix insertion of " inside @smallexample. lisp/textmodes/texinfo.el (texinfo-enable-quote-envs): Add "smallexample". --- lisp/ChangeLog | 5 +++++ lisp/textmodes/texinfo.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3b7b62badc2..ff604d0236b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-07 Eli Zaretskii + + * textmodes/texinfo.el (texinfo-enable-quote-envs): Add + "smallexample". + 2012-12-07 Le Wang * hilit-chg.el (hilit-chg-set-face-on-change): Don't burp in diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 4e7715dcea9..52b9ab092ae 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -676,7 +676,8 @@ Puts point on a blank line between them." (not (match-end 1))))) (defvar texinfo-enable-quote-macros "@\\(code\\|samp\\|kbd\\)\\>") -(defvar texinfo-enable-quote-envs '("example\\>" "lisp\\>")) +(defvar texinfo-enable-quote-envs + '("example\\>" "smallexample\\>" "lisp\\>")) (defun texinfo-insert-quote (&optional arg) "Insert the appropriate quote mark for Texinfo. Usually inserts the value of `texinfo-open-quote' (normally ``) or From 76b92feef1ce7919484065b0ee66e8bb891aff51 Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Sat, 8 Dec 2012 11:16:45 +0800 Subject: [PATCH 10/15] * lread.c (Vload_source_file_function): Doc fix. Fixes: debbugs:11647 --- src/ChangeLog | 4 ++++ src/lread.c | 16 ++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1cca404d2aa..427f729730f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-12-08 Christopher Schmidt + + * lread.c (Vload_source_file_function): Doc fix (Bug#11647). + 2012-12-07 Eli Zaretskii * indent.c (Fvertical_motion): If a display string will be diff --git a/src/lread.c b/src/lread.c index 94744620279..be7b44e603b 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4518,12 +4518,16 @@ The default is nil, which means use the function `read'. */); Vload_read_function = Qnil; DEFVAR_LISP ("load-source-file-function", Vload_source_file_function, - doc: /* Function called in `load' for loading an Emacs Lisp source file. -This function is for doing code conversion before reading the source file. -If nil, loading is done without any code conversion. -Arguments are FULLNAME, FILE, NOERROR, NOMESSAGE, where - FULLNAME is the full name of FILE. -See `load' for the meaning of the remaining arguments. */); + doc: /* Function called in `load' to load an Emacs Lisp source file. +The value should be a function for doing code conversion before +reading a source file. It can also be nil, in which case loading is +done without any code conversion. + +If the value is a function, it is called with four arguments, +FULLNAME, FILE, NOERROR, NOMESSAGE. FULLNAME is the absolute name of +the file to load, FILE is the non-absolute name (for messages etc.), +and NOERROR and NOMESSAGE are the corresponding arguments passed to +`load'. The function should return t if the file was loaded. */); Vload_source_file_function = Qnil; DEFVAR_BOOL ("load-force-doc-strings", load_force_doc_strings, From 6ce49f24590f0dbd9cf127756c6ea57311657cb8 Mon Sep 17 00:00:00 2001 From: Dani Moncayo Date: Sat, 8 Dec 2012 11:25:28 +0800 Subject: [PATCH 11/15] * lisp/simple.el (just-one-space): Doc fix. * doc/emacs/killing.texi (Deletion): Doc fix. Fixes: debbugs:12748 --- doc/emacs/ChangeLog | 4 ++++ doc/emacs/killing.texi | 2 +- lisp/ChangeLog | 4 ++++ lisp/simple.el | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 7599c1e823e..0825cda9044 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2012-12-08 Dani Moncayo + + * killing.texi (Deletion): Doc fix (Bug#12748). + 2012-12-03 Juanma Barranquero * vc1-xtra.texi (General VC Options): Remove obsolete reference diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index a8d08bd6602..fcd881a6bdc 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi @@ -123,7 +123,7 @@ point, regardless of the number of spaces that existed previously (even if there were none before). With a numeric argument @var{n}, it leaves @var{n} spaces before point if @var{n} is positive; if @var{n} is negative, it deletes newlines in addition to spaces and tabs, -leaving a single space before point. +leaving @var{-n} spaces before point. @kbd{C-x C-o} (@code{delete-blank-lines}) deletes all blank lines after the current line. If the current line is blank, it deletes all diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ff604d0236b..1efcd623e2a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-12-08 Dani Moncayo + + * simple.el (just-one-space): Doc fix. + 2012-12-07 Eli Zaretskii * textmodes/texinfo.el (texinfo-enable-quote-envs): Add diff --git a/lisp/simple.el b/lisp/simple.el index 589f1786fb4..61a5a3ea10b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -744,7 +744,7 @@ If BACKWARD-ONLY is non-nil, only delete them before point." (defun just-one-space (&optional n) "Delete all spaces and tabs around point, leaving one space (or N spaces). -If N is negative, delete newlines as well." +If N is negative, delete newlines as well, leaving -N spaces." (interactive "*p") (unless n (setq n 1)) (let ((orig-pos (point)) From cb576b5cd0d5899b73ce92c2d7d58535c60bb1d2 Mon Sep 17 00:00:00 2001 From: Fabrice Popineau Date: Sat, 8 Dec 2012 14:06:46 +0200 Subject: [PATCH 12/15] Fix incompatibilities with 64-bit Windows builds. src/w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to DWORD_PTR, for compatibility with 64-bit builds. src/w32.c (_PROCESS_MEMORY_COUNTERS_EX): (GetProcessWorkingSetSize_Proc, get_process_working_set_size) (system_process_attributes): Use SIZE_T rather than DWORD, for compatibility with 64-bit builds. --- src/ChangeLog | 10 ++++++++++ src/w32.c | 36 ++++++++++++++++++------------------ src/w32fns.c | 2 +- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 427f729730f..f3af852f9e9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-12-08 Fabrice Popineau + + * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to + DWORD_PTR, for compatibility with 64-bit builds. + + * w32.c (_PROCESS_MEMORY_COUNTERS_EX): + (GetProcessWorkingSetSize_Proc, get_process_working_set_size) + (system_process_attributes): Use SIZE_T rather than DWORD, for + compatibility with 64-bit builds. + 2012-12-08 Christopher Schmidt * lread.c (Vload_source_file_function): Doc fix (Bug#11647). diff --git a/src/w32.c b/src/w32.c index f5630993d43..fc97b0b490b 100644 --- a/src/w32.c +++ b/src/w32.c @@ -101,17 +101,17 @@ typedef struct _MEMORY_STATUS_EX { _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15 defines it in psapi.h */ typedef struct _PROCESS_MEMORY_COUNTERS_EX { - DWORD cb; - DWORD PageFaultCount; - DWORD PeakWorkingSetSize; - DWORD WorkingSetSize; - DWORD QuotaPeakPagedPoolUsage; - DWORD QuotaPagedPoolUsage; - DWORD QuotaPeakNonPagedPoolUsage; - DWORD QuotaNonPagedPoolUsage; - DWORD PagefileUsage; - DWORD PeakPagefileUsage; - DWORD PrivateUsage; + DWORD cb; + DWORD PageFaultCount; + SIZE_T PeakWorkingSetSize; + SIZE_T WorkingSetSize; + SIZE_T QuotaPeakPagedPoolUsage; + SIZE_T QuotaPagedPoolUsage; + SIZE_T QuotaPeakNonPagedPoolUsage; + SIZE_T QuotaNonPagedPoolUsage; + SIZE_T PagefileUsage; + SIZE_T PeakPagefileUsage; + SIZE_T PrivateUsage; } PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX; #endif @@ -351,8 +351,8 @@ typedef BOOL (WINAPI * GetProcessMemoryInfo_Proc) ( DWORD cb); typedef BOOL (WINAPI * GetProcessWorkingSetSize_Proc) ( HANDLE hProcess, - DWORD * lpMinimumWorkingSetSize, - DWORD * lpMaximumWorkingSetSize); + PSIZE_T lpMinimumWorkingSetSize, + PSIZE_T lpMaximumWorkingSetSize); typedef BOOL (WINAPI * GlobalMemoryStatus_Proc) ( LPMEMORYSTATUS lpBuffer); typedef BOOL (WINAPI * GlobalMemoryStatusEx_Proc) ( @@ -4620,8 +4620,8 @@ get_process_memory_info (HANDLE h_proc, static BOOL WINAPI get_process_working_set_size (HANDLE h_proc, - DWORD *minrss, - DWORD *maxrss) + PSIZE_T minrss, + PSIZE_T maxrss) { static GetProcessWorkingSetSize_Proc s_pfn_Get_Process_Working_Set_Size = NULL; @@ -4866,7 +4866,7 @@ system_process_attributes (Lisp_Object pid) unsigned egid; PROCESS_MEMORY_COUNTERS mem; PROCESS_MEMORY_COUNTERS_EX mem_ex; - DWORD minrss, maxrss; + SIZE_T minrss, maxrss; MEMORYSTATUS memst; MEMORY_STATUS_EX memstex; double totphys = 0.0; @@ -5094,7 +5094,7 @@ system_process_attributes (Lisp_Object pid) && get_process_memory_info (h_proc, (PROCESS_MEMORY_COUNTERS *)&mem_ex, sizeof (mem_ex))) { - DWORD rss = mem_ex.WorkingSetSize / 1024; + SIZE_T rss = mem_ex.WorkingSetSize / 1024; attrs = Fcons (Fcons (Qmajflt, make_fixnum_or_float (mem_ex.PageFaultCount)), @@ -5109,7 +5109,7 @@ system_process_attributes (Lisp_Object pid) else if (h_proc && get_process_memory_info (h_proc, &mem, sizeof (mem))) { - DWORD rss = mem_ex.WorkingSetSize / 1024; + SIZE_T rss = mem_ex.WorkingSetSize / 1024; attrs = Fcons (Fcons (Qmajflt, make_fixnum_or_float (mem.PageFaultCount)), diff --git a/src/w32fns.c b/src/w32fns.c index 8e1ecc1cb00..de5cee1d7a7 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7032,7 +7032,7 @@ cache_system_info (void) /* Cache page size, allocation unit, processor type, etc. */ GetSystemInfo (&sysinfo_cache); - syspage_mask = sysinfo_cache.dwPageSize - 1; + syspage_mask = (DWORD_PTR)sysinfo_cache.dwPageSize - 1; /* Cache os info. */ osinfo_cache.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); From a06ae17da2c6eb3c0e53fb3c9de555da71796af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Sat, 8 Dec 2012 20:02:30 +0100 Subject: [PATCH 13/15] * nsterm.m (fd_handler:): FD_ZERO fds. Fixes: debbugs:13103 --- src/ChangeLog | 6 +++++- src/nsterm.m | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f3af852f9e9..9d9c1fdaff5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,9 +1,13 @@ +2012-12-08 Jan Djärv + + * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103). + 2012-12-08 Fabrice Popineau * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to DWORD_PTR, for compatibility with 64-bit builds. - * w32.c (_PROCESS_MEMORY_COUNTERS_EX): + * w32.c (_PROCESS_MEMORY_COUNTERS_EX): (GetProcessWorkingSetSize_Proc, get_process_working_set_size) (system_process_attributes): Use SIZE_T rather than DWORD, for compatibility with 64-bit builds. diff --git a/src/nsterm.m b/src/nsterm.m index 9d52bd7f52b..783765fe0b6 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4566,7 +4566,7 @@ - (void)fd_handler:(id)unused if (waiting) { SELECT_TYPE fds; - + FD_ZERO (&fds); FD_SET (selfds[0], &fds); result = select (selfds[0]+1, &fds, NULL, NULL, NULL); if (result > 0) From 2c066ad3ae3723168aa1f333a98dabcd2ced5024 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 9 Dec 2012 11:44:59 +0800 Subject: [PATCH 14/15] * simple.el (set-mark-default-inactive): Mark for removal after 24.3. --- lisp/ChangeLog | 5 +++++ lisp/simple.el | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1efcd623e2a..37d6e340399 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-09 Chong Yidong + + * simple.el (set-mark-default-inactive): Mark as obsolete, for + removal after 24.3. + 2012-12-08 Dani Moncayo * simple.el (just-one-space): Doc fix. diff --git a/lisp/simple.el b/lisp/simple.el index 61a5a3ea10b..389df0cde4e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4135,11 +4135,12 @@ after C-u \\[set-mark-command]." (defcustom set-mark-default-inactive nil "If non-nil, setting the mark does not activate it. -This causes \\[set-mark-command] and \\[exchange-point-and-mark] to -behave the same whether or not `transient-mark-mode' is enabled." +This option does the same thing as disabling Transient Mark mode, +and it will be removed in the near future." :type 'boolean :group 'editing-basics :version "23.1") +(make-obsolete-variable 'set-mark-default-inactive nil "24.3") (defun set-mark-command (arg) "Set the mark where point is, or jump to the mark. From f433306af510e86a614e9f9f082b6d2d5f56a968 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 9 Dec 2012 10:36:46 -0500 Subject: [PATCH 15/15] * doc/lispref/control.texi (Pattern maching case statement): New node. --- doc/lispref/ChangeLog | 4 ++ doc/lispref/control.texi | 104 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 210897f6de3..b0f5e9bced0 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2012-12-09 Stefan Monnier + + * control.texi (Pattern maching case statement): New node. + 2012-12-06 Stefan Monnier * customize.texi (Variable Definitions): Mention the default :group diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 489e5cc5b22..00b0a75a3e2 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -285,6 +285,110 @@ For example: @end group @end example +@menu +* Pattern maching case statement:: +@end menu + +@node Pattern maching case statement +@subsection Pattern maching case statement +@cindex pcase +@cindex pattern matching + +To compare a particular value against various possible cases, the macro +@code{pcase} can come handy. It takes the following form: + +@example +(pcase @var{exp} @var{branch}1 @var{branch}2 @var{branch}3 @dots{}) +@end example + +where each @var{branch} takes the form @code{(@var{upattern} +@var{body-forms}@dots{})}. + +It will first evaluate @var{exp} and then compare the value against each +@var{upattern} to see which @var{branch} to use, after which it will run the +corresponding @var{body-forms}. A common use case is to distinguish +between a few different constant values: + +@example +(pcase (get-return-code x) + (`success (message "Done!")) + (`would-block (message "Sorry, can't do it now")) + (`read-only (message "The shmliblick is read-only")) + (`access-denied (message "You do not have the needed rights")) + (code (message "Unknown return code %S" code))) +@end example + +In the last clause, @code{code} is a variable that gets bound to the value that +was returned by @code{(get-return-code x)}. + +To give a more complex example, a simple interpreter for a little +expression language could look like: + +@example +(defun evaluate (exp env) + (pcase exp + (`(add ,x ,y) (+ (evaluate x env) (evaluate y env))) + (`(call ,fun ,arg) (funcall (evaluate fun) (evaluate arg env))) + (`(fn ,arg ,body) (lambda (val) + (evaluate body (cons (cons arg val) env)))) + ((pred numberp) exp) + ((pred symbolp) (cdr (assq exp env))) + (_ (error "Unknown expression %S" exp)))) +@end example + +Where @code{`(add ,x ,y)} is a pattern that checks that @code{exp} is a three +element list starting with the symbol @code{add}, then extracts the second and +third elements and binds them to the variables @code{x} and @code{y}. +@code{(pred numberp)} is a pattern that simply checks that @code{exp} +is a number, and @code{_} is the catch-all pattern that matches anything. + +There are two kinds of patterns involved in @code{pcase}, called +@emph{U-patterns} and @emph{Q-patterns}. The @var{upattern} mentioned above +are U-patterns and can take the following forms: + +@table @code +@item `@var{qpattern} +This is one of the most common form of patterns. The intention is to mimic the +backquote macro: this pattern matches those values that could have been built +by such a backquote expression. Since we're pattern matching rather than +building a value, the unquote does not indicate where to plug an expression, +but instead it lets one specify a U-pattern that should match the value at +that location. + +More specifically, a Q-pattern can take the following forms: +@table @code +@item (@var{qpattern1} . @var{qpattern2}) +This pattern matches any cons cell whose @code{car} matches @var{QPATTERN1} and +whose @code{cdr} matches @var{PATTERN2}. +@item @var{atom} +This pattern matches any atom @code{equal} to @var{atom}. +@item ,@var{upattern} +This pattern matches any object that matches the @var{upattern}. +@end table + +@item @var{symbol} +A mere symbol in a U-pattern matches anything, and additionally let-binds this +symbol to the value that it matched, so that you can later refer to it, either +in the @var{body-forms} or also later in the pattern. +@item _ +This so-called @emph{don't care} pattern matches anything, like the previous +one, but unless symbol patterns it does not bind any variable. +@item (pred @var{pred}) +This pattern matches if the function @var{pred} returns non-@code{nil} when +called with the object being matched. +@item (or @var{upattern1} @var{upattern2}@dots{}) +This pattern matches as soon as one of the argument patterns succeeds. +All argument patterns should let-bind the same variables. +@item (and @var{upattern1} @var{upattern2}@dots{}) +This pattern matches only if all the argument patterns succeed. +@item (guard @var{exp}) +This pattern ignores the object being examined and simply succeeds if @var{exp} +evaluates to non-@code{nil} and fails otherwise. It is typically used inside +an @code{and} pattern. For example, @code{(and x (guard (< x 10)))} +is a pattern which matches any number smaller than 10 and let-binds it to +the variable @code{x}. +@end table + @node Combining Conditions @section Constructs for Combining Conditions