diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | admin/ChangeLog | 4 | ||||
-rw-r--r-- | admin/bzrmerge.el | 3 | ||||
-rw-r--r-- | doc/emacs/ChangeLog | 5 | ||||
-rw-r--r-- | doc/emacs/mule.texi | 47 | ||||
-rw-r--r-- | lib-src/etags.c | 7 | ||||
-rw-r--r-- | lib/intprops.h | 38 | ||||
-rw-r--r-- | lib/stdint.in.h | 2 | ||||
-rw-r--r-- | lisp/ChangeLog | 46 | ||||
-rw-r--r-- | lisp/dired-aux.el | 19 | ||||
-rw-r--r-- | lisp/dired.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/macroexp.el | 10 | ||||
-rw-r--r-- | lisp/files.el | 260 | ||||
-rw-r--r-- | lisp/image-mode.el | 3 | ||||
-rw-r--r-- | lisp/nxml/rng-xsd.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/grep.el | 4 | ||||
-rw-r--r-- | lisp/vc/diff-mode.el | 9 | ||||
-rw-r--r-- | lisp/vc/vc-dir.el | 1 | ||||
-rw-r--r-- | lisp/wid-edit.el | 6 | ||||
-rw-r--r-- | m4/mktime.m4 | 19 | ||||
-rw-r--r-- | m4/readlink.m4 | 5 | ||||
-rw-r--r-- | src/ChangeLog | 38 | ||||
-rw-r--r-- | src/Makefile.in | 15 | ||||
-rw-r--r-- | src/dispnew.c | 30 | ||||
-rw-r--r-- | src/gnutls.c | 3 | ||||
-rw-r--r-- | src/xselect.c | 79 |
28 files changed, 413 insertions, 259 deletions
diff --git a/ChangeLog b/ChangeLog index 99d5c667f76..a3c17418bd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-05-22 Paul Eggert <eggert@cs.ucla.edu> + + * lib/intprops.h, lib/stdint.in.h, m4/mktime.m4, m4/readlink.m4: + Merge from gnulib. + +2011-05-21 Andreas Schwab <schwab@linux-m68k.org> + + * Makefile.in (AUTOMAKE_INPUTS): Add $(srcdir)/lib/gnulib.mk. + 2011-05-20 Eli Zaretskii <eliz@gnu.org> * .bzrignore: Add lib/stdio.in-h, lib/stdbool.h, and lib/stdint.h. diff --git a/Makefile.in b/Makefile.in index 5127563be35..1c0dbb9c27e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -422,7 +422,7 @@ ACLOCAL_INPUTS = @MAINT@ $(srcdir)/m4/$(DOS_gnulib_comp.m4) $(srcdir)/aclocal.m4: $(ACLOCAL_INPUTS) cd $(srcdir) && aclocal -I m4 -AUTOMAKE_INPUTS = @MAINT@ $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am +AUTOMAKE_INPUTS = @MAINT@ $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am $(srcdir)/lib/gnulib.mk $(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS) cd $(srcdir) && automake --gnu -a -c lib/Makefile am--refresh: $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/src/config.in diff --git a/admin/ChangeLog b/admin/ChangeLog index 853c1941a92..7aaeb1d5ee2 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2011-05-21 Glenn Morris <rgm@gnu.org> + + * bzrmerge.el (bzrmerge-resolve): Suppress prompts about file-locals. + 2011-03-07 Chong Yidong <cyd@stupidchicken.com> * Version 23.3 released. diff --git a/admin/bzrmerge.el b/admin/bzrmerge.el index 33cbae22a6c..583f0d88866 100644 --- a/admin/bzrmerge.el +++ b/admin/bzrmerge.el @@ -146,7 +146,8 @@ are both lists of revnos, in oldest-first order." (unless (file-exists-p file) (error "Bzrmerge-resolve: Can't find %s" file)) (with-demoted-errors (let ((exists (find-buffer-visiting file))) - (with-current-buffer (find-file-noselect file) + (with-current-buffer (let ((enable-local-variables :safe)) + (find-file-noselect file)) (if (buffer-modified-p) (error "Unsaved changes in %s" (current-buffer))) (save-excursion diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 1f236ef4206..2bf07904172 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2011-05-22 Chong Yidong <cyd@stupidchicken.com> + + * mule.texi (Specify Coding, Text Coding, Communication Coding): + (File Name Coding, Terminal Coding): Add command names (Bug#8312). + 2011-05-18 Glenn Morris <rgm@gnu.org> * ack.texi (Acknowledgments): Remove fakemail.c. diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 1a4d0d33bc6..a721e0c204b 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -916,11 +916,12 @@ written in the Emacs internal character code). @section Specifying a File's Coding System If Emacs recognizes the encoding of a file incorrectly, you can -reread the file using the correct coding system by typing @kbd{C-x -@key{RET} r @var{coding-system} @key{RET}}. To see what coding system -Emacs actually used to decode the file, look at the coding system -mnemonic letter near the left edge of the mode line (@pxref{Mode -Line}), or type @kbd{C-h C @key{RET}}. +reread the file using the correct coding system with @kbd{C-x +@key{RET} r} (@code{revert-buffer-with-coding-system}). This command +prompts for the coding system to use. To see what coding system Emacs +actually used to decode the file, look at the coding system mnemonic +letter near the left edge of the mode line (@pxref{Mode Line}), or +type @kbd{C-h C} (@code{describe-coding-system}). @vindex coding You can specify the coding system for a particular file in the file @@ -994,15 +995,16 @@ one: @table @kbd @item C-x @key{RET} f @var{coding} @key{RET} -Use coding system @var{coding} for saving or revisiting the visited -file in the current buffer. +Use coding system @var{coding} to save or revisit the visited file in +the current buffer (@code{set-buffer-file-coding-system}) @item C-x @key{RET} c @var{coding} @key{RET} Specify coding system @var{coding} for the immediately following -command. +command (@code{universal-coding-system-argument}). @item C-x @key{RET} r @var{coding} @key{RET} -Revisit the current file using the coding system @var{coding}. +Revisit the current file using the coding system @var{coding} +(@code{revert-buffer-with-coding-system}). @item M-x recode-region @key{RET} @var{right} @key{RET} @var{wrong} @key{RET} Convert a region that was decoded using coding system @var{wrong}, @@ -1084,19 +1086,17 @@ in communication with other processes. @table @kbd @item C-x @key{RET} x @var{coding} @key{RET} Use coding system @var{coding} for transferring selections to and from -other window-based applications. +other window-based applications (@code{set-selection-coding-system}). @item C-x @key{RET} X @var{coding} @key{RET} Use coding system @var{coding} for transferring @emph{one} -selection---the next one---to or from another window-based application. +selection---the next one---to or from another window-based application +(@code{set-next-selection-coding-system}). @item C-x @key{RET} p @var{input-coding} @key{RET} @var{output-coding} @key{RET} Use coding systems @var{input-coding} and @var{output-coding} for -subprocess input and output in the current buffer. - -@item C-x @key{RET} c @var{coding} @key{RET} -Specify coding system @var{coding} for the immediately following -command. +subprocess input and output in the current buffer +(@code{set-buffer-process-coding-system}). @end table @kindex C-x RET x @@ -1134,9 +1134,10 @@ own buffer, and thus you can use this command to specify translation to and from a particular subprocess by giving the command in the corresponding buffer. - You can also use @kbd{C-x @key{RET} c} just before the command that -runs or starts a subprocess, to specify the coding system to use for -communication with that subprocess. + You can also use @kbd{C-x @key{RET} c} +(@code{universal-coding-system-argument}) just before the command that +runs or starts a subprocess, to specify the coding system for +communicating with that subprocess. @xref{Text Coding}. The default for translation of process input and output depends on the current language environment. @@ -1160,7 +1161,7 @@ the text representation.) @table @kbd @item C-x @key{RET} F @var{coding} @key{RET} Use coding system @var{coding} for encoding and decoding file -@emph{names}. +@emph{names} (@code{set-file-name-coding-system}). @end table @vindex file-name-coding-system @@ -1205,10 +1206,12 @@ system, and the coding system to which you wish to convert. @table @kbd @item C-x @key{RET} k @var{coding} @key{RET} -Use coding system @var{coding} for keyboard input. +Use coding system @var{coding} for keyboard input +(@code{set-keyboard-coding-system}). @item C-x @key{RET} t @var{coding} @key{RET} -Use coding system @var{coding} for terminal output. +Use coding system @var{coding} for terminal output +(@code{set-terminal-coding-system}). @end table @kindex C-x RET t diff --git a/lib-src/etags.c b/lib-src/etags.c index a2cdf26abc7..097f6842c07 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -93,8 +93,11 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; #ifdef HAVE_CONFIG_H # include <config.h> - /* On some systems, Emacs defines static as nothing for the sake - of unexec. We don't want that here since we don't use unexec. */ + /* This is probably not necessary any more. On some systems, config.h + used to define static as nothing for the sake of unexec. We don't + want that here since we don't use unexec. None of these systems + are supported any more, but the idea is still mentioned in + etc/PROBLEMS. */ # undef static # ifndef PTR /* for XEmacs */ # define PTR void * diff --git a/lib/intprops.h b/lib/intprops.h index a84bd6af531..293204ab43a 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -27,6 +27,10 @@ E should not have side effects. */ #define _GL_INT_CONVERT(e, v) ((e) - (e) + (v)) +/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see + <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */ +#define _GL_INT_NEGATE_CONVERT(e, v) ((e) - (e) - (v)) + /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ @@ -50,7 +54,7 @@ /* Return 1 if the integer expression E, after integer promotion, has a signed type. E should not have side effects. */ -#define _GL_INT_SIGNED(e) (_GL_INT_CONVERT (e, -1) < 0) +#define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) /* Minimum and maximum values for integer types and expressions. These @@ -79,7 +83,7 @@ #define _GL_INT_MAXIMUM(e) \ (_GL_INT_SIGNED (e) \ ? _GL_SIGNED_INT_MAXIMUM (e) \ - : _GL_INT_CONVERT (e, -1)) + : _GL_INT_NEGATE_CONVERT (e, 1)) #define _GL_SIGNED_INT_MAXIMUM(e) \ (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) @@ -179,16 +183,21 @@ : 0 < (a)) /* Return 1 if A * B would overflow in [MIN,MAX] arithmetic. - See above for restrictions. */ + See above for restrictions. Avoid && and || as they tickle + bugs in Sun C 5.11 2010/08/13 and other compilers; see + <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */ #define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \ ((b) < 0 \ ? ((a) < 0 \ ? (a) < (max) / (b) \ - : (b) < -1 && (min) / (b) < (a)) \ - : (0 < (b) \ - && ((a) < 0 \ - ? (a) < (min) / (b) \ - : (max) / (b) < (a)))) + : (b) == -1 \ + ? 0 \ + : (min) / (b) < (a)) \ + : (b) == 0 \ + ? 0 \ + : ((a) < 0 \ + ? (a) < (min) / (b) \ + : (max) / (b) < (a))) /* Return 1 if A / B would overflow in [MIN,MAX] arithmetic. See above for restrictions. Do not check for division by zero. */ @@ -234,11 +243,11 @@ (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \ || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max)) #define _GL_DIVIDE_OVERFLOW(a, b, min, max) \ - ((min) < 0 ? (b) == _GL_INT_CONVERT (min, -1) && (a) < - (max) \ + ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \ : (a) < 0 ? (b) <= (a) + (b) - 1 \ : (b) < 0 && (a) + (b) <= (a)) #define _GL_REMAINDER_OVERFLOW(a, b, min, max) \ - ((min) < 0 ? (b) == _GL_INT_CONVERT (min, -1) && (a) < - (max) \ + ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \ : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \ : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max)) @@ -302,13 +311,10 @@ /* Return 1 if the expression A <op> B would overflow, where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test, assuming MIN and MAX are the minimum and maximum for the result type. - - This macro assumes that A | B is a valid integer if both A and B are, - which is true of all known practical hosts. If this is a problem - for you, please let us know how to fix it for your host. */ + Arguments should be free of side effects. */ #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \ op_result_overflow (a, b, \ - _GL_INT_MINIMUM ((a) | (b)), \ - _GL_INT_MAXIMUM ((a) | (b))) + _GL_INT_MINIMUM ((b) - (b) + (a)), \ + _GL_INT_MAXIMUM ((b) - (b) + (a))) #endif /* _GL_INTPROPS_H */ diff --git a/lib/stdint.in.h b/lib/stdint.in.h index b32227bb04c..376b96a785d 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -93,7 +93,7 @@ #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H -/* Minimum and maximum values for a integer type under the usual assumption. +/* Minimum and maximum values for an integer type under the usual assumption. Return an unspecified value if BITS == 0, adding a check to pacify picky compilers. */ diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 05a7d63bb3d..506348601ee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,49 @@ +2011-05-22 Yuanle Song <sylecn@gmail.com> + + * nxml/rng-xsd.el (rng-xsd-check-pattern): Use case-sensitive + matching (Bug#8516). + +2011-01-22 Jari Aalto <jari.aalto@cante.net> + + * vc/vc-dir.el (vc-default-dir-printer): Give edited tag a + different face (Bug#8178). + +2011-05-22 Chong Yidong <cyd@stupidchicken.com> + + * vc/diff-mode.el (diff-changed): Don't use terminal specs for + defface (Bug#8144). + +2011-05-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/macroexp.el (macroexpand-all-1): Convert ' to #' for + funcall as well (bug#8712). Warn when performing those conversions. + * emacs-lisp/bytecomp.el (byte-compile-form): Fix error report. + + * progmodes/grep.el (grep-mode): Fix it for good (bug#8684)! + +2011-05-22 Glenn Morris <rgm@gnu.org> + + * files.el (hack-local-variables-prop-line): Small simplifications. + (hack-local-variables, hack-local-variables-prop-line): + If MODE-ONLY, return the mode, rather than just `t'. + +2011-05-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/grep.el (grep-mode): Fix last change (bug#8684). + +2011-05-21 Glenn Morris <rgm@gnu.org> + + * files.el (hack-local-variables-prop-line, hack-local-variables): + If only interested in the mode, don't bother doing the other stuff. + + * image-mode.el (image-after-revert-hook): + Redraw all frames on which the image is visible. (Bug#8567) + + * dired-aux.el (dired-touch-initial): Just use current-time. (Bug#6887) + + * wid-edit.el (widget-checklist-match-inline): + Fix 2011-04-19 change. (Bug#8649) + 2011-05-20 Stefan Monnier <monnier@iro.umontreal.ca> * emacs-lisp/checkdoc.el (checkdoc-sentencespace-region-engine): diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 059a635cded..8e4b3b5c6a6 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -229,14 +229,17 @@ List has a form of (file-name full-file-name (attribute-list))." (defun dired-touch-initial (files) "Create initial input value for `touch' command." - (let (initial) - (while files - (let ((current (nth 5 (file-attributes (car files))))) - (if (and initial (not (equal initial current))) - (setq initial (current-time) files nil) - (setq initial current)) - (setq files (cdr files)))) - (format-time-string "%Y%m%d%H%M.%S" initial))) + ;; Nobody can explain what this version is supposed to do. (Bug#6887) + ;; Also, the manual says it uses "the present time". + ;;; (let (initial) + ;;; (while files + ;;; (let ((current (nth 5 (file-attributes (car files))))) + ;;; (if (and initial (not (equal initial current))) + ;;; (setq initial (current-time) files nil) + ;;; (setq initial current)) + ;;; (setq files (cdr files)))) + ;;; (format-time-string "%Y%m%d%H%M.%S" initial))) + (format-time-string "%Y%m%d%H%M.%S" (current-time))) (defun dired-do-chxxx (attribute-name program op-symbol arg) ;; Change file attributes (mode, group, owner, timestamp) of marked files and diff --git a/lisp/dired.el b/lisp/dired.el index c581597494c..48cdc2a2e26 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3629,7 +3629,7 @@ Ask means pop up a menu for the user to select one of copy, move or link." ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "e34e1bbdb701078d52466c319d8e0cda") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "7efcfe4f9e0913ae4a87be014010c27f") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e7f2115a848..49b39b6a1f9 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2892,8 +2892,8 @@ If FORM is a lambda or a macro, byte-compile it as a function." That command is designed for interactive use only" fn)) (if (and (fboundp (car form)) (eq (car-safe (symbol-function (car form))) 'macro)) - (byte-compile-report-error - (format "Forgot to expand macro %s" (car form)))) + (byte-compile-log-warning + (format "Forgot to expand macro %s" (car form)) nil :error)) (if (and handler ;; Make sure that function exists. This is important ;; for CL compiler macros since the symbol may be diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index f0a075ace37..ccfdf2e0551 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -169,14 +169,22 @@ Assumes the caller has bound `macroexpand-all-environment'." ;; here, so that any code that cares about the difference will ;; see the same transformation. ;; First arg is a function: - (`(,(and fun (or `apply `mapcar `mapatoms `mapconcat `mapc)) + (`(,(and fun (or `funcall `apply `mapcar `mapatoms `mapconcat `mapc)) ',(and f `(lambda . ,_)) . ,args) + (byte-compile-log-warning + (format "%s quoted with ' rather than with #'" + (list 'lambda (nth 1 f) '...)) + t) ;; We don't use `maybe-cons' since there's clearly a change. (cons fun (cons (macroexpand-all-1 (list 'function f)) (macroexpand-all-forms args)))) ;; Second arg is a function: (`(,(and fun (or `sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args) + (byte-compile-log-warning + (format "%s quoted with ' rather than with #'" + (list 'lambda (nth 1 f) '...)) + t) ;; We don't use `maybe-cons' since there's clearly a change. (cons fun (cons (macroexpand-all-1 arg1) diff --git a/lisp/files.el b/lisp/files.el index 200b9b1d303..24a0e0a5b62 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3032,60 +3032,62 @@ n -- to ignore the local variables list.") (defun hack-local-variables-prop-line (&optional mode-only) "Return local variables specified in the -*- line. -Ignore any specification for `mode:' and `coding:'; -`set-auto-mode' should already have handled `mode:', -`set-auto-coding' should already have handled `coding:'. - -If MODE-ONLY is non-nil, all we do is check whether the major -mode is specified, returning t if it is specified. Otherwise, -return an alist of elements (VAR . VAL), where VAR is a variable -and VAL is the specified value." +Returns an alist of elements (VAR . VAL), where VAR is a variable +and VAL is the specified value. Ignores any specification for +`mode:' and `coding:' (which should have already been handled +by `set-auto-mode' and `set-auto-coding', respectively). +Throws an error if the -*- line is malformed. + +If MODE-ONLY is non-nil, just returns the symbol specifying the +mode, if there is one, otherwise nil." (save-excursion (goto-char (point-min)) (let ((end (set-auto-mode-1)) - result mode-specified) - ;; Parse the -*- line into the RESULT alist. - ;; Also set MODE-SPECIFIED if we see a spec or `mode'. + result) (cond ((not end) nil) ((looking-at "[ \t]*\\([^ \t\n\r:;]+\\)\\([ \t]*-\\*-\\)") - ;; Simple form: "-*- MODENAME -*-". Already handled. - (setq mode-specified t) - nil) + ;; Simple form: "-*- MODENAME -*-". + (if mode-only + (intern (concat (match-string 1) "-mode")))) (t ;; Hairy form: '-*-' [ <variable> ':' <value> ';' ]* '-*-' ;; (last ";" is optional). - (while (< (point) end) + ;; If MODE-ONLY, just check for `mode'. + ;; Otherwise, parse the -*- line into the RESULT alist. + (while (and (or (not mode-only) + (not result)) + (< (point) end)) (or (looking-at "[ \t]*\\([^ \t\n:]+\\)[ \t]*:[ \t]*") (error "Malformed -*- line")) (goto-char (match-end 0)) ;; There used to be a downcase here, ;; but the manual didn't say so, ;; and people want to set var names that aren't all lc. - (let ((key (intern (match-string 1))) - (val (save-restriction - (narrow-to-region (point) end) - (let ((read-circle nil)) - (read (current-buffer)))))) - ;; It is traditional to ignore - ;; case when checking for `mode' in set-auto-mode, - ;; so we must do that here as well. - ;; That is inconsistent, but we're stuck with it. - ;; The same can be said for `coding' in set-auto-coding. - (or (and (equal (downcase (symbol-name key)) "mode") - (setq mode-specified t)) - (equal (downcase (symbol-name key)) "coding") - (condition-case nil - (push (cons (if (eq key 'eval) - 'eval - (indirect-variable key)) - val) result) - (error nil))) - (skip-chars-forward " \t;"))))) - - (if mode-only - mode-specified - result)))) + (let* ((key (intern (match-string 1))) + (val (save-restriction + (narrow-to-region (point) end) + (let ((read-circle nil)) + (read (current-buffer))))) + ;; It is traditional to ignore + ;; case when checking for `mode' in set-auto-mode, + ;; so we must do that here as well. + ;; That is inconsistent, but we're stuck with it. + ;; The same can be said for `coding' in set-auto-coding. + (keyname (downcase (symbol-name key)))) + (if mode-only + (and (equal keyname "mode") + (setq result + (intern (concat (symbol-name val) "-mode")))) + (or (equal keyname "coding") + (condition-case nil + (push (cons (if (eq key 'eval) + 'eval + (indirect-variable key)) + val) result) + (error nil)))) + (skip-chars-forward " \t;"))) + result))))) (defun hack-local-variables-filter (variables dir-name) "Filter local variable settings, querying the user if necessary. @@ -3144,8 +3146,10 @@ DIR-NAME is the name of the associated directory. Otherwise it is nil." (defun hack-local-variables (&optional mode-only) "Parse and put into effect this buffer's local variables spec. -If MODE-ONLY is non-nil, all we do is check whether the major mode -is specified, returning t if it is specified." +If MODE-ONLY is non-nil, all we do is check whether a \"mode:\" +is specified, and return the corresponding mode symbol, or nil. +In this case, we try to ignore minor-modes, and only return a +major-mode." (let ((enable-local-variables (and local-enable-local-variables enable-local-variables)) result) @@ -3154,88 +3158,98 @@ is specified, returning t if it is specified." (report-errors "Directory-local variables error: %s" (hack-dir-local-variables))) (when (or mode-only enable-local-variables) - (setq result (hack-local-variables-prop-line mode-only)) - ;; Look for "Local variables:" line in last page. - (save-excursion - (goto-char (point-max)) - (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) - 'move) - (when (let ((case-fold-search t)) - (search-forward "Local Variables:" nil t)) - (skip-chars-forward " \t") - ;; suffix is what comes after "local variables:" in its line. - ;; prefix is what comes before "local variables:" in its line. - (let ((suffix - (concat - (regexp-quote (buffer-substring (point) - (line-end-position))) - "$")) - (prefix - (concat "^" (regexp-quote - (buffer-substring (line-beginning-position) - (match-beginning 0))))) - beg) - - (forward-line 1) - (let ((startpos (point)) - endpos - (thisbuf (current-buffer))) - (save-excursion - (unless (let ((case-fold-search t)) - (re-search-forward - (concat prefix "[ \t]*End:[ \t]*" suffix) - nil t)) - ;; This used to be an error, but really all it means is - ;; that this may simply not be a local-variables section, - ;; so just ignore it. - (message "Local variables list is not properly terminated")) - (beginning-of-line) - (setq endpos (point))) - - (with-temp-buffer - (insert-buffer-substring thisbuf startpos endpos) - (goto-char (point-min)) - (subst-char-in-region (point) (point-max) ?\^m ?\n) - (while (not (eobp)) - ;; Discard the prefix. - (if (looking-at prefix) - (delete-region (point) (match-end 0)) - (error "Local variables entry is missing the prefix")) - (end-of-line) - ;; Discard the suffix. - (if (looking-back suffix) - (delete-region (match-beginning 0) (point)) - (error "Local variables entry is missing the suffix")) - (forward-line 1)) - (goto-char (point-min)) - - (while (not (eobp)) - ;; Find the variable name; strip whitespace. - (skip-chars-forward " \t") - (setq beg (point)) - (skip-chars-forward "^:\n") - (if (eolp) (error "Missing colon in local variables entry")) - (skip-chars-backward " \t") - (let* ((str (buffer-substring beg (point))) - (var (let ((read-circle nil)) - (read str))) - val) - ;; Read the variable value. - (skip-chars-forward "^:") - (forward-char 1) - (let ((read-circle nil)) - (setq val (read (current-buffer)))) - (if mode-only - (if (eq var 'mode) - (setq result t)) - (unless (eq var 'coding) - (condition-case nil - (push (cons (if (eq var 'eval) - 'eval - (indirect-variable var)) - val) result) - (error nil))))) - (forward-line 1)))))))) + ;; If MODE-ONLY is non-nil, and the prop line specifies a mode, + ;; then we're done, and have no need to scan further. + (unless (and (setq result (hack-local-variables-prop-line mode-only)) + mode-only) + ;; Look for "Local variables:" line in last page. + (save-excursion + (goto-char (point-max)) + (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) + 'move) + (when (let ((case-fold-search t)) + (search-forward "Local Variables:" nil t)) + (skip-chars-forward " \t") + ;; suffix is what comes after "local variables:" in its line. + ;; prefix is what comes before "local variables:" in its line. + (let ((suffix + (concat + (regexp-quote (buffer-substring (point) + (line-end-position))) + "$")) + (prefix + (concat "^" (regexp-quote + (buffer-substring (line-beginning-position) + (match-beginning 0))))) + beg) + + (forward-line 1) + (let ((startpos (point)) + endpos + (thisbuf (current-buffer))) + (save-excursion + (unless (let ((case-fold-search t)) + (re-search-forward + (concat prefix "[ \t]*End:[ \t]*" suffix) + nil t)) + ;; This used to be an error, but really all it means is + ;; that this may simply not be a local-variables section, + ;; so just ignore it. + (message "Local variables list is not properly terminated")) + (beginning-of-line) + (setq endpos (point))) + + (with-temp-buffer + (insert-buffer-substring thisbuf startpos endpos) + (goto-char (point-min)) + (subst-char-in-region (point) (point-max) ?\^m ?\n) + (while (not (eobp)) + ;; Discard the prefix. + (if (looking-at prefix) + (delete-region (point) (match-end 0)) + (error "Local variables entry is missing the prefix")) + (end-of-line) + ;; Discard the suffix. + (if (looking-back suffix) + (delete-region (match-beginning 0) (point)) + (error "Local variables entry is missing the suffix")) + (forward-line 1)) + (goto-char (point-min)) + + (while (and (not (eobp)) + (or (not mode-only) + (not result))) + ;; Find the variable name; strip whitespace. + (skip-chars-forward " \t") + (setq beg (point)) + (skip-chars-forward "^:\n") + (if (eolp) (error "Missing colon in local variables entry")) + (skip-chars-backward " \t") + (let* ((str (buffer-substring beg (point))) + (var (let ((read-circle nil)) + (read str))) + val val2) + ;; Read the variable value. + (skip-chars-forward "^:") + (forward-char 1) + (let ((read-circle nil)) + (setq val (read (current-buffer)))) + (if mode-only + (and (eq var 'mode) + ;; Specifying minor-modes via mode: is + ;; deprecated, but try to reject them anyway. + (not (string-match + "-minor\\'" + (setq val2 (symbol-name val)))) + (setq result (intern (concat val2 "-mode")))) + (unless (eq var 'coding) + (condition-case nil + (push (cons (if (eq var 'eval) + 'eval + (indirect-variable var)) + val) result) + (error nil))))) + (forward-line 1))))))))) ;; Now we've read all the local variables. ;; If MODE-ONLY is non-nil, return whether the mode was specified. (cond (mode-only result) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 17f006e81a1..f4eb5eeaf45 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -532,7 +532,8 @@ the image by calling `image-mode'." (when (image-get-display-property) (image-toggle-display-text) ;; Update image display. - (redraw-frame (selected-frame)) + (mapc (lambda (window) (redraw-frame (window-frame window))) + (get-buffer-window-list (current-buffer) 'nomini 'visible)) (image-toggle-display-image))) diff --git a/lisp/nxml/rng-xsd.el b/lisp/nxml/rng-xsd.el index 266f8daac9e..b481039fdab 100644 --- a/lisp/nxml/rng-xsd.el +++ b/lisp/nxml/rng-xsd.el @@ -238,7 +238,7 @@ must be equal." obj))) (defun rng-xsd-check-pattern (str regexp convert &rest args) - (and (string-match regexp str) + (and (let ((case-fold-search nil)) (string-match regexp str)) (apply convert (cons str args)))) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 3b819a149b2..db8e82193b3 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -698,7 +698,9 @@ This function is called from `compilation-filter-hook'." grep-hit-face) (set (make-local-variable 'compilation-error-regexp-alist) grep-regexp-alist) - (set (make-local-variable 'compilation-directory-matcher) nil) + ;; compilation-directory-matcher can't be nil, so we set it to a regexp that + ;; can never match. + (set (make-local-variable 'compilation-directory-matcher) '("\\`a\\`")) (set (make-local-variable 'compilation-process-setup-function) 'grep-process-setup) (set (make-local-variable 'compilation-disable-input) t) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 56ebe868a2d..392973e08fe 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -295,9 +295,14 @@ try to refine the current hunk, as well." (defvar diff-added-face 'diff-added) (defface diff-changed - '((((type tty pc) (class color) (background light)) + ;; We normally apply a `shadow'-based face on the `diff-context' + ;; face, and keep `diff-changed' the default. + '((((class color grayscale) (min-colors 88))) + ;; If the terminal lacks sufficient colors for shadowing, + ;; highlight changed lines explicitly. + (((class color) (background light)) :foreground "magenta" :weight bold :slant italic) - (((type tty pc) (class color) (background dark)) + (((class color) (background dark)) :foreground "yellow" :weight bold :slant italic)) "`diff-mode' face used to highlight changed lines." :group 'diff-mode) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 01b6f2fc26e..5f3a9a21b59 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1238,6 +1238,7 @@ These are the commands available for use in the file status buffer: (format "%-20s" state) 'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face) ((memq state '(missing conflict)) 'font-lock-warning-face) + ((eq state 'edited) 'font-lock-constant-face) (t 'font-lock-variable-name-face)) 'mouse-face 'highlight) " " diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 31cc8ad9ca9..7b7813db94b 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -2283,9 +2283,9 @@ If the item is checked, CHOSEN is a cons whose cdr is the value." (while vals (let ((answer (widget-checklist-match-up args vals))) (cond (answer - (let ((vals (widget-match-inline answer vals))) - (setq found (append found (car vals)) - vals (cdr vals) + (let ((vals2 (widget-match-inline answer vals))) + (setq found (append found (car vals2)) + vals (cdr vals2) args (delq answer args)))) (greedy (setq rest (append rest (list (car vals))) diff --git a/m4/mktime.m4 b/m4/mktime.m4 index 56b2416d619..01167a1ec0e 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,4 +1,4 @@ -# serial 19 +# serial 20 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -234,6 +234,23 @@ AC_DEFUN([gl_FUNC_MKTIME], fi ]) +AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [ + AC_REQUIRE([gl_FUNC_MKTIME]) + if test $REPLACE_MKTIME = 0; then + dnl BeOS has __mktime_internal in libc, but other platforms don't. + AC_CHECK_FUNC([__mktime_internal], + [AC_DEFINE([mktime_internal], [__mktime_internal], + [Define to the real name of the mktime_internal function.]) + ], + [dnl mktime works but it doesn't export __mktime_internal, + dnl so we need to substitute our own mktime implementation. + REPLACE_MKTIME=1 + AC_LIBOBJ([mktime]) + gl_PREREQ_MKTIME + ]) + fi +]) + # Prerequisites of lib/mktime.c. AC_DEFUN([gl_PREREQ_MKTIME], [ diff --git a/m4/readlink.m4 b/m4/readlink.m4 index a502ca560fe..ec737d3f408 100644 --- a/m4/readlink.m4 +++ b/m4/readlink.m4 @@ -1,4 +1,4 @@ -# readlink.m4 serial 9 +# readlink.m4 serial 10 dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -48,7 +48,8 @@ AC_DEFUN([gl_FUNC_READLINK], fi ]) -# Like gl_FUNC_READLINK, except prepare for separate compilation (no AC_LIBOBJ). +# Like gl_FUNC_READLINK, except prepare for separate compilation +# (no REPLACE_READLINK, no AC_LIBOBJ). AC_DEFUN([gl_FUNC_READLINK_SEPARATE], [ AC_CHECK_FUNCS_ONCE([readlink]) diff --git a/src/ChangeLog b/src/ChangeLog index b74d831d707..74f0bd52a5d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -22,8 +22,6 @@ * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN. -2011-05-21 Paul Eggert <eggert@cs.ucla.edu> - * data.c: Avoid integer truncation in expressions involving floats. * data.c: Include <intprops.h>. (arith_driver): When there's an integer overflow in an expression @@ -33,8 +31,6 @@ most-negative-fixnum 0.5) should yield about -4.6e+18, not zero. Do not rely on undefined behavior after integer overflow. -2011-05-20 Paul Eggert <eggert@cs.ucla.edu> - merge count_size_as_multibyte, parse_str_to_multibyte * character.c, character.h (count_size_as_multibyte): Renamed from parse_str_to_multibyte; all uses changed. @@ -44,6 +40,40 @@ a character than a buffer op, so better that it's in character.c. * fns.c, print.c: Adjust to above changes. +2011-05-22 Paul Eggert <eggert@cs.ucla.edu> + + * gnutls.c: Remove unused macros. + (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function): + (fn_gnutls_transport_set_push_function) [!WINDOWSNT]: + Remove macros that are defined and never used. + Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14). + +2011-05-22 Chong Yidong <cyd@stupidchicken.com> + + * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS. + (Fx_get_selection_internal): Minor cleanup. + (Fx_own_selection_internal): Rename arguments for consistency with + select.el. + +2011-05-22 Paul Eggert <eggert@cs.ucla.edu> + + * xselect.c (QSAVE_TARGETS): New static var, to fix build failure. + +2011-05-22 Chong Yidong <cyd@stupidchicken.com> + + * xselect.c (syms_of_xselect): Include character.h; use DEFSYM. + +2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dispnew.c (scrolling_window): Don't exclude the case that the + last enabled row in the desired matrix touches the bottom boundary. + +2011-05-21 Glenn Morris <rgm@gnu.org> + + * Makefile.in ($(etc)/DOC): Make second command line even shorter. + (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion, + and add some more files. + 2011-05-20 Eli Zaretskii <eliz@gnu.org> * callproc.c (Fcall_process) [MSDOS]: Fix arguments to diff --git a/src/Makefile.in b/src/Makefile.in index 557a6f54748..c4250b90633 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -149,11 +149,13 @@ M17N_FLT_LIBS = @M17N_FLT_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ +## dbusbind.o if HAVE_DBUS, else empty. DBUS_OBJ = @DBUS_OBJ@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ +## gtkutil.o if USE_GTK, else empty. GTK_OBJ=@GTK_OBJ@ ## -ltermcap, or -lncurses, or -lcurses, or "". @@ -198,7 +200,10 @@ OLDXMENU_DEPS=@OLDXMENU_DEPS@ ## Else $(OLDXMENU). LIBXMENU=@LIBXMENU@ +## xmenu.o if HAVE_X_WINDOWS, else empty. XMENU_OBJ=@XMENU_OBJ@ +## xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o +## xsettings.o xgselect.o if HAVE_X_WINDOWS, else empty. XOBJ=@XOBJ@ TOOLKIT_LIBW=@TOOLKIT_LIBW@ @@ -241,7 +246,9 @@ MSDOS_X_OBJ = ns_appdir=@ns_appdir@ ns_appbindir=@ns_appbindir@ ns_appsrc=@ns_appsrc@ +## fontset.o fringe.o image.o if HAVE_NS, else empty. NS_OBJ=@NS_OBJ@ +## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS. NS_OBJC_OBJ=@NS_OBJC_OBJ@ ## Only set if NS_IMPL_GNUSTEP. GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@ @@ -333,12 +340,16 @@ obj = $(base_obj) $(NS_OBJC_OBJ) ## Object files used on some machine or other. ## These go in the DOC file on all machines in case they are needed. +## Some of them have no DOC entries, but it does no harm to have them +## in the list, in case they ever add any such entries. SOME_MACHINE_OBJECTS = dosfns.o msdos.o \ xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ fontset.o dbusbind.o \ nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \ w32.o w32console.o w32fns.o w32heap.o w32inevt.o \ - w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_OBJ) + w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \ + w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \ + xsettings.o xgselect.o termcap.o ## gmalloc.o if !SYSTEM_MALLOC && !DOUG_LEA_MALLOC, else empty. GMALLOC_OBJ=@GMALLOC_OBJ@ @@ -411,7 +422,7 @@ emacs$(EXEEXT): temacs$(EXEEXT) $(etc)/DOC $(lisp) $(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp) -rm -f $(etc)/DOC $(libsrc)/make-docfile -d $(srcdir) $(SOME_MACHINE_OBJECTS) $(obj) > $(etc)/DOC - $(libsrc)/make-docfile -a $(etc)/DOC -d $(srcdir) `sed -n -e 's| \\\\||' -e 's|^[ ]*$$(lispsource)|../lisp|p' $(srcdir)/lisp.mk` + $(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) `sed -n -e 's| \\\\||' -e 's|^[ ]*$$(lispsource)/||p' $(srcdir)/lisp.mk` $(libsrc)/make-docfile$(EXEEXT): cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT) diff --git a/src/dispnew.c b/src/dispnew.c index 0457d650b3a..41f486baf16 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -4330,23 +4330,29 @@ scrolling_window (struct window *w, int header_line_p) first_old = first_new = i; - /* Set last_new to the index + 1 of the last enabled row in the - desired matrix. */ + /* Set last_new to the index + 1 of the row that reaches the + bottom boundary in the desired matrix. Give up if we find a + disabled row before we reach the bottom boundary. */ i = first_new + 1; - while (i < desired_matrix->nrows - 1 - && MATRIX_ROW (desired_matrix, i)->enabled_p - && MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (desired_matrix, i)) <= yb) - ++i; + while (i < desired_matrix->nrows - 1) + { + int bottom; - if (!MATRIX_ROW (desired_matrix, i)->enabled_p) - return 0; + if (!MATRIX_ROW (desired_matrix, i)->enabled_p) + return 0; + bottom = MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (desired_matrix, i)); + if (bottom <= yb) + ++i; + if (bottom >= yb) + break; + } last_new = i; - /* Set last_old to the index + 1 of the last enabled row in the - current matrix. We don't look at the enabled flag here because - we plan to reuse part of the display even if other parts are - disabled. */ + /* Set last_old to the index + 1 of the row that reaches the bottom + boundary in the current matrix. We don't look at the enabled + flag here because we plan to reuse part of the display even if + other parts are disabled. */ i = first_old + 1; while (i < current_matrix->nrows - 1) { diff --git a/src/gnutls.c b/src/gnutls.c index 540bfaac25c..5558fb9ee0b 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -221,10 +221,7 @@ init_gnutls_functions (Lisp_Object libraries) #define fn_gnutls_record_send gnutls_record_send #define fn_gnutls_strerror gnutls_strerror #define fn_gnutls_transport_set_errno gnutls_transport_set_errno -#define fn_gnutls_transport_set_lowat gnutls_transport_set_lowat #define fn_gnutls_transport_set_ptr2 gnutls_transport_set_ptr2 -#define fn_gnutls_transport_set_pull_function gnutls_transport_set_pull_function -#define fn_gnutls_transport_set_push_function gnutls_transport_set_push_function #define fn_gnutls_x509_crt_check_hostname gnutls_x509_crt_check_hostname #define fn_gnutls_x509_crt_deinit gnutls_x509_crt_deinit #define fn_gnutls_x509_crt_import gnutls_x509_crt_import diff --git a/src/xselect.c b/src/xselect.c index 3ddd4c54b49..c4e9fbf9ff7 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -38,6 +38,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "process.h" #include "termhooks.h" #include "keyboard.h" +#include "character.h" #include <X11/Xproto.h> @@ -400,17 +401,6 @@ x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, in handler_fn = Qnil; value = XCAR (XCDR (XCDR (local_value))); } -#if 0 - else if (EQ (target_type, QDELETE)) - { - handler_fn = Qnil; - Fx_disown_selection_internal - (selection_symbol, - XCAR (XCDR (XCDR (local_value)))); - value = QNULL; - } -#endif - #if 0 /* #### MULTIPLE doesn't work yet */ else if (CONSP (target_type) && XCAR (target_type) == QMULTIPLE) @@ -2006,18 +1996,18 @@ x_handle_selection_notify (XSelectionEvent *event) DEFUN ("x-own-selection-internal", Fx_own_selection_internal, Sx_own_selection_internal, 2, 2, 0, - doc: /* Assert an X selection of the given TYPE with the given VALUE. -TYPE is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. + doc: /* Assert an X selection of type SELECTION and value VALUE. +SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. \(Those are literal upper-case symbol names, since that's what X expects.) VALUE is typically a string, or a cons of two markers, but may be anything that the functions on `selection-converter-alist' know about. */) - (Lisp_Object selection_name, Lisp_Object selection_value) + (Lisp_Object selection, Lisp_Object value) { check_x (); - CHECK_SYMBOL (selection_name); - if (NILP (selection_value)) error ("SELECTION-VALUE may not be nil"); - x_own_selection (selection_name, selection_value); - return selection_value; + CHECK_SYMBOL (selection); + if (NILP (value)) error ("VALUE may not be nil"); + x_own_selection (selection, value); + return value; } @@ -2056,22 +2046,16 @@ selections. If omitted, defaults to the time for the last event. */) val = x_get_local_selection (selection_symbol, target_type, 1); if (NILP (val)) - { - val = x_get_foreign_selection (selection_symbol, target_type, time_stamp); - goto DONE; - } + RETURN_UNGCPRO (x_get_foreign_selection (selection_symbol, + target_type, time_stamp)); - if (CONSP (val) - && SYMBOLP (XCAR (val))) + if (CONSP (val) && SYMBOLP (XCAR (val))) { val = XCDR (val); if (CONSP (val) && NILP (XCDR (val))) val = XCAR (val); } - val = clean_local_selection_data (val); - DONE: - UNGCPRO; - return val; + RETURN_UNGCPRO (clean_local_selection_data (val)); } DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, @@ -2651,25 +2635,22 @@ A value of 0 means wait as long as necessary. This is initialized from the x_selection_timeout = 0; /* QPRIMARY is defined in keyboard.c. */ - QSECONDARY = intern_c_string ("SECONDARY"); staticpro (&QSECONDARY); - QSTRING = intern_c_string ("STRING"); staticpro (&QSTRING); - QINTEGER = intern_c_string ("INTEGER"); staticpro (&QINTEGER); - QCLIPBOARD = intern_c_string ("CLIPBOARD"); staticpro (&QCLIPBOARD); - QTIMESTAMP = intern_c_string ("TIMESTAMP"); staticpro (&QTIMESTAMP); - QTEXT = intern_c_string ("TEXT"); staticpro (&QTEXT); - QCOMPOUND_TEXT = intern_c_string ("COMPOUND_TEXT"); staticpro (&QCOMPOUND_TEXT); - QUTF8_STRING = intern_c_string ("UTF8_STRING"); staticpro (&QUTF8_STRING); - QDELETE = intern_c_string ("DELETE"); staticpro (&QDELETE); - QMULTIPLE = intern_c_string ("MULTIPLE"); staticpro (&QMULTIPLE); - QINCR = intern_c_string ("INCR"); staticpro (&QINCR); - QEMACS_TMP = intern_c_string ("_EMACS_TMP_"); staticpro (&QEMACS_TMP); - QTARGETS = intern_c_string ("TARGETS"); staticpro (&QTARGETS); - QATOM = intern_c_string ("ATOM"); staticpro (&QATOM); - QATOM_PAIR = intern_c_string ("ATOM_PAIR"); staticpro (&QATOM_PAIR); - QNULL = intern_c_string ("NULL"); staticpro (&QNULL); - Qcompound_text_with_extensions = intern_c_string ("compound-text-with-extensions"); - staticpro (&Qcompound_text_with_extensions); - - Qforeign_selection = intern_c_string ("foreign-selection"); - staticpro (&Qforeign_selection); + DEFSYM (QSECONDARY, "SECONDARY"); + DEFSYM (QSTRING, "STRING"); + DEFSYM (QINTEGER, "INTEGER"); + DEFSYM (QCLIPBOARD, "CLIPBOARD"); + DEFSYM (QTIMESTAMP, "TIMESTAMP"); + DEFSYM (QTEXT, "TEXT"); + DEFSYM (QCOMPOUND_TEXT, "COMPOUND_TEXT"); + DEFSYM (QUTF8_STRING, "UTF8_STRING"); + DEFSYM (QDELETE, "DELETE"); + DEFSYM (QMULTIPLE, "MULTIPLE"); + DEFSYM (QINCR, "INCR"); + DEFSYM (QEMACS_TMP, "_EMACS_TMP_"); + DEFSYM (QTARGETS, "TARGETS"); + DEFSYM (QATOM, "ATOM"); + DEFSYM (QATOM_PAIR, "ATOM_PAIR"); + DEFSYM (QNULL, "NULL"); + DEFSYM (Qcompound_text_with_extensions, "compound-text-with-extensions"); + DEFSYM (Qforeign_selection, "foreign-selection"); } |