From ee12c421b61218a868712f66b0176c451e20717e Mon Sep 17 00:00:00 2001 From: Dhruva Krishnamurthy Date: Mon, 23 Dec 2019 17:20:06 -0800 Subject: imagemagick-types needs to initialize ImageMagick * src/image.c (imagemagick_initialize): New function, with body taken from imagemagick_load_image. (imagemagick_load_image, Fimagemagick_types): Use it. Copyright-paperwork-exempt: yes --- src/image.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src') 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 *, MagickPixelPacket *); #endif +static void +imagemagick_initialize (void) +{ + static bool imagemagick_initialized; + if (!imagemagick_initialized) + { + imagemagick_initialized = true; + MagickWandGenesis (); + } +} + /* Log ImageMagick error message. Useful when an ImageMagick function returns the status `MagickFalse'. */ @@ -8874,14 +8885,7 @@ imagemagick_load_image (struct frame *f, struct image *img, double rotation; char hint_buffer[MaxTextExtent]; char *filename_hint = NULL; - - /* Initialize the ImageMagick environment. */ - static bool imagemagick_initialized; - if (!imagemagick_initialized) - { - imagemagick_initialized = true; - MagickWandGenesis (); - } + imagemagick_initialize (); /* Handle image index for image types who can contain more than one image. Interface :index is same as for GIF. First we "ping" the image to see how @@ -9290,6 +9294,7 @@ and `imagemagick-types-inhibit'. */) char **imtypes; size_t i; + imagemagick_initialize (); ex = AcquireExceptionInfo (); imtypes = GetMagickList ("*", &numf, ex); DestroyExceptionInfo (ex); -- cgit v1.2.1 From 75d0cef20dbc522e6217a5765f21bfa841aff89b Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 24 Dec 2019 02:37:08 +0100 Subject: Trivial docstring fixes * ChangeLog.3: * lisp/emacs-lisp/cl-macs.el (cl-flet): * lisp/filesets.el (filesets-menu-ensure-use-cached): * lisp/progmodes/compile.el (compilation-context-lines): * lisp/progmodes/prolog.el (prolog-paren-indent): * lisp/progmodes/sql.el (sql-password-search-wallet-function): Fix typos in docstrings. * lisp/cedet/semantic/analyze.el (semantic-analyze-push-error): Doc fix. * lisp/emacs-lisp/map.el (map-put, map-info): Refill docstring. (map-contains-key): Fix typo. (map-every-p): Doc fix. --- src/syntax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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) for nested comments and should be zero or negative else. ST_COMMENT_STYLE cannot be nested. PREV_SYNTAX is the SYNTAX_WITH_FLAGS of the previous character - (or 0 If the search cannot start in the middle of a two-character). + (or 0 if the search cannot start in the middle of a two-character). If successful, return true and store the charpos of the comment's end into *CHARPOS_PTR and the corresponding bytepos into -- cgit v1.2.1 From 51ea32dd1294ef7b8fb14ff6f75cf1616d225901 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Tue, 24 Dec 2019 09:47:02 +0100 Subject: * src/emacs-module.h.in: Add reference to manual. --- src/emacs-module.h.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in index e9d5de495d6..5743d10ca43 100644 --- a/src/emacs-module.h.in +++ b/src/emacs-module.h.in @@ -17,6 +17,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ +/* +This file defines the Emacs module API. Please see the chapter +`Dynamic Modules' in the GNU Emacs Lisp Reference Manual for +information how to write modules and use this header file. +*/ + #ifndef EMACS_MODULE_H #define EMACS_MODULE_H -- cgit v1.2.1 From 0de63092c8ebae3877d97a18fa231c7ca2fbadc0 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 24 Dec 2019 17:11:04 +0100 Subject: Clarify base64 requirements and say what {en,de}code_coding_region does * src/coding.c (Fencode_coding_region): Clarify what this does. (Fdecode_coding_region): Ditto. * src/fns.c (Fbase64_decode_region): Clarify that this function returns bytes, not text (bug#38587). (Fbase64_encode_region): Clarify that this function takes bytes, not text. --- src/coding.c | 14 ++++++++++++++ src/fns.c | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'src') 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, DEFUN ("decode-coding-region", Fdecode_coding_region, Sdecode_coding_region, 3, 4, "r\nzCoding system: ", doc: /* Decode the current region from the specified coding system. + +What's meant by \"decoding\" is transforming bytes into text +(characters). If, for instance, you have a region that contains data +that represents the two bytes #xc2 #xa9, after calling this function +with the utf-8 coding system, the region will contain the single +character ?\\N{COPYRIGHT SIGN}. + When called from a program, takes four arguments: START, END, CODING-SYSTEM, and DESTINATION. START and END are buffer positions. @@ -9438,6 +9445,13 @@ not fully specified.) */) DEFUN ("encode-coding-region", Fencode_coding_region, Sencode_coding_region, 3, 4, "r\nzCoding system: ", doc: /* Encode the current region by specified coding system. + +What's meant by \"encoding\" is transforming textual data (characters) +into bytes. If, for instance, you have a region that contains the +single character ?\\N{COPYRIGHT SIGN}, after calling this function with +the utf-8 coding system, the data in the region will represent the two +bytes #xc2 #xa9. + When called from a program, takes four arguments: START, END, CODING-SYSTEM and DESTINATION. START and END are buffer positions. diff --git a/src/fns.c b/src/fns.c index 3ae3192b3d5..5e62d0e6f90 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3297,7 +3297,13 @@ static Lisp_Object base64_encode_string_1 (Lisp_Object, bool, DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, 2, 3, "r", doc: /* Base64-encode the region between BEG and END. -Return the length of the encoded text. +The data in the region is assumed to represent bytes, not text. If +you want to base64-encode text, the text has to be converted into data +first by using `encode-coding-region' with the appropriate coding +system first. + +Return the length of the encoded data. + Optional third argument NO-LINE-BREAK means do not break long lines into shorter lines. */) (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, DEFUN ("base64-decode-region", Fbase64_decode_region, Sbase64_decode_region, 2, 3, "r", doc: /* Base64-decode the region between BEG and END. -Return the length of the decoded text. +Return the length of the decoded data. + +Note that after calling this function, the data in the region will +represent bytes, not text. If you want to end up with text, you have +to call `decode-coding-region' afterwards with an appropriate coding +system. + If the region can't be decoded, signal an error and don't modify the buffer. Optional third argument BASE64URL determines whether to use the URL variant of the base 64 encoding, as defined in RFC 4648. */) -- cgit v1.2.1