[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 00995c8 5/5: Merge from origin/emacs-26
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 00995c8 5/5: Merge from origin/emacs-26 |
Date: |
Wed, 8 Nov 2017 23:30:40 -0500 (EST) |
branch: master
commit 00995c88dde4f8078a843b48faef16668a126d9c
Merge: fae6cdc 9e59de9
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Merge from origin/emacs-26
9e59de9449 Use GCALIGNED properly for GCC
b9d7c90260 In f90.el, set fill-paragraph-function to a useful value
# Conflicts:
# src/lisp.h
---
lib-src/make-docfile.c | 2 +-
lisp/progmodes/f90.el | 18 +++++++++++++++++-
src/buffer.c | 4 ++--
src/lisp.h | 14 +++++++++-----
src/thread.c | 2 +-
5 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 0ea3f7b..ff84df9 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -668,7 +668,7 @@ close_emacs_globals (ptrdiff_t num_symbols)
"extern\n"
"#endif\n"
"struct {\n"
- " struct Lisp_Symbol GCALIGNED s;\n"
+ " struct GCALIGNED Lisp_Symbol s;\n"
"} lispsym[%td];\n"),
num_symbols);
}
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 7215628..0cd665c 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -133,7 +133,7 @@
;; f90-indent-region (can be called by calling indent-region)
;; f90-indent-subprogram
;; f90-break-line f90-join-lines
-;; f90-fill-region
+;; f90-fill-region f90-fill-paragraph
;; f90-insert-end
;; f90-upcase-keywords f90-upcase-region-keywords
;; f90-downcase-keywords f90-downcase-region-keywords
@@ -784,6 +784,7 @@ Can be overridden by the value of
`font-lock-maximum-decoration'.")
["Indent Region" f90-indent-region :active mark-active]
["Fill Region" f90-fill-region :active mark-active
:help "Fill long lines in the region"]
+ ["Fill Statement/Comment" fill-paragraph :active t]
"--"
["Break Line at Point" f90-break-line :active t
:help "Break the current line at point"]
@@ -1185,6 +1186,7 @@ with no args, if that value is non-nil."
(set (make-local-variable 'abbrev-all-caps) t)
(set (make-local-variable 'normal-auto-fill-function) 'f90-do-auto-fill)
(setq indent-tabs-mode nil) ; auto buffer local
+ (set (make-local-variable 'fill-paragraph-function) 'f90-fill-paragraph)
(set (make-local-variable 'font-lock-defaults)
'((f90-font-lock-keywords f90-font-lock-keywords-1
f90-font-lock-keywords-2
@@ -2158,6 +2160,20 @@ Like `join-line', but handles F90 syntax."
(if (featurep 'xemacs)
(zmacs-deactivate-region)
(deactivate-mark))))
+
+(defun f90-fill-paragraph (&optional justify)
+ "In a comment, fill it as a paragraph, else fill the current statement.
+For use as the value of `fill-paragraph-function'.
+Passes optional argument JUSTIFY to `fill-comment-paragraph'.
+Always returns non-nil (to prevent `fill-paragraph' being called)."
+ (interactive "*P")
+ (or (fill-comment-paragraph justify)
+ (save-excursion
+ (f90-next-statement)
+ (let ((end (if (bobp) (point) (1- (point)))))
+ (f90-previous-statement)
+ (f90-fill-region (point) end)))
+ t))
(defconst f90-end-block-optional-name
'("program" "module" "subroutine" "function" "type")
diff --git a/src/buffer.c b/src/buffer.c
index 15735a2..edeed55 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -61,7 +61,7 @@ struct buffer *all_buffers;
Setting the default value also goes through the alist of buffers
and stores into each buffer that does not say it has a local value. */
-struct buffer GCALIGNED buffer_defaults;
+struct GCALIGNED buffer buffer_defaults;
/* This structure marks which slots in a buffer have corresponding
default values in buffer_defaults.
@@ -84,7 +84,7 @@ struct buffer buffer_local_flags;
/* This structure holds the names of symbols whose values may be
buffer-local. It is indexed and accessed in the same way as the above. */
-struct buffer GCALIGNED buffer_local_symbols;
+struct GCALIGNED buffer buffer_local_symbols;
/* Return the symbol of the per-buffer variable at offset OFFSET in
the buffer structure. */
diff --git a/src/lisp.h b/src/lisp.h
index 1ce32f3..e3262ad 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -277,10 +277,14 @@ DEFINE_GDB_SYMBOL_END (VALMASK)
error !;
#endif
-/* Declare an object to have an address that is a multiple of
- GCALIGNMENT. This is a no-op if the object's natural alignment is
- already a multiple of GCALIGNMENT. alignas is not suitable here,
- as it fails if the object's natural alignment exceeds GCALIGNMENT. */
+/* Use GCALIGNED immediately after the 'struct' keyword to require the
+ struct to have an address that is a multiple of GCALIGNMENT. This
+ is a no-op if the struct's natural alignment is already a multiple
+ of GCALIGNMENT. GCALIGNED's implementation uses the 'aligned'
+ attribute instead of 'alignas (GCALIGNMENT)', as the latter would
+ fail if an object's natural alignment exceeds GCALIGNMENT. The
+ implementation hopes that natural alignment suffices on platforms
+ lacking 'aligned'. */
#ifdef HAVE_STRUCT_ATTRIBUTE_ALIGNED
# define GCALIGNED __attribute__ ((aligned (GCALIGNMENT)))
#else
@@ -2941,7 +2945,7 @@ CHECK_NUMBER_CDR (Lisp_Object x)
/* This version of DEFUN declares a function prototype with the right
arguments, so we can catch errors with maxargs at compile-time. */
#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
- static struct Lisp_Subr GCALIGNED sname = \
+ static struct GCALIGNED Lisp_Subr sname = \
{ { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS },
\
{ .a ## maxargs = fnname }, \
minargs, maxargs, lname, intspec, 0}; \
diff --git a/src/thread.c b/src/thread.c
index 03f5b31..7335833 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -26,7 +26,7 @@ along with GNU Emacs. If not, see
<https://www.gnu.org/licenses/>. */
#include "coding.h"
#include "syssignal.h"
-static struct thread_state GCALIGNED main_thread;
+static struct GCALIGNED thread_state main_thread;
struct thread_state *current_thread = &main_thread;