Commit 215d9fcb authored by Glenn Morris's avatar Glenn Morris

Merge from origin/emacs-27

52080b57 (origin/emacs-27) * lisp/minibuffer.el (read-file-name-def...
e4cec1fd ; * etc/NEWS: Fix some file name quotations.
13995f31 Make emacs prefer an existing ~/.emacs.d to an existing XD...
91cac249 ; etc/NEWS minor edits
5505babc Describe --with-cairo non-support for bitmapped fonts.
caf00066 Mention GTK font chooser changes in NEWS
23b87db6 ; Unmaintain fortran elisp
3b0d1a50 f90: handle F2008 module function
55803cc1 Move shell-related menu items to "Shell Commands" submenu ...
2be48605 * admin/notes/font-backend: Remove outdated file. (Bug#34663)
f07a4701 Declare the ftx font backend driver obsolete
6c08a430 ; Fix wording of a comment.

# Conflicts:
#	admin/notes/font-backend
#	etc/NEWS
parents 0f4fa004 52080b57
Pipeline #4573 passed with stage
in 77 minutes and 30 seconds
......@@ -2655,26 +2655,37 @@ library. @xref{Hooks}.
Emacs normally finds your init file in a location under your home
directory. @xref{Init File}. By default this location is
@file{~/.config/emacs/init.el} where @file{~/} stands for your home directory.
@file{~/.emacs.d/init.el} where @file{~/} stands for your home directory.
This default can be overridden as described below.
If @env{XDG_CONFIG_HOME} is set in your environment, its
value replaces @file{~/.config} in the name of the default
init file.
If the default init file's parent directory does not exist but the
directory @file{~/.emacs.d} does exist, Emacs looks for your init file
Emacs looks for your init file
using the filenames @file{~/.emacs.el}, @file{~/.emacs}, or
@file{~/.emacs.d/init.el}; you can choose to use any one of these
names. (Note that only the locations directly in your home directory
have a leading dot in the location's basename.) Although this is
backward-compatible with older Emacs versions, modern POSIX platforms
prefer putting your initialization files under @file{~/.config} so
that troubleshooting a problem that might be due to a bad init file,
or archiving a collection of init files, can be done by renaming that
directory. To help older Emacs versions find configuration files in
their current default locations, you can execute the following
Emacs Lisp code:
have a leading dot in the location's basename.)
Emacs can also look in an XDG-compatible location for @file{init.el},
the default is the directory @file{~/.config/emacs}. This can be
overriden by setting @env{XDG_CONFIG_HOME} in your environment, its
value replaces @file{~/.config} in the name of the default XDG init
file. However @file{~/.emacs.d} and @file{~/.emacs} are always
preferred if they exist, which means that you must delete or rename
them in order to use the XDG location.
Note also that if neither the XDG location nor @file{~/.emacs.d}
exist, then Emacs will create @file{~/.emacs.d} (and therefore use it
during subsequent invocations).
Emacs will set @var{user-emacs-directory} to the directory it decides
to use.
Although this is backward-compatible with older Emacs versions, modern
POSIX platforms prefer putting your initialization files under
@file{~/.config} so that troubleshooting a problem that might be due
to a bad init file, or archiving a collection of init files, can be
done by renaming that directory. To help older Emacs versions find
configuration files in their current default locations, you can
execute the following Emacs Lisp code:
@example
(make-symbolic-link ".config/emacs" "~/.emacs.d")
......@@ -2694,7 +2705,7 @@ otherwise, it looks up the home directory corresponding to that user
name in the system's data base of users.
For brevity the rest of the Emacs documentation generally uses just
the current default location @file{~/.config/emacs/init.el} for the
the current default location @file{~/.emacs.d/init.el} for the
init file.
@c LocalWords: backtab
......@@ -2740,7 +2751,7 @@ Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}.
@xref{Init File}. However, it is sometimes desirable
to have customizations that take effect during Emacs startup earlier than the
normal init file is processed. Such customizations can be put in the early
init file, @file{~/.config/emacs.d/early-init.el} or @file{~/.emacs.d/early-init.el}. This file is loaded before the
init file, @file{~/.config/emacs/early-init.el} or @file{~/.emacs.d/early-init.el}. This file is loaded before the
package system and GUI is initialized, so in it you can customize variables
that affect frame appearance as well as the package initialization process,
such as @code{package-enable-at-startup}, @code{package-load-list}, and
......
This diff is collapsed.
......@@ -924,21 +924,22 @@ open_config (char const *home, char const *xdg, char const *config_file)
char *configname = xmalloc (max (xdgsubdirsize, homesubdirsizemax)
+ strlen (config_file));
FILE *config;
if (xdg || home)
if (home)
{
strcpy ((xdg
? stpcpy (stpcpy (configname, xdg), "/emacs/server/")
: stpcpy (stpcpy (configname, home), "/.config/emacs/server/")),
config_file);
strcpy (stpcpy (stpcpy (configname, home), "/.emacs.d/server/"),
config_file);
config = fopen (configname, "rb");
}
else
config = NULL;
if (! config && home)
if (! config && (xdg || home))
{
strcpy (stpcpy (stpcpy (configname, home), "/.emacs.d/server/"),
config_file);
strcpy ((xdg
? stpcpy (stpcpy (configname, xdg), "/emacs/server/")
: stpcpy (stpcpy (configname, home), "/.config/emacs/server/")),
config_file);
config = fopen (configname, "rb");
}
......
......@@ -1649,6 +1649,27 @@ mail status in mode line"))
menu))
(defvar menu-bar-shell-commands-menu
(let ((menu (make-sparse-keymap "Shell Commands")))
(bindings--define-key menu [interactive-shell]
'(menu-item "Run Shell Interactively" shell
:help "Run a subshell interactively"))
(bindings--define-key menu [async-shell-command]
'(menu-item "Async Shell Command..." async-shell-command
:help "Invoke a shell command asynchronously in background"))
(bindings--define-key menu [shell-on-region]
'(menu-item "Shell Command on Region..." shell-command-on-region
:enable mark-active
:help "Pass marked region to a shell command"))
(bindings--define-key menu [shell]
'(menu-item "Shell Command..." shell-command
:help "Invoke a shell command and catch its output"))
menu))
(defun menu-bar-read-mail ()
"Read mail using `read-mail-command'."
(interactive)
......@@ -1740,16 +1761,14 @@ mail status in mode line"))
(bindings--define-key menu [gdb]
'(menu-item "Debugger (GDB)..." gdb
:help "Debug a program from within Emacs with GDB"))
(bindings--define-key menu [shell-on-region]
'(menu-item "Shell Command on Region..." shell-command-on-region
:enable mark-active
:help "Pass marked region to a shell command"))
(bindings--define-key menu [shell]
'(menu-item "Shell Command..." shell-command
:help "Invoke a shell command and catch its output"))
(bindings--define-key menu [compile]
'(menu-item "Compile..." compile
:help "Invoke compiler or Make, view compilation errors"))
(bindings--define-key menu [shell-commands]
`(menu-item "Shell Commands"
,menu-bar-shell-commands-menu))
(bindings--define-key menu [rgrep]
'(menu-item "Recursive Grep..." rgrep
:help "Interactively ask for parameters and search recursively"))
......
......@@ -2737,8 +2737,13 @@ See `read-file-name' for the meaning of the arguments."
(unless dir (setq dir (or default-directory "~/")))
(unless (file-name-absolute-p dir) (setq dir (expand-file-name dir)))
(unless default-filename
(setq default-filename (if initial (expand-file-name initial dir)
buffer-file-name)))
(setq default-filename
(cond
((null initial) buffer-file-name)
;; Special-case "" because (expand-file-name "" "/tmp/") returns
;; "/tmp" rather than "/tmp/" (bug#39057).
((equal "" initial) dir)
(t (expand-file-name initial dir)))))
;; If dir starts with user's homedir, change that to ~.
(setq dir (abbreviate-file-name dir))
;; Likewise for default-filename.
......
......@@ -3,7 +3,7 @@
;; Copyright (C) 1995-1997, 2000-2020 Free Software Foundation, Inc.
;; Author: Torbjörn Einarsson <Torbjorn.Einarsson@era.ericsson.se>
;; Maintainer: Glenn Morris <rgm@gnu.org>
;; Maintainer: emacs-devel@gnu.org
;; Keywords: fortran, f90, languages
;; This file is part of GNU Emacs.
......@@ -539,8 +539,10 @@ type-name parts, respectively."
read\\|write\\)\\)[ \t]*(" (1 font-lock-keyword-face t))
;; Other functions and declarations. Named interfaces = F2003.
;; F2008: end submodule submodule_name.
'("\\_<\\(\\(?:end[ \t]*\\)?\\(program\\|\\(?:sub\\)?module\\|\
function\\|associate\\|subroutine\\|interface\\)\\|use\\|call\\)\
;; F2008: module function|subroutine NAME.
'("\\_<\\(\\(?:end[ \t]*\\)?\\(program\\|\
\\(?:module[ \t]*\\)?\\(?:function\\|subroutine\\)\\|\
\\(?:sub\\)?module\\|associate\\|interface\\)\\|use\\|call\\)\
\\_>[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
(1 font-lock-keyword-face) (3 font-lock-function-name-face nil t))
;; F2008: submodule (parent_name) submodule_name.
......@@ -1381,14 +1383,19 @@ write\\)[ \t]*([^)\n]*)")
(cond
((looking-at "\\(program\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
(list (match-string 1) (match-string 2)))
((and (not (looking-at "module[ \t]*procedure\\_>"))
((and (not (looking-at "module[ \t]*\\(procedure\\|function\\|subroutine\\)\\_>"))
(looking-at "\\(module\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>"))
(list (match-string 1) (match-string 2)))
((looking-at "\\(submodule\\)[ \t]*([^)\n]+)[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
(list (match-string 1) (match-string 2)))
((and (not (looking-at "end[ \t]*\\(function\\|subroutine\\)"))
(looking-at "[^!'\"&\n]*\\(function\\|subroutine\\)[ \t]+\
((and (not (looking-at "end[ \t]*\\(function\\|procedure\\|subroutine\\)"))
(looking-at "[^!'\"&\n]*\\(?:module[ \t]*\\)?\
\\(function\\|subroutine\\)[ \t]+\
\\(\\(?:\\sw\\|\\s_\\)+\\)"))
;; TODO: In F2008 "module procedure foo" may or may not start a block,
;; It is impossible to tell the difference without parsing state.
;;; (looking-at "[^!'\"&\n]*module[ \t]*\\(procedure\\)[ \t]+\
;;;\\(\\(?:\\sw\\|\\s_\\)+\\)")))
(list (match-string 1) (match-string 2)))))
;; Following will match an un-named main program block; however
;; one needs to check if there is an actual PROGRAM statement after
......
......@@ -4,7 +4,7 @@
;; Inc.
;; Author: Michael D. Prange <prange@erl.mit.edu>
;; Maintainer: Glenn Morris <rgm@gnu.org>
;; Maintainer: emacs-devel@gnu.org
;; Keywords: fortran, languages
;; This file is part of GNU Emacs.
......
......@@ -497,28 +497,28 @@ DIRS are relative."
(defvar startup--xdg-config-home-emacs)
;; Return the name of the init file directory for Emacs, assuming
;; XDG-DIR is the XDG location and USER-NAME is the user name.
;; If USER-NAME is nil or "", use the current user.
;; Prefer the XDG location unless it does does not exist and the
;; .emacs.d location does exist.
;; XDG-DIR is the XDG location and USER-NAME is the user name. If
;; USER-NAME is nil or "", use the current user. Prefer the XDG
;; location only if the .emacs.d location does not exist.
(defun startup--xdg-or-homedot (xdg-dir user-name)
(if (file-exists-p xdg-dir)
xdg-dir
(let ((emacs-d-dir (concat "~" user-name
(if (eq system-type 'ms-dos)
"/_emacs.d/"
"/.emacs.d/"))))
(if (or (file-exists-p emacs-d-dir)
(if (eq system-type 'windows-nt)
(if (file-directory-p (concat "~" user-name))
(directory-files (concat "~" user-name) nil
"\\`[._]emacs\\(\\.elc?\\)?\\'"))
(file-exists-p (concat "~" init-file-user
(if (eq system-type 'ms-dos)
"/_emacs"
"/.emacs")))))
emacs-d-dir
xdg-dir))))
(let ((emacs-d-dir (concat "~" user-name
(if (eq system-type 'ms-dos)
"/_emacs.d/"
"/.emacs.d/"))))
(cond
((or (file-exists-p emacs-d-dir)
(if (eq system-type 'windows-nt)
(if (file-directory-p (concat "~" user-name))
(directory-files (concat "~" user-name) nil
"\\`[._]emacs\\(\\.elc?\\)?\\'"))
(file-exists-p (concat "~" init-file-user
(if (eq system-type 'ms-dos)
"/_emacs"
"/.emacs")))))
emacs-d-dir)
((file-exists-p xdg-dir)
xdg-dir)
(t emacs-d-dir))))
(defun normal-top-level ()
"Emacs calls this function when it first starts up.
......
......@@ -63,8 +63,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
Look in <sys/time.h> for a timeval structure. */
#define HAVE_TIMEVAL 1
/* And the select implementation does 1-byte read-ahead waiting
for received packets, so datagrams are broken too. */
/* Our select emulation does 1-byte read-ahead waiting for received
packets, so datagrams are broken. */
#define BROKEN_DATAGRAM_SOCKETS 1
#define MAIL_USE_SYSTEM_LOCK 1
......
......@@ -277,4 +277,24 @@ end program prog")
(forward-line -2)
(should (= 2 (current-indentation))))) ; type is
(ert-deftest f90-test-bug38415 ()
"Test for https://debbugs.gnu.org/38415 ."
(with-temp-buffer
(f90-mode)
(setq-local f90-smart-end 'no-blink)
(insert "module function foo(x)
real :: x
end")
(f90-indent-line)
(should (equal " function foo"
(buffer-substring (point) (line-end-position))))
(goto-char (point-max))
(insert "\nmodule subroutine bar(x)
real :: x
end")
(f90-indent-line)
(should (equal " subroutine bar"
(buffer-substring (point) (line-end-position))))))
;;; f90-tests.el ends here
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment