aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-01-18 23:21:25 -0800
committerGlenn Morris2012-01-18 23:21:25 -0800
commit1259009aa17da6dc038afff96963f6d9bbd3b8e1 (patch)
tree83be407107aea29bea07036e65c41b1c0ea99475
parent54de86ac6216fc2eece477308dde090381d6b6c7 (diff)
parent685305ebe0455a8d5211bedf41b588bccfb432c8 (diff)
downloademacs-1259009aa17da6dc038afff96963f6d9bbd3b8e1.tar.gz
emacs-1259009aa17da6dc038afff96963f6d9bbd3b8e1.zip
Merge from emacs-23; up to 2012-01-19T07:15:48Z!rgm@gnu.org.
-rw-r--r--admin/grammars/python.wy3
-rw-r--r--admin/grammars/wisent-grammar.el4
-rw-r--r--etc/NEWS.2314
-rw-r--r--lisp/cedet/semantic/wisent/js-wy.el2
-rw-r--r--lisp/cedet/semantic/wisent/python-wy.el3
-rw-r--r--src/ChangeLog6
-rw-r--r--src/character.c67
7 files changed, 54 insertions, 45 deletions
diff --git a/admin/grammars/python.wy b/admin/grammars/python.wy
index 65f317145a0..f7808fd20b8 100644
--- a/admin/grammars/python.wy
+++ b/admin/grammars/python.wy
@@ -1,7 +1,8 @@
1;;; python.wy -- LALR grammar for Python 1;;; python.wy -- LALR grammar for Python
2 2
3;; Copyright (C) 2002-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2012 Free Software Foundation, Inc.
4;; Copyright (C) 2001-2010 Python Software Foundation 4;; Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
5;; 2009, 2010 Python Software Foundation; All Rights Reserved
5 6
6;; Author: Richard Kim <ryk@dspwiz.com> 7;; Author: Richard Kim <ryk@dspwiz.com>
7;; Maintainer: Richard Kim <ryk@dspwiz.com> 8;; Maintainer: Richard Kim <ryk@dspwiz.com>
diff --git a/admin/grammars/wisent-grammar.el b/admin/grammars/wisent-grammar.el
index be014a56906..714b5211127 100644
--- a/admin/grammars/wisent-grammar.el
+++ b/admin/grammars/wisent-grammar.el
@@ -470,13 +470,13 @@ Menu items are appended to the common grammar menu.")
470 "srecode/srt-wy") 470 "srecode/srt-wy")
471 ("wisent-javascript-jv-wy.el" 471 ("wisent-javascript-jv-wy.el"
472 "semantic/wisent/js-wy" 472 "semantic/wisent/js-wy"
473 "Copyright (C) 1998-2011 Ecma International" 473 "Copyright (C) 1998-2011 Ecma International."
474 ,wisent-make-parsers--ecmascript-license) 474 ,wisent-make-parsers--ecmascript-license)
475 ("wisent-java-tags-wy.el" 475 ("wisent-java-tags-wy.el"
476 "semantic/wisent/javat-wy") 476 "semantic/wisent/javat-wy")
477 ("wisent-python-wy.el" 477 ("wisent-python-wy.el"
478 "semantic/wisent/python-wy" 478 "semantic/wisent/python-wy"
479 "Copyright (C) 2001-2010 Python Software Foundation" 479 "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Python Software Foundation; All Rights Reserved."
480 ,wisent-make-parsers--python-license))) 480 ,wisent-make-parsers--python-license)))
481 481
482(defun wisent-make-parsers () 482(defun wisent-make-parsers ()
diff --git a/etc/NEWS.23 b/etc/NEWS.23
index f9dbfa8adef..77ba82c15ad 100644
--- a/etc/NEWS.23
+++ b/etc/NEWS.23
@@ -24,12 +24,22 @@ require version 1.14 or later. See README.W32 and nt/INSTALL for
24details and pointers to URLs where the latest libpng can be 24details and pointers to URLs where the latest libpng can be
25downloaded. 25downloaded.
26 26
27 27* Changes in Specialized Modes and Packages in Emacs 23.4
28
29** EDE
30
31*** New variable `ede-project-directories'.
32EDE now refuses to automatically load a project file (Project.ede)
33unless the file is in one of the directories specified by this
34variable. This reduces the risk of inadvertently loading malicious
35project files. The commands `M-x ede-new' and `M-x ede' now offer to
36save directories to `ede-project-directories'.
37
28* Changes in Emacs 23.4 on non-free operating systems 38* Changes in Emacs 23.4 on non-free operating systems
29 39
30** The MS-Windows port can now use more than 500MB of heap. 40** The MS-Windows port can now use more than 500MB of heap.
31Depending on the available virtual memory, Emacs on Windows can now 41Depending on the available virtual memory, Emacs on Windows can now
32have up to 2GB of heap space. This allows, e.g., to visit several 42have up to 2GB of heap space. This allows, e.g., visiting several
33large (> 256MB) files in the same session. 43large (> 256MB) files in the same session.
34 44
35 45
diff --git a/lisp/cedet/semantic/wisent/js-wy.el b/lisp/cedet/semantic/wisent/js-wy.el
index b8d3240aef1..05346b02c8d 100644
--- a/lisp/cedet/semantic/wisent/js-wy.el
+++ b/lisp/cedet/semantic/wisent/js-wy.el
@@ -1,7 +1,7 @@
1;;; semantic/wisent/js-wy.el --- Generated parser support file 1;;; semantic/wisent/js-wy.el --- Generated parser support file
2 2
3;; Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
4;; Copyright (C) 1998-2011 Ecma International 4;; Copyright (C) 1998-2011 Ecma International.
5 5
6;; This file is part of GNU Emacs. 6;; This file is part of GNU Emacs.
7 7
diff --git a/lisp/cedet/semantic/wisent/python-wy.el b/lisp/cedet/semantic/wisent/python-wy.el
index cb0f37c8f16..e8229dcd9ea 100644
--- a/lisp/cedet/semantic/wisent/python-wy.el
+++ b/lisp/cedet/semantic/wisent/python-wy.el
@@ -1,7 +1,8 @@
1;;; semantic/wisent/python-wy.el --- Generated parser support file 1;;; semantic/wisent/python-wy.el --- Generated parser support file
2 2
3;; Copyright (C) 2002-2004, 2007, 2010-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2004, 2007, 2010-2012 Free Software Foundation, Inc.
4;; Copyright (C) 2001-2010 Python Software Foundation 4;; Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
5;; 2009, 2010 Python Software Foundation; All Rights Reserved
5 6
6;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
7 8
diff --git a/src/ChangeLog b/src/ChangeLog
index aa4e92b4134..3a6e31eede4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12012-01-19 Kenichi Handa <handa@m17n.org>
2
3 * character.c (char_width): New function.
4 (Fchar_width, c_string_width, lisp_string_width):
5 Use char_width (Bug#9496).
6
12012-01-16 Martin Rudalics <rudalics@gmx.at> 72012-01-16 Martin Rudalics <rudalics@gmx.at>
2 8
3 * window.c (Vwindow_persistent_parameters): New variable. 9 * window.c (Vwindow_persistent_parameters): New variable.
diff --git a/src/character.c b/src/character.c
index a2cb416d770..593fbcece0b 100644
--- a/src/character.c
+++ b/src/character.c
@@ -308,6 +308,31 @@ If the multibyte character does not represent a byte, return -1. */)
308 } 308 }
309} 309}
310 310
311
312/* Return width (columns) of C considering the buffer display table DP. */
313
314static int
315char_width (int c, struct Lisp_Char_Table *dp)
316{
317 int width = CHAR_WIDTH (c);
318
319 if (dp)
320 {
321 Lisp_Object disp = DISP_CHAR_VECTOR (dp, c), ch;
322 int i;
323
324 if (VECTORP (disp))
325 for (i = 0, width = 0; i < ASIZE (disp); i++)
326 {
327 ch = AREF (disp, i);
328 if (CHARACTERP (ch))
329 width += CHAR_WIDTH (XFASTINT (ch));
330 }
331 }
332 return width;
333}
334
335
311DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0, 336DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0,
312 doc: /* Return width of CHAR when displayed in the current buffer. 337 doc: /* Return width of CHAR when displayed in the current buffer.
313The width is measured by how many columns it occupies on the screen. 338The width is measured by how many columns it occupies on the screen.
@@ -315,21 +340,11 @@ Tab is taken to occupy `tab-width' columns.
315usage: (char-width CHAR) */) 340usage: (char-width CHAR) */)
316 (Lisp_Object ch) 341 (Lisp_Object ch)
317{ 342{
318 Lisp_Object disp;
319 int c, width; 343 int c, width;
320 struct Lisp_Char_Table *dp = buffer_display_table ();
321 344
322 CHECK_CHARACTER (ch); 345 CHECK_CHARACTER (ch);
323 c = XINT (ch); 346 c = XINT (ch);
324 347 width = char_width (c, buffer_display_table ());
325 /* Get the way the display table would display it. */
326 disp = dp ? DISP_CHAR_VECTOR (dp, c) : Qnil;
327
328 if (VECTORP (disp))
329 width = sanitize_char_width (ASIZE (disp));
330 else
331 width = CHAR_WIDTH (c);
332
333 return make_number (width); 348 return make_number (width);
334} 349}
335 350
@@ -350,22 +365,9 @@ c_string_width (const unsigned char *str, EMACS_INT len, int precision,
350 365
351 while (i_byte < len) 366 while (i_byte < len)
352 { 367 {
353 int bytes, thiswidth; 368 int bytes;
354 Lisp_Object val;
355 int c = STRING_CHAR_AND_LENGTH (str + i_byte, bytes); 369 int c = STRING_CHAR_AND_LENGTH (str + i_byte, bytes);
356 370 int thiswidth = char_width (c, dp);
357 if (dp)
358 {
359 val = DISP_CHAR_VECTOR (dp, c);
360 if (VECTORP (val))
361 thiswidth = sanitize_char_width (ASIZE (val));
362 else
363 thiswidth = CHAR_WIDTH (c);
364 }
365 else
366 {
367 thiswidth = CHAR_WIDTH (c);
368 }
369 371
370 if (precision > 0 372 if (precision > 0
371 && (width + thiswidth > precision)) 373 && (width + thiswidth > precision))
@@ -447,18 +449,7 @@ lisp_string_width (Lisp_Object string, EMACS_INT precision,
447 else 449 else
448 c = str[i_byte], bytes = 1; 450 c = str[i_byte], bytes = 1;
449 chars = 1; 451 chars = 1;
450 if (dp) 452 thiswidth = char_width (c, dp);
451 {
452 val = DISP_CHAR_VECTOR (dp, c);
453 if (VECTORP (val))
454 thiswidth = sanitize_char_width (ASIZE (val));
455 else
456 thiswidth = CHAR_WIDTH (c);
457 }
458 else
459 {
460 thiswidth = CHAR_WIDTH (c);
461 }
462 } 453 }
463 454
464 if (precision <= 0) 455 if (precision <= 0)