commit 45ffe7329e88226809b860a9e8d57f09815820fc (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sat May 18 10:02:25 2019 +0200 Remove usage of string-as-unibyte in arc-mode * lisp/arc-mode.el (archive-l-e): Encode with utf-8-emacs-unix instead of using string-as-unibyte. diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 871395ebb4..9eec7ea086 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -535,7 +535,8 @@ in which case a second argument, length LEN, should be supplied." (if (stringp str) (setq len (length str)) (setq str (buffer-substring str (+ str len)))) - (setq str (string-as-unibyte str)) + (if (multibyte-string-p str) + (setq str (encode-coding-string str 'utf-8-emacs-unix))) (let ((result 0) (i 0)) (while (< i len) commit 6c9a1deb41f0a9d3dd7e8615a0015a74a851b426 Author: Eli Zaretskii Date: Sat May 18 10:15:19 2019 +0300 Fix visiting and saving UTF-16 encoded XML files * lisp/international/mule.el (sgml-xml-auto-coding-function): When the 'enncoding' tag specifies a UTF-16 encoding, enforce saving the buffer with BOM, per the XML spec. (xml-find-file-coding-system): Recognize UTF-16 encodings with BOM. (Bug#35766) (Bug#8282) * lisp/international/mule-cmds.el (select-safe-coding-system): Don't consider UTF-16 encodings with and without BOM as "different", so as not to annoy users with redundant questions about mismatch between the XML/SGML header and the selected explicit encoding. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index dfa9e4e6c8..27296ecfb2 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1029,7 +1029,13 @@ It is highly recommended to fix it before writing to a file." ;; This check perhaps isn't ideal, but is probably ;; the best thing to do. (not (auto-coding-alist-lookup (or file buffer-file-name ""))) - (not (coding-system-equal coding-system auto-cs))) + (not (coding-system-equal coding-system auto-cs)) + ;; coding-system-equal barfs on 'charset'. + (or (equal (coding-system-type auto-cs) 'charset) + (equal (coding-system-type coding-system) 'charset) + (not (coding-system-equal (coding-system-type auto-cs) + (coding-system-type + coding-system))))) (unless (yes-or-no-p (format "Selected encoding %s disagrees with \ %s specified by file contents. Really save (else edit coding cookies \ diff --git a/lisp/international/mule.el b/lisp/international/mule.el index b5414de0db..21f3118a98 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -2498,7 +2498,18 @@ This function is intended to be added to `auto-coding-functions'." (when end (if (re-search-forward "encoding=[\"']\\(.+?\\)[\"']" end t) (let* ((match (match-string 1)) - (sym (intern (downcase match)))) + (sym-name (downcase match)) + (sym-name + ;; https://www.w3.org/TR/xml/#charencoding says: + ;; "Entities encoded in UTF-16 MUST [...] begin + ;; with the Byte Order Mark." The trick below is + ;; based on the fact that utf-16be/le don't + ;; specify BOM, while utf-16-be/le do. + (cond + ((equal sym-name "utf-16le") "utf-16-le") + ((equal sym-name "utf-16be") "utf-16-be") + (t sym-name))) + (sym (intern sym-name))) (if (coding-system-p sym) ;; If the encoding tag is UTF-8 and the buffer's ;; encoding is one of the variants of UTF-8, use the @@ -2587,9 +2598,14 @@ added by processing software." (let ((detected (with-coding-priority '(utf-8) (coding-system-base - (detect-coding-region (point-min) (point-max) t))))) - ;; Pure ASCII always comes back as undecided. + (detect-coding-region (point-min) (point-max) t)))) + (bom (list (char-after 1) (char-after 2)))) (cond + ((equal bom '(#xFE #xFF)) + 'utf-16be-with-signature) + ((equal bom '(#xFF #xFE)) + 'utf-16le-with-signature) + ;; Pure ASCII always comes back as undecided. ((memq detected '(utf-8 undecided)) 'utf-8) ((eq detected 'utf-16le-with-signature) 'utf-16le-with-signature) commit d0b72dbba0bef8bc8ec0e1c2d55d179820d5e452 Author: Lars Ingebrigtsen Date: Sat May 18 07:47:32 2019 +0200 Mitigate byte-compile warning in arc-mode * lisp/arc-mode.el (byte-after): Remove defsubst. Replace all calls to byte-after with get-byte throughout the file, because byte-after gave compilation warnings. diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 1c88f9a1a1..871395ebb4 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -517,9 +517,6 @@ Each descriptor is a vector of the form ;;; Section: Support functions. (eval-when-compile - (defsubst byte-after (pos) - "Like char-after but an eight-bit char is converted to unibyte." - (multibyte-char-to-unibyte (char-after pos))) (defsubst insert-unibyte (&rest args) "Like insert but don't make unibyte string and eight-bit char multibyte." (dolist (elt args) @@ -1492,8 +1489,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." files visual) (while (and (< (+ p 29) (point-max)) - (= (byte-after p) ?\C-z) - (> (byte-after (1+ p)) 0)) + (= (get-byte p) ?\C-z) + (> (get-byte (1+ p)) 0)) (let* ((namefld (buffer-substring (+ p 2) (+ p 2 13))) (fnlen (or (string-match "\0" namefld) 13)) (efnname (decode-coding-string (substring namefld 0 fnlen) @@ -1558,13 +1555,13 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." visual) (while (progn (goto-char p) ;beginning of a base header. (looking-at "\\(.\\|\n\\)\\(.\\|\n\\)-l[hz][0-9ds]-")) - (let* ((hsize (byte-after p)) ;size of the base header (level 0 and 1) + (let* ((hsize (get-byte p)) ;size of the base header (level 0 and 1) (csize (archive-l-e (+ p 7) 4)) ;size of a compressed file to follow (level 0 and 2), ;size of extended headers + the compressed file to follow (level 1). (ucsize (archive-l-e (+ p 11) 4)) ;size of an uncompressed file. (time1 (archive-l-e (+ p 15) 2)) ;date/time (MSDOS format in level 0, 1 headers (time2 (archive-l-e (+ p 17) 2)) ;and UNIX format in level 2 header.) - (hdrlvl (byte-after (+ p 20))) ;header level + (hdrlvl (get-byte (+ p 20))) ;header level thsize ;total header size (base + extensions) fnlen efnname osid fiddle ifnname width p2 neh ;beginning of next extension header (level 1 and 2) @@ -1572,7 +1569,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." gname uname modtime moddate) (if (= hdrlvl 3) (error "can't handle lzh level 3 header type")) (when (or (= hdrlvl 0) (= hdrlvl 1)) - (setq fnlen (byte-after (+ p 21))) ;filename length + (setq fnlen (get-byte (+ p 21))) ;filename length (setq efnname (let ((str (buffer-substring (+ p 22) (+ p 22 fnlen)))) ;filename from offset 22 (decode-coding-string str archive-file-name-coding-system))) @@ -1583,19 +1580,19 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (setq neh (+ p 24)))) ;specific to level 2 header (if neh ;if level 1 or 2 we expect extension headers to follow (let* ((ehsize (archive-l-e neh 2)) ;size of the extension header - (etype (byte-after (+ neh 2)))) ;extension type + (etype (get-byte (+ neh 2)))) ;extension type (while (not (= ehsize 0)) (cond ((= etype 1) ;file name (let ((i (+ neh 3))) (while (< i (+ neh ehsize)) - (setq efnname (concat efnname (char-to-string (byte-after i)))) + (setq efnname (concat efnname (char-to-string (get-byte i)))) (setq i (1+ i))))) ((= etype 2) ;directory name (let ((i (+ neh 3))) (while (< i (+ neh ehsize)) (setq dir (concat dir - (if (= (byte-after i) + (if (= (get-byte i) 255) "/" (char-to-string @@ -1619,7 +1616,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." ) (setq neh (+ neh ehsize)) (setq ehsize (archive-l-e neh 2)) - (setq etype (byte-after (+ neh 2)))) + (setq etype (get-byte (+ neh 2)))) ;;get total header size for level 1 and 2 headers (setq thsize (- neh p)))) (if (= hdrlvl 0) ;total header size @@ -1706,7 +1703,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (let ((sum 0)) (while (> count 0) (setq count (1- count) - sum (+ sum (byte-after p)) + sum (+ sum (get-byte p)) p (1+ p))) (logand sum 255))) @@ -1715,8 +1712,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (save-excursion (widen) (let* ((p (+ archive-proper-file-start (aref descr 4))) - (oldhsize (byte-after p)) - (oldfnlen (byte-after (+ p 21))) + (oldhsize (get-byte p)) + (oldfnlen (get-byte (+ p 21))) (newfnlen (length newname)) (newhsize (+ oldhsize newfnlen (- oldfnlen))) (inhibit-read-only t)) @@ -1735,10 +1732,10 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (widen) (dolist (fil files) (let* ((p (+ archive-proper-file-start (aref fil 4))) - (hsize (byte-after p)) - (fnlen (byte-after (+ p 21))) + (hsize (get-byte p)) + (fnlen (get-byte (+ p 21))) (p2 (+ p 22 fnlen)) - (creator (if (>= (- hsize fnlen) 24) (byte-after (+ p2 2)) 0)) + (creator (if (>= (- hsize fnlen) 24) (get-byte (+ p2 2)) 0)) (inhibit-read-only t)) (if (= creator ?U) (progn @@ -1821,7 +1818,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (setq p (archive-l-e (+ p 48) 8))) (setq p (+ p (point-min))) (while (string= "PK\001\002" (buffer-substring p (+ p 4))) - (let* ((creator (byte-after (+ p 5))) + (let* ((creator (get-byte (+ p 5))) ;; (method (archive-l-e (+ p 10) 2)) (modtime (archive-l-e (+ p 12) 2)) (moddate (archive-l-e (+ p 14) 2)) @@ -1841,7 +1838,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (logior ?\444 (if isdir (logior 16384 ?\111) 0) (if (zerop - (logand 1 (byte-after (+ p 38)))) + (logand 1 (get-byte (+ p 38)))) ?\222 0))) (t nil))) (modestr (if mode (archive-int-to-mode mode) "??????????")) @@ -1918,7 +1915,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (widen) (dolist (fil files) (let* ((p (+ archive-proper-file-start (car (aref fil 4)))) - (creator (byte-after (+ p 5))) + (creator (get-byte (+ p 5))) (oldmode (aref fil 3)) (newval (archive-calc-mode oldmode newmode t)) (inhibit-read-only t)) @@ -1928,7 +1925,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (insert-unibyte (logand newval 255) (ash newval -8))) ((memq creator '(0 5 6 7 10 11 15)) ; Dos etc. (goto-char (+ p 38)) - (insert-unibyte (logior (logand (byte-after (point)) 254) + (insert-unibyte (logior (logand (get-byte (point)) 254) (logand (logxor 1 (ash newval -7)) 1))) (delete-char 1)) (t (message "Don't know how to change mode for this member")))) @@ -1949,9 +1946,9 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." (modtime (archive-l-e (+ p 16) 2)) (ucsize (archive-l-e (+ p 20) 4)) (namefld (buffer-substring (+ p 38) (+ p 38 13))) - (dirtype (byte-after (+ p 4))) - (lfnlen (if (= dirtype 2) (byte-after (+ p 56)) 0)) - (ldirlen (if (= dirtype 2) (byte-after (+ p 57)) 0)) + (dirtype (get-byte (+ p 4))) + (lfnlen (if (= dirtype 2) (get-byte (+ p 56)) 0)) + (ldirlen (if (= dirtype 2) (get-byte (+ p 57)) 0)) (fnlen (or (string-match "\0" namefld) 13)) (efnname (let ((str (concat commit a7a730e32a62790121566d756df53fbe250c1eb0 Author: Eli Zaretskii Date: Sat May 18 07:08:02 2019 +0200 (hexl-insert-multibyte-char): Avoid using `string-as-unibyte' * lisp/hexl.el (hexl-insert-multibyte-char): Avoid using `string-as-unibyte' in the fallback case. diff --git a/lisp/hexl.el b/lisp/hexl.el index c1c2d70daf..ee5a9c0fce 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -877,17 +877,18 @@ and their encoded form is inserted byte by byte." "0x%x -- invalid character code; use \\[hexl-insert-hex-string]" ch)) (t - (let ((encoded (encode-coding-char ch coding)) - (internal (string-as-unibyte (char-to-string ch))) - internal-hex) - ;; If encode-coding-char returns nil, it means our character - ;; cannot be safely encoded with buffer-file-coding-system. - ;; In that case, we offer to insert the internal representation - ;; of that character, byte by byte. - (when (null encoded) - (setq internal-hex - (mapconcat (function (lambda (c) (format "%x" c))) - internal " ")) + (let ((encoded (encode-coding-char ch coding)) + (internal (char-to-string ch)) + internal-hex) + ;; If encode-coding-char returns nil, it means our character + ;; cannot be safely encoded with buffer-file-coding-system. + ;; In that case, we offer to insert the internal representation + ;; of that character, byte by byte. + (when (null encoded) + (setq internal (encode-coding-string internal 'utf-8-emacs) + internal-hex + (mapconcat (function (lambda (c) (format "%x" c))) + internal " ")) (if (yes-or-no-p (format-message "Insert char 0x%x's internal representation \"%s\"? " commit 635d7a39bc3281203e3e49e7a37d5403d547f1d6 Author: Lars Ingebrigtsen Date: Fri May 17 17:37:35 2019 +0200 (dirtrack-toggle, dirtrackp): Remove obsolete aliases * lisp/dirtrack.el (dirtrack-toggle, dirtrackp): Remove function/variable aliases declared obsolete in Emacs 23.1 (and that issued a byte-compile warning). diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el index 0925a4de12..259d3fdf2e 100644 --- a/lisp/dirtrack.el +++ b/lisp/dirtrack.el @@ -179,8 +179,6 @@ and ends with a forward slash." dir)) -(define-obsolete-function-alias 'dirtrack-toggle 'dirtrack-mode "23.1") -(define-obsolete-variable-alias 'dirtrackp 'dirtrack-mode "23.1") ;;;###autoload (define-minor-mode dirtrack-mode "Toggle directory tracking in shell buffers (Dirtrack mode). commit 41bf865329bbc2411203e9a90bc8dfd93ed5ef31 Author: Paul Eggert Date: Fri May 17 18:41:22 2019 -0700 Clean up and simplify image-type setup This also fixes an unlikely hang involving a circular image description. * src/dispextern.h (struct image.type): Now pointer-to-const. * src/image.c (struct image_type.init) [!WINDOWSNT]: Omit. (IMAGE_TYPE_INIT): New macro. (image_types): Now a small array-of-const, not a pointer. (CACHE_IMAGE_TYPE): Remove; the code’s simpler without it. (ADD_IMAGE_TYPE): Remove this macro, replacing with ... (add_image_type): ... this equivalent function. All uses changed. (define_image_type): Remove. All uses removed. (valid_image_p): Use FOR_EACH_TAIL_SAFE to avoid Emacs hanging if the user creates a circular description of an image. (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type) (gif_type, imagemagick_type, svg_type, gs_type): Remove; now done by image_types. (init_imagemagick_functions): Remove decl of nonexistent function. (gs_clear_image): Remove; all uses replaced by image_clear_image. (initialize_image_type): New function, which captures a lot of the previously-scattered WINDOWSNT ifdefs. (lookup_image_type): Use it. (reset_image_types): Remove. All uses removed. (syms_of_image): Don’t worry about ignoring image_types for pdumper, since it’s a constant now. diff --git a/src/dispextern.h b/src/dispextern.h index 619f4c0767..e86ea6a02a 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3036,7 +3036,7 @@ struct image int hmargin, vmargin; /* Reference to the type of the image. */ - struct image_type *type; + struct image_type const *type; /* True means that loading the image failed. Don't try again. */ bool load_failed_p; diff --git a/src/emacs.c b/src/emacs.c index 86d2bc65ac..fd46540ce2 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2494,9 +2494,6 @@ You must run Emacs in batch mode in order to dump it. */) # ifdef WINDOWSNT Vlibrary_cache = Qnil; # endif -# ifdef HAVE_WINDOW_SYSTEM - reset_image_types (); -# endif Vpurify_flag = tem; diff --git a/src/image.c b/src/image.c index 0779594989..b82bf12aa5 100644 --- a/src/image.c +++ b/src/image.c @@ -548,82 +548,29 @@ struct image_type /* Free resources of image IMG which is used on frame F. */ void (*free) (struct frame *f, struct image *img); +#ifdef WINDOWSNT /* Initialization function (used for dynamic loading of image libraries on Windows), or NULL if none. */ bool (*init) (void); - - /* Next in list of all supported image types. */ - struct image_type *next; + /* An initializer for the init field. */ +# define IMAGE_TYPE_INIT(f) f +#else +# define IMAGE_TYPE_INIT(f) +#endif }; -/* List of supported image types. Use define_image_type to add new - types. Use lookup_image_type to find a type for a given symbol. */ - -static struct image_type *image_types; - /* Forward function prototypes. */ -static struct image_type *lookup_image_type (Lisp_Object); +static struct image_type const *lookup_image_type (Lisp_Object); static void image_laplace (struct frame *, struct image *); static void image_emboss (struct frame *, struct image *); static void image_build_heuristic_mask (struct frame *, struct image *, Lisp_Object); -#ifdef WINDOWSNT -#define CACHE_IMAGE_TYPE(type, status) \ - do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) -#else -#define CACHE_IMAGE_TYPE(type, status) -#endif - -#define ADD_IMAGE_TYPE(type) \ - do { Vimage_types = Fcons (type, Vimage_types); } while (0) - -/* Define a new image type from TYPE. This adds a copy of TYPE to - image_types and caches the loading status of TYPE. */ -static struct image_type * -define_image_type (struct image_type *type) +static void +add_image_type (Lisp_Object type) { - struct image_type *p = NULL; - int new_type = type->type; - bool type_valid = true; - - block_input (); - - for (p = image_types; p; p = p->next) - if (p->type == new_type) - goto done; - - if (type->init) - { -#if defined HAVE_NTGUI && defined WINDOWSNT - /* If we failed to load the library before, don't try again. */ - Lisp_Object tested = Fassq (builtin_lisp_symbol (new_type), - Vlibrary_cache); - if (CONSP (tested) && NILP (XCDR (tested))) - type_valid = false; - else -#endif - { - type_valid = type->init (); - CACHE_IMAGE_TYPE (builtin_lisp_symbol (new_type), - type_valid ? Qt : Qnil); - } - } - - if (type_valid) - { - /* Make a copy of TYPE to avoid a bus error in a dumped Emacs. - The initialized data segment is read-only. */ - p = xmalloc (sizeof *p); - *p = *type; - p->next = image_types; - image_types = p; - } - - done: - unblock_input (); - return p; + Vimage_types = Fcons (type, Vimage_types); } @@ -637,29 +584,24 @@ define_image_type (struct image_type *type) bool valid_image_p (Lisp_Object object) { - bool valid_p = 0; - if (IMAGEP (object)) { - Lisp_Object tem; - - for (tem = XCDR (object); CONSP (tem); tem = XCDR (tem)) - if (EQ (XCAR (tem), QCtype)) + Lisp_Object tail = XCDR (object); + FOR_EACH_TAIL_SAFE (tail) + if (EQ (XCAR (tail), QCtype)) { - tem = XCDR (tem); - if (CONSP (tem) && SYMBOLP (XCAR (tem))) + tail = XCDR (tail); + if (CONSP (tail)) { - struct image_type *type; - type = lookup_image_type (XCAR (tem)); + struct image_type const *type = lookup_image_type (XCAR (tail)); if (type) - valid_p = type->valid_p (object); + return type->valid_p (object); } - break; } } - return valid_p; + return false; } @@ -2575,8 +2517,6 @@ slurp_file (int fd, ptrdiff_t *size) XBM images ***********************************************************************/ -static bool xbm_load (struct frame *f, struct image *img); -static bool xbm_image_p (Lisp_Object object); static bool xbm_file_p (Lisp_Object); @@ -2620,18 +2560,6 @@ static const struct image_keyword xbm_format[XBM_LAST] = {":mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} }; -/* Structure describing the image type XBM. */ - -static struct image_type xbm_type = -{ - SYMBOL_INDEX (Qxbm), - xbm_image_p, - xbm_load, - image_clear_image, - NULL, - NULL -}; - /* Tokens returned from xbm_scan. */ enum xbm_token @@ -3357,13 +3285,6 @@ xbm_load (struct frame *f, struct image *img) XPM images ***********************************************************************/ -#if defined (HAVE_XPM) || defined (HAVE_NS) - -static bool xpm_image_p (Lisp_Object object); -static bool xpm_load (struct frame *f, struct image *img); - -#endif /* HAVE_XPM || HAVE_NS */ - #ifdef HAVE_XPM #ifdef HAVE_NTGUI /* Indicate to xpm.h that we don't have Xlib. */ @@ -3425,24 +3346,6 @@ static const struct image_keyword xpm_format[XPM_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -#if defined HAVE_NTGUI && defined WINDOWSNT -static bool init_xpm_functions (void); -#else -#define init_xpm_functions NULL -#endif - -/* Structure describing the image type XPM. */ - -static struct image_type xpm_type = -{ - SYMBOL_INDEX (Qxpm), - xpm_image_p, - xpm_load, - image_clear_image, - init_xpm_functions, - NULL -}; - #ifdef HAVE_X_WINDOWS /* Define ALLOC_XPM_COLORS if we can use Emacs' own color allocation @@ -5364,9 +5267,6 @@ image_build_heuristic_mask (struct frame *f, struct image *img, PBM (mono, gray, color) ***********************************************************************/ -static bool pbm_image_p (Lisp_Object object); -static bool pbm_load (struct frame *f, struct image *img); - /* Indices of image specification fields in gs_format, below. */ enum pbm_keyword_index @@ -5403,19 +5303,6 @@ static const struct image_keyword pbm_format[PBM_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -/* Structure describing the image type `pbm'. */ - -static struct image_type pbm_type = -{ - SYMBOL_INDEX (Qpbm), - pbm_image_p, - pbm_load, - image_clear_image, - NULL, - NULL -}; - - /* Return true if OBJECT is a valid PBM image specification. */ static bool @@ -5834,11 +5721,6 @@ pbm_load (struct frame *f, struct image *img) #if defined (HAVE_PNG) || defined (HAVE_NS) || defined (USE_CAIRO) -/* Function prototypes. */ - -static bool png_image_p (Lisp_Object object); -static bool png_load (struct frame *f, struct image *img); - /* Indices of image specification fields in png_format, below. */ enum png_keyword_index @@ -5873,24 +5755,6 @@ static const struct image_keyword png_format[PNG_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -#if defined HAVE_NTGUI && defined WINDOWSNT -static bool init_png_functions (void); -#else -#define init_png_functions NULL -#endif - -/* Structure describing the image type `png'. */ - -static struct image_type png_type = -{ - SYMBOL_INDEX (Qpng), - png_image_p, - png_load, - image_clear_image, - init_png_functions, - NULL -}; - /* Return true if OBJECT is a valid PNG image specification. */ static bool @@ -6518,9 +6382,6 @@ png_load (struct frame *f, struct image *img) #if defined (HAVE_JPEG) || defined (HAVE_NS) -static bool jpeg_image_p (Lisp_Object object); -static bool jpeg_load (struct frame *f, struct image *img); - /* Indices of image specification fields in gs_format, below. */ enum jpeg_keyword_index @@ -6555,24 +6416,6 @@ static const struct image_keyword jpeg_format[JPEG_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -#if defined HAVE_NTGUI && defined WINDOWSNT -static bool init_jpeg_functions (void); -#else -#define init_jpeg_functions NULL -#endif - -/* Structure describing the image type `jpeg'. */ - -static struct image_type jpeg_type = -{ - SYMBOL_INDEX (Qjpeg), - jpeg_image_p, - jpeg_load, - image_clear_image, - init_jpeg_functions, - NULL -}; - /* Return true if OBJECT is a valid JPEG image specification. */ static bool @@ -7150,9 +6993,6 @@ jpeg_load (struct frame *f, struct image *img) #if defined (HAVE_TIFF) || defined (HAVE_NS) -static bool tiff_image_p (Lisp_Object object); -static bool tiff_load (struct frame *f, struct image *img); - /* Indices of image specification fields in tiff_format, below. */ enum tiff_keyword_index @@ -7189,24 +7029,6 @@ static const struct image_keyword tiff_format[TIFF_LAST] = {":index", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0} }; -#if defined HAVE_NTGUI && defined WINDOWSNT -static bool init_tiff_functions (void); -#else -#define init_tiff_functions NULL -#endif - -/* Structure describing the image type `tiff'. */ - -static struct image_type tiff_type = -{ - SYMBOL_INDEX (Qtiff), - tiff_image_p, - tiff_load, - image_clear_image, - init_tiff_functions, - NULL -}; - /* Return true if OBJECT is a valid TIFF image specification. */ static bool @@ -7634,10 +7456,6 @@ tiff_load (struct frame *f, struct image *img) #if defined (HAVE_GIF) || defined (HAVE_NS) -static bool gif_image_p (Lisp_Object object); -static bool gif_load (struct frame *f, struct image *img); -static void gif_clear_image (struct frame *f, struct image *img); - /* Indices of image specification fields in gif_format, below. */ enum gif_keyword_index @@ -7674,24 +7492,6 @@ static const struct image_keyword gif_format[GIF_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -#if defined HAVE_NTGUI && defined WINDOWSNT -static bool init_gif_functions (void); -#else -#define init_gif_functions NULL -#endif - -/* Structure describing the image type `gif'. */ - -static struct image_type gif_type = -{ - SYMBOL_INDEX (Qgif), - gif_image_p, - gif_load, - gif_clear_image, - init_gif_functions, - NULL -}; - /* Free X resources of GIF image IMG which is used on frame F. */ static void @@ -8289,10 +8089,6 @@ gif_load (struct frame *f, struct image *img) ImageMagick ***********************************************************************/ -static bool imagemagick_image_p (Lisp_Object); -static bool imagemagick_load (struct frame *, struct image *); -static void imagemagick_clear_image (struct frame *, struct image *); - /* Indices of image specification fields in imagemagick_format. */ enum imagemagick_keyword_index @@ -8341,25 +8137,6 @@ static struct image_keyword imagemagick_format[IMAGEMAGICK_LAST] = {":crop", IMAGE_DONT_CHECK_VALUE_TYPE, 0} }; -#if defined HAVE_NTGUI && defined WINDOWSNT -static bool init_imagemagick_functions (void); -#else -#define init_imagemagick_functions NULL -#endif - -/* Structure describing the image type for any image handled via - ImageMagick. */ - -static struct image_type imagemagick_type = - { - SYMBOL_INDEX (Qimagemagick), - imagemagick_image_p, - imagemagick_load, - imagemagick_clear_image, - init_imagemagick_functions, - NULL - }; - /* Free X resources of imagemagick image IMG which is used on frame F. */ static void @@ -9137,9 +8914,6 @@ and `imagemagick-types-inhibit'. */) /* Function prototypes. */ -static bool svg_image_p (Lisp_Object object); -static bool svg_load (struct frame *f, struct image *img); - static bool svg_load_image (struct frame *, struct image *, char *, ptrdiff_t, char *); @@ -9177,27 +8951,6 @@ static const struct image_keyword svg_format[SVG_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -# if defined HAVE_NTGUI && defined WINDOWSNT -static bool init_svg_functions (void); -# else -#define init_svg_functions NULL -# endif - -/* Structure describing the image type `svg'. Its the same type of - structure defined for all image formats, handled by emacs image - functions. See struct image_type in dispextern.h. */ - -static struct image_type svg_type = -{ - SYMBOL_INDEX (Qsvg), - svg_image_p, - svg_load, - image_clear_image, - init_svg_functions, - NULL -}; - - /* Return true if OBJECT is a valid SVG image specification. Do this by calling parse_image_spec and supplying the keywords that identify the SVG format. */ @@ -9621,10 +9374,6 @@ svg_load_image (struct frame *f, struct image *img, char *contents, #ifdef HAVE_GHOSTSCRIPT -static bool gs_image_p (Lisp_Object object); -static bool gs_load (struct frame *f, struct image *img); -static void gs_clear_image (struct frame *f, struct image *img); - /* Indices of image specification fields in gs_format, below. */ enum gs_keyword_index @@ -9665,28 +9414,6 @@ static const struct image_keyword gs_format[GS_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -/* Structure describing the image type `ghostscript'. */ - -static struct image_type gs_type = -{ - SYMBOL_INDEX (Qpostscript), - gs_image_p, - gs_load, - gs_clear_image, - NULL, - NULL -}; - - -/* Free X resources of Ghostscript image IMG which is used on frame F. */ - -static void -gs_clear_image (struct frame *f, struct image *img) -{ - image_clear_image (f, img); -} - - /* Return true if OBJECT is a valid Ghostscript image specification. */ @@ -9965,87 +9692,86 @@ the library file(s) specified by `dynamic-library-alist'. */) return lookup_image_type (type) ? Qt : Qnil; } -/* Look up image type TYPE, and return a pointer to its image_type - structure. Return 0 if TYPE is not a known image type. */ - -static struct image_type * -lookup_image_type (Lisp_Object type) +static bool +initialize_image_type (struct image_type const *type) { - /* Types pbm and xbm are built-in and always available. */ - if (EQ (type, Qpbm)) - return define_image_type (&pbm_type); - - if (EQ (type, Qxbm)) - return define_image_type (&xbm_type); +#ifdef WINDOWSNT + bool (*init) (void) = type->init; -#if defined (HAVE_XPM) || defined (HAVE_NS) - if (EQ (type, Qxpm)) - return define_image_type (&xpm_type); + if (init) + { + /* If we failed to load the library before, don't try again. */ + Lisp_Object typesym = builtin_lisp_symbol (type->type); + Lisp_Object tested = Fassq (typesym, Vlibrary_cache); + if (CONSP (tested) && NILP (XCDR (tested))) + return false; + bool type_valid = init (); + Vlibrary_cache = Fcons (Fcons (typesym, type_valid ? Qt : Qnil), + Vlibrary_cache); + return type_valid; + } #endif + return true; +} -#if defined (HAVE_JPEG) || defined (HAVE_NS) - if (EQ (type, Qjpeg)) - return define_image_type (&jpeg_type); -#endif +/* Array of supported image types. */ -#if defined (HAVE_TIFF) || defined (HAVE_NS) - if (EQ (type, Qtiff)) - return define_image_type (&tiff_type); +static struct image_type const image_types[] = +{ +#ifdef HAVE_GHOSTSCRIPT + { SYMBOL_INDEX (Qpostscript), gs_image_p, gs_load, image_clear_image }, #endif - -#if defined (HAVE_GIF) || defined (HAVE_NS) - if (EQ (type, Qgif)) - return define_image_type (&gif_type); +#ifdef HAVE_IMAGEMAGICK + { SYMBOL_INDEX (Qimagemagick), imagemagick_image_p, imagemagick_load, + imagemagick_clear_image }, #endif - -#if defined (HAVE_PNG) || defined (HAVE_NS) || defined (USE_CAIRO) - if (EQ (type, Qpng)) - return define_image_type (&png_type); +#ifdef HAVE_RSVG + { SYMBOL_INDEX (Qsvg), svg_image_p, svg_load, image_clear_image, + IMAGE_TYPE_INIT (init_svg_functions) }, #endif - -#if defined (HAVE_RSVG) - if (EQ (type, Qsvg)) - return define_image_type (&svg_type); +#if defined HAVE_PNG || defined HAVE_NS || defined USE_CAIRO + { SYMBOL_INDEX (Qpng), png_image_p, png_load, image_clear_image, + IMAGE_TYPE_INIT (init_png_functions) }, #endif - -#if defined (HAVE_IMAGEMAGICK) - if (EQ (type, Qimagemagick)) - return define_image_type (&imagemagick_type); +#if defined HAVE_GIF || defined HAVE_NS + { SYMBOL_INDEX (Qgif), gif_image_p, gif_load, gif_clear_image, + IMAGE_TYPE_INIT (init_gif_functions) }, #endif - -#ifdef HAVE_GHOSTSCRIPT - if (EQ (type, Qpostscript)) - return define_image_type (&gs_type); +#if defined HAVE_TIFF || defined HAVE_NS + { SYMBOL_INDEX (Qtiff), tiff_image_p, tiff_load, image_clear_image, + IMAGE_TYPE_INIT (init_tiff_functions) }, #endif +#if defined HAVE_JPEG || defined HAVE_NS + { SYMBOL_INDEX (Qjpeg), jpeg_image_p, jpeg_load, image_clear_image, + IMAGE_TYPE_INIT (init_jpeg_functions) }, +#endif +#if defined HAVE_XPM || defined HAVE_NS + { SYMBOL_INDEX (Qxpm), xpm_image_p, xpm_load, image_clear_image, + IMAGE_TYPE_INIT (init_xpm_functions) }, +#endif + { SYMBOL_INDEX (Qxbm), xbm_image_p, xbm_load, image_clear_image }, + { SYMBOL_INDEX (Qpbm), pbm_image_p, pbm_load, image_clear_image }, +}; - return NULL; -} - -#if defined HAVE_UNEXEC && defined HAVE_WINDOW_SYSTEM - -/* Reset image_types before dumping. - Called from Fdump_emacs. */ +/* Look up image type TYPE, and return a pointer to its image_type + structure. Return 0 if TYPE is not a known image type. */ -void -reset_image_types (void) +static struct image_type const * +lookup_image_type (Lisp_Object type) { - while (image_types) + for (int i = 0; i < ARRAYELTS (image_types); i++) { - struct image_type *next = image_types->next; - xfree (image_types); - image_types = next; + struct image_type const *r = &image_types[i]; + if (EQ (type, builtin_lisp_symbol (r->type))) + return initialize_image_type (r) ? r : NULL; } + return NULL; } -#endif + void syms_of_image (void) { - /* Initialize this only once; it will be reset before dumping. */ - /* The portable dumper will just leave it NULL, so no need to reset. */ - image_types = NULL; - PDUMPER_IGNORE (image_types); - /* Must be defined now because we're going to update it below, while defining the supported image types. */ DEFVAR_LISP ("image-types", Vimage_types, @@ -10096,7 +9822,7 @@ non-numeric, there is no explicit limit on the size of images. */); DEFSYM (QCmax_width, ":max-width"); DEFSYM (QCmax_height, ":max-height"); #ifdef HAVE_GHOSTSCRIPT - ADD_IMAGE_TYPE (Qpostscript); + add_image_type (Qpostscript); DEFSYM (QCloader, ":loader"); DEFSYM (QCpt_width, ":pt-width"); DEFSYM (QCpt_height, ":pt-height"); @@ -10136,44 +9862,44 @@ non-numeric, there is no explicit limit on the size of images. */); #endif DEFSYM (Qpbm, "pbm"); - ADD_IMAGE_TYPE (Qpbm); + add_image_type (Qpbm); DEFSYM (Qxbm, "xbm"); - ADD_IMAGE_TYPE (Qxbm); + add_image_type (Qxbm); #if defined (HAVE_XPM) || defined (HAVE_NS) DEFSYM (Qxpm, "xpm"); - ADD_IMAGE_TYPE (Qxpm); + add_image_type (Qxpm); #endif #if defined (HAVE_JPEG) || defined (HAVE_NS) DEFSYM (Qjpeg, "jpeg"); - ADD_IMAGE_TYPE (Qjpeg); + add_image_type (Qjpeg); #endif #if defined (HAVE_TIFF) || defined (HAVE_NS) DEFSYM (Qtiff, "tiff"); - ADD_IMAGE_TYPE (Qtiff); + add_image_type (Qtiff); #endif #if defined (HAVE_GIF) || defined (HAVE_NS) DEFSYM (Qgif, "gif"); - ADD_IMAGE_TYPE (Qgif); + add_image_type (Qgif); #endif #if defined (HAVE_PNG) || defined (HAVE_NS) DEFSYM (Qpng, "png"); - ADD_IMAGE_TYPE (Qpng); + add_image_type (Qpng); #endif #if defined (HAVE_IMAGEMAGICK) DEFSYM (Qimagemagick, "imagemagick"); - ADD_IMAGE_TYPE (Qimagemagick); + add_image_type (Qimagemagick); #endif #if defined (HAVE_RSVG) DEFSYM (Qsvg, "svg"); - ADD_IMAGE_TYPE (Qsvg); + add_image_type (Qsvg); #ifdef HAVE_NTGUI /* Other libraries used directly by svg code. */ DEFSYM (Qgdk_pixbuf, "gdk-pixbuf"); diff --git a/src/lisp.h b/src/lisp.h index 77f23be66b..876b757bf3 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3643,7 +3643,6 @@ extern void init_fringe_once (void); /* Defined in image.c. */ extern int x_bitmap_mask (struct frame *, ptrdiff_t); -extern void reset_image_types (void); extern void syms_of_image (void); #ifdef HAVE_JSON commit 4fbcecfaef8a3773b605c183c4da66cdabb39eef Author: Stefan Monnier Date: Fri May 17 14:42:36 2019 -0400 * lisp/gnus/gnus-sum.el (gnus-tmp-thread): New var The recent change to use lexical-binding introduced a bug because gnus-summary-line-format-alist refers to variable `thread` which is now lexical and hence not available there any more. Replace it with a dynamically scoped var `gnus-tmp-thread` as was already done with all other vars. (gnus-summary-line-format-alist): Use it instead of `thread`. (gnus-summary-prepare-threads): Bind it around call to (eval gnus-summary-line-format-spec). diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index f761fdb794..556fb63a07 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -50,6 +50,7 @@ (defvar gnus-tmp-score-char) (defvar gnus-tmp-subject) (defvar gnus-tmp-subject-or-nil) +(defvar gnus-tmp-thread) (defvar gnus-tmp-unread) (defvar gnus-tmp-unread-and-unselected) (defvar gnus-tmp-unread-and-unticked) @@ -1443,15 +1444,17 @@ the normal Gnus MIME machinery." (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s) (?i gnus-tmp-score ?d) (?z gnus-tmp-score-char ?c) - (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d) + (?V (gnus-thread-total-score + (and (boundp 'gnus-tmp-thread) (car gnus-tmp-thread))) + ?d) (?U gnus-tmp-unread ?c) (?f (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header gnus-tmp-from) ?s) (?t (gnus-summary-number-of-articles-in-thread - (and (boundp 'thread) (car thread)) gnus-tmp-level) + (and (boundp 'gnus-tmp-thread) (car gnus-tmp-thread)) gnus-tmp-level) ?d) (?e (gnus-summary-number-of-articles-in-thread - (and (boundp 'thread) (car thread)) gnus-tmp-level t) + (and (boundp 'gnus-tmp-thread) (car gnus-tmp-thread)) gnus-tmp-level t) ?c) (?u gnus-tmp-user-defined ?s) (?P (gnus-pick-line-number) ?d) @@ -3786,9 +3789,9 @@ buffer that was in action when the last article was fetched." (setq gnus-tmp-name gnus-tmp-from)) (unless (numberp gnus-tmp-lines) (setq gnus-tmp-lines -1)) - (if (= gnus-tmp-lines -1) - (setq gnus-tmp-lines "?") - (setq gnus-tmp-lines (number-to-string gnus-tmp-lines))) + (setq gnus-tmp-lines (if (= gnus-tmp-lines -1) + "?" + (number-to-string gnus-tmp-lines))) (condition-case () (put-text-property (point) @@ -5265,7 +5268,7 @@ or a straight list of headers." gnus-tmp-header gnus-tmp-unread gnus-tmp-downloaded gnus-tmp-replied gnus-tmp-subject-or-nil gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score - gnus-tmp-score-char gnus-tmp-from gnus-tmp-name + gnus-tmp-score-char gnus-tmp-from gnus-tmp-name gnus-tmp-thread gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket tree-stack) @@ -5516,9 +5519,10 @@ or a straight list of headers." (setq gnus-tmp-name gnus-tmp-from)) (unless (numberp gnus-tmp-lines) (setq gnus-tmp-lines -1)) - (if (= gnus-tmp-lines -1) - (setq gnus-tmp-lines "?") - (setq gnus-tmp-lines (number-to-string gnus-tmp-lines))) + (setq gnus-tmp-lines (if (= gnus-tmp-lines -1) + "?" + (number-to-string gnus-tmp-lines))) + (setq gnus-tmp-thread thread) (put-text-property (point) (progn (eval gnus-summary-line-format-spec) (point)) commit deb88392c61d9cdf99f2fbe432c16d995541e2c0 Author: Lars Ingebrigtsen Date: Fri May 17 13:55:43 2019 +0200 Move Info-edit-* commands from info.el to obsolete/info-edit.el * lisp/info.el: Move Info-edit-* commands to obsolete/info-edit.el. * lisp/obsolete/info-edit.el: New file. diff --git a/lisp/info.el b/lisp/info.el index 2882262aad..c211887a39 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -380,12 +380,6 @@ with wrapping around the current Info node." :type 'hook :group 'info) -(defvar Info-edit-mode-hook nil - "Hook run when `Info-edit-mode' is activated.") - -(make-obsolete-variable 'Info-edit-mode-hook - "editing Info nodes by hand is not recommended." "24.4") - (defvar-local Info-current-file nil "Info file that Info is now looking at, or nil. This is the name that was specified in Info, not the actual file name. @@ -4384,59 +4378,6 @@ Advanced commands: (copy-marker (marker-position m))) (make-marker)))))) -(define-obsolete-variable-alias 'Info-edit-map 'Info-edit-mode-map "24.1") -(defvar Info-edit-mode-map (let ((map (make-sparse-keymap))) - (set-keymap-parent map text-mode-map) - (define-key map "\C-c\C-c" 'Info-cease-edit) - map) - "Local keymap used within `e' command of Info.") - -(make-obsolete-variable 'Info-edit-mode-map - "editing Info nodes by hand is not recommended." - "24.4") - -;; Info-edit mode is suitable only for specially formatted data. -(put 'Info-edit-mode 'mode-class 'special) - -(define-derived-mode Info-edit-mode text-mode "Info Edit" - "Major mode for editing the contents of an Info node. -Like text mode with the addition of `Info-cease-edit' -which returns to Info mode for browsing." - (setq buffer-read-only nil) - (force-mode-line-update) - (buffer-enable-undo (current-buffer))) - -(make-obsolete 'Info-edit-mode - "editing Info nodes by hand is not recommended." "24.4") - -(defun Info-edit () - "Edit the contents of this Info node." - (interactive) - (Info-edit-mode) - (message "%s" (substitute-command-keys - "Editing: Type \\\\[Info-cease-edit] to return to info"))) - -(put 'Info-edit 'disabled "Editing Info nodes by hand is not recommended. -This feature will be removed in future.") - -(make-obsolete 'Info-edit - "editing Info nodes by hand is not recommended." "24.4") - -(defun Info-cease-edit () - "Finish editing Info node; switch back to Info proper." - (interactive) - ;; Do this first, so nothing has changed if user C-g's at query. - (and (buffer-modified-p) - (y-or-n-p "Save the file? ") - (save-buffer)) - (Info-mode) - (force-mode-line-update) - (and (marker-position Info-tag-table-marker) - (buffer-modified-p) - (message "Tags may have changed. Use Info-tagify if necessary"))) - -(make-obsolete 'Info-cease-edit - "editing Info nodes by hand is not recommended." "24.4") (defvar Info-file-list-for-emacs '("ediff" "eudc" "forms" "gnus" "info" ("Info" . "info") ("mh" . "mh-e") diff --git a/lisp/obsolete/info-edit.el b/lisp/obsolete/info-edit.el new file mode 100644 index 0000000000..b64e84003f --- /dev/null +++ b/lisp/obsolete/info-edit.el @@ -0,0 +1,83 @@ +;; info-edit.el --- Editing info files -*- lexical-binding:t -*- + +;; Copyright (C) 1985-1986, 1992-2019 Free Software Foundation, Inc. + +;; Maintainer: emacs-devel@gnu.org +;; Keywords: help +;; Obsolete-since: 24.4 + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; 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 . + +;;; Commentary: + +;;; Code: + +(require 'info) + +(defvar Info-edit-mode-hook nil + "Hook run when `Info-edit-mode' is activated.") + +(make-obsolete-variable 'Info-edit-mode-hook + "editing Info nodes by hand is not recommended." "24.4") + +(define-obsolete-variable-alias 'Info-edit-map 'Info-edit-mode-map "24.1") +(defvar Info-edit-mode-map (let ((map (make-sparse-keymap))) + (set-keymap-parent map text-mode-map) + (define-key map "\C-c\C-c" 'Info-cease-edit) + map) + "Local keymap used within `e' command of Info.") + +(make-obsolete-variable 'Info-edit-mode-map + "editing Info nodes by hand is not recommended." + "24.4") + +;; Info-edit mode is suitable only for specially formatted data. +(put 'Info-edit-mode 'mode-class 'special) + +(define-derived-mode Info-edit-mode text-mode "Info Edit" + "Major mode for editing the contents of an Info node. +Like text mode with the addition of `Info-cease-edit' +which returns to Info mode for browsing." + (setq buffer-read-only nil) + (force-mode-line-update) + (buffer-enable-undo (current-buffer))) + +(defun Info-edit () + "Edit the contents of this Info node." + (interactive) + (Info-edit-mode) + (message "%s" (substitute-command-keys + "Editing: Type \\\\[Info-cease-edit] to return to info"))) + +(put 'Info-edit 'disabled "Editing Info nodes by hand is not recommended. +This feature will be removed in future.") + +(defun Info-cease-edit () + "Finish editing Info node; switch back to Info proper." + (interactive) + ;; Do this first, so nothing has changed if user C-g's at query. + (and (buffer-modified-p) + (y-or-n-p "Save the file? ") + (save-buffer)) + (Info-mode) + (force-mode-line-update) + (and (marker-position Info-tag-table-marker) + (buffer-modified-p) + (message "Tags may have changed. Use Info-tagify if necessary"))) + +(provide 'info-edit) + +;;; info-edit.el ends here commit 81ce8d9d11fa89fd4a636af5ef63eadf8f605e58 Author: Lars Ingebrigtsen Date: Fri May 17 12:27:26 2019 +0200 Use cl-assert instead of assert in ps-print.el * lisp/ps-print.el (ps-begin-job): Use cl-assert instead of assert and require cl-lib. diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 8569500fe0..59ac84a363 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -12,6 +12,8 @@ ;; Version: 7.3.5 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre +(eval-when-compile (require 'cl-lib)) + (defconst ps-print-version "7.3.5" "ps-print.el, v 7.3.5 <2009/12/23 vinicius> @@ -5829,7 +5831,7 @@ XSTART YSTART are the relative position for the first page in a sheet.") ;; They may be overridden by ps-mule-begin-job. ps-basic-plot-string-function 'ps-basic-plot-string ps-encode-header-string-function nil) - (assert (not (multibyte-string-p ps-control-or-escape-regexp))) + (cl-assert (not (multibyte-string-p ps-control-or-escape-regexp))) ;; initialize page dimensions (ps-get-page-dimensions) ;; final check commit 004ef8a8e162639a5de9b6abe49ce741a6da00c3 Author: Lars Ingebrigtsen Date: Fri May 17 12:16:19 2019 +0200 (ps-begin-job): Remove two unneeded string-as-unibyte calls * lisp/ps-print.el (ps-begin-job): Remove two unneeded string-as-unibyte calls to avoid byte compilation warnings. diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 881d6a8f4b..8569500fe0 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -5772,9 +5772,9 @@ XSTART YSTART are the relative position for the first page in a sheet.") ps-footer-font-size-internal (ps-get-font-size 'ps-footer-font-size) ps-control-or-escape-regexp (cond ((eq ps-print-control-characters '8-bit) - (string-as-unibyte "[\000-\037\177-\377]")) + "[\000-\037\177-\377]") ((eq ps-print-control-characters 'control-8-bit) - (string-as-unibyte "[\000-\037\177-\237]")) + "[\000-\037\177-\237]") ((eq ps-print-control-characters 'control) "[\000-\037\177]") (t "[\t\n\f]")) @@ -5829,6 +5829,7 @@ XSTART YSTART are the relative position for the first page in a sheet.") ;; They may be overridden by ps-mule-begin-job. ps-basic-plot-string-function 'ps-basic-plot-string ps-encode-header-string-function nil) + (assert (not (multibyte-string-p ps-control-or-escape-regexp))) ;; initialize page dimensions (ps-get-page-dimensions) ;; final check