Mercurial > emacs
view lisp/mh-e/mh-funcs.el @ 110523:a5ad4f188e19
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.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 18 Sep 2010 22:49:54 -0400 |
parents | 1d1d5d9bd884 |
children | 376148b31b5e |
line wrap: on
line source
;;; mh-funcs.el --- MH-E functions not everyone will use right away ;; Copyright (C) 1993, 1995, ;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ;; Free Software Foundation, Inc. ;; Author: Bill Wohler <wohler@newt.com> ;; Maintainer: Bill Wohler <wohler@newt.com> ;; Keywords: mail ;; See: mh-e.el ;; 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 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: ;; Putting these functions in a separate file lets MH-E start up faster, ;; since less Lisp code needs to be loaded all at once. ;; Please add the functions in alphabetical order. If only one or two ;; small support routines are needed, place them with the function; ;; otherwise, create a separate section for them. ;;; Change Log: ;;; Code: (require 'mh-e) (require 'mh-scan) ;;;###mh-autoload (defun mh-burst-digest () "Break up digest into separate messages\\<mh-folder-mode-map>. This command uses the MH command \"burst\" to break out each message in the digest into its own message. Using this command, you can quickly delete unwanted messages, like this: Once the digest is split up, toggle out of MH-Folder Show mode with \\[mh-toggle-showing] so that the scan lines fill the screen and messages aren't displayed. Then use \\[mh-delete-msg] to quickly delete messages that you don't want to read (based on the \"Subject:\" header field). You can also burst the digest to reply directly to the people who posted the messages in the digest. One problem you may encounter is that the \"From:\" header fields are preceded with a \">\" so that your reply can't create the \"To:\" field correctly. In this case, you must correct the \"To:\" field yourself." (interactive) (let ((digest (mh-get-msg-num t))) (mh-process-or-undo-commands mh-current-folder) (mh-set-folder-modified-p t) ; lock folder while bursting (message "Bursting digest...") (mh-exec-cmd "burst" mh-current-folder digest "-inplace") (with-mh-folder-updating (t) (beginning-of-line) (delete-region (point) (point-max))) (mh-regenerate-headers (format "%d-last" digest) t) (mh-goto-cur-msg) (message "Bursting digest...done"))) ;;;###mh-autoload (defun mh-copy-msg (range folder) "Copy RANGE to FOLDER\\<mh-folder-mode-map>. If you wish to copy a message to another folder, you can use this command (see the \"-link\" argument to \"refile\"). Like the command \\[mh-refile-msg], this command prompts you for the name of the target folder and you can specify a range. Note that unlike the command \\[mh-refile-msg], the copy takes place immediately. The original copy remains in the current folder. Check the documentation of `mh-interactive-range' to see how RANGE is read in interactive use." (interactive (list (mh-interactive-range "Copy") (mh-prompt-for-folder "Copy to" "" t))) (let ((msg-list (let ((result ())) (mh-iterate-on-range msg range (mh-notate nil mh-note-copied mh-cmd-note) (push msg result)) result))) (mh-exec-cmd "refile" (mh-coalesce-msg-list msg-list) "-link" "-src" mh-current-folder folder))) ;;;###mh-autoload (defun mh-kill-folder () "Remove folder. Remove all of the messages (files) within the current folder, and then remove the folder (directory) itself. Run the abnormal hook `mh-kill-folder-suppress-prompt-hooks'. The hook functions are called with no arguments and should return a non-nil value to suppress the normal prompt when you remove a folder. This is useful for folders that are easily regenerated." (interactive) (if (or (run-hook-with-args-until-success 'mh-kill-folder-suppress-prompt-hooks) (yes-or-no-p (format "Remove folder %s (and all included messages)? " mh-current-folder))) (let ((folder mh-current-folder) (window-config mh-previous-window-config)) (mh-set-folder-modified-p t) ; lock folder to kill it (mh-exec-cmd-daemon "rmf" 'mh-rmf-daemon folder) (when (boundp 'mh-speed-folder-map) (mh-speed-invalidate-map folder)) (mh-remove-from-sub-folders-cache folder) (mh-set-folder-modified-p nil) ; so kill-buffer doesn't complain (if (and mh-show-buffer (get-buffer mh-show-buffer)) (kill-buffer mh-show-buffer)) (if (get-buffer folder) (kill-buffer folder)) (when window-config (set-window-configuration window-config)) (message "Folder %s removed" folder)) (message "Folder not removed"))) (defun mh-rmf-daemon (process output) "The rmf PROCESS puts OUTPUT in temporary buffer. Display the results only if something went wrong." (set-buffer (get-buffer-create mh-temp-buffer)) (insert-before-markers output) (when (save-excursion (goto-char (point-min)) (re-search-forward "^rmf: " (point-max) t)) (display-buffer mh-temp-buffer))) ;; Shush compiler. (defvar view-exit-action) ;;;###mh-autoload (defun mh-list-folders () "List mail folders." (interactive) (let ((temp-buffer mh-folders-buffer)) (with-output-to-temp-buffer temp-buffer (with-current-buffer temp-buffer (erase-buffer) (message "Listing folders...") (mh-exec-cmd-output "folders" t (if mh-recursive-folders-flag "-recurse" "-norecurse")) (goto-char (point-min)) (mh-view-mode-enter) (setq view-exit-action 'kill-buffer) (message "Listing folders...done"))))) ;;;###mh-autoload (defun mh-pack-folder (range) "Pack folder\\<mh-folder-mode-map>. This command packs the folder, removing gaps from the numbering sequence. If you don't want to rescan the entire folder afterward, this command will accept a RANGE. Check the documentation of `mh-interactive-range' to see how RANGE is read in interactive use. This command will ask if you want to process refiles or deletes first and then either run \\[mh-execute-commands] for you or undo the pending refiles and deletes. The hook `mh-pack-folder-hook' is run after the folder is packed; see its documentation for variables it can use." (interactive (list (if current-prefix-arg (mh-read-range "Scan" mh-current-folder t nil t mh-interpret-number-as-range-flag) '("all")))) (let ((threaded-flag (memq 'unthread mh-view-ops))) (mh-pack-folder-1 range) (mh-goto-cur-msg) (when mh-index-data (mh-index-update-maps mh-current-folder)) (cond (threaded-flag (mh-toggle-threads)) (mh-index-data (mh-index-insert-folder-headers)))) (run-hooks 'mh-pack-folder-hook) (message "Packing folder...done")) (defun mh-pack-folder-1 (range) "Close and pack the current folder. Display RANGE after packing, or the entire folder if RANGE is nil." (mh-process-or-undo-commands mh-current-folder) (message "Packing folder...") (mh-set-folder-modified-p t) ; lock folder while packing (save-excursion (mh-exec-cmd-quiet t "folder" mh-current-folder "-pack" "-norecurse" "-fast")) (mh-reset-threads-and-narrowing) (mh-regenerate-headers range)) ;;;###mh-autoload (defun mh-page-digest () "Display next message in digest." (interactive) (mh-in-show-buffer (mh-show-buffer) ;; Go to top of screen (in case user moved point). (move-to-window-line 0) (let ((case-fold-search nil)) ;; Search for blank line and then for From: (or (and (search-forward "\n\n" nil t) (re-search-forward "^From:" nil t)) (error "No more messages in digest"))) ;; Go back to previous blank line, then forward to the first non-blank. (search-backward "\n\n" nil t) (forward-line 2) (mh-recenter 0))) ;;;###mh-autoload (defun mh-page-digest-backwards () "Display previous message in digest." (interactive) (mh-in-show-buffer (mh-show-buffer) ;; Go to top of screen (in case user moved point). (move-to-window-line 0) (let ((case-fold-search nil)) (beginning-of-line) (or (and (search-backward "\n\n" nil t) (re-search-backward "^From:" nil t)) (error "No previous message in digest"))) ;; Go back to previous blank line, then forward to the first non-blank. (if (search-backward "\n\n" nil t) (forward-line 2)) (mh-recenter 0))) ;;;###mh-autoload (defun mh-pipe-msg (command include-header) "Pipe message through shell command COMMAND. You are prompted for the Unix command through which you wish to run your message. If you give a prefix argument INCLUDE-HEADER to this command, the message header is included in the text passed to the command." (interactive (list (read-string "Shell command on message: ") current-prefix-arg)) (let ((msg-file-to-pipe (mh-msg-filename (mh-get-msg-num t))) (message-directory default-directory)) (with-current-buffer (get-buffer-create mh-temp-buffer) (erase-buffer) (insert-file-contents msg-file-to-pipe) (goto-char (point-min)) (if (not include-header) (search-forward "\n\n")) (let ((default-directory message-directory)) (shell-command-on-region (point) (point-max) command nil))))) ;;;###mh-autoload (defun mh-sort-folder (&optional extra-args) "Sort folder. By default, messages are sorted by date. The option `mh-sortm-args' holds extra arguments to pass on to the command \"sortm\" when a prefix argument EXTRA-ARGS is used." (interactive "P") (mh-process-or-undo-commands mh-current-folder) (setq mh-next-direction 'forward) (mh-set-folder-modified-p t) ; lock folder while sorting (message "Sorting folder...") (let ((threaded-flag (memq 'unthread mh-view-ops))) (mh-exec-cmd "sortm" mh-current-folder (if extra-args mh-sortm-args)) (when mh-index-data (mh-index-update-maps mh-current-folder)) (message "Sorting folder...done") (mh-scan-folder mh-current-folder "all") (cond (threaded-flag (mh-toggle-threads)) (mh-index-data (mh-index-insert-folder-headers))))) ;;;###mh-autoload (defun mh-store-msg (directory) "Unpack message created with \"uudecode\" or \"shar\". The default DIRECTORY for extraction is the current directory; however, you have a chance to specify a different extraction directory. The next time you use this command, the default directory is the last directory you used. If you would like to change the initial default directory, customize the option `mh-store-default-directory', change the value from \"Current\" to \"Directory\", and then enter the name of the directory for storing the content of these messages." (interactive (list (let ((udir (or mh-store-default-directory default-directory))) (read-file-name "Store message in directory: " udir udir nil)))) (let ((msg-file-to-store (mh-msg-filename (mh-get-msg-num t)))) (with-current-buffer (get-buffer-create mh-temp-buffer) (erase-buffer) (insert-file-contents msg-file-to-store) (mh-store-buffer directory)))) (defun mh-store-buffer (directory) "Unpack buffer created with \"uudecode\" or \"shar\". See `mh-store-msg' for a description of DIRECTORY." (interactive (list (let ((udir (or mh-store-default-directory default-directory))) (read-file-name "Store buffer in directory: " udir udir nil)))) (let ((store-directory (expand-file-name directory)) (sh-start (save-excursion (goto-char (point-min)) (if (re-search-forward "^#![ \t]*/bin/sh\\|^#\\|^: " nil t) (progn ;; The "cut here" pattern was removed from above ;; because it seemed to hurt more than help. ;; But keep this to make it easier to put it back. (if (looking-at "^[^a-z0-9\"]*cut here\\b") (forward-line 1)) (beginning-of-line) (if (looking-at "^[#:]....+\n\\( ?\n\\)?end$") nil ;most likely end of a uuencode (point)))))) (command "sh") (uudecode-filename "(unknown filename)") log-begin) (if (not sh-start) (save-excursion (goto-char (point-min)) (if (re-search-forward "^begin [0-7]+ " nil t) (setq uudecode-filename (buffer-substring (point) (progn (end-of-line) (point))))))) (with-current-buffer (get-buffer-create mh-log-buffer) (setq log-begin (mh-truncate-log-buffer)) (if (not (file-directory-p store-directory)) (progn (insert "mkdir " directory "\n") (call-process "mkdir" nil mh-log-buffer t store-directory))) (insert "cd " directory "\n") (setq mh-store-default-directory directory) (if (not sh-start) (progn (setq command "uudecode") (insert uudecode-filename " being uudecoded...\n")))) (set-window-start (display-buffer mh-log-buffer) log-begin) ;watch progress (let ((default-directory (file-name-as-directory store-directory))) (if (equal (call-process-region sh-start (point-max) command nil mh-log-buffer t) 0) (with-current-buffer mh-log-buffer (insert "\n(mh-store finished)\n")) (error "Error occurred during execution of %s" command))))) ;;;###mh-autoload (defun mh-undo-folder () "Undo all refiles and deletes in the current folder." (interactive) (cond ((or mh-do-not-confirm-flag (yes-or-no-p "Undo all commands in folder? ")) (setq mh-delete-list nil mh-refile-list nil mh-seq-list nil mh-next-direction 'forward) (with-mh-folder-updating (nil) (mh-remove-all-notation))) (t (message "Commands not undone")))) (provide 'mh-funcs) ;; Local Variables: ;; indent-tabs-mode: nil ;; sentence-end-double-space: nil ;; End: ;; arch-tag: 1936c4f1-4843-438e-bc4b-a63bb75a7762 ;;; mh-funcs.el ends here