]> code.delx.au - gnu-emacs-elpa/blob - packages/ada-mode/ada-mode-compat-24.2.el
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / ada-mode / ada-mode-compat-24.2.el
1 ;; ada-mode-compat-24.2.el --- Implement current Emacs features not present in Emacs 24.2 -*- lexical-binding:t -*-
2 ;; FIXME: rename to ada-mode-compat.el, rely on functionp etc. doc emacs version for each item
3
4 ;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
5
6 ;; This file is part of GNU Emacs.
7
8 ;; GNU Emacs is free software: you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
12
13 ;; GNU Emacs is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
17
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
20
21 ;; using cl-lib 0.4 from Gnu ELPA
22
23 (when (not (functionp 'file-name-base))
24 (defun file-name-base (&optional filename)
25 "Return the base name of the FILENAME: no directory, no extension.
26 FILENAME defaults to `buffer-file-name'."
27 (file-name-sans-extension
28 (file-name-nondirectory (or filename (buffer-file-name))))))
29
30 (when (not (functionp 'font-lock-ensure))
31 (defun font-lock-ensure (&optional beg end)
32 (font-lock-fontify-region (or beg (point-min)) (or end (point-max)))))
33
34 ;; FIXME: need cl-flet, but there is no macrop
35 (provide 'ada-mode-compat-24.2)
36
37 ;; end of file