2021-03-15 00:08:34 -04:00
|
|
|
|
;;; semantic/texi.el --- Semantic details for Texinfo files -*- lexical-binding: t; -*-
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
2022-01-01 02:45:51 -05:00
|
|
|
|
;; Copyright (C) 2001-2005, 2007-2022 Free Software Foundation, Inc.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
;; Author: Eric M. Ludlam <zappo@gnu.org>
|
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 15:52:52 -07:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;
|
|
|
|
|
;; Parse Texinfo buffers using regular expressions. The core parser
|
|
|
|
|
;; engine is the function `semantic-texi-parse-headings'. The
|
|
|
|
|
;; parser plug-in is the function `semantic-texi-parse-region' that
|
|
|
|
|
;; overrides `semantic-parse-region'.
|
|
|
|
|
|
2012-10-25 22:13:16 +02:00
|
|
|
|
(require 'semantic/db-find)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(require 'semantic/format)
|
2012-10-25 22:13:16 +02:00
|
|
|
|
(require 'semantic/ctxt)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(require 'texinfo)
|
|
|
|
|
|
2009-09-05 21:20:17 +00:00
|
|
|
|
(defvar ede-minor-mode)
|
2013-09-28 10:54:27 +08:00
|
|
|
|
(declare-function ispell-lookup-words "ispell")
|
2009-09-05 21:20:17 +00:00
|
|
|
|
(declare-function ede-current-project "ede")
|
2009-09-03 03:58:13 +00:00
|
|
|
|
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(defvar semantic-texi-super-regex
|
|
|
|
|
"^@\\(top\\|chapter\\|\\(sub\\)*section\\|unnumbered\\(\\(sub\\)*sec\\)?\\|\
|
|
|
|
|
\\(chap\\|\\(sub\\)+\\|major\\)?heading\\|appendix\\(\\(sub\\)*sec\\)?\\|\
|
|
|
|
|
centerchap\\|def\\(var\\|un\\|fn\\|opt\\)x?\\)"
|
|
|
|
|
"Regular expression used to find special sections in a Texinfo file.")
|
|
|
|
|
|
|
|
|
|
(defvar semantic-texi-name-field-list
|
|
|
|
|
'( ("defvar" . 1)
|
|
|
|
|
("defvarx" . 1)
|
|
|
|
|
("defun" . 1)
|
|
|
|
|
("defunx" . 1)
|
|
|
|
|
("defopt" . 1)
|
|
|
|
|
("deffn" . 2)
|
|
|
|
|
("deffnx" . 2)
|
|
|
|
|
)
|
|
|
|
|
"List of definition commands, and the field position.
|
|
|
|
|
The field position is the field number (based at 1) where the
|
|
|
|
|
name of this section is.")
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
2021-03-15 00:08:34 -04:00
|
|
|
|
(defun semantic-texi-parse-region (&rest _ignore)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
"Parse the current texinfo buffer for semantic tags.
|
|
|
|
|
IGNORE any arguments, always parse the whole buffer.
|
|
|
|
|
Each tag returned is of the form:
|
|
|
|
|
(\"NAME\" section (:members CHILDREN))
|
|
|
|
|
or
|
|
|
|
|
(\"NAME\" def)
|
|
|
|
|
|
2019-10-24 23:06:23 -04:00
|
|
|
|
It is an override of `semantic-parse-region' and must be installed by the
|
2009-08-29 19:00:35 +00:00
|
|
|
|
function `semantic-install-function-overrides'."
|
2019-10-24 23:06:23 -04:00
|
|
|
|
(mapcar #'semantic-texi-expand-tag
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(semantic-texi-parse-headings)))
|
|
|
|
|
|
|
|
|
|
(defun semantic-texi-parse-changes ()
|
|
|
|
|
"Parse changes in the current texinfo buffer."
|
|
|
|
|
;; NOTE: For now, just schedule a full reparse.
|
|
|
|
|
;; To be implemented later.
|
|
|
|
|
(semantic-parse-tree-set-needs-rebuild))
|
|
|
|
|
|
|
|
|
|
(defun semantic-texi-expand-tag (tag)
|
|
|
|
|
"Expand the texinfo tag TAG."
|
|
|
|
|
(let ((chil (semantic-tag-components tag)))
|
|
|
|
|
(if chil
|
|
|
|
|
(semantic-tag-put-attribute
|
2021-03-15 00:08:34 -04:00
|
|
|
|
tag :members (mapcar #'semantic-texi-expand-tag chil)))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(car (semantic--tag-expand tag))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-texi-parse-headings ()
|
|
|
|
|
"Parse the current texinfo buffer for all semantic tags now."
|
|
|
|
|
(let ((pass1 nil))
|
|
|
|
|
;; First search and snarf.
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(let ((semantic--progress-reporter
|
|
|
|
|
(make-progress-reporter
|
|
|
|
|
(format "Parsing %s..."
|
|
|
|
|
(file-name-nondirectory buffer-file-name))
|
|
|
|
|
(point-min) (point-max))))
|
|
|
|
|
(while (re-search-forward semantic-texi-super-regex nil t)
|
|
|
|
|
(setq pass1 (cons (match-beginning 0) pass1))
|
|
|
|
|
(progress-reporter-update semantic--progress-reporter (point)))
|
|
|
|
|
(progress-reporter-done semantic--progress-reporter)))
|
|
|
|
|
(setq pass1 (nreverse pass1))
|
|
|
|
|
;; Now, make some tags while creating a set of children.
|
|
|
|
|
(car (semantic-texi-recursive-combobulate-list pass1 0))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(defsubst semantic-texi-new-section-tag (name members start end)
|
|
|
|
|
"Create a semantic tag of class section.
|
|
|
|
|
NAME is the name of this section.
|
|
|
|
|
MEMBERS is a list of semantic tags representing the elements that make
|
|
|
|
|
up this section.
|
|
|
|
|
START and END define the location of data described by the tag."
|
|
|
|
|
(append (semantic-tag name 'section :members members)
|
|
|
|
|
(list start end)))
|
|
|
|
|
|
|
|
|
|
(defsubst semantic-texi-new-def-tag (name start end)
|
|
|
|
|
"Create a semantic tag of class def.
|
|
|
|
|
NAME is the name of this definition.
|
|
|
|
|
START and END define the location of data described by the tag."
|
|
|
|
|
(append (semantic-tag name 'def)
|
|
|
|
|
(list start end)))
|
|
|
|
|
|
|
|
|
|
(defun semantic-texi-set-endpoint (metataglist pnt)
|
|
|
|
|
"Set the end point of the first section tag in METATAGLIST to PNT.
|
|
|
|
|
METATAGLIST is a list of tags in the intermediate tag format used by the
|
|
|
|
|
texinfo parser. PNT is the new point to set."
|
|
|
|
|
(let ((metatag nil))
|
|
|
|
|
(while (and metataglist
|
|
|
|
|
(not (eq (semantic-tag-class (car metataglist)) 'section)))
|
|
|
|
|
(setq metataglist (cdr metataglist)))
|
|
|
|
|
(setq metatag (car metataglist))
|
|
|
|
|
(when metatag
|
|
|
|
|
(setcar (nthcdr (1- (length metatag)) metatag) pnt)
|
|
|
|
|
metatag)))
|
|
|
|
|
|
|
|
|
|
(defun semantic-texi-recursive-combobulate-list (sectionlist level)
|
|
|
|
|
"Rearrange SECTIONLIST to be a hierarchical tag list starting at LEVEL.
|
|
|
|
|
Return the rearranged new list, with all remaining tags from
|
|
|
|
|
SECTIONLIST starting at ELT 2. Sections not are not dealt with as soon as a
|
|
|
|
|
tag with greater section value than LEVEL is found."
|
|
|
|
|
(let ((newl nil)
|
|
|
|
|
(oldl sectionlist)
|
|
|
|
|
tag
|
|
|
|
|
)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(catch 'level-jump
|
|
|
|
|
(while oldl
|
|
|
|
|
(goto-char (car oldl))
|
|
|
|
|
(if (looking-at "@\\(\\w+\\)")
|
|
|
|
|
(let* ((word (match-string 1))
|
|
|
|
|
(levelmatch (assoc word texinfo-section-list))
|
|
|
|
|
text begin tmp
|
|
|
|
|
)
|
|
|
|
|
;; Set begin to the right location
|
|
|
|
|
(setq begin (point))
|
|
|
|
|
;; Get out of here if there if we made it that far.
|
|
|
|
|
(if (and levelmatch (<= (car (cdr levelmatch)) level))
|
|
|
|
|
(progn
|
|
|
|
|
(when newl
|
|
|
|
|
(semantic-texi-set-endpoint newl begin))
|
|
|
|
|
(throw 'level-jump t)))
|
|
|
|
|
;; Recombobulate
|
|
|
|
|
(if levelmatch
|
|
|
|
|
(let ((end (match-end 1)))
|
|
|
|
|
;; Levels sometimes have a @node just in front.
|
|
|
|
|
;; That node statement should be included in the space
|
|
|
|
|
;; for this entry.
|
|
|
|
|
(save-excursion
|
|
|
|
|
(skip-chars-backward "\n \t")
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(when (looking-at "@node\\>")
|
|
|
|
|
(setq begin (point))))
|
|
|
|
|
;; When there is a match, the descriptive text
|
|
|
|
|
;; consists of the rest of the line.
|
|
|
|
|
(goto-char end)
|
|
|
|
|
(skip-chars-forward " \t")
|
|
|
|
|
(setq text (buffer-substring-no-properties
|
|
|
|
|
(point)
|
|
|
|
|
(progn (end-of-line) (point))))
|
|
|
|
|
;; Next, recurse into the body to find the end.
|
|
|
|
|
(setq tmp (semantic-texi-recursive-combobulate-list
|
|
|
|
|
(cdr oldl) (car (cdr levelmatch))))
|
|
|
|
|
;; Build a tag
|
|
|
|
|
(setq tag (semantic-texi-new-section-tag
|
|
|
|
|
text (car tmp) begin (point)))
|
|
|
|
|
;; Before appending the newtag, update the previous tag
|
|
|
|
|
;; if it is a section tag.
|
|
|
|
|
(when newl
|
|
|
|
|
(semantic-texi-set-endpoint newl begin))
|
|
|
|
|
;; Append new tag to our master list.
|
|
|
|
|
(setq newl (cons tag newl))
|
|
|
|
|
;; continue
|
|
|
|
|
(setq oldl (cdr tmp))
|
|
|
|
|
)
|
|
|
|
|
;; No match means we have a def*, so get the name from
|
|
|
|
|
;; it based on the type of thingy we found.
|
|
|
|
|
(setq levelmatch (assoc word semantic-texi-name-field-list)
|
|
|
|
|
tmp (or (cdr levelmatch) 1))
|
|
|
|
|
(forward-sexp tmp)
|
|
|
|
|
(skip-chars-forward " \t")
|
|
|
|
|
(setq text (buffer-substring-no-properties
|
|
|
|
|
(point)
|
|
|
|
|
(progn (forward-sexp 1) (point))))
|
|
|
|
|
;; Seek the end of this definition
|
|
|
|
|
(goto-char begin)
|
|
|
|
|
(semantic-texi-forward-deffn)
|
|
|
|
|
(setq tag (semantic-texi-new-def-tag text begin (point))
|
|
|
|
|
newl (cons tag newl))
|
|
|
|
|
;; continue
|
|
|
|
|
(setq oldl (cdr oldl)))
|
|
|
|
|
)
|
|
|
|
|
(error "Problem finding section in semantic/texi parser"))
|
|
|
|
|
;; (setq oldl (cdr oldl))
|
|
|
|
|
)
|
|
|
|
|
;; When oldl runs out, force a new endpoint as point-max
|
|
|
|
|
(when (not oldl)
|
|
|
|
|
(semantic-texi-set-endpoint newl (point-max)))
|
|
|
|
|
))
|
|
|
|
|
(cons (nreverse newl) oldl)))
|
|
|
|
|
|
|
|
|
|
(defun semantic-texi-forward-deffn ()
|
|
|
|
|
"Move forward over one deffn type definition.
|
|
|
|
|
The cursor should be on the @ sign."
|
|
|
|
|
(when (looking-at "@\\(\\w+\\)")
|
|
|
|
|
(let* ((type (match-string 1))
|
|
|
|
|
(seek (concat "^@end\\s-+" (regexp-quote type))))
|
|
|
|
|
(re-search-forward seek nil t))))
|
|
|
|
|
|
|
|
|
|
(define-mode-local-override semantic-tag-components
|
|
|
|
|
texinfo-mode (tag)
|
|
|
|
|
"Return components belonging to TAG."
|
|
|
|
|
(semantic-tag-get-attribute tag :members))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Overrides: Context Parsing
|
|
|
|
|
;;
|
|
|
|
|
;; How to treat texi as a language?
|
|
|
|
|
;;
|
|
|
|
|
(defvar semantic-texi-environment-regexp
|
|
|
|
|
(if (string-match texinfo-environment-regexp "@menu")
|
|
|
|
|
;; Make sure our Emacs has menus in it.
|
|
|
|
|
texinfo-environment-regexp
|
|
|
|
|
;; If no menus, then merge in the menu concept.
|
|
|
|
|
(when (string-match "cartouche" texinfo-environment-regexp)
|
|
|
|
|
(concat (substring texinfo-environment-regexp
|
|
|
|
|
0 (match-beginning 0))
|
|
|
|
|
"menu\\|"
|
|
|
|
|
(substring texinfo-environment-regexp
|
|
|
|
|
(match-beginning 0)))))
|
2009-10-01 04:54:05 +00:00
|
|
|
|
"Regular expression for matching texinfo environments.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
uses `texinfo-environment-regexp', but makes sure that it
|
|
|
|
|
can handle the @menu environment.")
|
|
|
|
|
|
|
|
|
|
(define-mode-local-override semantic-up-context texinfo-mode ()
|
|
|
|
|
"Handle texinfo constructs which do not use parenthetical nesting."
|
|
|
|
|
(let ((done nil))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((parenthetical (semantic-up-context-default))
|
|
|
|
|
)
|
|
|
|
|
(when (not parenthetical)
|
2011-11-19 18:29:42 -08:00
|
|
|
|
;; We are in parentheses. Are they the types of parens
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; belonging to a texinfo construct?
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(forward-word-strictly -1)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(when (looking-at "@\\w+{")
|
|
|
|
|
(setq done (point))))))
|
|
|
|
|
;; If we are not in a parenthetical node, then find a block instead.
|
|
|
|
|
;; Use the texinfo support to find block start/end constructs.
|
|
|
|
|
(save-excursion
|
|
|
|
|
(while (and (not done)
|
|
|
|
|
(re-search-backward semantic-texi-environment-regexp nil t))
|
|
|
|
|
;; For any hit, if we find an @end foo, then jump to the
|
|
|
|
|
;; matching @foo. If it is not an end, then we win!
|
|
|
|
|
(if (not (looking-at "@end\\s-+\\(\\w+\\)"))
|
|
|
|
|
(setq done (point))
|
|
|
|
|
;; Skip over this block
|
|
|
|
|
(let ((env (match-string 1)))
|
|
|
|
|
(re-search-backward (concat "@" env))))
|
|
|
|
|
))
|
|
|
|
|
;; All over, post what we find.
|
|
|
|
|
(if done
|
|
|
|
|
;; We found something, so use it.
|
|
|
|
|
(progn (goto-char done)
|
|
|
|
|
nil)
|
|
|
|
|
t)))
|
|
|
|
|
|
|
|
|
|
(define-mode-local-override semantic-beginning-of-context texinfo-mode (&optional point)
|
|
|
|
|
"Move to the beginning of the context surrounding POINT."
|
|
|
|
|
(if (semantic-up-context point)
|
|
|
|
|
;; If we can't go up, we can't do this either.
|
|
|
|
|
t
|
|
|
|
|
;; We moved, so now we need to skip into whatever this thing is.
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
2016-02-05 23:54:21 +02:00
|
|
|
|
(forward-word-strictly 1) ;; skip the command
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(if (looking-at "\\s-*{")
|
|
|
|
|
;; In a short command. Go in.
|
|
|
|
|
(down-list 1)
|
|
|
|
|
;; An environment. Go to the next line.
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(forward-char 1))
|
|
|
|
|
nil))
|
|
|
|
|
|
|
|
|
|
(define-mode-local-override semantic-ctxt-current-class-list
|
2021-03-15 00:08:34 -04:00
|
|
|
|
texinfo-mode (&optional _point)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
"Determine the class of tags that can be used at POINT.
|
|
|
|
|
For texinfo, there two possibilities returned.
|
2019-11-11 10:30:13 -08:00
|
|
|
|
1) `function' - for a call to a texinfo function
|
|
|
|
|
2) `word' - indicates an English word.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
It would be nice to know function arguments too, but not today."
|
|
|
|
|
(let ((sym (semantic-ctxt-current-symbol)))
|
|
|
|
|
(if (and sym (= (aref (car sym) 0) ?@))
|
|
|
|
|
'(function)
|
|
|
|
|
'(word))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Overrides : Formatting
|
|
|
|
|
;;
|
|
|
|
|
;; Various override to better format texi tags.
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
(define-mode-local-override semantic-format-tag-abbreviate
|
|
|
|
|
texinfo-mode (tag &optional parent color)
|
|
|
|
|
"Texinfo tags abbreviation."
|
|
|
|
|
(let ((class (semantic-tag-class tag))
|
|
|
|
|
(name (semantic-format-tag-name tag parent color))
|
|
|
|
|
)
|
|
|
|
|
(cond ((eq class 'function)
|
|
|
|
|
(concat name "{ }"))
|
|
|
|
|
(t (semantic-format-tag-abbreviate-default tag parent color)))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(define-mode-local-override semantic-format-tag-prototype
|
|
|
|
|
texinfo-mode (tag &optional parent color)
|
|
|
|
|
"Texinfo tags abbreviation."
|
|
|
|
|
(semantic-format-tag-abbreviate tag parent color))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Texi Unique Features
|
|
|
|
|
;;
|
|
|
|
|
(defun semantic-tag-texi-section-text-bounds (tag)
|
|
|
|
|
"Get the bounds to the text of TAG.
|
|
|
|
|
The text bounds is the text belonging to this node excluding
|
|
|
|
|
the text of any child nodes, but including any defuns."
|
|
|
|
|
(let ((memb (semantic-tag-components tag)))
|
|
|
|
|
;; Members.. if one is a section, check it out.
|
|
|
|
|
(while (and memb (not (semantic-tag-of-class-p (car memb) 'section)))
|
|
|
|
|
(setq memb (cdr memb)))
|
|
|
|
|
;; No members? ... then a simple problem!
|
|
|
|
|
(if (not memb)
|
|
|
|
|
(semantic-tag-bounds tag)
|
|
|
|
|
;; Our end is their beginning...
|
|
|
|
|
(list (semantic-tag-start tag) (semantic-tag-start (car memb))))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-texi-current-environment (&optional point)
|
|
|
|
|
"Return as a string the type of the current environment.
|
|
|
|
|
Optional argument POINT is where to look for the environment."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(when point (goto-char (point)))
|
|
|
|
|
(while (and (or (not (looking-at semantic-texi-environment-regexp))
|
|
|
|
|
(looking-at "@end"))
|
|
|
|
|
(not (semantic-up-context)))
|
|
|
|
|
)
|
|
|
|
|
(when (looking-at semantic-texi-environment-regexp)
|
|
|
|
|
(match-string 1))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Analyzer
|
|
|
|
|
;;
|
|
|
|
|
(eval-when-compile
|
|
|
|
|
(require 'semantic/analyze))
|
|
|
|
|
|
2018-02-28 13:39:52 -05:00
|
|
|
|
(declare-function semantic-analyze-context "semantic/analyze")
|
|
|
|
|
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(define-mode-local-override semantic-analyze-current-context
|
2021-03-15 00:08:34 -04:00
|
|
|
|
texinfo-mode (_point)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
"Analysis context makes no sense for texinfo. Return nil."
|
|
|
|
|
(let* ((prefixandbounds (semantic-ctxt-current-symbol-and-bounds (point)))
|
|
|
|
|
(prefix (car prefixandbounds))
|
|
|
|
|
(bounds (nth 2 prefixandbounds))
|
|
|
|
|
(prefixclass (semantic-ctxt-current-class-list))
|
|
|
|
|
)
|
|
|
|
|
(when prefix
|
2009-09-03 03:58:13 +00:00
|
|
|
|
(require 'semantic/analyze)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(semantic-analyze-context
|
|
|
|
|
:buffer (current-buffer)
|
|
|
|
|
:scope nil
|
|
|
|
|
:bounds bounds
|
|
|
|
|
:prefix prefix
|
|
|
|
|
:prefixtypes nil
|
|
|
|
|
:prefixclass prefixclass)
|
|
|
|
|
)
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(defvar semantic-texi-command-completion-list
|
|
|
|
|
(append (mapcar (lambda (a) (car a)) texinfo-section-list)
|
2019-10-28 16:05:39 +01:00
|
|
|
|
texinfo-environments
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Is there a better list somewhere? Here are few
|
|
|
|
|
;; of the top of my head.
|
|
|
|
|
"anchor" "asis"
|
|
|
|
|
"bullet"
|
|
|
|
|
"code" "copyright"
|
|
|
|
|
"defun" "deffn" "defoption" "defvar" "dfn"
|
|
|
|
|
"emph" "end"
|
|
|
|
|
"ifinfo" "iftex" "inforef" "item" "itemx"
|
|
|
|
|
"kdb"
|
|
|
|
|
"node"
|
|
|
|
|
"ref"
|
|
|
|
|
"set" "setfilename" "settitle"
|
|
|
|
|
"value" "var"
|
|
|
|
|
"xref"
|
|
|
|
|
)
|
|
|
|
|
"List of commands that we might bother completing.")
|
|
|
|
|
|
|
|
|
|
(define-mode-local-override semantic-analyze-possible-completions
|
2021-03-15 00:08:34 -04:00
|
|
|
|
texinfo-mode (context &rest _flags)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
"List smart completions at point.
|
|
|
|
|
Since texinfo is not a programming language the default version is not
|
2011-11-12 23:48:23 -08:00
|
|
|
|
useful. Instead, look at the current symbol. If it is a command
|
2009-08-29 19:00:35 +00:00
|
|
|
|
do primitive texinfo built ins. If not, use ispell to lookup words
|
|
|
|
|
that start with that symbol."
|
2019-06-13 18:01:42 +02:00
|
|
|
|
(let ((prefix (car (oref context prefix)))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
)
|
2019-06-13 18:01:42 +02:00
|
|
|
|
(cond ((member 'function (oref context prefixclass))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Do completion for texinfo commands
|
|
|
|
|
(let* ((cmd (substring prefix 1))
|
|
|
|
|
(lst (all-completions
|
|
|
|
|
cmd semantic-texi-command-completion-list)))
|
|
|
|
|
(mapcar (lambda (f) (semantic-tag (concat "@" f) 'function))
|
|
|
|
|
lst))
|
|
|
|
|
)
|
2019-06-13 18:01:42 +02:00
|
|
|
|
((member 'word (oref context prefixclass))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Do completion for words via ispell.
|
|
|
|
|
(require 'ispell)
|
2013-09-28 10:54:27 +08:00
|
|
|
|
(let ((word-list (ispell-lookup-words prefix)))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(mapcar (lambda (f) (semantic-tag f 'word)) word-list))
|
|
|
|
|
)
|
|
|
|
|
(t nil))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Parser Setup
|
|
|
|
|
;;
|
2011-11-03 21:03:45 +01:00
|
|
|
|
;; In semantic/imenu.el, not part of Emacs.
|
2009-10-31 02:03:19 +00:00
|
|
|
|
(defvar semantic-imenu-expandable-tag-classes)
|
|
|
|
|
(defvar semantic-imenu-bucketize-file)
|
|
|
|
|
(defvar semantic-imenu-bucketize-type-members)
|
|
|
|
|
|
2012-10-02 02:10:29 +08:00
|
|
|
|
;;;###autoload
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(defun semantic-default-texi-setup ()
|
|
|
|
|
"Set up a buffer for parsing of Texinfo files."
|
|
|
|
|
;; This will use our parser.
|
|
|
|
|
(semantic-install-function-overrides
|
2019-10-24 23:06:23 -04:00
|
|
|
|
'((semantic-parse-region . semantic-texi-parse-region)
|
|
|
|
|
(semantic-parse-changes . semantic-texi-parse-changes)))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(setq semantic-parser-name "TEXI"
|
|
|
|
|
;; Setup a dummy parser table to enable parsing!
|
|
|
|
|
semantic--parse-table t
|
2021-03-15 00:08:34 -04:00
|
|
|
|
imenu-create-index-function #'semantic-create-imenu-index
|
2009-08-29 19:00:35 +00:00
|
|
|
|
semantic-command-separation-character "@"
|
|
|
|
|
semantic-type-relation-separator-character '(":")
|
|
|
|
|
semantic-symbol->name-assoc-list '((section . "Section")
|
|
|
|
|
(def . "Definition")
|
|
|
|
|
)
|
|
|
|
|
semantic-imenu-expandable-tag-classes '(section)
|
|
|
|
|
semantic-imenu-bucketize-file nil
|
|
|
|
|
semantic-imenu-bucketize-type-members nil
|
|
|
|
|
senator-step-at-start-end-tag-classes '(section)
|
|
|
|
|
semantic-stickyfunc-sticky-classes '(section)
|
|
|
|
|
)
|
2009-09-05 01:00:36 +00:00
|
|
|
|
;; (local-set-key [(f9)] 'semantic-texi-update-doc-from-texi)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
2021-03-15 00:08:34 -04:00
|
|
|
|
(add-hook 'texinfo-mode-hook #'semantic-default-texi-setup)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Special features of Texinfo tag streams
|
|
|
|
|
;;
|
|
|
|
|
;; This section provides specialized access into texinfo files.
|
|
|
|
|
;; Because texinfo files often directly refer to functions and programs
|
|
|
|
|
;; it is useful to access the texinfo file from the C code for document
|
2011-11-19 01:18:31 -08:00
|
|
|
|
;; maintenance.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(defun semantic-texi-associated-files (&optional buffer)
|
|
|
|
|
"Find texinfo files associated with BUFFER."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(if buffer (set-buffer buffer))
|
|
|
|
|
(cond ((and (fboundp 'ede-documentation-files)
|
|
|
|
|
ede-minor-mode (ede-current-project))
|
|
|
|
|
;; When EDE is active, ask it.
|
|
|
|
|
(ede-documentation-files)
|
|
|
|
|
)
|
2009-09-03 03:58:13 +00:00
|
|
|
|
((and (featurep 'semantic/db) (semanticdb-minor-mode-p))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; See what texinfo files we have loaded in the database
|
|
|
|
|
(let ((tabs (semanticdb-get-database-tables
|
|
|
|
|
semanticdb-current-database))
|
|
|
|
|
(r nil))
|
|
|
|
|
(while tabs
|
|
|
|
|
(if (eq (oref (car tabs) major-mode) 'texinfo-mode)
|
|
|
|
|
(setq r (cons (oref (car tabs) file) r)))
|
|
|
|
|
(setq tabs (cdr tabs)))
|
|
|
|
|
r))
|
|
|
|
|
(t
|
Fix edge case errors in filename-matching regexps
These changes fix actual or latent bugs in regexps that match
file names, such as PATTERN arguments to 'directory-files'. See
https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00265.html
* admin/authors.el (authors-obsolete-files-regexps)
(authors-renamed-files-regexps):
* lisp/auth-source-pass.el (auth-source-pass-entries):
* lisp/calendar/todo-mode.el (todo-show, todo-find-filtered-items-file)
(todo-filter-items, todo-reset-nondiary-marker, todo-reset-done-string)
(todo-reset-comment-string, todo-reset-highlight-item):
* lisp/cedet/semantic/db-ebrowse.el (semanticdb-load-ebrowse-caches):
* lisp/cedet/semantic/texi.el (semantic-texi-associated-files):
* lisp/cedet/srecode/map.el (srecode-map-update-map):
* lisp/dired.el (dired-re-no-dot):
* lisp/emacs-lisp/autoload.el (update-directory-autoloads):
* lisp/emacs-lisp/shadow.el (load-path-shadows-find):
* lisp/files.el (auto-mode-alist, directory-files-no-dot-files-regexp):
* lisp/finder.el (finder-compile-keywords):
* lisp/generic-x.el (inetd-conf-generic-mode, named-boot-generic-mode)
(resolve-conf-generic-mode, etc-modules-conf-generic-mode):
* lisp/gnus/gnus-agent.el (gnus-agent-read-agentview)
(gnus-agent-regenerate-group, gnus-agent-update-files-total-fetched-for):
* lisp/gnus/gnus-cache.el (gnus-cache-articles-in-group):
* lisp/gnus/gnus-score.el (gnus-score-search-global-directories):
* lisp/gnus/gnus-util.el (gnus-delete-directory):
* lisp/gnus/gnus-uu.el (gnus-uu-dir-files):
* lisp/gnus/nndraft.el (nndraft-request-group):
* lisp/gnus/nnmh.el (nnmh-request-group, nnmh-request-create-group):
(nnmh-request-delete-group, nnmh-active-number, nnmh-update-gnus-unreads):
* lisp/gnus/nnspool.el (nnspool-request-group):
* lisp/gnus/spam-stat.el (spam-stat-process-directory)
(spam-stat-test-directory):
* lisp/help-fns.el (help-fns--first-release):
* lisp/help.el (view-emacs-news):
* lisp/international/quail.el (quail-update-leim-list-file):
* lisp/international/titdic-cnv.el (batch-titdic-convert):
* lisp/mail/mspools.el (mspools-set-vm-spool-files)
(mspools-get-spool-files):
* lisp/mail/rmail.el (rmail-secondary-file-regexp)
(rmail-speedbar-match-folder-regexp):
* lisp/net/ange-ftp.el (ange-ftp-delete-directory):
* lisp/net/tramp.el (tramp-use-absolute-autoload-file-names):
* lisp/obsolete/gulp.el (gulp-send-requests):
* lisp/obsolete/vc-arch.el (vc-arch-trim-revlib):
* lisp/org/ob-core.el (org-babel-remove-temporary-directory):
* lisp/progmodes/ebnf2ps.el (ebnf-file-suffix-regexp, ebnf-style-database):
* lisp/progmodes/executable.el (executable-command-find-posix-p):
* lisp/startup.el (command-line):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/url/url-about.el (url-probe-protocols):
* lisp/vc/vc-rcs.el (vc-rcs-register, vc-rcs-unregister):
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test19-directory-files-and-attributes):
* test/lisp/net/tramp-tests.el (tramp-test19-directory-files-and-attributes):
Replace ^ and $ with \` and \', respectively.
Use (rx (or (not ".") "...")), translated into "[^.]\\|\\.\\.\\.",
to match anything but "." and "..", instead of several incorrect
regexps.
2020-04-14 12:17:40 +02:00
|
|
|
|
(directory-files default-directory nil "\\.texi\\'"))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
;; Turns out this might not be useful.
|
|
|
|
|
;; Delete later if that is true.
|
2021-03-15 00:08:34 -04:00
|
|
|
|
(defun semantic-texi-find-documentation (name &optional _type)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
"Find the function or variable NAME of TYPE in the texinfo source.
|
|
|
|
|
NAME is a string representing some functional symbol.
|
|
|
|
|
TYPE is a string, such as \"variable\" or \"Command\" used to find
|
|
|
|
|
the correct definition in case NAME qualifies as several things.
|
|
|
|
|
When this function exists, POINT is at the definition.
|
|
|
|
|
If the doc was not found, an error is thrown.
|
|
|
|
|
Note: TYPE not yet implemented."
|
|
|
|
|
(let ((f (semantic-texi-associated-files))
|
|
|
|
|
stream match)
|
|
|
|
|
(while (and f (not match))
|
|
|
|
|
(unless stream
|
|
|
|
|
(with-current-buffer (find-file-noselect (car f))
|
|
|
|
|
(setq stream (semantic-fetch-tags))))
|
|
|
|
|
(setq match (semantic-find-first-tag-by-name name stream))
|
|
|
|
|
(when match
|
|
|
|
|
(set-buffer (semantic-tag-buffer match))
|
|
|
|
|
(goto-char (semantic-tag-start match)))
|
|
|
|
|
(setq f (cdr f)))))
|
|
|
|
|
|
2009-09-05 01:00:36 +00:00
|
|
|
|
;; (defun semantic-texi-update-doc-from-texi (&optional tag)
|
|
|
|
|
;; "Update the documentation in the texinfo deffn class tag TAG.
|
|
|
|
|
;; The current buffer must be a texinfo file containing TAG.
|
|
|
|
|
;; If TAG is nil, determine a tag based on the current position."
|
|
|
|
|
;; (interactive)
|
|
|
|
|
;; (unless (or (featurep 'semantic/db)
|
|
|
|
|
;; (require 'semantic/db-mode)
|
|
|
|
|
;; (semanticdb-minor-mode-p))
|
|
|
|
|
;; (error "Texinfo updating only works when `semanticdb' is being used"))
|
|
|
|
|
;; (semantic-fetch-tags)
|
|
|
|
|
;; (unless tag
|
|
|
|
|
;; (beginning-of-line)
|
|
|
|
|
;; (setq tag (semantic-current-tag)))
|
|
|
|
|
;; (unless (semantic-tag-of-class-p tag 'def)
|
|
|
|
|
;; (error "Only deffns (or defun or defvar) can be updated"))
|
|
|
|
|
;; (let* ((name (semantic-tag-name tag))
|
|
|
|
|
;; (tags (semanticdb-strip-find-results
|
|
|
|
|
;; (semanticdb-with-match-any-mode
|
|
|
|
|
;; (semanticdb-brute-deep-find-tags-by-name name))
|
|
|
|
|
;; 'name))
|
|
|
|
|
;; (docstring nil)
|
|
|
|
|
;; (docstringproto nil)
|
|
|
|
|
;; (docstringvar nil)
|
|
|
|
|
;; (doctag nil)
|
|
|
|
|
;; (doctagproto nil)
|
|
|
|
|
;; (doctagvar nil)
|
|
|
|
|
;; )
|
|
|
|
|
;; (save-excursion
|
|
|
|
|
;; (while (and tags (not docstring))
|
|
|
|
|
;; (let ((sourcetag (car tags)))
|
|
|
|
|
;; ;; There could be more than one! Come up with a better
|
|
|
|
|
;; ;; solution someday.
|
|
|
|
|
;; (when (semantic-tag-buffer sourcetag)
|
|
|
|
|
;; (set-buffer (semantic-tag-buffer sourcetag))
|
|
|
|
|
;; (unless (eq major-mode 'texinfo-mode)
|
|
|
|
|
;; (cond ((semantic-tag-get-attribute sourcetag :prototype-flag)
|
|
|
|
|
;; ;; If we found a match with doc that is a prototype, then store
|
|
|
|
|
;; ;; that, but don't exit till we find the real deal.
|
|
|
|
|
;; (setq docstringproto (semantic-documentation-for-tag sourcetag)
|
|
|
|
|
;; doctagproto sourcetag))
|
|
|
|
|
;; ((eq (semantic-tag-class sourcetag) 'variable)
|
|
|
|
|
;; (setq docstringvar (semantic-documentation-for-tag sourcetag)
|
|
|
|
|
;; doctagvar sourcetag))
|
|
|
|
|
;; ((semantic-tag-get-attribute sourcetag :override-function-flag)
|
|
|
|
|
;; nil)
|
|
|
|
|
;; (t
|
|
|
|
|
;; (setq docstring (semantic-documentation-for-tag sourcetag))))
|
|
|
|
|
;; (setq doctag (if docstring sourcetag nil))))
|
|
|
|
|
;; (setq tags (cdr tags)))))
|
|
|
|
|
;; ;; If we found a prototype of the function that has some doc, but not the
|
2011-11-15 18:37:37 +01:00
|
|
|
|
;; ;; actual function, let's make due with that.
|
2009-09-05 01:00:36 +00:00
|
|
|
|
;; (if (not docstring)
|
|
|
|
|
;; (cond ((stringp docstringvar)
|
|
|
|
|
;; (setq docstring docstringvar
|
|
|
|
|
;; doctag doctagvar))
|
|
|
|
|
;; ((stringp docstringproto)
|
|
|
|
|
;; (setq docstring docstringproto
|
|
|
|
|
;; doctag doctagproto))))
|
|
|
|
|
;; ;; Test for doc string
|
|
|
|
|
;; (unless docstring
|
|
|
|
|
;; (error "Could not find documentation for %s" (semantic-tag-name tag)))
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-18 22:49:54 -04:00
|
|
|
|
;;
|
|
|
|
|
;; (require 'srecode)
|
2011-11-03 21:03:45 +01:00
|
|
|
|
;; (require 'srecode/texi)
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-18 22:49:54 -04:00
|
|
|
|
;;
|
2009-09-05 01:00:36 +00:00
|
|
|
|
;; ;; If we have a string, do the replacement.
|
|
|
|
|
;; (delete-region (semantic-tag-start tag)
|
|
|
|
|
;; (semantic-tag-end tag))
|
2011-11-17 01:09:20 -08:00
|
|
|
|
;; ;; Use useful functions from the document library.
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-18 22:49:54 -04:00
|
|
|
|
;; (srecode-texi-insert-tag-as-doc doctag)
|
|
|
|
|
;; ;(semantic-insert-foreign-tag doctag)
|
2009-09-05 01:00:36 +00:00
|
|
|
|
;; ))
|
|
|
|
|
|
|
|
|
|
;; (defun semantic-texi-update-doc-from-source (&optional tag)
|
|
|
|
|
;; "Update the documentation for the source TAG.
|
|
|
|
|
;; The current buffer must be a non-texinfo source file containing TAG.
|
|
|
|
|
;; If TAG is nil, determine the tag based on the current position.
|
|
|
|
|
;; The current buffer must include TAG."
|
|
|
|
|
;; (interactive)
|
|
|
|
|
;; (when (eq major-mode 'texinfo-mode)
|
|
|
|
|
;; (error "Not a source file"))
|
|
|
|
|
;; (semantic-fetch-tags)
|
|
|
|
|
;; (unless tag
|
|
|
|
|
;; (setq tag (semantic-current-tag)))
|
|
|
|
|
;; (unless (semantic-documentation-for-tag tag)
|
|
|
|
|
;; (error "Cannot find interesting documentation to use for %s"
|
|
|
|
|
;; (semantic-tag-name tag)))
|
|
|
|
|
;; (let* ((name (semantic-tag-name tag))
|
|
|
|
|
;; (texi (semantic-texi-associated-files))
|
|
|
|
|
;; (doctag nil)
|
|
|
|
|
;; (docbuff nil))
|
|
|
|
|
;; (while (and texi (not doctag))
|
|
|
|
|
;; (set-buffer (find-file-noselect (car texi)))
|
|
|
|
|
;; (setq doctag (car (semantic-deep-find-tags-by-name
|
|
|
|
|
;; name (semantic-fetch-tags)))
|
|
|
|
|
;; docbuff (if doctag (current-buffer) nil))
|
|
|
|
|
;; (setq texi (cdr texi)))
|
|
|
|
|
;; (unless doctag
|
|
|
|
|
;; (error "Tag %s is not yet documented. Use the `document' command"
|
|
|
|
|
;; name))
|
|
|
|
|
;; ;; Ok, we should have everything we need. Do the deed.
|
|
|
|
|
;; (if (get-buffer-window docbuff)
|
|
|
|
|
;; (set-buffer docbuff)
|
|
|
|
|
;; (switch-to-buffer docbuff))
|
|
|
|
|
;; (goto-char (semantic-tag-start doctag))
|
|
|
|
|
;; (delete-region (semantic-tag-start doctag)
|
|
|
|
|
;; (semantic-tag-end doctag))
|
|
|
|
|
;; ;; Use useful functions from the document library.
|
|
|
|
|
;; (require 'document)
|
|
|
|
|
;; (document-insert-texinfo tag (semantic-tag-buffer tag))
|
|
|
|
|
;; ))
|
|
|
|
|
|
|
|
|
|
;; (defun semantic-texi-update-doc (&optional tag)
|
|
|
|
|
;; "Update the documentation for TAG.
|
|
|
|
|
;; If the current buffer is a texinfo file, then find the source doc, and
|
|
|
|
|
;; update it. If the current buffer is a source file, then get the
|
|
|
|
|
;; documentation for this item, find the existing doc in the associated
|
|
|
|
|
;; manual, and update that."
|
|
|
|
|
;; (interactive)
|
|
|
|
|
;; (cond ;;((eq major-mode 'texinfo-mode)
|
|
|
|
|
;; ;; (semantic-texi-update-doc-from-texi tag))
|
|
|
|
|
;; (t
|
|
|
|
|
;; (semantic-texi-update-doc-from-source tag))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
(defun semantic-texi-goto-source (&optional tag)
|
|
|
|
|
"Jump to the source for the definition in the texinfo file TAG.
|
|
|
|
|
If TAG is nil, it is derived from the deffn under POINT."
|
|
|
|
|
(interactive)
|
2009-09-03 03:58:13 +00:00
|
|
|
|
(unless (or (featurep 'semantic/db) (semanticdb-minor-mode-p))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(error "Texinfo updating only works when `semanticdb' is being used"))
|
|
|
|
|
(semantic-fetch-tags)
|
|
|
|
|
(unless tag
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(setq tag (semantic-current-tag)))
|
|
|
|
|
(unless (semantic-tag-of-class-p tag 'def)
|
|
|
|
|
(error "Only deffns (or defun or defvar) can be updated"))
|
|
|
|
|
(let* ((name (semantic-tag-name tag))
|
|
|
|
|
(tags (semanticdb-fast-strip-find-results
|
|
|
|
|
(semanticdb-with-match-any-mode
|
|
|
|
|
(semanticdb-brute-deep-find-tags-by-name name nil 'name))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(done nil)
|
|
|
|
|
)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(while (and tags (not done))
|
|
|
|
|
(set-buffer (semantic-tag-buffer (car tags)))
|
|
|
|
|
(unless (eq major-mode 'texinfo-mode)
|
|
|
|
|
(switch-to-buffer (semantic-tag-buffer (car tags)))
|
|
|
|
|
(goto-char (semantic-tag-start (car tags)))
|
|
|
|
|
(setq done t))
|
|
|
|
|
(setq tags (cdr tags)))
|
|
|
|
|
(if (not done)
|
|
|
|
|
(error "Could not find tag for %s" (semantic-tag-name tag)))
|
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
(provide 'semantic/texi)
|
|
|
|
|
|
2012-10-02 02:10:29 +08:00
|
|
|
|
;; Local variables:
|
|
|
|
|
;; generated-autoload-file: "loaddefs.el"
|
|
|
|
|
;; generated-autoload-load-name: "semantic/texi"
|
|
|
|
|
;; End:
|
|
|
|
|
|
2009-09-03 03:58:13 +00:00
|
|
|
|
;;; semantic/texi.el ends here
|