"Fossies" - the Fresh Open Source Software Archive

Member "auctex-12.3/style/url.el" (18 Oct 2020, 3370 Bytes) of package /linux/misc/auctex-12.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lisp source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "url.el": 12.2_vs_12.3.

    1 ;;; url.el --- AUCTeX style for `url.sty'
    2 
    3 ;; Copyright (C) 2004-2005, 2018, 2020 Free Software Foundation, Inc.
    4 
    5 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
    6 ;; Maintainer: auctex-devel@gnu.org
    7 ;; Created: 2004-10-13
    8 ;; Keywords: tex
    9 
   10 ;; This file is part of AUCTeX.
   11 
   12 ;; AUCTeX is free software; you can redistribute it and/or modify it
   13 ;; under the terms of the GNU General Public License as published by
   14 ;; the Free Software Foundation; either version 3, or (at your option)
   15 ;; any later version.
   16 
   17 ;; AUCTeX is distributed in the hope that it will be useful, but
   18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
   19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   20 ;; General Public License for more details.
   21 
   22 ;; You should have received a copy of the GNU General Public License
   23 ;; along with AUCTeX; see the file COPYING.  If not, write to the Free
   24 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   25 ;; 02110-1301, USA.
   26 
   27 ;;; Commentary:
   28 
   29 ;; This file adds support for `url.sty'.
   30 
   31 ;;; Code:
   32 
   33 ;; Silence the compiler:
   34 (declare-function font-latex-add-keywords
   35           "font-latex"
   36           (keywords class))
   37 
   38 (declare-function font-latex-set-syntactic-keywords
   39           "font-latex")
   40 
   41 (TeX-add-style-hook
   42  "url"
   43  (lambda ()
   44    ;; New symbols
   45    (TeX-add-symbols
   46     "Url"
   47     "UrlBigBreakPenalty"
   48     "UrlBigBreaks"
   49     "UrlBreakPenalty"
   50     "UrlBreaks"
   51     "UrlFont"
   52     "UrlLeft"
   53     "UrlNoBreaks"
   54     "UrlOrds"
   55     "UrlRight"
   56     "UrlSpecials"
   57     '("path" (TeX-arg-verb-delim-or-brace "Path"))
   58     ;; "hyperref" redefines \url so that the argument is only in
   59     ;; braces.  We check here if hyperref is loaded:
   60     '("url" (TeX-arg-conditional (member "hyperref" (TeX-style-list))
   61                  ("Url")
   62                      ((TeX-arg-verb-delim-or-brace "Url"))))
   63     "urldef"
   64     '("urlstyle" TeX-arg-urlstyle))
   65 
   66    (add-to-list 'LaTeX-verbatim-macros-with-delims-local "path")
   67    ;; hyperref.el has some code to remove "url" from
   68    ;; `LaTeX-verbatim-macros-with-delims-local', but we check here as
   69    ;; well if "hyperref" is already loaded:
   70    (unless (member "hyperref" (TeX-style-list))
   71      (add-to-list 'LaTeX-verbatim-macros-with-delims-local "url"))
   72    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "path")
   73    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "url")
   74 
   75    ;; Fontification
   76    (when (and (fboundp 'font-latex-add-keywords)
   77           (eq TeX-install-font-lock 'font-latex-setup))
   78      (font-latex-add-keywords '(("path" "") ("url" "")) 'reference)
   79      (font-latex-add-keywords '(("Url" "")
   80                 ("UrlBigBreakPenalty" "")
   81                 ("UrlBigBreaks" "")
   82                 ("UrlBreakPenalty" "")
   83                 ("UrlBreaks" "")
   84                 ("UrlFont" "")
   85                 ("UrlLeft" "")
   86                 ("UrlNoBreaks" "")
   87                 ("UrlOrds" "")
   88                 ("UrlRight" "")
   89                 ("UrlSpecials" "")
   90                 ("urldef" "")
   91                 ("urlstyle" "{"))
   92                   'variable)
   93      ;; Tell font-lock about the update.
   94      (font-latex-set-syntactic-keywords)))
   95  LaTeX-dialect)
   96 
   97 (defun TeX-arg-urlstyle (optional &optional prompt)
   98   "Prompt for style used in \\urlstyle with completion."
   99   (TeX-argument-insert
  100    (completing-read (TeX-argument-prompt optional prompt "Style")
  101             (mapcar 'list '("rm" "same" "sf" "tt"))
  102             nil t)
  103    optional))
  104 
  105 (defvar LaTeX-url-package-options '("hyphens" "obeyspaces" "spaces" "LY1"
  106                     "T1" "allowmove")
  107   "Package options for the url package.")
  108 
  109 ;;; url.el ends here