aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2018-10-21 14:36:10 -0400
committerStefan Monnier2018-10-21 14:36:10 -0400
commit08192e40093bdbc8e6be6b283935b51c12d66eca (patch)
treea6ae55aa7ba3e403db9dd11d6a37058d764d89b0
parent17252062b03defe9eac6a510e88b87932ef400fe (diff)
downloademacs-08192e40093bdbc8e6be6b283935b51c12d66eca.tar.gz
emacs-08192e40093bdbc8e6be6b283935b51c12d66eca.zip
Always define 'define-fringe-bitmap'
* lisp/cus-start.el: Test 'fringe-bitmaps' to see if fringe.c was compiled. * lisp/fringe.el: Use lexical-binding. (define-fringe-bitmap): Provide a fallback implementation. * lisp/progmodes/flymake.el (flymake-double-exclamation-mark): Define unconditionally. * lisp/progmodes/gdb-mi.el (define-fringe-bitmap): Don't declare any more. (breakpoint, hollow-right-triangle): Define unconditionally.
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/cus-start.el2
-rw-r--r--lisp/fringe.el20
-rw-r--r--lisp/progmodes/flymake.el37
-rw-r--r--lisp/progmodes/gdb-mi.el16
5 files changed, 47 insertions, 31 deletions
diff --git a/etc/NEWS b/etc/NEWS
index be6668ed42e..7a98b492f13 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -876,6 +876,9 @@ documentation of the new mode and its commands.
876 876
877* Incompatible Lisp Changes in Emacs 27.1 877* Incompatible Lisp Changes in Emacs 27.1
878 878
879** define-fringe-bitmap is always defined, even when Emacs is built
880without any GUI support.
881
879--- 882---
880** Just loading a theme's file no longer activates the theme's settings. 883** Just loading a theme's file no longer activates the theme's settings.
881Loading a theme with 'M-x load-theme' still activates the theme, as it 884Loading a theme with 'M-x load-theme' still activates the theme, as it
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index e33fe6e5ecf..133e94fcdb1 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -685,7 +685,7 @@ since it could result in memory overflow and make Emacs crash."
685 ((string-match "selection" (symbol-name symbol)) 685 ((string-match "selection" (symbol-name symbol))
686 (fboundp 'x-selection-exists-p)) 686 (fboundp 'x-selection-exists-p))
687 ((string-match "fringe" (symbol-name symbol)) 687 ((string-match "fringe" (symbol-name symbol))
688 (fboundp 'define-fringe-bitmap)) 688 (boundp 'fringe-bitmaps))
689 ((string-match "\\`imagemagick" (symbol-name symbol)) 689 ((string-match "\\`imagemagick" (symbol-name symbol))
690 (fboundp 'imagemagick-types)) 690 (fboundp 'imagemagick-types))
691 ((equal "font-use-system-font" (symbol-name symbol)) 691 ((equal "font-use-system-font" (symbol-name symbol))
diff --git a/lisp/fringe.el b/lisp/fringe.el
index a806b4e6a19..583a0e2c20b 100644
--- a/lisp/fringe.el
+++ b/lisp/fringe.el
@@ -1,4 +1,4 @@
1;;; fringe.el --- fringe setup and control 1;;; fringe.el --- fringe setup and control -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2002-2018 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2018 Free Software Foundation, Inc.
4 4
@@ -291,6 +291,24 @@ SIDE must be the symbol `left' or `right'."
291 0) 291 0)
292 (float (frame-char-width)))) 292 (float (frame-char-width))))
293 293
294;;;###autoload
295(unless (fboundp 'define-fringe-bitmap)
296 (defun define-fringe-bitmap (_bitmap _bits &optional _height _width _align)
297 "Define fringe bitmap BITMAP from BITS of size HEIGHT x WIDTH.
298BITMAP is a symbol identifying the new fringe bitmap.
299BITS is either a string or a vector of integers.
300HEIGHT is height of bitmap. If HEIGHT is nil, use length of BITS.
301WIDTH must be an integer between 1 and 16, or nil which defaults to 8.
302Optional fifth arg ALIGN may be one of ‘top’, ‘center’, or ‘bottom’,
303indicating the positioning of the bitmap relative to the rows where it
304is used; the default is to center the bitmap. Fifth arg may also be a
305list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap
306should be repeated.
307If BITMAP already exists, the existing definition is replaced."
308 ;; This is a fallback for non-GUI builds.
309 ;; The real implementation is in src/fringe.c.
310 ))
311
294(provide 'fringe) 312(provide 'fringe)
295 313
296;;; fringe.el ends here 314;;; fringe.el ends here
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 60d1660e5fe..5831301a57c 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -219,25 +219,24 @@ Specifically, start it when the saved buffer is actually displayed."
219 :version "26.1" 219 :version "26.1"
220 :type 'boolean) 220 :type 'boolean)
221 221
222(when (fboundp 'define-fringe-bitmap) 222(define-fringe-bitmap 'flymake-double-exclamation-mark
223 (define-fringe-bitmap 'flymake-double-exclamation-mark 223 (vector #b00000000
224 (vector #b00000000 224 #b00000000
225 #b00000000 225 #b00000000
226 #b00000000 226 #b00000000
227 #b00000000 227 #b01100110
228 #b01100110 228 #b01100110
229 #b01100110 229 #b01100110
230 #b01100110 230 #b01100110
231 #b01100110 231 #b01100110
232 #b01100110 232 #b01100110
233 #b01100110 233 #b01100110
234 #b01100110 234 #b01100110
235 #b01100110 235 #b00000000
236 #b00000000 236 #b01100110
237 #b01100110 237 #b00000000
238 #b00000000 238 #b00000000
239 #b00000000 239 #b00000000))
240 #b00000000)))
241 240
242(defvar-local flymake-timer nil 241(defvar-local flymake-timer nil
243 "Timer for starting syntax check.") 242 "Timer for starting syntax check.")
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index da979de5400..32bdc315a42 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1741,16 +1741,12 @@ static char *magick[] = {
1741(defvar breakpoint-disabled-icon nil 1741(defvar breakpoint-disabled-icon nil
1742 "Icon for disabled breakpoint in display margin.") 1742 "Icon for disabled breakpoint in display margin.")
1743 1743
1744(declare-function define-fringe-bitmap "fringe.c" 1744;; Bitmap for breakpoint in fringe
1745 (bitmap bits &optional height width align)) 1745(define-fringe-bitmap 'breakpoint
1746 1746 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")
1747(and (display-images-p) 1747;; Bitmap for gud-overlay-arrow in fringe
1748 ;; Bitmap for breakpoint in fringe 1748(define-fringe-bitmap 'hollow-right-triangle
1749 (define-fringe-bitmap 'breakpoint 1749 "\xe0\x90\x88\x84\x84\x88\x90\xe0")
1750 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")
1751 ;; Bitmap for gud-overlay-arrow in fringe
1752 (define-fringe-bitmap 'hollow-right-triangle
1753 "\xe0\x90\x88\x84\x84\x88\x90\xe0"))
1754 1750
1755(defface breakpoint-enabled 1751(defface breakpoint-enabled
1756 '((t 1752 '((t