diff options
| author | Eli Zaretskii | 2012-10-20 18:17:25 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-10-20 18:17:25 +0200 |
| commit | 6d03e7beda333663080a64af902231342fd941cf (patch) | |
| tree | bd4521483ad70701e3dbf2c32e2910947bad5b53 | |
| parent | 87c6b4e6bd7e023bd57c709bb6af59bca27bf4f6 (diff) | |
| parent | 83c85d8e2e6c1e1cb309f554555e1aebc1dcb44f (diff) | |
| download | emacs-6d03e7beda333663080a64af902231342fd941cf.tar.gz emacs-6d03e7beda333663080a64af902231342fd941cf.zip | |
Merge from trunk.
| -rw-r--r-- | lib-src/ChangeLog | 12 | ||||
| -rw-r--r-- | lib-src/make-docfile.c | 22 | ||||
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/eshell/esh-cmd.el | 28 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 18 | ||||
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/lisp.h | 51 | ||||
| -rw-r--r-- | src/lread.c | 23 |
8 files changed, 123 insertions, 43 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 2b88017fc5b..8120ab7f18d 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,6 +1,16 @@ | |||
| 1 | 2012-10-20 Eli Zaretskii <eliz@gnu.org> | 1 | 2012-10-20 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | Prevent silent omission of doc strings from uncompile Lisp files. | 3 | * make-docfile.c (IS_SLASH, DEF_ELISP_FILE): New macros. |
| 4 | (scan_lisp_file): Only pass a .el file if its basename matches a | ||
| 5 | known file in its entirety. Use IS_SLASH and DEF_ELISP_FILE. | ||
| 6 | |||
| 7 | 2012-10-20 Andreas Schwab <schwab@linux-m68k.org> | ||
| 8 | |||
| 9 | * make-docfile.c (scan_lisp_file): Add bounds checking. | ||
| 10 | |||
| 11 | 2012-10-20 Eli Zaretskii <eliz@gnu.org> | ||
| 12 | |||
| 13 | Prevent silent omission of doc strings from uncompiled Lisp files. | ||
| 4 | * make-docfile.c (scan_lisp_file): Barf if called with a .el file | 14 | * make-docfile.c (scan_lisp_file): Barf if called with a .el file |
| 5 | other than one of a small list of supported un-compiled files. | 15 | other than one of a small list of supported un-compiled files. |
| 6 | 16 | ||
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 555a563d748..b6cd1530a4c 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -58,9 +58,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 58 | #undef chdir | 58 | #undef chdir |
| 59 | #define READ_TEXT "rt" | 59 | #define READ_TEXT "rt" |
| 60 | #define READ_BINARY "rb" | 60 | #define READ_BINARY "rb" |
| 61 | #define IS_SLASH(c) ((c) == '/' || (c) == '\\' || (c) == ':') | ||
| 61 | #else /* not DOS_NT */ | 62 | #else /* not DOS_NT */ |
| 62 | #define READ_TEXT "r" | 63 | #define READ_TEXT "r" |
| 63 | #define READ_BINARY "r" | 64 | #define READ_BINARY "r" |
| 65 | #define IS_SLASH(c) ((c) == '/') | ||
| 64 | #endif /* not DOS_NT */ | 66 | #endif /* not DOS_NT */ |
| 65 | 67 | ||
| 66 | static int scan_file (char *filename); | 68 | static int scan_file (char *filename); |
| @@ -1098,6 +1100,8 @@ search_lisp_doc_at_eol (FILE *infile) | |||
| 1098 | return 1; | 1100 | return 1; |
| 1099 | } | 1101 | } |
| 1100 | 1102 | ||
| 1103 | #define DEF_ELISP_FILE(fn) { #fn, sizeof(#fn) - 1 } | ||
| 1104 | |||
| 1101 | static int | 1105 | static int |
| 1102 | scan_lisp_file (const char *filename, const char *mode) | 1106 | scan_lisp_file (const char *filename, const char *mode) |
| 1103 | { | 1107 | { |
| @@ -1111,21 +1115,25 @@ scan_lisp_file (const char *filename, const char *mode) | |||
| 1111 | static struct { | 1115 | static struct { |
| 1112 | const char *fn; | 1116 | const char *fn; |
| 1113 | size_t fl; | 1117 | size_t fl; |
| 1114 | } uncompiled[] = { | 1118 | } const uncompiled[] = { |
| 1115 | { "loaddefs.el", sizeof("loaddefs.el") - 1 }, | 1119 | DEF_ELISP_FILE (loaddefs.el), |
| 1116 | { "loadup.el", sizeof("loadup.el") - 1 }, | 1120 | DEF_ELISP_FILE (loadup.el), |
| 1117 | { "charprop.el", sizeof("charprop.el") - 1 } | 1121 | DEF_ELISP_FILE (charprop.el) |
| 1118 | }; | 1122 | }; |
| 1119 | int i, match; | 1123 | int i, match; |
| 1120 | size_t flen = strlen (filename); | 1124 | size_t flen = strlen (filename); |
| 1121 | 1125 | ||
| 1122 | if (generate_globals) | 1126 | if (generate_globals) |
| 1123 | fatal ("scanning lisp file when -g specified", 0); | 1127 | fatal ("scanning lisp file when -g specified", 0); |
| 1124 | if (!strcmp (filename + flen - 3, ".el")) | 1128 | if (flen > 3 && !strcmp (filename + flen - 3, ".el")) |
| 1125 | { | 1129 | { |
| 1126 | for (i = 0, match = 0; i < sizeof(uncompiled)/sizeof(uncompiled[0]); i++) | 1130 | for (i = 0, match = 0; i < sizeof (uncompiled) / sizeof (uncompiled[0]); |
| 1131 | i++) | ||
| 1127 | { | 1132 | { |
| 1128 | if (!strcmp (filename + flen - uncompiled[i].fl, uncompiled[i].fn)) | 1133 | if (uncompiled[i].fl <= flen |
| 1134 | && !strcmp (filename + flen - uncompiled[i].fl, uncompiled[i].fn) | ||
| 1135 | && (flen == uncompiled[i].fl | ||
| 1136 | || IS_SLASH (filename[flen - uncompiled[i].fl - 1]))) | ||
| 1129 | { | 1137 | { |
| 1130 | match = 1; | 1138 | match = 1; |
| 1131 | break; | 1139 | break; |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 41b0135a708..0e947b4039b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-10-20 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * vc/vc.el (vc-diff-internal): Set up Diff mode even if there are | ||
| 4 | no changes to show (Bug#12586). | ||
| 5 | |||
| 6 | * eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body | ||
| 7 | list explicitly (Bug#12571). | ||
| 8 | |||
| 1 | 2012-10-20 Arne Jørgensen <arne@arnested.dk> | 9 | 2012-10-20 Arne Jørgensen <arne@arnested.dk> |
| 2 | 10 | ||
| 3 | * progmodes/flymake.el (flymake-create-temp-inplace): Use | 11 | * progmodes/flymake.el (flymake-create-temp-inplace): Use |
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 5a10721387b..e6e89d83b7c 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el | |||
| @@ -484,20 +484,22 @@ implemented via rewriting, rather than as a function." | |||
| 484 | (let ((body (car (last terms)))) | 484 | (let ((body (car (last terms)))) |
| 485 | (setcdr (last terms 2) nil) | 485 | (setcdr (last terms 2) nil) |
| 486 | `(let ((for-items | 486 | `(let ((for-items |
| 487 | (append | 487 | (copy-tree |
| 488 | ,@(mapcar | 488 | (append |
| 489 | (lambda (elem) | 489 | ,@(mapcar |
| 490 | (if (listp elem) | 490 | (lambda (elem) |
| 491 | elem | 491 | (if (listp elem) |
| 492 | `(list ,elem))) | 492 | elem |
| 493 | (cdr (cddr terms))))) | 493 | `(list ,elem))) |
| 494 | (eshell-command-body '(nil)) | 494 | (cdr (cddr terms)))))) |
| 495 | (eshell-command-body '(nil)) | ||
| 495 | (eshell-test-body '(nil))) | 496 | (eshell-test-body '(nil))) |
| 496 | (while (consp for-items) | 497 | (while (car for-items) |
| 497 | (let ((,(intern (cadr terms)) (car for-items))) | 498 | (let ((,(intern (cadr terms)) (car for-items))) |
| 498 | (eshell-protect | 499 | (eshell-protect |
| 499 | ,(eshell-invokify-arg body t))) | 500 | ,(eshell-invokify-arg body t))) |
| 500 | (setq for-items (cdr for-items))) | 501 | (setcar for-items (cadr for-items)) |
| 502 | (setcdr for-items (cddr for-items))) | ||
| 501 | (eshell-close-handles | 503 | (eshell-close-handles |
| 502 | eshell-last-command-status | 504 | eshell-last-command-status |
| 503 | (list 'quote eshell-last-command-result)))))) | 505 | (list 'quote eshell-last-command-result)))))) |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 2da721b41d8..a909aca5bca 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -1584,21 +1584,21 @@ Return t if the buffer had changes, nil otherwise." | |||
| 1584 | (let ((vc-disable-async-diff (not async))) | 1584 | (let ((vc-disable-async-diff (not async))) |
| 1585 | (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer)) | 1585 | (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer)) |
| 1586 | (set-buffer buffer) | 1586 | (set-buffer buffer) |
| 1587 | (diff-mode) | ||
| 1588 | (set (make-local-variable 'diff-vc-backend) (car vc-fileset)) | ||
| 1589 | (set (make-local-variable 'revert-buffer-function) | ||
| 1590 | `(lambda (ignore-auto noconfirm) | ||
| 1591 | (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose))) | ||
| 1592 | ;; Make the *vc-diff* buffer read only, the diff-mode key | ||
| 1593 | ;; bindings are nicer for read only buffers. pcl-cvs does the | ||
| 1594 | ;; same thing. | ||
| 1595 | (setq buffer-read-only t) | ||
| 1587 | (if (and (zerop (buffer-size)) | 1596 | (if (and (zerop (buffer-size)) |
| 1588 | (not (get-buffer-process (current-buffer)))) | 1597 | (not (get-buffer-process (current-buffer)))) |
| 1589 | ;; Treat this case specially so as not to pop the buffer. | 1598 | ;; Treat this case specially so as not to pop the buffer. |
| 1590 | (progn | 1599 | (progn |
| 1591 | (message "%s" (cdr messages)) | 1600 | (message "%s" (cdr messages)) |
| 1592 | nil) | 1601 | nil) |
| 1593 | (diff-mode) | ||
| 1594 | (set (make-local-variable 'diff-vc-backend) (car vc-fileset)) | ||
| 1595 | (set (make-local-variable 'revert-buffer-function) | ||
| 1596 | `(lambda (ignore-auto noconfirm) | ||
| 1597 | (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose))) | ||
| 1598 | ;; Make the *vc-diff* buffer read only, the diff-mode key | ||
| 1599 | ;; bindings are nicer for read only buffers. pcl-cvs does the | ||
| 1600 | ;; same thing. | ||
| 1601 | (setq buffer-read-only t) | ||
| 1602 | ;; Display the buffer, but at the end because it can change point. | 1602 | ;; Display the buffer, but at the end because it can change point. |
| 1603 | (pop-to-buffer (current-buffer)) | 1603 | (pop-to-buffer (current-buffer)) |
| 1604 | ;; The diff process may finish early, so call `vc-diff-finish' | 1604 | ;; The diff process may finish early, so call `vc-diff-finish' |
diff --git a/src/ChangeLog b/src/ChangeLog index f61c2ccdb00..c81009928de 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-10-20 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * lread.c (Fload): Doc fix (Bug#12592). | ||
| 4 | |||
| 1 | 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change) | 5 | 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change) |
| 2 | 6 | ||
| 3 | * font.c (Ffont_at): Fix previous change. | 7 | * font.c (Ffont_at): Fix previous change. |
diff --git a/src/lisp.h b/src/lisp.h index b9e78385313..7b9654e89e8 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -222,7 +222,9 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = 0 }; | |||
| 222 | 222 | ||
| 223 | /* Define the fundamental Lisp data structures. */ | 223 | /* Define the fundamental Lisp data structures. */ |
| 224 | 224 | ||
| 225 | /* This is the set of Lisp data types. */ | 225 | /* This is the set of Lisp data types. If you want to define a new |
| 226 | data type, read the comments after Lisp_Fwd_Type definition | ||
| 227 | below. */ | ||
| 226 | 228 | ||
| 227 | /* Lisp integers use 2 tags, to give them one extra bit, thus | 229 | /* Lisp integers use 2 tags, to give them one extra bit, thus |
| 228 | extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ | 230 | extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ |
| @@ -298,6 +300,53 @@ enum Lisp_Fwd_Type | |||
| 298 | Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */ | 300 | Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */ |
| 299 | }; | 301 | }; |
| 300 | 302 | ||
| 303 | /* If you want to define a new Lisp data type, here are some | ||
| 304 | instructions. See the thread at | ||
| 305 | http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00561.html | ||
| 306 | for more info. | ||
| 307 | |||
| 308 | First, there are already a couple of Lisp types that can be used if | ||
| 309 | your new type does not need to be exposed to Lisp programs nor | ||
| 310 | displayed to users. These are Lisp_Save_Value, a Lisp_Misc | ||
| 311 | subtype, and PVEC_OTHER, a kind of vectorlike object. The former | ||
| 312 | is suitable for temporarily stashing away pointers and integers in | ||
| 313 | a Lisp object (see the existing uses of make_save_value and | ||
| 314 | XSAVE_VALUE). The latter is useful for vector-like Lisp objects | ||
| 315 | that need to be used as part of other objects, but which are never | ||
| 316 | shown to users or Lisp code (search for PVEC_OTHER in xterm.c for | ||
| 317 | an example). | ||
| 318 | |||
| 319 | These two types don't look pretty when printed, so they are | ||
| 320 | unsuitable for Lisp objects that can be exposed to users. | ||
| 321 | |||
| 322 | To define a new data type, add one more Lisp_Misc subtype or one | ||
| 323 | more pseudovector subtype. Pseudovectors are more suitable for | ||
| 324 | objects with several slots that need to support fast random access, | ||
| 325 | whil Lisp_Misc types are foreverything else. A pseudovector object | ||
| 326 | provides one or more slots for Lisp objects, followed by struct | ||
| 327 | members that are accessible only from C. A Lisp_Misc object is a | ||
| 328 | wrapper for a C struct that can contain anything you like. | ||
| 329 | |||
| 330 | To add a new pseudovector type, extend the pvec_type enumeration; | ||
| 331 | to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration. | ||
| 332 | |||
| 333 | For a Lisp_Misc, you will also need to add your entry to union | ||
| 334 | Lisp_Misc (but make sure the first word has the same structure as | ||
| 335 | the others, starting with a 16-bit member of the Lisp_Misc_Type | ||
| 336 | enumeration and a 1-bit GC markbit) and make sure the overall size | ||
| 337 | of the union is not increased by your addition. | ||
| 338 | |||
| 339 | Then you will need to add switch branches in print.c (in | ||
| 340 | print_object, to print your object, and possibly also in | ||
| 341 | print_preprocess) and to alloc.c, to mark your object (in | ||
| 342 | mark_object) and to free it (in gc_sweep). The latter is also the | ||
| 343 | right place to call any code specific to your data type that needs | ||
| 344 | to run when the object is recycled -- e.g., free any additional | ||
| 345 | resources allocated for it that are not Lisp objects. You can even | ||
| 346 | make a pointer to the function that frees the resources a slot in | ||
| 347 | your object -- this way, the same object could be used to represent | ||
| 348 | several disparate C structures. */ | ||
| 349 | |||
| 301 | #ifdef CHECK_LISP_OBJECT_TYPE | 350 | #ifdef CHECK_LISP_OBJECT_TYPE |
| 302 | 351 | ||
| 303 | typedef struct { EMACS_INT i; } Lisp_Object; | 352 | typedef struct { EMACS_INT i; } Lisp_Object; |
diff --git a/src/lread.c b/src/lread.c index 6d4c0d990af..94744620279 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -996,18 +996,17 @@ If optional fifth arg MUST-SUFFIX is non-nil, insist on | |||
| 996 | the suffix `.elc' or `.el'; don't accept just FILE unless | 996 | the suffix `.elc' or `.el'; don't accept just FILE unless |
| 997 | it ends in one of those suffixes or includes a directory name. | 997 | it ends in one of those suffixes or includes a directory name. |
| 998 | 998 | ||
| 999 | If this function fails to find a file, it may look for different | 999 | If NOSUFFIX is nil, then if a file could not be found, try looking for |
| 1000 | representations of that file before trying another file. | 1000 | a different representation of the file by adding non-empty suffixes to |
| 1001 | It does so by adding the non-empty suffixes in `load-file-rep-suffixes' | 1001 | its name, before trying another file. Emacs uses this feature to find |
| 1002 | to the file name. Emacs uses this feature mainly to find compressed | 1002 | compressed versions of files when Auto Compression mode is enabled. |
| 1003 | versions of files when Auto Compression mode is enabled. | 1003 | If NOSUFFIX is non-nil, disable this feature. |
| 1004 | 1004 | ||
| 1005 | The exact suffixes that this function tries out, in the exact order, | 1005 | The suffixes that this function tries out, when NOSUFFIX is nil, are |
| 1006 | are given by the value of the variable `load-file-rep-suffixes' if | 1006 | given by the return value of `get-load-suffixes' and the values listed |
| 1007 | NOSUFFIX is non-nil and by the return value of the function | 1007 | in `load-file-rep-suffixes'. If MUST-SUFFIX is non-nil, only the |
| 1008 | `get-load-suffixes' if MUST-SUFFIX is non-nil. If both NOSUFFIX and | 1008 | return value of `get-load-suffixes' is used, i.e. the file name is |
| 1009 | MUST-SUFFIX are nil, this function first tries out the latter suffixes | 1009 | required to have a non-empty suffix. |
| 1010 | and then the former. | ||
| 1011 | 1010 | ||
| 1012 | Loading a file records its definitions, and its `provide' and | 1011 | Loading a file records its definitions, and its `provide' and |
| 1013 | `require' calls, in an element of `load-history' whose | 1012 | `require' calls, in an element of `load-history' whose |