aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog27
-rw-r--r--lisp/emacs-lisp/debug.el34
-rw-r--r--lisp/pcomplete.el18
-rw-r--r--lisp/progmodes/sh-script.el2
-rw-r--r--lisp/shell.el20
-rw-r--r--src/ChangeLog33
-rw-r--r--src/cmds.c3
-rw-r--r--src/dispnew.c3
-rw-r--r--src/xdisp.c2
9 files changed, 105 insertions, 37 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4c7306174d6..61ef1a21065 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,22 @@
12011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * shell.el (shell-completion-vars): Set pcomplete-arg-quote-list.
4 * pcomplete.el (pcomplete-quote-argument): Fix thinko (bug#9161).
5
6 * pcomplete.el (pcomplete-parse-comint-arguments): Fix inf-loop.
7 Mark obsolete.
8 * shell.el (shell-parse-pcomplete-arguments): New function.
9 (shell-completion-vars): Use it instead (bug#9160).
10
112011-08-22 Stefan Monnier <monnier@iro.umontreal.ca>
12
13 * progmodes/sh-script.el (sh-maybe-here-document): Disable magic in
14 strings and comments (bug#9333).
15
16 * emacs-lisp/debug.el (debug-arglist): New function.
17 (debug-convert-byte-code): Use it. Handle lexical byte-codes.
18 (debug-on-entry-1): Handle interpreted closures (bug#9120).
19
12011-08-22 Juri Linkov <juri@jurta.org> 202011-08-22 Juri Linkov <juri@jurta.org>
2 21
3 * progmodes/compile.el (compilation-mode-font-lock-keywords): 22 * progmodes/compile.el (compilation-mode-font-lock-keywords):
@@ -45,8 +64,8 @@
45 (font-lock-default-fontify-region) 64 (font-lock-default-fontify-region)
46 (font-lock-default-unfontify-region): Add docstrings (Bug#8624). 65 (font-lock-default-unfontify-region): Add docstrings (Bug#8624).
47 66
48 * progmodes/compile.el (compilation-error-properties): Fix 67 * progmodes/compile.el (compilation-error-properties):
49 confusion between file struct and message struct (Bug#9319). 68 Fix confusion between file struct and message struct (Bug#9319).
50 (compilation-error-regexp-alist-alist): Fix 2011-05-09 change to 69 (compilation-error-regexp-alist-alist): Fix 2011-05-09 change to
51 `ant' regexp. 70 `ant' regexp.
52 71
@@ -140,8 +159,8 @@
140 binding variables (bug#9298). Also clean up some unused 159 binding variables (bug#9298). Also clean up some unused
141 autoloads. 160 autoloads.
142 161
143 * net/network-stream.el (network-stream-open-starttls): Support 162 * net/network-stream.el (network-stream-open-starttls):
144 using starttls.el without using gnutls-cli. 163 Support using starttls.el without using gnutls-cli.
145 164
1462011-08-17 Juri Linkov <juri@jurta.org> 1652011-08-17 Juri Linkov <juri@jurta.org>
147 166
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 157749500e7..8276030ccf8 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -778,6 +778,7 @@ Redefining FUNCTION also cancels it."
778 (not (debugger-special-form-p symbol)))) 778 (not (debugger-special-form-p symbol))))
779 t nil nil (symbol-name fn))) 779 t nil nil (symbol-name fn)))
780 (list (if (equal val "") fn (intern val))))) 780 (list (if (equal val "") fn (intern val)))))
781 ;; FIXME: Use advice.el.
781 (when (debugger-special-form-p function) 782 (when (debugger-special-form-p function)
782 (error "Function %s is a special form" function)) 783 (error "Function %s is a special form" function))
783 (if (or (symbolp (symbol-function function)) 784 (if (or (symbolp (symbol-function function))
@@ -835,24 +836,30 @@ To specify a nil argument interactively, exit with an empty minibuffer."
835 (message "Cancelling debug-on-entry for all functions") 836 (message "Cancelling debug-on-entry for all functions")
836 (mapcar 'cancel-debug-on-entry debug-function-list))) 837 (mapcar 'cancel-debug-on-entry debug-function-list)))
837 838
839(defun debug-arglist (definition)
840 ;; FIXME: copied from ad-arglist.
841 "Return the argument list of DEFINITION."
842 (require 'help-fns)
843 (help-function-arglist definition 'preserve-names))
844
838(defun debug-convert-byte-code (function) 845(defun debug-convert-byte-code (function)
839 (let* ((defn (symbol-function function)) 846 (let* ((defn (symbol-function function))
840 (macro (eq (car-safe defn) 'macro))) 847 (macro (eq (car-safe defn) 'macro)))
841 (when macro (setq defn (cdr defn))) 848 (when macro (setq defn (cdr defn)))
842 (unless (consp defn) 849 (when (byte-code-function-p defn)
843 ;; Assume a compiled code object. 850 (let* ((args (debug-arglist defn))
844 (let* ((contents (append defn nil))
845 (body 851 (body
846 (list (list 'byte-code (nth 1 contents) 852 `((,(if (memq '&rest args) #'apply #'funcall)
847 (nth 2 contents) (nth 3 contents))))) 853 ,defn
848 (if (nthcdr 5 contents) 854 ,@(remq '&rest (remq '&optional args))))))
849 (setq body (cons (list 'interactive (nth 5 contents)) body))) 855 (if (> (length defn) 5)
850 (if (nth 4 contents) 856 (push `(interactive ,(aref defn 5)) body))
857 (if (aref defn 4)
851 ;; Use `documentation' here, to get the actual string, 858 ;; Use `documentation' here, to get the actual string,
852 ;; in case the compiled function has a reference 859 ;; in case the compiled function has a reference
853 ;; to the .elc file. 860 ;; to the .elc file.
854 (setq body (cons (documentation function) body))) 861 (setq body (cons (documentation function) body)))
855 (setq defn (cons 'lambda (cons (car contents) body)))) 862 (setq defn `(closure (t) ,args ,@body)))
856 (when macro (setq defn (cons 'macro defn))) 863 (when macro (setq defn (cons 'macro defn)))
857 (fset function defn)))) 864 (fset function defn))))
858 865
@@ -861,11 +868,12 @@ To specify a nil argument interactively, exit with an empty minibuffer."
861 (tail defn)) 868 (tail defn))
862 (when (eq (car-safe tail) 'macro) 869 (when (eq (car-safe tail) 'macro)
863 (setq tail (cdr tail))) 870 (setq tail (cdr tail)))
864 (if (not (eq (car-safe tail) 'lambda)) 871 (if (not (memq (car-safe tail) '(closure lambda)))
865 ;; Only signal an error when we try to set debug-on-entry. 872 ;; Only signal an error when we try to set debug-on-entry.
866 ;; When we try to clear debug-on-entry, we are now done. 873 ;; When we try to clear debug-on-entry, we are now done.
867 (when flag 874 (when flag
868 (error "%s is not a user-defined Lisp function" function)) 875 (error "%s is not a user-defined Lisp function" function))
876 (if (eq (car tail) 'closure) (setq tail (cdr tail)))
869 (setq tail (cdr tail)) 877 (setq tail (cdr tail))
870 ;; Skip the docstring. 878 ;; Skip the docstring.
871 (when (and (stringp (cadr tail)) (cddr tail)) 879 (when (and (stringp (cadr tail)) (cddr tail))
@@ -875,9 +883,9 @@ To specify a nil argument interactively, exit with an empty minibuffer."
875 (setq tail (cdr tail))) 883 (setq tail (cdr tail)))
876 (unless (eq flag (equal (cadr tail) '(implement-debug-on-entry))) 884 (unless (eq flag (equal (cadr tail) '(implement-debug-on-entry)))
877 ;; Add/remove debug statement as needed. 885 ;; Add/remove debug statement as needed.
878 (if flag 886 (setcdr tail (if flag
879 (setcdr tail (cons '(implement-debug-on-entry) (cdr tail))) 887 (cons '(implement-debug-on-entry) (cdr tail))
880 (setcdr tail (cddr tail))))) 888 (cddr tail)))))
881 defn)) 889 defn))
882 890
883(defun debugger-list-functions () 891(defun debugger-list-functions ()
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 46a82e3720d..bdf2dadd16c 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -811,15 +811,19 @@ this is `comint-dynamic-complete-functions'."
811 (while (< (point) end) 811 (while (< (point) end)
812 (skip-chars-forward " \t\n") 812 (skip-chars-forward " \t\n")
813 (push (point) begins) 813 (push (point) begins)
814 (let ((skip t)) 814 (while
815 (while skip 815 (progn
816 (skip-chars-forward "^ \t\n") 816 (skip-chars-forward "^ \t\n\\")
817 (if (eq (char-before) ?\\) 817 (when (eq (char-after) ?\\)
818 (skip-chars-forward " \t\n") 818 (forward-char 1)
819 (setq skip nil)))) 819 (unless (eolp)
820 (forward-char 1)
821 t))))
820 (push (buffer-substring-no-properties (car begins) (point)) 822 (push (buffer-substring-no-properties (car begins) (point))
821 args)) 823 args))
822 (cons (nreverse args) (nreverse begins))))) 824 (cons (nreverse args) (nreverse begins)))))
825(make-obsolete 'pcomplete-parse-comint-arguments
826 'comint-parse-pcomplete-arguments "24.1")
823 827
824(defun pcomplete-parse-arguments (&optional expand-p) 828(defun pcomplete-parse-arguments (&optional expand-p)
825 "Parse the command line arguments. Most completions need this info." 829 "Parse the command line arguments. Most completions need this info."
@@ -879,7 +883,7 @@ Magic characters are those in `pcomplete-arg-quote-list'."
879 (or (run-hook-with-args-until-success 883 (or (run-hook-with-args-until-success
880 'pcomplete-quote-arg-hook filename index) 884 'pcomplete-quote-arg-hook filename index)
881 (when (memq c pcomplete-arg-quote-list) 885 (when (memq c pcomplete-arg-quote-list)
882 (string "\\" c)) 886 (string ?\\ c))
883 (char-to-string c)) 887 (char-to-string c))
884 (setq index (1+ index)))) 888 (setq index (1+ index))))
885 filename 889 filename
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 31a4fbaef4d..7b949134c6c 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -460,6 +460,7 @@ This is buffer-local in every such buffer.")
460 (define-key map "\C-c+" 'sh-add) 460 (define-key map "\C-c+" 'sh-add)
461 (define-key map "\C-\M-x" 'sh-execute-region) 461 (define-key map "\C-\M-x" 'sh-execute-region)
462 (define-key map "\C-c\C-x" 'executable-interpret) 462 (define-key map "\C-c\C-x" 'executable-interpret)
463 ;; FIXME: Use post-self-insert-hook.
463 (define-key map "<" 'sh-maybe-here-document) 464 (define-key map "<" 'sh-maybe-here-document)
464 (define-key map "(" 'skeleton-pair-insert-maybe) 465 (define-key map "(" 'skeleton-pair-insert-maybe)
465 (define-key map "{" 'skeleton-pair-insert-maybe) 466 (define-key map "{" 'skeleton-pair-insert-maybe)
@@ -3659,6 +3660,7 @@ The document is bounded by `sh-here-document-word'."
3659 (save-excursion 3660 (save-excursion
3660 (backward-char 2) 3661 (backward-char 2)
3661 (sh-quoted-p)) 3662 (sh-quoted-p))
3663 (nth 8 (syntax-ppss))
3662 (let ((tabs (if (string-match "\\`-" sh-here-document-word) 3664 (let ((tabs (if (string-match "\\`-" sh-here-document-word)
3663 (make-string (/ (current-indentation) tab-width) ?\t) 3665 (make-string (/ (current-indentation) tab-width) ?\t)
3664 "")) 3666 ""))
diff --git a/lisp/shell.el b/lisp/shell.el
index de811543ba0..01d1a688f0e 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -383,6 +383,21 @@ to `dirtrack-mode'."
383 :group 'shell 383 :group 'shell
384 :type '(choice (const nil) regexp)) 384 :type '(choice (const nil) regexp))
385 385
386(defun shell-parse-pcomplete-arguments ()
387 "Parse whitespace separated arguments in the current region."
388 (let ((begin (save-excursion (shell-backward-command 1) (point)))
389 (end (point))
390 begins args)
391 (save-excursion
392 (goto-char begin)
393 (while (< (point) end)
394 (skip-chars-forward " \t\n")
395 (push (point) begins)
396 (looking-at "\\(?:[^\s\t\n\\]\\|'[^']*'\\|\"\\(?:[^\"\\]\\|\\\\.\\)*\"\\|\\\\.\\)*\\(?:\\\\\\|'[^']*\\|\"\\(?:[^\"\\]\\|\\\\.\\)*\\)?")
397 (goto-char (match-end 0))
398 (push (buffer-substring-no-properties (car begins) (point))
399 args))
400 (cons (nreverse args) (nreverse begins)))))
386 401
387(defun shell-completion-vars () 402(defun shell-completion-vars ()
388 "Setup completion vars for `shell-mode' and `read-shell-command'." 403 "Setup completion vars for `shell-mode' and `read-shell-command'."
@@ -396,8 +411,9 @@ to `dirtrack-mode'."
396 (set (make-local-variable 'comint-dynamic-complete-functions) 411 (set (make-local-variable 'comint-dynamic-complete-functions)
397 shell-dynamic-complete-functions) 412 shell-dynamic-complete-functions)
398 (set (make-local-variable 'pcomplete-parse-arguments-function) 413 (set (make-local-variable 'pcomplete-parse-arguments-function)
399 ;; FIXME: This function should be moved to shell.el. 414 #'shell-parse-pcomplete-arguments)
400 #'pcomplete-parse-comint-arguments) 415 (set (make-local-variable 'pcomplete-arg-quote-list)
416 (append "\\ \t\n\r\"'`$|&;(){}[]<>#" nil))
401 (set (make-local-variable 'pcomplete-termination-string) 417 (set (make-local-variable 'pcomplete-termination-string)
402 (cond ((not comint-completion-addsuffix) "") 418 (cond ((not comint-completion-addsuffix) "")
403 ((stringp comint-completion-addsuffix) 419 ((stringp comint-completion-addsuffix)
diff --git a/src/ChangeLog b/src/ChangeLog
index e3cf7546962..d4f654a1028 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,18 @@
12011-08-23 Eli Zaretskii <eliz@gnu.org>
2
3 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
4 instead of CHAR_TO_BYTE. Fixes a crash when a completion
5 candidate is selected by the mouse, and that candidate has a
6 composed character under the mouse.
7
8 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9 coordinates reported by pos-visible-in-window-p for a composed
10 character in column zero.
11
122011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13
14 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
15
12011-08-22 Eli Zaretskii <eliz@gnu.org> 162011-08-22 Eli Zaretskii <eliz@gnu.org>
2 17
3 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition, 18 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
@@ -45,8 +60,8 @@
452011-08-17 Chong Yidong <cyd@stupidchicken.com> 602011-08-17 Chong Yidong <cyd@stupidchicken.com>
46 61
47 * eval.c (internal_condition_case, internal_condition_case_1) 62 * eval.c (internal_condition_case, internal_condition_case_1)
48 (internal_condition_case_2, internal_condition_case_n): Remove 63 (internal_condition_case_2, internal_condition_case_n):
49 unnecessary aborts (Bug#9081). 64 Remove unnecessary aborts (Bug#9081).
50 65
512011-08-17 Eli Zaretskii <eliz@gnu.org> 662011-08-17 Eli Zaretskii <eliz@gnu.org>
52 67
@@ -69,8 +84,8 @@
69 * unexcw.c ( __malloc_initialized): Declare external variable. 84 * unexcw.c ( __malloc_initialized): Declare external variable.
70 (fixup_executable): Force the dumped emacs to reinitialize malloc. 85 (fixup_executable): Force the dumped emacs to reinitialize malloc.
71 86
72 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo): New 87 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
73 variables. 88 New variables.
74 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the 89 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
75 dumped emacs. 90 dumped emacs.
76 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage 91 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
@@ -172,8 +187,8 @@
172 * xdisp.c (iterate_out_of_display_property): xassert that 187 * xdisp.c (iterate_out_of_display_property): xassert that
173 IT->position is set to within IT->object's boundaries. Break from 188 IT->position is set to within IT->object's boundaries. Break from
174 the loop as soon as EOB is reached; avoids infloops in redisplay 189 the loop as soon as EOB is reached; avoids infloops in redisplay
175 when IT->position is set up wrongly due to some bug. Set 190 when IT->position is set up wrongly due to some bug.
176 IT->current to match the bidi iterator unconditionally. 191 Set IT->current to match the bidi iterator unconditionally.
177 (push_display_prop): Allow GET_FROM_STRING as IT->method on 192 (push_display_prop): Allow GET_FROM_STRING as IT->method on
178 entry. Force push_it to save on the stack the current 193 entry. Force push_it to save on the stack the current
179 buffer/string position, to be restored by pop_it. Fix flags in 194 buffer/string position, to be restored by pop_it. Fix flags in
@@ -196,8 +211,8 @@
1962011-08-08 Eli Zaretskii <eliz@gnu.org> 2112011-08-08 Eli Zaretskii <eliz@gnu.org>
197 212
198 * xdisp.c (forward_to_next_line_start): Allow to use the 213 * xdisp.c (forward_to_next_line_start): Allow to use the
199 no-display-properties-and-no-overlays under bidi display. Set 214 no-display-properties-and-no-overlays under bidi display.
200 disp_pos in the bidi iterator to avoid searches for display 215 Set disp_pos in the bidi iterator to avoid searches for display
201 properties and overlays. 216 properties and overlays.
202 217
2032011-08-08 Chong Yidong <cyd@stupidchicken.com> 2182011-08-08 Chong Yidong <cyd@stupidchicken.com>
@@ -235,7 +250,7 @@
235 * bidi.c <bidi_cache_total_alloc>: Now static. 250 * bidi.c <bidi_cache_total_alloc>: Now static.
236 (bidi_initialize): Initialize bidi_cache_total_alloc. 251 (bidi_initialize): Initialize bidi_cache_total_alloc.
237 252
238 *xdisp.c (display_line): Release buffer allocated for shelved bidi 253 * xdisp.c (display_line): Release buffer allocated for shelved bidi
239 cache. (Bug#9221) 254 cache. (Bug#9221)
240 255
241 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total 256 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
diff --git a/src/cmds.c b/src/cmds.c
index f49cfc221be..c079ad7168f 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -271,7 +271,8 @@ Whichever character you type to run this command is inserted.
271Before insertion, `expand-abbrev' is executed if the inserted character does 271Before insertion, `expand-abbrev' is executed if the inserted character does
272not have word syntax and the previous character in the buffer does. 272not have word syntax and the previous character in the buffer does.
273After insertion, the value of `auto-fill-function' is called if the 273After insertion, the value of `auto-fill-function' is called if the
274`auto-fill-chars' table has a non-nil value for the inserted character. */) 274`auto-fill-chars' table has a non-nil value for the inserted character.
275At the end, it runs `post-self-insert-hook'. */)
275 (Lisp_Object n) 276 (Lisp_Object n)
276{ 277{
277 int remove_boundary = 1; 278 int remove_boundary = 1;
diff --git a/src/dispnew.c b/src/dispnew.c
index 4cffc32b0d7..a09421a9f15 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5314,7 +5314,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5314 if (STRINGP (it.string)) 5314 if (STRINGP (it.string))
5315 BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); 5315 BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos));
5316 else 5316 else
5317 BYTEPOS (pos->pos) = CHAR_TO_BYTE (CHARPOS (pos->pos)); 5317 BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer),
5318 CHARPOS (pos->pos));
5318 } 5319 }
5319 5320
5320#ifdef HAVE_WINDOW_SYSTEM 5321#ifdef HAVE_WINDOW_SYSTEM
diff --git a/src/xdisp.c b/src/xdisp.c
index 5ce8cbf8d9b..6fbbc69a7ca 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -24292,6 +24292,8 @@ x_produce_glyphs (struct it *it)
24292 Lisp_Object gstring; 24292 Lisp_Object gstring;
24293 struct font_metrics metrics; 24293 struct font_metrics metrics;
24294 24294
24295 it->nglyphs = 1;
24296
24295 gstring = composition_gstring_from_id (it->cmp_it.id); 24297 gstring = composition_gstring_from_id (it->cmp_it.id);
24296 it->pixel_width 24298 it->pixel_width
24297 = composition_gstring_width (gstring, it->cmp_it.from, it->cmp_it.to, 24299 = composition_gstring_width (gstring, it->cmp_it.from, it->cmp_it.to,