diff options
| author | Glenn Morris | 2019-12-25 07:50:19 -0800 |
|---|---|---|
| committer | Glenn Morris | 2019-12-25 07:50:19 -0800 |
| commit | 2bb7bb4abfa5667ba5cd220ca3dd89731f33ff09 (patch) | |
| tree | 3317f66921cf3cd0d787816217bfd056e2bc2a3f /src | |
| parent | 93d4725f9ceabfaf40e75ecf2e28b67789741941 (diff) | |
| parent | ca6a53d3bc91d6fef9aa872495ab74298ce91bee (diff) | |
| download | emacs-2bb7bb4abfa5667ba5cd220ca3dd89731f33ff09.tar.gz emacs-2bb7bb4abfa5667ba5cd220ca3dd89731f33ff09.zip | |
Merge from origin/emacs-27
ca6a53d3bc Don't default to showing X-Faces externally in Gnus
dbf4b5b2d0 Fix manual typo in Special Read Syntax
a9fe6dfa90 Fix problem with emacs -nw / eww / svg
0de63092c8 Clarify base64 requirements and say what {en,de}code_codin...
6184aa003f ; * etc/NEWS: Fix boring oddities.
51ea32dd12 * src/emacs-module.h.in: Add reference to manual.
75d0cef20d Trivial docstring fixes
ee12c421b6 imagemagick-types needs to initialize ImageMagick
# Conflicts:
# etc/NEWS
Diffstat (limited to 'src')
| -rw-r--r-- | src/coding.c | 14 | ||||
| -rw-r--r-- | src/emacs-module.h.in | 6 | ||||
| -rw-r--r-- | src/fns.c | 16 | ||||
| -rw-r--r-- | src/image.c | 21 | ||||
| -rw-r--r-- | src/syntax.c | 2 |
5 files changed, 48 insertions, 11 deletions
diff --git a/src/coding.c b/src/coding.c index d9964908dce..35d6be470c8 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -9415,6 +9415,13 @@ code_convert_region (Lisp_Object start, Lisp_Object end, | |||
| 9415 | DEFUN ("decode-coding-region", Fdecode_coding_region, Sdecode_coding_region, | 9415 | DEFUN ("decode-coding-region", Fdecode_coding_region, Sdecode_coding_region, |
| 9416 | 3, 4, "r\nzCoding system: ", | 9416 | 3, 4, "r\nzCoding system: ", |
| 9417 | doc: /* Decode the current region from the specified coding system. | 9417 | doc: /* Decode the current region from the specified coding system. |
| 9418 | |||
| 9419 | What's meant by \"decoding\" is transforming bytes into text | ||
| 9420 | (characters). If, for instance, you have a region that contains data | ||
| 9421 | that represents the two bytes #xc2 #xa9, after calling this function | ||
| 9422 | with the utf-8 coding system, the region will contain the single | ||
| 9423 | character ?\\N{COPYRIGHT SIGN}. | ||
| 9424 | |||
| 9418 | When called from a program, takes four arguments: | 9425 | When called from a program, takes four arguments: |
| 9419 | START, END, CODING-SYSTEM, and DESTINATION. | 9426 | START, END, CODING-SYSTEM, and DESTINATION. |
| 9420 | START and END are buffer positions. | 9427 | START and END are buffer positions. |
| @@ -9438,6 +9445,13 @@ not fully specified.) */) | |||
| 9438 | DEFUN ("encode-coding-region", Fencode_coding_region, Sencode_coding_region, | 9445 | DEFUN ("encode-coding-region", Fencode_coding_region, Sencode_coding_region, |
| 9439 | 3, 4, "r\nzCoding system: ", | 9446 | 3, 4, "r\nzCoding system: ", |
| 9440 | doc: /* Encode the current region by specified coding system. | 9447 | doc: /* Encode the current region by specified coding system. |
| 9448 | |||
| 9449 | What's meant by \"encoding\" is transforming textual data (characters) | ||
| 9450 | into bytes. If, for instance, you have a region that contains the | ||
| 9451 | single character ?\\N{COPYRIGHT SIGN}, after calling this function with | ||
| 9452 | the utf-8 coding system, the data in the region will represent the two | ||
| 9453 | bytes #xc2 #xa9. | ||
| 9454 | |||
| 9441 | When called from a program, takes four arguments: | 9455 | When called from a program, takes four arguments: |
| 9442 | START, END, CODING-SYSTEM and DESTINATION. | 9456 | START, END, CODING-SYSTEM and DESTINATION. |
| 9443 | START and END are buffer positions. | 9457 | START and END are buffer positions. |
diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in index a4312730143..ecbfe28c72c 100644 --- a/src/emacs-module.h.in +++ b/src/emacs-module.h.in | |||
| @@ -17,6 +17,12 @@ GNU General Public License for more details. | |||
| 17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
| 18 | along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | 18 | along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ |
| 19 | 19 | ||
| 20 | /* | ||
| 21 | This file defines the Emacs module API. Please see the chapter | ||
| 22 | `Dynamic Modules' in the GNU Emacs Lisp Reference Manual for | ||
| 23 | information how to write modules and use this header file. | ||
| 24 | */ | ||
| 25 | |||
| 20 | #ifndef EMACS_MODULE_H | 26 | #ifndef EMACS_MODULE_H |
| 21 | #define EMACS_MODULE_H | 27 | #define EMACS_MODULE_H |
| 22 | 28 | ||
| @@ -3297,7 +3297,13 @@ static Lisp_Object base64_encode_string_1 (Lisp_Object, bool, | |||
| 3297 | DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, | 3297 | DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, |
| 3298 | 2, 3, "r", | 3298 | 2, 3, "r", |
| 3299 | doc: /* Base64-encode the region between BEG and END. | 3299 | doc: /* Base64-encode the region between BEG and END. |
| 3300 | Return the length of the encoded text. | 3300 | The data in the region is assumed to represent bytes, not text. If |
| 3301 | you want to base64-encode text, the text has to be converted into data | ||
| 3302 | first by using `encode-coding-region' with the appropriate coding | ||
| 3303 | system first. | ||
| 3304 | |||
| 3305 | Return the length of the encoded data. | ||
| 3306 | |||
| 3301 | Optional third argument NO-LINE-BREAK means do not break long lines | 3307 | Optional third argument NO-LINE-BREAK means do not break long lines |
| 3302 | into shorter lines. */) | 3308 | into shorter lines. */) |
| 3303 | (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break) | 3309 | (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break) |
| @@ -3544,7 +3550,13 @@ base64_encode_1 (const char *from, char *to, ptrdiff_t length, | |||
| 3544 | DEFUN ("base64-decode-region", Fbase64_decode_region, Sbase64_decode_region, | 3550 | DEFUN ("base64-decode-region", Fbase64_decode_region, Sbase64_decode_region, |
| 3545 | 2, 3, "r", | 3551 | 2, 3, "r", |
| 3546 | doc: /* Base64-decode the region between BEG and END. | 3552 | doc: /* Base64-decode the region between BEG and END. |
| 3547 | Return the length of the decoded text. | 3553 | Return the length of the decoded data. |
| 3554 | |||
| 3555 | Note that after calling this function, the data in the region will | ||
| 3556 | represent bytes, not text. If you want to end up with text, you have | ||
| 3557 | to call `decode-coding-region' afterwards with an appropriate coding | ||
| 3558 | system. | ||
| 3559 | |||
| 3548 | If the region can't be decoded, signal an error and don't modify the buffer. | 3560 | If the region can't be decoded, signal an error and don't modify the buffer. |
| 3549 | Optional third argument BASE64URL determines whether to use the URL variant | 3561 | Optional third argument BASE64URL determines whether to use the URL variant |
| 3550 | of the base 64 encoding, as defined in RFC 4648. */) | 3562 | of the base 64 encoding, as defined in RFC 4648. */) |
diff --git a/src/image.c b/src/image.c index 70d932f9edb..fc90c5ea74b 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -8603,6 +8603,17 @@ extern WandExport void PixelGetMagickColor (const PixelWand *, | |||
| 8603 | MagickPixelPacket *); | 8603 | MagickPixelPacket *); |
| 8604 | #endif | 8604 | #endif |
| 8605 | 8605 | ||
| 8606 | static void | ||
| 8607 | imagemagick_initialize (void) | ||
| 8608 | { | ||
| 8609 | static bool imagemagick_initialized; | ||
| 8610 | if (!imagemagick_initialized) | ||
| 8611 | { | ||
| 8612 | imagemagick_initialized = true; | ||
| 8613 | MagickWandGenesis (); | ||
| 8614 | } | ||
| 8615 | } | ||
| 8616 | |||
| 8606 | /* Log ImageMagick error message. | 8617 | /* Log ImageMagick error message. |
| 8607 | Useful when an ImageMagick function returns the status `MagickFalse'. */ | 8618 | Useful when an ImageMagick function returns the status `MagickFalse'. */ |
| 8608 | 8619 | ||
| @@ -8874,14 +8885,7 @@ imagemagick_load_image (struct frame *f, struct image *img, | |||
| 8874 | double rotation; | 8885 | double rotation; |
| 8875 | char hint_buffer[MaxTextExtent]; | 8886 | char hint_buffer[MaxTextExtent]; |
| 8876 | char *filename_hint = NULL; | 8887 | char *filename_hint = NULL; |
| 8877 | 8888 | imagemagick_initialize (); | |
| 8878 | /* Initialize the ImageMagick environment. */ | ||
| 8879 | static bool imagemagick_initialized; | ||
| 8880 | if (!imagemagick_initialized) | ||
| 8881 | { | ||
| 8882 | imagemagick_initialized = true; | ||
| 8883 | MagickWandGenesis (); | ||
| 8884 | } | ||
| 8885 | 8889 | ||
| 8886 | /* Handle image index for image types who can contain more than one image. | 8890 | /* Handle image index for image types who can contain more than one image. |
| 8887 | Interface :index is same as for GIF. First we "ping" the image to see how | 8891 | Interface :index is same as for GIF. First we "ping" the image to see how |
| @@ -9290,6 +9294,7 @@ and `imagemagick-types-inhibit'. */) | |||
| 9290 | char **imtypes; | 9294 | char **imtypes; |
| 9291 | size_t i; | 9295 | size_t i; |
| 9292 | 9296 | ||
| 9297 | imagemagick_initialize (); | ||
| 9293 | ex = AcquireExceptionInfo (); | 9298 | ex = AcquireExceptionInfo (); |
| 9294 | imtypes = GetMagickList ("*", &numf, ex); | 9299 | imtypes = GetMagickList ("*", &numf, ex); |
| 9295 | DestroyExceptionInfo (ex); | 9300 | DestroyExceptionInfo (ex); |
diff --git a/src/syntax.c b/src/syntax.c index edfdae22590..0f539da328a 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -2280,7 +2280,7 @@ in_classes (int c, Lisp_Object iso_classes) | |||
| 2280 | for nested comments and should be zero or negative else. | 2280 | for nested comments and should be zero or negative else. |
| 2281 | ST_COMMENT_STYLE cannot be nested. | 2281 | ST_COMMENT_STYLE cannot be nested. |
| 2282 | PREV_SYNTAX is the SYNTAX_WITH_FLAGS of the previous character | 2282 | PREV_SYNTAX is the SYNTAX_WITH_FLAGS of the previous character |
| 2283 | (or 0 If the search cannot start in the middle of a two-character). | 2283 | (or 0 if the search cannot start in the middle of a two-character). |
| 2284 | 2284 | ||
| 2285 | If successful, return true and store the charpos of the comment's | 2285 | If successful, return true and store the charpos of the comment's |
| 2286 | end into *CHARPOS_PTR and the corresponding bytepos into | 2286 | end into *CHARPOS_PTR and the corresponding bytepos into |