bpt/emacs.git
12 years ago* calendar/todos.el: Further comment revision and code
Stephen Berman [Sun, 20 May 2012 23:23:52 +0000 (00:23 +0100)]
* calendar/todos.el: Further comment revision and code
rearrangement.
(todos-item-end): Revert last change.
(todos-key-bindings, todos-menu, todos-archive-mode-map)
(todos-filter-items-mode-map): Use renamed commands.
(todos-hide-show-date-time): Rename from
todos-toggle-display-date-time.
(todos-mark-unmark-item): Rename from todos-toggle-mark-item and
adjust caller.
(todos-backward-item): Exempt special handling only from
todos-regexp-items-buffer instead of todos-filter-items-mode.
(todos-raise-item-priority): Don't allow item reprioritizing in
Todos filter items mode except for top priority items.

12 years ago* calendar/todos.el: Add and revise further doc strings and
Stephen Berman [Sat, 19 May 2012 00:21:36 +0000 (01:21 +0100)]
* calendar/todos.el: Add and revise further doc strings and
comments.
(todos-filter-function, todos-custom-items)
(todos-custom-items-multifile): Remove.
(todos-filter-done-items): New defcustom.
(todos-item-end, todos-backward-item): Handle todos-filter-items-mode.
(todos-filter-items): Check return value of caller first; tag
archived items for todos-jump-to-item; delete categories sexp
before processing filter; check todos-filter-done-items for
whether to leave done items; remove custom filter; fix regexp for
file and category tags; don't invoke buffer fontification.
(powerset-recursive): Fix typo.
(todos-key-bindings): Remove unused bindings.
(todos-top-priorities-multifile, todos-diary-items-multifile)
(todos-regexp-items-multifile): Use variable todos-multiple-files.
(todos-jump-to-item): Fix regexp; handle archive tags; take
todos-filter-done-items into account.
(todos-insert-item-from-calendar): Relocate to end of file
together with key-binding as addition to calendar.el.

12 years ago* calendar/todos.el Add and revise further doc strings and
Stephen Berman [Thu, 17 May 2012 21:20:44 +0000 (22:20 +0100)]
* calendar/todos.el Add and revise further doc strings and
comments; major code rearrangement.
(todos-merged-files, todos-prompt-merged-files)
(todos-print-priorities, todos-tmp-buffer-name)
(todos-top-priorities-widgets, todos-update-merged-files)
(todos-merged-top-priorities, todos-merged-diary-items)
(todos-merged-regexp-items, todos-merged-custom-items)
(todos-raw-mode, todos-change-default-file)
(todos-toggle-diary-inclusion, todos-toggle-item-diary-nonmarking)
(todos-toggle-diary-nonmarking, todos-validate-category-name):
Remove.
(todos-category-string-matcher): Comment out.
(todos-categories): New defgroup.
(todos-initial-file, todos-filter-buffer)
(todos-top-priorities-buffer, todos-categories-category-label)
(todos-diary-items-buffer, todos-regexp-items-buffer)
(todos-custom-items-buffer, todos-filter-files)
(todos-highlight-item, todos-todo-mode-date-time-regexp):
New defcustoms.
(todos-diary-expired): New face.
(todos-print-buffer, todos-multiple-files)
(todos-multiple-files-widget, todos-key-bindings): New variables.
(todos-short-file-name, todos-reevaluate-default-file-defcustom)
(todos-special-buffer-name)
(todos-reevaluate-filter-files-defcustom)
(todos-reset-highlight-item, todos-reevaluate-defcustoms)
(todos-nondiary-marker-matcher, todos-diary-nonmarking-matcher)
(todos-diary-expired-matcher, todos-category-string-matcher-1)
(todos-category-string-matcher-2, todos-repair-categories-sexp)
(todos-validate-name, todos-multiple-files)
(todos-display-categories-1, todos-update-categories-display)
(todos-modes-set-3, todos-mode-external-set): New functions.
(todos-set-top-priorities-in-file)
(todos-set-top-priorities-in-category)
(todos-top-priorities-multifile, todos-diary-items-multifile)
(todos-regexp-items-multifile, todos-custom-items-multifile)
(todos-convert-legacy-files, todos-jump-to-item)
(todos-edit-multiline-item, todos-edit-item-date-from-calendar)
(todos-edit-item-diary-inclusion)
(todos-edit-category-diary-inclusion)
(todos-edit-item-diary-nonmarking)
(todos-edit-category-diary-nonmarking): New commands.
(todos, todos-faces): Update :version.
(todos-done-separator, todos-completion-ignore-case):
Change default value.
(todos-done-separator): Change :set function.
(todos-indent-to-here): Add :validate function to :type.
(todos-prefix-string, todos-mark, todos-button)
(todos-sorted-column, todos-archived-only, todos-search)
(todos-done, todos-done-sep): Provide full face definitions
instead of inheriting.
(todos-edit-buffer, todos-categories-buffer): Change from
defcustom to defvar.
(todos-category-beg, todos-category-done): Change from defvar to
defconst.
(todos-files): Check if todos-files-directory exists.
(todos-default-todos-file, todos-mode-line-control, todos-print):
Use todos-short-file-name.
(todos-font-lock-keywords): Use todos-nondiary-marker-matcher,
todos-diary-nonmarking-matcher, todos-category-string-matcher-1,
todos-category-string-matcher-2, todos-diary-expired-matcher.
(todos-category-select): Use todos-done-string-start, and
condition search on todos-show-with-done; don't make display
overlay for done items separator string if there already is one;
use todos-highlight-item, require hl-line and activate
hl-line-mode here in order to avoid a hang if done in todos-mode
or the mode hook.
(todos-update-categories-sexp): Use todos-categories-full if set,
otherwise todos-categories.
(todos-make-categories-list): Don't test for archive file when
processing a legacy todo-mode file.
(todos-check-format): Add check for todos-categories sexp.
(todos-diary-item-p): Use todos-nondiary-start instead of
todos-date-pattern.
(todos-marked-item-p): Rename from todos-item-marked-p.
(todos-read-file-name): Don't accept empty name; validate.
(todos-read-category): Validate new name before prompting whether
to add new category; force quit if user answers no.
(todos-filter-items): Improve implementation.
(todos-set-top-priorities): Rewrite as a noninteractive function
using minibuffer input instead of widgets.
(todos-insert-sort-button): Call todos-display-sorted with
argument nil to display categories in numerical order, instead of
calling todos-display-categories.
(powerset-recursive): Borrow and slightly reformulate the (GDFL'd)
Common Lisp powerset function at
http://rosettacode.org/wiki/Power_set#Common_Lisp.
(powerset-bitwise): Implement in Emacs Lisp the (GDFL'd) C
powerset function at http://rosettacode.org/wiki/Power_set#C.
(todos-powerset): Defalias to powerset-bitwise.
(todos-mode-map): Generate from todos-key-bindings instead of
listing each key definition.
(todos-categories-mode-map): Add two bindings.
(todos-filter-items-mode-map): Add some bindings, remove others.
(todos-mode): Derive from special-mode; use todos-modes-set-3; add
function setting todos-done-separator to
window-configuration-change-hook.
(todos-unload-hook): Remove function setting todos-done-separator
from window-configuration-change-hook.
(todos-archive-mode): Derive from todos-mode; use todos-modes-set-3.
(todos-edit-mode): Derive from text-mode; use todos-mode-external-set.
(todos-categories-mode): Derive from special-mode; use
todos-mode-external-set.
(todos-filter-items-mode): Derive from special-mode.
(todos-quit): Save archive file if it hasn't yet been saved.
(todos-display-categories): Delegate all functionality to
todos-display-categories-1 and todos-update-categories-display.
(todos-toggle-view-done-items): Improve implementation.
(todos-highlight-item): Require hl-line.
(todos-toggle-display-date-time): Remove argument and make it
apply only to whole file.
(todos-top-priorities, todos-diary-items, todos-regexp-items)
(todos-custom-items): Use todos-special-buffer-name.
(todos-add-file): Use todos-short-file-name and
todos-reevaluate-defcustoms; remove validation, since it's now
done in todos-read-file-name.
(todos-add-category): Also update todos-categories-full if non-nil.
(todos-delete-category): Delete file after confirmation if only
category is deleted.
(todos-move-category): Use todos-short-file-name and
todos-reevaluate-defcustoms.
(todos-insert-item): Fix getting date from the calendar and
insertion of time string.
(todos-set-date-from-calendar): Enter calendar buffer, suppressing
display of diary entries.
(todos-edit-multiline): Add optional argument to restrict editing
buffer to current item, otherwise make entire buffer (i.e. whole
file) editable.
(todos-edit-quit): When whole file is editable, check file format
validity before killing buffer, and if valid, recalculate
categories sexp to be safe.
(todos-edit-item-header): Allow choosing date from calendar.
(todos-item-done): Handle marked items.

12 years ago* calendar/todos.el (todos-item-start): Restore commented out code
Stephen Berman [Fri, 2 Dec 2011 23:46:31 +0000 (00:46 +0100)]
* calendar/todos.el (todos-item-start): Restore commented out code
to prevent wrongly moving point in widened buffer.

12 years ago* calendar/todos.el: Remove old commentary from todo-mode.el; add
Stephen Berman [Fri, 2 Dec 2011 13:27:28 +0000 (14:27 +0100)]
* calendar/todos.el: Remove old commentary from todo-mode.el; add
and revise further doc strings and comments; require cl.el at
compile time for remove-duplicates; use function powerset from
http://rosettacode.org/wiki/Power_set#Common_Lisp (GFDL); further
code rearrangement.  Add adapted version of diary-goto-entry as comment.
(todos-file-top, todos-archived-categories-buffer)
(todos-save-top-priorities-too, todos-toggle-item-diary-inclusion)
(todos-save-top-priorities, todos-reset-separator)
(todos-switch-todos-file, todos-item-string-start, todos-counts)
(todos-string-count-lines, todos-string-multiline-p)
(todos-display-categories-alphabetically): Remove.
(todos-insert-item-ask-date, todos-insert-item-ask-date-time)
(todos-insert-item-ask-date-time-for-diary)
(todos-insert-item-ask-date-time-for-diary-here)
(todos-insert-item-ask-date-time-here)
(todos-insert-item-ask-date-maybe-notime)
(todos-insert-item-ask-date-maybe-notime-for-diary)
(todos-insert-item-ask-date-maybe-notime-for-diary-here)
(todos-insert-item-ask-date-maybe-notime-here)
(todos-insert-item-ask-date-for-diary)
(todos-insert-item-ask-date-for-diary-here)
(todos-insert-item-ask-date-here, todos-insert-item-ask-dayname)
(todos-insert-item-ask-dayname-time)
(todos-insert-item-ask-dayname-time-for-diary)
(todos-insert-item-ask-dayname-time-for-diary-here)
(todos-insert-item-ask-dayname-time-here)
(todos-insert-item-ask-dayname-maybe-notime)
(todos-insert-item-ask-dayname-maybe-notime-for-diary)
(todos-insert-item-ask-dayname-maybe-notime-for-diary-here)
(todos-insert-item-ask-dayname-maybe-notime-here)
(todos-insert-item-ask-dayname-for-diary)
(todos-insert-item-ask-dayname-for-diary-here)
(todos-insert-item-ask-dayname-here, todos-insert-item-ask-time)
(todos-insert-item-ask-time-for-diary)
(todos-insert-item-ask-time-for-diary-here)
(todos-insert-item-ask-time-here)
(todos-insert-item-maybe-notime)
(todos-insert-item-maybe-notime-for-diary)
(todos-insert-item-maybe-notime-for-diary-here)
(todos-insert-item-maybe-notime-here)
(todos-insert-item-for-diary, todos-insert-item-for-diary-here)
(todos-insert-item-here): Remove; all of these are now generated
on loading (some with the same name, most with other names.)
(todos-item-counts, todos-display-categories-alphabetically)
(todos-display-categories-sorted-by-todo)
(todos-display-categories-sorted-by-diary)
(todos-display-categories-sorted-by-done)
(todos-display-categories-sorted-by-archived): Comment out.
(todos-comment-string, todos-mode-line-function)
(todos-filter-function, todos-priorities-rules)
(todos-visit-files-commands, todos-categories-totals-label)
(todos-use-only-highlighted-region, todos-diary-nonmarking):
New defcustoms.
(todos-mark, todos-comment): New faces.
(todos-comment-face): Corresponding new variable.
(todos-categories-full, todos-global-current-todos-file)
(todos-first-visit, todos-insertion-commands-args-genlist)
(todos-insertion-commands-args, todos-insertion-commands-names)
(todos-insertion-commands, todos-insertion-commands-arg-key-list)
(todos-top-priorities-widgets, todos-date-from-calendar)
(todos-item-mark, todos-categories-with-marks): New variables.
(todos-mode-line-control, todos-reset-global-current-todos-file)
(todos-gen-arglists, todos-insertion-command-name)
(todos-insertion-key-bindings, todos-unload-hook)
(todos-filter-items, todos-set-date-from-calendar)
(todos-comment-string-matcher, todos-after-find-file)
(todos-reset-nondiary-marker, todos-reset-done-string)
(todos-reset-comment-string, todos-show-current-file)
(todos-item-marked-p, todos-total-item-counts): New functions.
(todos-define-insertion-command): New macro.
(todos-toggle-mark-item, todos-mark-category)
(todos-unmark-category, todos-set-top-priorities)
(todos-merged-diary-items, todos-regexp-items)
(todos-merged-regexp-items, todos-custom-items)
(todos-merged-custom-items, todos-comment-done-item)
(todos-archive-category-done-items, todos-unarchive-items)
(todos-print-to-file): New commands.
(todos-done-separator): Change :set function.
(todos-done-string): Uncomment :initialize and :set functions.
(todos-files): Use file-truename.
(todos-show-current-file): Rename from
todos-auto-switch-todos-file and change :set function accordingly.
(todos-font-lock-keywords): Use todos-comment-string-matcher;
change names of other matcher functions to new *-matcher.
(todos-category-number): Change initial value.
(todos-insertion-map): Use todos-insertion-key-bindings to
generate key definitions.
(todos-mode-map): Don't suppress digit keys, so they can supply
prefix arguments; add new and change some existing bindings.
(todos-archive-mode-map): Change a key binding.
(todos-categories-mode-map): Comment out a key binding.
(todos-filter-items-mode-map): Rename from
todos-top-priorities-mode-map.
(todos-mode): Make todos-current-todos-file,
todos-categories-full, todos-categories, todos-first-visit,
todos-category-number, todos-show-done-only,
todos-categories-with-marks local variables and set them; add
todos-show-current-file to pre-command-hook, todos-after-find-file
to post-command-hook and todos-reset-global-current-todos-file to
kill-buffer-hook.
(todos-archive-mode): Make todos-current-todos-file,
todos-categories and todos-category-number local variables and set
them; add todos-after-find-file to post-command-hook.
(todos-raw-mode): New derived major mode.
(todos-categories-mode): Don't set font-lock-defaults and
buffer-read-only; make todos-current-todos-file and
todos-categories local variables and set them.
(todos-filter-items-mode): Rename from todos-top-priorities-mode-map.
(todos-quit): Don't reset todos-categories on quitting
todos-categories-mode; handle quitting todos-filter-items-mode.
(todos-show): Simplify; when visiting an archive file switch to
corresponding Todos file; use todos-first-visit.
(todos-view-archived-items): Simplify; call todos-category-number.
(todos-show-archive): Rename from todos-switch-to-archive and
adjust callers; simplify.
(todos-toggle-display-date-time): Add optional argument to toggle
display in entire file.
(todos-top-priorities): Use todos-filter-items, which now contains
the previous core of this command.
(todos-merged-top-priorities, todos-diary-items):
Use todos-filter-items.
(todos-forward-category): Add optional argument to go to the
previous category.
(todos-backward-category): Use todos-forward-category.
(todos-jump-to-category): Refine implementation.
(todos-forward-item, todos-backward-item): Fix movement from todo
to done item and vice versa.
(todos-add-file): Remove argument and simplify.
(todos-rename-category): Use todos-current-todos-file and
todos-mode-line-function; set todos-categories with
todos-set-categories.
(todos-delete-category): Ask what to do if category has archived items.
(todos-raise-category): Ensure modified todos-categories is added
to file's categories sexp.
(todos-move-category): Improve implementation, especially handling
of archived categories.
(todos-merge-category): Tweak; set item counts.
(todos-insert-item): Improve handling of various argument values;
add new argument values to control marking of diary items and to
use region for item body.
(todos-insert-item-from-calendar): Use todos-global-current-todos-file.
(todos-delete-item, todos-edit-item-header): Handle marked items.
(todos-edit-item): Incorporate functionality of removed
todos-string-multiline-p.
(todos-edit-multiline): Use set-window-buffer instead of
switch-to-buffer.
(todos-edit-quit): Don't save on quitting; use todos-show instead
of todos-category-select.
(todos-raise-item-priority): Add argument to lower priority;
improve handling of top priority items in todos-filter-items-mode;
restore marks.
(todos-lower-item-priority): Use todos-raise-item-priority.
(todos-set-item-priority): Increment maximum number if item is new.
(todos-move-item): Handle marked items; delay changing category
moved from till after movement to avoid restoring if user cancels
before insertion.
(todos-item-done): Add optional argument to insert comment; fix
item counts and update sexp.
(todos-item-undo): Fix item counts and update.
(todos-archive-done-item-or-items): Rename from
todos-archive-done-items; add optional argument to archive all
items in category; handle marked items.
(todos-unarchive-category): Use todos-unarchive-items.
(todos-toggle-diary-inclusion): Incorporate functionality of
removed todos-toggle-item-diary-inclusion; handle marked items.
(todos-print): Add optional argument to print to file.
(todos-done-string-start): Don't use todos-nondiary-start.
(todos-date-string-matcher, todos-time-string-matcher)
(todos-done-string-matcher, todos-category-string-matcher): Rename
from *-match and adjust callers.
(todos-wrap-and-indent): Use set instead of setq for local variables.
(todos-prefix-overlays): Improve overlay handling.
(todos-reset-categories): Fix and complete implementation.
(todos-toggle-show-current-file): Rename from
todos-toggle-switch-todos-file-noninteractively.
(todos-category-select): Use todos-mode-line-function.
(todos-item-start): Comment out code used by removed function.
(todos-remove-item): Handle presence of both prefix/number and
mark overlays.
(todos-get-count): Simplify.
(todos-set-count): Change argument list and adjust callers; simplify.
(todos-set-categories): Handle new archive files; use
todos-categories-full and todos-ignore-archived-categories.
(todos-truncate-categories-list): Use todos-categories-full.
(todos-update-categories-sexp): Use kill-region instead of
kill-line; use todos-categories-full.
(todos-read-file-name): Add argument to require existing file and
adjust callers; use file-truename.
(todos-read-category): Remove argument to require existing
category and delegate it to completing-read in function body.
(todos-validate-category-name): Make empty string prompt only for
initial category name.
(todos-read-date): Use = instead of eq for testing if month = 13,
and if it is, set monthname to *.
(todos-display-categories): Use todos-global-current-todos-file;
use set-window-buffer instead of switch-to-buffer; add a line
showing item count totals.
(todos-padded-string): Use the longest of category name or label.
(todos-descending-counts): Rename from
todos-descending-counts-store and adjust users.
(todos-insert-category-line): Adjust format; use mapconcat; kill
buffer after jumping to category.

13 years ago* calendar/todos.el Add and revise various doc strings, remove
Stephen Berman [Mon, 16 May 2011 00:00:28 +0000 (01:00 +0100)]
* calendar/todos.el Add and revise various doc strings, remove
further commented out code; add further comments; further code
rearrangement.
(todos-file-do, todos-archive-file, todos-mode-hook)
(todos-edit-mode-hook, todos-exclusion-start, todos-exclusion-end)
(todos-view-archive, todos-search-string)
(todos-jump-to-category-noninteractively, todos-initial-setup):
Remove.
(todos-files): Remove this defcustom.
(todos-initial-category, todos-display-categories-first)
(todos-auto-switch-todos-file, todos-default-todos-file)
(todos-categories-category-label, todos-categories-todo-label)
(todos-categories-diary-label, todos-categories-done-label)
(todos-categories-archived-label)
(todos-categories-number-separator, todos-categories-align)
(todos-ignore-archived-categories, todos-nondiary-marker):
New defcustoms.
(todos-prefix, todos-done-separator, todos-file-top)
(todos-categories-buffer, todos-archived-categories-buffer)
(todos-edit-buffer, todos-always-add-time-string, todos-button):
Change default value.
(todos-done-string): Add todos-reset-done-string as :set function,
but keep this commented out.
(todos-files, todos-archives, todos-insertion-map)
(todos-category-done, todos-nondiary-start, todos-nondiary-end)
(todos-show-done-only, todos-date-string-start)
(todos-done-string-start): New variables.
(todos-files-directory, todos-files-function, todos-merged-files)
(todos-prompt-merged-files, todos-files, todos-modes-set-1)
(todos-modes-set-2, todos-reset-done-string, todos-reset-categories)
(todos-toggle-switch-todos-file-noninteractively)
(todos-switch-todos-file, todos-counts, todos-get-count)
(todos-set-count, todos-set-categories)
(todos-truncate-categories-list, todos-update-categories-sexp)
(todos-read-file-name, todos-sort, todos-display-sorted)
(todos-label-to-key, todos-insert-sort-button): New functions.
(todos-display-categories-sorted-by-todo)
(todos-display-categories-sorted-by-diary)
(todos-display-categories-sorted-by-done)
(todos-display-categories-sorted-by-archived)
(todos-update-merged-files, todos-switch-to-archive)
(todos-choose-archive, todos-merged-top-priorities)
(todos-jump-to-category-other-file, todos-clear-matches)
(todos-add-file, todos-change-default-file, todos-move-category)
(todos-merge-category, todos-merge-categories)
(todos-edit-item-time, todos-move-item-to-file)
(todos-unarchive-category, todos-toggle-item-diary-nonmarking)
(todos-toggle-diary-nonmarking): New commands.
(todos-toggle-show-done-only): New command replacing todos-view-archive.
(todos-faces): New defgroup; use in all face definitions.
(todos-sorted-column, todos-archived-only, todos-search): New faces.
(todos-font-lock-keywords): Use subexpression 1 with matcher
todos-category-string-match.
(todos-mode-map, todos-archive-mode-map, todos-edit-mode-map)
(todos-categories-mode-map): Add new key bindings; change some
existing bindings.
(todos-top-priorities-mode-map): New keymap.
(todos-menu): Add submenues and new entries.
(auto-mode-alist): Add extension of Todos and Todos archive files.
(todos-mode, todos-archive-mode): Make derived mode; use
todos-modes-set-1, todos-modes-set-2, todos-auto-switch-todos-file
and todos-switch-todos-file; make todos-show-done-only local
variable.
(todos-edit-mode): Make derived mode; use todos-modes-set-1.
(todos-categories-mode): Make derived mode.
(todos-top-priorities-mode): New derived major mode.
(todos-save): Remove unused code.
(todos-quit): Handle todos-categories-mode; save archive buffer.
(todos-show): Add optional argument to prompt for a Todos file; if
called interactively or with prefix arg or from an archive, don't
make a no-op but reset todos-current-todos-file, todos-categories
and todos-category-number; use todos-read-file-name,
todos-display-categories-first, todos-ignore-archived-categories.
(todos-display-categories): Change argument name; refactor code
for inserting table labels and lines, using
todos-ignore-archived-categories, todos-sort,
todos-categories-number-separator, todos-insert-sort-button,
todos-categories-*-labels, and todos-insert-category-line.
(todos-display-categories-alphabetically): Use todos-display-sorted.
(todos-toggle-view-done-items): Use todos-done-string-start and
todos-get-count.
(todos-toggle-display-date-time): Use todos-done-string-start.
(todos-top-priorities): Remove autoload cookie; partially rewrite:
new argument list; allow combining top priorities of multiple
Todos files; change display to include category (and file) name as
part of item header; use todos-top-priorities-mode.
(todos-diary-items): Reimplement using only todos-top-priorities.
(todos-forward-category, todos-backward-category): Accommodate to
1-based numbering of categories; move point to top of category.
(todos-jump-to-category): Rewrite, adding optional arguments to
provide a category in non-interactive uses and to prompt for which
Todos file to jump to.
(todos-search): Reimplement; highlight each match as found, say
how many matches remain and prompt whether to go to next one; at
end of search prompt whether to remove highlighting.
(todos-add-category): Remove autoload cookie; assign new category
the highest category number; associate zero-initialized vector of
item counts, instead of property list, with new category; use
todos-validate-category-name and todos-update-categories-sexp.
(todos-rename-category): Use todos-validate-category-name and
todos-update-categories-sexp; take archive files into account.
(todos-delete-category): Use todos-get-count and
todos-update-categories-sexp, let-bind variable that were
mistakenly global; use delete-region instead of kill-region;
accommodate to 1-based numbering of categories; move point to top
of category.
(todos-raise-category): Handle item count vectors; use
todos-insert-category-line and todos-update-categories-sexp.
(todos-insert-item): Use nil time-string argument to omit time
string; use todos-nondiary-start and todos-nondiary-end and
todos-update-categories-sexp; if category named to insert into
does not exist, add it; take new diary items into account.
(todos-insert-item-ask-date, todos-insert-item-ask-date-time)
(todos-insert-item-ask-date-time-for-diary)
(todos-insert-item-ask-date-time-for-diary-here)
(todos-insert-item-ask-date-time-here)
(todos-insert-item-ask-date-maybe-notime)
(todos-insert-item-ask-date-maybe-notime-for-diary)
(todos-insert-item-ask-date-maybe-notime-for-diary-here)
(todos-insert-item-ask-date-maybe-notime-here)
(todos-insert-item-ask-date-for-diary)
(todos-insert-item-ask-date-for-diary-here)
(todos-insert-item-ask-date-here, todos-insert-item-ask-dayname)
(todos-insert-item-ask-dayname-time)
(todos-insert-item-ask-dayname-time-for-diary)
(todos-insert-item-ask-dayname-time-for-diary-here)
(todos-insert-item-ask-dayname-time-here)
(todos-insert-item-ask-dayname-maybe-notime)
(todos-insert-item-ask-dayname-maybe-notime-for-diary)
(todos-insert-item-ask-dayname-maybe-notime-for-diary-here)
(todos-insert-item-ask-dayname-maybe-notime-here)
(todos-insert-item-ask-dayname-for-diary)
(todos-insert-item-ask-dayname-for-diary-here)
(todos-insert-item-ask-dayname-here, todos-insert-item-ask-time)
(todos-insert-item-ask-time-for-diary)
(todos-insert-item-ask-time-for-diary-here)
(todos-insert-item-ask-time-here)
(todos-insert-item-maybe-notime)
(todos-insert-item-maybe-notime-for-diary)
(todos-insert-item-maybe-notime-for-diary-here)
(todos-insert-item-maybe-notime-here)
(todos-insert-item-for-diary, todos-insert-item-for-diary-here):
New insertion commands.
(todos-insert-item-from-calendar): Use todos-current-todos-file.
(todos-delete-item): Handle diary items;
use todos-update-categories-sexp.
(todos-edit-item): Check if point is with item string;
use read-string instead of read-from-minibuffer;
use todos-date-string-start; after editing put point at start of
item text.
(todos-edit-multiline): Narrow to item before invoking
todos-edit-mode; show key binding of todos-edit-quit in a message.
(todos-edit-quit): Use todos-save; kill buffer.
(todos-edit-item-header): Add optional argument to prompt for
editing only date string or only time string;
use todos-date-string-start.
(todos-edit-item-date, todos-edit-item-date-is-today)
(todos-raise-item-priority, todos-lower-item-priority): Rename
from todos-{raise, lower}-item and make them DTRT in
todos-top-priorities-mode.
(todos-set-item-priority): Make interactive; use todos-get-count
and todos-insert-with-overlays; interactively, just relocate the
item within its category.
(todos-move-item): Add optional argument to prompt for a category
in another Todos file; handle diary items; fix restoration after
cancelling before inserting.
(todos-item-done): Handle diary items; simplify handling of
insertion in done items section.
(todos-item-undo): Handle diary items.
(todos-archive-done-items): Accommodate to new handling of archive
files (in parallel with Todos files); handle diary items; use
todos-done-string-start.
(todos-toggle-item-diary-inclusion): Use todos-nondiary-start,
todos-nondiary-end and todos-item-counts.
(todos-toggle-diary-inclusion): Use todos-category-done instead of
todos-category-end.
(todos-print): Remove autoload cookie; rewrite to make overlays,
line wrapping and wrap prefixes printable.
(todos-date-pattern): Make parenthesized groups shy.
(todos-date-string-match): Use todos-date-string-start; make
todos-date-pattern an explicitly numbered group.
(todos-time-string-match): Use todos-date-string-start.
(todos-done-string-match): Use todos-done-string-start.
(todos-category-string-match): Rewrite to match new category and
category+filename patterns in todos-top-priorities-mode.
(todos-prefix-overlays): Use todos-done-string-start and
todos-category-done.
(todos-reset-prefix): Handle archive files; restore point after
changing prefix.
(todos-reset-separator): Handle archive files.
(todos-category-number): Make category number one more than its
list index.
(todos-current-category): Accommodate to 1-based numbering of
categories.
(todos-category-select): Simplify handling of done items and done
separator string overlay.
(todos-item-start): Use todos-date-string-start and
todos-done-string-start.
(todos-item-start, todos-item-end): Fix wrong parenthesizing.
(todos-item-string): Restore point after getting item bounds; use
buffer-substring-no-properties.
(todos-done-item-p): Use todos-done-string-start.
(todos-make-categories-list): Add optional argument to force
looping through file to get categories and their item counts,
otherwise set todos-categories from sexp in first line; use
vectors of item counts instead of plists; count diary items.
(todos-item-counts): Use todos-counts, todos-set-counts,
todos-get-counts, and todos-update-categories-sexp instead of
getting and setting properties; handle diary items.
(todos-read-category): Add argument to set prompt; don't offer
default category.
(todos-validate-category-name): Rename from
todos-check-category-name; take into account whether there are
already categories or not.
(todos-read-date): Accept `*' as an unspecified month, day, or year.
(todos-padded-string): Accommodate new structure of
todos-categories as alists; use todos-categories-align.
(todos-descending-counts-store): New variable.
(todos-insert-category-line): Rename from
todos-insert-category-name and reimplement using labels and
todos-get-counts instead of properties; use
todos-ignore-archived-categories; highlight sorted column.

13 years ago* calendar/todos.el Remove lots of commented out code; add various
Stephen Berman [Fri, 9 Jul 2010 12:50:10 +0000 (13:50 +0100)]
* calendar/todos.el Remove lots of commented out code; add various
comments; further code rearrangement.
(todos-insert-item-here-ask-date-time)
(todos-insert-item-ask-date-time)
(todos-insert-item-ask-dayname-time)
(todos-insert-item-for-diary)
(todos-insert-item-for-diary-ask-date-time)
(todos-make-categories-alist, todos-categories-alist): Remove.
(todos-categories-list): Comment out.
(todos-make-categories-list): New function replacing
todos-make-categories-alist, using category plists to get item
counts and taking archive into account.
(todos-current-todos-file): New variable.
(todos-mode-map): Update key bindings.
(todos-save): Add as comment code to make sure todos-categories
sexp is current on saving.
(todos-quit): Call todos-show on quitting Todos archive buffer.
(todos-show): If todos-current-todos-file is not set to Todos
file, set it as a new file; set todos-categories from
todos-make-categories-alist.
(todos-display-categories): Use a different display format for
archive file; put point initially on the first button.
(todos-toggle-view-done-items): Check the category's `done'
property to determine if there are done items.
(todos-view-archive): Set todos-current-todos-file to the archive
file; jump from the Todos file to the same category in the
archive, if it exists, else jump to the first category; use
message instead of error.
(todos-add-category): Intern a special symbol for the new category
and set its property list to holds counts of the numbers of todo,
done and archived items in the category; assign the new category
the current highest category number.
(todos-rename-category): Don't use todos-categories-alist.
(todos-delete-category): Check the category's `todo' and `done'
properties to determine if it is empty; ensure that the end of the
last category is found; after deleting the category, empty its
plist and unintern its special symbol.
(todos-insert-item-here): Fix argument list of todos-insert-item.
(todos-delete-item, todos-raise-item, todos-lower-item):
Use message instead of error.
(todos-move-item): If the category to be moved to does not exist,
add it as a new category.
(todos-item-done, todos-reset-separator):
Use todos-category-select instead of todos-show.
(todos-archive-done-items): Make buffer writeable; conditionalize
search for end of category; save after adding to archive in case
the file is new, so it can be found.
(todos-category-select): Wrap search in if instead of or+and;
don't hide done items in an archive.
(todos-set-item-priority): Check the category's `todo'
property to determine if there are not done todo items.
(todos-jump-to-category-noninteractively): Just switch to buffer
visiting todos-current-todos-file, since this can be either a
Todos file or an archive.
(todos-item-counts): Use category's plist instead of an alist.
(todos-longest-category-name-length): Argument is now a list of
category names, not an alist, so just test each element, not each
element's the car.
(todos-padded-string): Use todos-categories instead of
todos-categories-alist.
(todos-insert-category-name): Use category plist to get item
counts; take archived items into account.

14 years ago* calendar/todos.el: Numerous spelling and comment fixes, doc
Stephen Berman [Fri, 18 Jun 2010 22:52:10 +0000 (23:52 +0100)]
* calendar/todos.el: Numerous spelling and comment fixes, doc
string fixes to conform with checkdoc, further rearrangement of
definitions, etc.
(todos-previous-line, todos-previous-answer)
(todos-insert-item-ask-date, todos-change-date)
(todos-date-nodayname-pattern, todos-dayname-date-pattern)
(todos-count-items-in-category, todos-count-all-items): Remove.
(todos-update-numbered-prefix, todos-item-start-overlays)
(todos-add-item-non-interactively): Comment out, also in uses.
(todos-done-separator): Change default value.
(todos-always-add-time-string): Rename from todos-add-time-string
and adjust uses.
(todos-read-category): Rename from todos-completing-read and
adjust callers; use todos-current-category.
(todos-make-categories-alist): Rename from function
todos-categories-alist.
(todos-categories-alist): New variable.
(todos-indent-to-here): New defcustom.
(todos-button): New face.
(todos-display-categories-alphabetically, todos-raise-category)
(todos-lower-category, todos-insert-item-for-diary-ask-date-time)
(todos-insert-item-here-ask-date-time)
(todos-insert-item-ask-date-time)
(todos-insert-item-ask-dayname-time): New commands.
(todos-edit-item-header): New command replacing todos-change-date.
(todos-category-number, todos-indent, todos-item-counts)
(todos-check-category-name, todos-read-date, todos-read-dayname)
(todos-read-time, todos-padded-string)
(todos-insert-category-name): New functions.
(todos-set-item-priority): New function replacing
todos-add-item-non-interactively.
(todos-mode-map): Remap newline to newline-and-indent.
(todos-edit-mode-map): Make sparse keymap; remap newline to
newline-and-indent.
(todos-categories-mode-map): New keymap.
(todos-mode, todos-edit-mode): Make indent-line-function local
variable and set to todos-indent.
(todos-categories-mode): New major mode.
(todos-display-categories): List categories initially in their
numerical order; add optional argument to switch to alphabetical
listing.
(todos-toggle-view-done-items): Simplify implementation.
(todos-toggle-display-date-time): Fix regexp search string.
(todos-backward-item, todos-forward-item): Use variable
todos-item-start.
(todos-add-category): Use todos-check-category-name and
todos-categories-alist.
(todos-rename-category): Use todos-current-category,
todos-check-category-name and todos-categories-alist.
(todos-delete-category): Use todos-check-category-name and
todos-categories-alist and take done items into account.
(todos-insert-item): Use separate arguments to handle insertion of
date/dayname and time strings, add new argument to mark item for
diary inclusion, use new todos-read-* functions,
todos-set-item-priority and todos-item-counts.
(todos-insert-item-here, todos-insert-item-for-diary)
(todos-insert-item-from-calendar): Adapt to new version of
todos-insert-item.
(todos-delete-item, todos-item-done): Use todos-item-counts.
(todos-edit-item): Indent newlines inserted by C-q C-j if nonspace
char follows.
(todos-lower-item): Ensure only not-done items can be lowered.
(todos-move-item): Use todos-current-category, todos-read-category
and todos-item-counts.
(todos-archive-done-items): Use todos-current-category and
todos-item-counts; fix regexp search string.
(todos-item-undo): Use todos-current-category,
todos-set-item-priority, todos-insert-with-overlays and
todos-item-counts; restore if user quits before inserting undone
item.
(todos-date-pattern): Rewrite without using
todos-date-nodayname-pattern and todos-dayname-date-pattern.
(todos-date-string-match): Do not make todos-date-pattern an
unnumbered group.
(todos-time-string-match): Make todos-date-pattern a shy group.
(todos-wrap-and-indent): Use todos-indent-to-here.
(todos-reset-prefix): Revert to using todos-show instead of
todos-category-select.
(todos-prefix-overlays): Fix numbering of done items and updating
of prefix.
(todos-category-select): Use todos-current-category; fix display
of separator string; don't move point to top of category.
(todos-jump-to-category-noninteractively): Use todos-category-number.
(todos-insert-with-overlays): Use todos-item-start unconditionally.
(todos-item-start): New variable.
(todos-item-start): Use it to define this function.
(todos-item-end): Adjust if item is last unfinished one before
displayed done items.
(todos-remove-item): Use todos-item-start and todos-item-end
instead of todos-forward-item and todos-backward-item.
(todos-longest-category-name-length): Add argument for list of
categories.

14 years ago* calendar/todos.el: Comment out calendar require, since diary-lib
Stephen Berman [Tue, 25 May 2010 00:19:50 +0000 (01:19 +0100)]
* calendar/todos.el: Comment out calendar require, since diary-lib
requires calendar.  Rearrange file to group definitions according
to their use (types of commands, internal functions, etc.)
(todos-file-done, todos-insert-threshold, todos-remove-separator)
(todos-date-string, todos-time-string, todos-check-overlay)
(todos-show-paren-hack, todos-file-item, todos-more-important-p):
Comment out.
(todos-current-date, todos-item-end-overlays)
(todos-list-categories): Remove.
(todos-item-end): Remove (the variable, not the function).
(todos-item-overlays): Rename to todos-prefix-overlays and adjust
callers.
(todos-prefix-overlays): Rename from todos-item-overlays.
(todos-done-separator, todos-done-string, todos-show-with-done)
(todos-files, todos-archive-file, todos-categories-buffer)
(todos-archived-categories-buffer, todos-wrap-lines)
(todos-line-wrapping-function): New defcustoms.
(todos-done, todos-done-sep): New faces.
(todos-done-face, todos-done-sep-face): Corresponding new variables.
(todos-search-string, todos-date-nodayname-pattern)
(todos-dayname-date-pattern, todos-date-pattern): New variables.
(todos-done-string-match, todos-category-string-match)
(todos-check-format, todos-wrap-and-indent, todos-reset-separator)
(todos-current-category, todos-count-items-in-category)
(todos-done-item-p, todos-categories-alist, todos-count-all-items)
(todos-longest-category-name-length): New functions.
(todos-categories-list): New buffer-specific function replacing
todos-list-categories.
(todos-toggle-item-numbering, todos-toggle-view-done-items)
(todos-search, todos-view-archive, todos-diary-items)
(todos-toggle-display-date-time, todos-insert-item-no-time)
(todos-insert-item-ask-date, todos-insert-item-for-diary)
(todos-insert-item-from-calendar, todos-edit-quit)
(todos-change-date, todos-item-done, todos-archive-done-items)
(todos-item-undo): New commands.
(todos-archive-mode): New mode.
(todos-archive-mode-map, todos-edit-mode-map): New keymaps.
(todos-category-beg): Change value.
(todos-number-prefix): Change default value.
(todos-edit-buffer): Change from defvar to defcustom.
(todos-font-lock-keywords): Use todos-done-string-match and
todos-category-string-match.
(todos-backward-item, todos-forward-item): Use todos-done-string
and todos-date-pattern.
(todos-display-categories): Reimplement using buttons from
button.el instead of widgets.
(todos-top-priorities): Use with-current-buffer; take done items
into account; ensure buffers gets fontified.
(todos-add-category): Ensure new category does not begin with
empty lines.
(todos-jump-to-category): Use todos-category-select instead of
todos-show.
(todos-rename-category): Prompt for new name in body instead of in
interactive spec.
(todos-insert-item): Don't insert in done items section of
category.  Add two optional arguments to control insertion: (i) to
insert near point without prompting for priority; (ii) to use
defaults for date and time strings, to prompt for these, or to
choose date from the Calendar.
(todos-insert-item-here): Reimplement using todos-insert-item.
(todos-delete-item): Don't move point after deleting last item.
(todos-raise-item, todos-lower-item): Take done items into account.
(todos-move-item): Don't move done items; update item numbering;
restore if user quits before inserting moved item.
(todos-print): Prompt for confirmation to print.
(todos-reset-prefix): Search backward from end of file instead of
forward from top.
(todos-jump-to-category-noninteractively): Take Todos archive into
account.
(todos-category-select): Show or hide done items according to
todos-show-with-done; if shown, coordinate separator and prefix
overlays.
(todos-add-item-non-interactively): Replace binary insertion
algorithm with prompting for numerical priority.
(todos-insert-with-overlays): Remove use of variable todos-item-end.
(todos-item-start): Take done items into account; use
todos-date-pattern.
(todos-item-end): Reimplement using todos-forward-item.
(todos-remove-item): Reimplement using todos-forward-item and
todos-backward-item; redo overlay handling.
(todos-mode-map): Add some new key bindings and change numerous
existing bindings; use "i" as prefix key for item insertion
commands.
(todos-mode): Use todos-wrap-lines and delegate word-wrap and
wrap-prefix settings to todos-wrap-and-indent; add to invisibility
spec; set buffer-read-only to t and consequently let-bind this
variable in all Todos commands that change buffer content.
(todos-edit-mode): Make an indepent mode, not derived from text-mode.
(todos-save): Don't save top priorities buffer.
(todos-show): Make a no-op if called interactively in narrowed
Todos mode, since, also to work around item prefix reduplication
bug with show-paren-mode enabled; use todos-categories-list.

14 years ago* calendar/todos.el: Comment out time-stamp require; require
Stephen Berman [Sat, 7 Nov 2009 20:27:40 +0000 (21:27 +0100)]
* calendar/todos.el: Comment out time-stamp require; require
calendar and diary-lib.
(todos-prefix): Change default value and doc string to reflect new
meaning; add :initialize and :set functions.
(todos-time-string-format, todos-entry-prefix-function)
(todos-initials, todos-entry-timestamp-initials)
(todos-prefix-face, todos-category-sep, todos-category-end)
(todos-cp): Comment out.
(todos-prefix-string): Inherit from font-lock-comment-face.
(todos-item-header, todos-item-header-face): Remove.
(todos-date, todos-time): New faces.
(todos-date-face, todos-time-face): Corresponding new variables.
(todos-add-time-string, todos-include-in-diary)
(todos-exclusion-start, todos-exclusion-end, todos-number-prefix):
New defcustoms.
(todos-item-end, todos-item-start-overlays)
(todos-item-end-overlays): New variables.
(todos-date-string-match, todos-time-string-match): New functions.
(todos-font-lock-keywords): Use them.
(todos-current-date, todos-date-string, todos-time-string)
(todos-toggle-item-diary-inclusion, todos-toggle-diary-inclusion)
(todos-reset-prefix, todos-update-numbered-prefix)
(todos-check-overlay, todos-item-overlays)
(todos-insert-with-overlays, todos-show-paren-hack): New functions.
(todos-highlight-item): New command.
(todos-category-beg): Change value.
(todos-category-select): Use todos-category-beg and todos-item-overlays.
(todos-backward-item): Add optional count argument; use it and
todos-item-start.
(todos-forward-item): Use todos-check-overlay, todos-item-start
and variable todos-item-end.
(todos-edit-item, todos-delete-item): Use todos-number-prefix,
todos-update-numbered-prefix, todos-item-overlays.
(todos-add-category, todos-rename-category)
(todos-list-categories): Use new category format.
(todos-delete-category): Allow deleting non-empty category;
use new category format.
(todos-add-item-non-interactively): Comment out unnecessary
save-excursion; use todos-insert-with-overlays.
(todos-insert-item): Comment out unnecessary save-excursion; use
new item format for date/time header and diary inclusion marking.
(todos-insert-item-here): Use new item format for date/time header
and diary inclusion marking; use todos-insert-with-overlays.
(todos-raise-item): Make a no-op if point is on an empty line; use
todos-insert-with-overlays.
(todos-lower-item): Use todos-insert-with-overlays.
(todos-top-priorities): Move call to todos-show inside
save-excursion; add save-current-buffer after save-restriction.
(todos-item-start): Use variable todos-item-end.
(todos-item-end): Use todos-check-overlay and variable todos-item-end.
(todos-remove-item): Take item overlays into account.
(todos-mode): Change calculation of wrap-prefix; make
hl-line-range-function a local variable and set it to highlight
todo item.
(todos-show): Ensure point stays at top of category.

14 years ago* calendar/todos.el (todos-window-configuration): Comment out.
Stephen Berman [Fri, 3 Jul 2009 23:07:26 +0000 (00:07 +0100)]
* calendar/todos.el (todos-window-configuration): Comment out.
(todos-display-categories): Comment out use of
todos-window-configuration; use switch-to-buffer instead of
pop-to-buffer.
(todos-jump-to-category-noninteractively): Comment out use of
todos-window-configuration.
(todos-edit-item): Don't allow editing of date/time item header.
(todos-insert-item, todos-insert-item-here): Insert date/time
header in front of new item string.
(todos-mode): Tweak wrap-prefix.

11 years agoCommit ChangeLog changes. (They weren't committed on the previous
Stephen Berman [Wed, 12 Sep 2012 14:15:03 +0000 (16:15 +0200)]
Commit ChangeLog changes.  (They weren't committed on the previous
fileset commit, although the ChangeLog had been saved.)

14 years ago* calendar/todos.el (todos-file-do, todos-file-done):
Stephen Berman [Fri, 26 Jun 2009 00:22:56 +0000 (01:22 +0100)]
* calendar/todos.el (todos-file-do, todos-file-done):
Change default location to directory "~/.emacs.d/".
(todos-completion-ignore-case, todos-categories-buffer):
New defcustoms.
(todos-prefix-string, todos-item-header): New faces.
(todos-prefix-face, todos-item-header-face): Corresponding
new variables.
(todos-rename-category, todos-delete-category)
(todos-display-categories, todos-move-item): New commands.
(todos-mode-map): Add key bindings for new commands and for
todos-add-category, which had no key binding.
(todos-jump-to-category-noninteractively): New function.
(todos-top-priorities): Comment out code using a previously
deleted variable.
(todos-completing-read): Allow SPC to insert a space when entering
a new category name; use todos-completion-ignore-case.
(todos-font-lock-keywords, todos-window-configuration):
New variables.
(todos-mode): Make mode-name "TODOS"; make font-lock-defaults,
word-wrap, and wrap-prefix local variables.

15 years ago* calendar/todos.el (todos-list-categories): Fix typos.
Stephen Berman [Mon, 16 Feb 2009 00:38:42 +0000 (01:38 +0100)]
* calendar/todos.el (todos-list-categories): Fix typos.
(todos-show): Ensure file is in todos-mode.

15 years agoSecond commit to todos.el.
Stephen Berman [Thu, 12 Feb 2009 21:35:50 +0000 (22:35 +0100)]
Second commit to todos.el.

* calendar/todos.el (todos-header): Remove defvar.
(todos-add-category): Comment out code that inserts and updates
the file local variables first line of the file todos-file-do.
(todos-list-categories): New function.
(todos-show): Use it; remove use of a previously deleted variable.

15 years agoReconstructed and backdated initial commit of todos.el.
Stephen Berman [Thu, 12 Feb 2009 21:00:00 +0000 (22:00 +0100)]
Reconstructed and backdated initial commit of todos.el.

* calendar/todos.el: New file.  This is a copy of todo-mode.el
from 2009-01-30T13:06:07Z!lekktu@gmail.com except for the following changes: replace all
occurrences of the namespace prefix "todo-" with "todos-", delete
the defvar todo-cats (the old name of todo-categories) and its use
in todos-add-category, delete all defaliases of old command names.

11 years agoFix 2012-09-11T14:06:33Z!bastien1@free.fr.
Bastien Guerry [Tue, 11 Sep 2012 17:43:21 +0000 (19:43 +0200)]
Fix 2012-09-11T14:06:33Z!bastien1@free.fr.

11 years ago* nsterm.h: Add delay parameter to updateFrameSize.
Jan Djärv [Tue, 11 Sep 2012 17:08:02 +0000 (19:08 +0200)]
* nsterm.h: Add delay parameter to updateFrameSize.

* nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
(updateFrameSize:): Add delay parameter to updateFrameSize, send it
to change_frame_size.
(windowDidResize:): Pass YES to updateFrameSize.

Fixes: debbugs:12388

11 years ago* subr.el (set-temporary-overlay-map): Add a docstring. (bug#12346)
Bastien Guerry [Tue, 11 Sep 2012 16:45:31 +0000 (18:45 +0200)]
* subr.el (set-temporary-overlay-map): Add a docstring.  (bug#12346)

Bug #12346 is not closed as this commit does not document
`set-temporary-overlay-map' in the manual.

11 years agoDiscard killed buffers from deleted window and frame objects.
Dmitry Antipov [Tue, 11 Sep 2012 15:42:50 +0000 (19:42 +0400)]
Discard killed buffers from deleted window and frame objects.
This reduces an amount of references to killed buffers and
helps GC to reclaim them faster.
* alloc.c (discard_killed_buffers): New function.
(mark_object): Use it for deleted windows and frames.
(mark_object): If symbol's value is set up for a killed buffer
or deleted frame, restore it's global binding.
* data.c (swap_in_global_binding): Add GC notice.
(swap_in_symval_forwarding): Use convenient set_blv_where.
* window.c (wset_next_buffers, wset_prev_buffers): Move ...
* window.h: ... to here.

11 years ago* minibuffer.el (completion-table-subvert): Fix docstring. (bug#12347)
Bastien Guerry [Tue, 11 Sep 2012 14:06:33 +0000 (16:06 +0200)]
* minibuffer.el (completion-table-subvert): Fix docstring.  (bug#12347)

11 years ago* help-fns.el (describe-variable): Fix typo. (bug#12346)
Bastien Guerry [Tue, 11 Sep 2012 13:43:06 +0000 (15:43 +0200)]
* help-fns.el (describe-variable): Fix typo. (bug#12346)

11 years agoAuto-commit of generated files.
Glenn Morris [Tue, 11 Sep 2012 10:17:36 +0000 (06:17 -0400)]
Auto-commit of generated files.

11 years agognus-notifications.el: add nil checks
Julien Danjou [Tue, 11 Sep 2012 10:08:59 +0000 (10:08 +0000)]
gnus-notifications.el: add nil checks

11 years agoBe more explicit about some Makefile dependencies
Glenn Morris [Tue, 11 Sep 2012 07:45:38 +0000 (00:45 -0700)]
Be more explicit about some Makefile dependencies

* Makefile.in (install-arch-dep, install-arch-indep, install-doc):
Be more explicit about dependencies, for parallel `make install'.

It is not so unreasonable to run `make -j# install' from a clean state
for a self-contained NS build, where the "installation" happens within
the build tree.

11 years agoConvenient macro to check whether the buffer is live.
Dmitry Antipov [Tue, 11 Sep 2012 04:22:03 +0000 (08:22 +0400)]
Convenient macro to check whether the buffer is live.
* buffer.h (BUFFER_LIVE_P): New macro.
* alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
* minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.

11 years agoFix wrong overhang display for gstring compositions (Bug#12364).
YAMAMOTO Mitsuharu [Tue, 11 Sep 2012 03:32:41 +0000 (12:32 +0900)]
Fix wrong overhang display for gstring compositions (Bug#12364).

* xdisp.c (right_overwritten, right_overwriting): Also handle gstring
composition cases (Bug#12364).

* xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
overhang of succeeding glyphs overlapping box cursor.

* w32term.c (x_draw_glyph_string): Likewise.

11 years agoSimplify, document, and port floating-point.
Paul Eggert [Tue, 11 Sep 2012 02:28:27 +0000 (19:28 -0700)]
Simplify, document, and port floating-point.

The porting part of this patch fixes bugs on non-IEEE platforms
with frexp, ldexp, logb.
* admin/CPP-DEFINES (HAVE_CBRT, HAVE_LOGB, logb): Remove.
* configure.ac (logb, cbrt): Do not check for these functions,
as they are not being used.
* doc/lispref/numbers.texi (Float Basics, Arithmetic Operations, Math Functions):
Document that / and mod (with floating point arguments), along
with asin, acos, log, log10, expt and sqrt, return special values
instead of signaling exceptions.
(Float Basics): Document that logb operates on the absolute value
of its argument.
(Math Functions): Document that (log ARG BASE) also returns NaN if
BASE is negative.  Document that (expt X Y) returns NaN if X is a
finite negative number and Y a finite non-integer.
* etc/NEWS: Document NaNs versus signaling-error change.
* src/data.c, src/lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
Now static.
* src/floatfns.c: Simplify discussion of functions that Emacs doesn't
support, by removing commented-out code and briefly listing the
C89 functions excluded.  The commented-out stuff was confusing
maintenance, e.g., we thought we needed cbrt but it was commented out.
(logb): Remove decl; no longer needed.
(isfinite): New macro, if not already supplied.
(isnan): Don't replace any existing macro.
(Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
are present on all C89 platforms.
(Ffrexp): Do not special-case zero, as frexp does the right thing
for that case.
(Flogb): Do not use logb, as it doesn't have the desired meaning
on hosts that use non-base-2 floating point.  Instead, stick with
frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
frexp, to avoid getting an unspecified result.

11 years ago* xdisp.c (Qinhibit_debug_on_message): Now static.
Paul Eggert [Tue, 11 Sep 2012 01:20:56 +0000 (18:20 -0700)]
* xdisp.c (Qinhibit_debug_on_message): Now static.

11 years ago* nsterm.m (ns_update_begin): Set clip path to whole view by using
Jan Djärv [Mon, 10 Sep 2012 21:01:45 +0000 (23:01 +0200)]
* nsterm.m (ns_update_begin): Set clip path to whole view by using
NSBezierPath.

Fixes: debbugs:12131

11 years ago* progmodes/sql.el: Version 3.1
Michael Mauger [Mon, 10 Sep 2012 19:22:53 +0000 (15:22 -0400)]
* progmodes/sql.el: Version 3.1
(sql-db2-escape-newlines): New variable.
(sql-escape-newlines-filter): Use it.

11 years agolisp/custom.el (custom-theme-load-confirm): Remove unneeded assignment.
Juanma Barranquero [Mon, 10 Sep 2012 15:52:15 +0000 (17:52 +0200)]
lisp/custom.el (custom-theme-load-confirm): Remove unneeded assignment.

11 years ago* vc/diff-mode.el (diff-mode-menu): diff-remove-trailing-whitespace.
Dan Nicolaescu [Mon, 10 Sep 2012 14:40:13 +0000 (10:40 -0400)]
* vc/diff-mode.el (diff-mode-menu): diff-remove-trailing-whitespace.

11 years agoMention diff-remove-trailing-whitespace.
Dan Nicolaescu [Mon, 10 Sep 2012 14:33:08 +0000 (10:33 -0400)]
Mention diff-remove-trailing-whitespace.

11 years agont/config.nt: Sync with autogen/config.in.
Juanma Barranquero [Mon, 10 Sep 2012 13:37:53 +0000 (09:37 -0400)]
nt/config.nt: Sync with autogen/config.in.
(FLOAT_CHECK_DOMAIN, HAVE_FMOD, HAVE_FREXP)
(HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove.

11 years agoAuto-commit of generated files.
Glenn Morris [Mon, 10 Sep 2012 10:18:11 +0000 (06:18 -0400)]
Auto-commit of generated files.

11 years ago* fns.c (Fdelq, Fdelete): Doc fix.
Chong Yidong [Mon, 10 Sep 2012 03:25:10 +0000 (11:25 +0800)]
* fns.c (Fdelq, Fdelete): Doc fix.

11 years agoParenthesize macro bodies.
Paul Eggert [Mon, 10 Sep 2012 01:17:23 +0000 (18:17 -0700)]
Parenthesize macro bodies.

* lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
(XSETFLOAT, XSETMISC): Parenthesize.

11 years agoNew emacs-lisp-byte-code-mode; misc minor changes.
Stefan Monnier [Mon, 10 Sep 2012 01:16:13 +0000 (21:16 -0400)]
New emacs-lisp-byte-code-mode; misc minor changes.
* lisp/emacs-lisp/lisp-mode.el (emacs-list-byte-code-comment-re): New var.
(emacs-lisp-byte-code-comment)
(emacs-lisp-byte-code-syntax-propertize, emacs-lisp-byte-code-mode):
New functions.
(eval-sexp-add-defvars): Don't skip defvars in column >0.
(eval-defun-2): Remove bogus interactive spec.
(lisp-indent-line): Remove redundant whole-exp code, now done in
indent-according-to-mode.
(save-match-data): Remove redundant indent data.
* lisp/emacs-lisp/benchmark.el (benchmark-run, benchmark-run-compiled):
Use `declare'.
* lisp/gnus/qp.el (quoted-printable-decode-region):
Inline+CSE+strength-reduction.

11 years agoImprove robustness of 'make bootstrap'.
Paul Eggert [Mon, 10 Sep 2012 01:03:27 +0000 (18:03 -0700)]
Improve robustness of 'make bootstrap'.

Run autogen.sh after bootstrap-clean, to avoid bzr pull issues.
* INSTALL, README: Document autogen.sh.
* Makefile.in (Makefile): Mark it as precious, since it's updated
atomically.
(MAKE_CONFIG_STATUS): New macro.
(config.status, bootstrap): Use it.  This causes 'make bootstrap'
to run config.status with the --recheck option, which is more
appropriate for a bootstrap.
(bootstrap): Run autogen.sh right after cleaning.  Don't worry
about failures due to missing tools.
* autogen.sh: Exit with status 101 when failing due to missing tools.
* make-dist: Distribute autogen.sh.

Fixes: debbugs:12376

11 years ago* lisp/replace.el (replace-regexp-lax-whitespace): New defcustom.
Juri Linkov [Sun, 9 Sep 2012 22:15:24 +0000 (01:15 +0300)]
* lisp/replace.el (replace-regexp-lax-whitespace): New defcustom.
(replace-lax-whitespace, query-replace-regexp)
(query-replace-regexp-eval, replace-regexp): Doc fix.
(perform-replace, replace-highlight): Let-bind
isearch-lax-whitespace to replace-lax-whitespace and
isearch-regexp-lax-whitespace to replace-regexp-lax-whitespace.

* lisp/isearch.el (isearch-query-replace): Let-bind
replace-lax-whitespace to isearch-lax-whitespace and
replace-regexp-lax-whitespace to
isearch-regexp-lax-whitespace.

Fixes: debbugs:10885

11 years ago* src/lisp.h (make_lisp_ptr): New macro to replace XSET.
Stefan Monnier [Sun, 9 Sep 2012 21:24:04 +0000 (17:24 -0400)]
* src/lisp.h (make_lisp_ptr): New macro to replace XSET.
(XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
Use it.

11 years ago* lisp/eshell/em-unix.el (eshell/sudo): Explicitly drop return value.
Stefan Monnier [Sun, 9 Sep 2012 21:11:14 +0000 (17:11 -0400)]
* lisp/eshell/em-unix.el (eshell/sudo): Explicitly drop return value.

11 years agoAvoid leaving traces of cursor when entering linum-mode.
Eli Zaretskii [Sun, 9 Sep 2012 20:10:36 +0000 (23:10 +0300)]
Avoid leaving traces of cursor when entering linum-mode.

 src/fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
 left fringe if the window has a left margin.  This avoids leaving
 traces of the cursor because its leftmost pixel is not drawn over.

11 years agoFix bug #12277 with incomplete redisplay of the vertical border between windows.
Eli Zaretskii [Sun, 9 Sep 2012 17:59:50 +0000 (20:59 +0300)]
Fix bug #12277 with incomplete redisplay of the vertical border between windows.

 src/dispnew.c (update_window_line): When the left margin area of a
 screen line is updated, set the redraw_fringe_bitmaps_p flag of
 that screen line.

11 years agoAssume C89 or later for math functions.
Paul Eggert [Sun, 9 Sep 2012 16:06:33 +0000 (09:06 -0700)]
Assume C89 or later for math functions.

This simplifies the code, and makes it a bit smaller and faster,
and (most important) makes it easier to clean up signal handling
since we can stop worring about floating-point exceptions in
library code.  That was a problem before C89, but the problem
went away many years ago on all practical Emacs targets.
* configure.ac (frexp, fmod): Remove checks for these functions,
as we now assume them.
(FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC, NO_MATHERR)
(HAVE_EXCEPTION):
Remove; no longer needed.
* admin/CPP-DEFINES (HAVE_FMOD, HAVE_FREXP, FLOAT_CHECK_DOMAIN)
(HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove.
* src/data.c, src/image.c, src/lread.c, src/print.c:
Don't include <math.h>; no longer needed.
* src/data.c, src/floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
might be autoconfigured, as that never happens.
* src/data.c (fmod):
* src/doprnt.c (DBL_MAX_10_EXP):
* src/print.c (DBL_DIG):
Remove.  C89 or later always defines these.
* src/floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
(in_float, float_error_arg, float_error_arg2, float_error_fn_name)
(arith_error, domain_error, domain_error2):
Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
no longer needed -- we simply return what C returns.  All uses removed.
(IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
the wrapped code.
(FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
Remove.  All uses expanded, as these macros are no longer used
more than once and are now more trouble than they're worth.
(Ftan): Use tan, not sin / cos.
(Flogb): Assume C89 frexp.
(fmod_float): Assume C89 fmod.
(matherr) [HAVE_MATHERR]: Remove; no longer needed.
(init_floatfns): Remove.  All uses removed.

11 years agoCorrect the handling of two c-state-cache state variables.
Alan Mackenzie [Sun, 9 Sep 2012 11:03:37 +0000 (11:03 +0000)]
Correct the handling of two c-state-cache state variables.
cc-engine.el (c-state-cache-init): Initialise
c-state-semi-nonlit-pos-cache\(-limit\)? properly.
(c-record-parse-state-state): record
c-state-semi-nonlit-pos-cache\(-limit\)?.

11 years agoRemove debug prints
Jan Djärv [Sun, 9 Sep 2012 08:44:22 +0000 (10:44 +0200)]
Remove debug prints

11 years ago* lisp/register.el (register-separator): Rename from
Andreas Schwab [Sun, 9 Sep 2012 08:10:56 +0000 (10:10 +0200)]
* lisp/register.el (register-separator): Rename from
separator-register.  All uses changed.  Doc fix.
(register): Fix version.

11 years agoClarify descriptions of delq and delete in Lisp manual.
Chong Yidong [Sun, 9 Sep 2012 07:50:45 +0000 (15:50 +0800)]
Clarify descriptions of delq and delete in Lisp manual.

* doc/lispref/lists.texi (Sets And Lists): Explain that the return value for
delete should be used, like for delq.

11 years ago* minibuf.texi: Fix last change.
Chong Yidong [Sun, 9 Sep 2012 07:09:03 +0000 (15:09 +0800)]
* minibuf.texi: Fix last change.

11 years agoAllow scrolling in y-or-n-p.
Chong Yidong [Sun, 9 Sep 2012 06:43:47 +0000 (14:43 +0800)]
Allow scrolling in y-or-n-p.

* lisp/replace.el (query-replace-map): Bind four new symbols for
requesting window scrolling.

* lisp/subr.el (y-or-n-p): Handle the window-scrolling bindings in
query-replace-map.

* lisp/custom.el (custom-theme-load-confirm): Use y-or-n-p.

* lisp/window.el (scroll-other-window-down): Make the arg optional.

* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't bind scrolling keys
since they are now in query-replace-map.

* doc/lispref/minibuf.texi (Yes-or-No Queries): Document recentering and
scrolling in y-or-n-p.  Remove gratuitous example.

* doc/lispref/searching.texi (Search and Replace): Document window scrolling
entries in query-replace-map.

Fixes: debbugs:8948

11 years agoUse quit-window for quitting the *Local Variables* buffer.
Chong Yidong [Sun, 9 Sep 2012 05:50:43 +0000 (13:50 +0800)]
Use quit-window for quitting the *Local Variables* buffer.

* lisp/files.el (hack-local-variables-confirm): Use quit-window to kill
the *Local Variables* buffer.

11 years ago* lisp/progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block,
Dmitry Gutov [Sat, 8 Sep 2012 23:32:25 +0000 (03:32 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block,
not just expect to be at its beginning.  Adjust callees.
Succeed when do-end block has no space before the pipe character.
(ruby-brace-to-do-end): When the original block is one-liner,
convert to multiline.  Reindent the result.

* test/automated/ruby-mode-tests.el:
(ruby-toggle-block-to-multiline): New test.
(ruby-should-indent-buffer, ruby-toggle-block-to-do-end)
(ruby-toggle-block-to-brace): Use buffer-string.

11 years ago* nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
Jan Djärv [Sat, 8 Sep 2012 20:16:39 +0000 (22:16 +0200)]
* nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
compositeToPoint for OSX < 10.6.

Fixes: debbugs:12390

11 years ago* lisp/register.el (increment-register): Route it to `append-to-register',
Jambunathan K [Sat, 8 Sep 2012 20:09:06 +0000 (16:09 -0400)]
* lisp/register.el (increment-register): Route it to `append-to-register',
if register contains text so that `C-x r +' can now be
used for appending to a text register.
(register): New group.
(register-separator): New user option.
(append-to-register, prepend-to-register): Add separator based on
`register-separator.
* doc/emacs/regs.texi (Text Registers): `C-x r +' can now be used instead of
M-x append-to-register.  New option `register-separator'.
(Number Registers): Mention that `C-x r +' is polymorphic.

Fixes: debbugs:12217

11 years agoAWK Mode: make auto-newline work when there's "==" in the pattern.
Alan Mackenzie [Sat, 8 Sep 2012 20:00:13 +0000 (20:00 +0000)]
AWK Mode: make auto-newline work when there's "==" in the pattern.
cc-cmds.el (c-point-syntax): Handle virtual semicolons correctly.
cc-engine.el (c-guess-basic-syntax CASE 5A.3): Test more rigorously for
"=" token.

11 years ago* floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
Paul Eggert [Sat, 8 Sep 2012 19:57:32 +0000 (12:57 -0700)]
* floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).

This produces more-accurate results.

11 years ago* nsterm.m (updateFrameSize): Call setFrame: on the view when size
Jan Djärv [Sat, 8 Sep 2012 17:22:15 +0000 (19:22 +0200)]
* nsterm.m (updateFrameSize): Call setFrame: on the view when size
changes.

Fixes: debbugs:12088

11 years ago* progmodes/ruby-mode.el (ruby-match-expression-expansion): Shorten
Dmitry Gutov [Sat, 8 Sep 2012 15:34:41 +0000 (19:34 +0400)]
* progmodes/ruby-mode.el (ruby-match-expression-expansion): Shorten
  previous change.

11 years ago* lisp/progmodes/ruby-mode.el (ruby-match-expression-expansion): Only
Dmitry Gutov [Sat, 8 Sep 2012 15:13:14 +0000 (19:13 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-match-expression-expansion): Only
fail when reached LIMIT.

11 years agoDon't bind M-= in Dired.
Chong Yidong [Sat, 8 Sep 2012 14:48:26 +0000 (22:48 +0800)]
Don't bind M-= in Dired.

* lisp/dired.el (dired-mode-map): Don't bind M-=.

* lisp/dired-aux.el (dired-diff): Use backup file as default.

11 years ago* subr.el (add-to-history): Fix delete usage.
Drew Adams [Sat, 8 Sep 2012 14:30:09 +0000 (22:30 +0800)]
* subr.el (add-to-history): Fix delete usage.

Fixes: debbugs:12314

11 years agoIntroduce "raw syntax descriptor" terminology, and use it.
Chong Yidong [Sat, 8 Sep 2012 14:23:01 +0000 (22:23 +0800)]
Introduce "raw syntax descriptor" terminology, and use it.

* syntax.texi (Syntax Table Internals): Define "raw syntax
descriptor" terminology.
(Syntax Descriptors): Mention raw syntax descriptors.

* lisp/subr.el (syntax-after, syntax-class): Doc fix.

* syntax.c (Fstring_to_syntax): Doc fix.

Fixes: debbugs:12383

11 years agoFix handling of debugger window. (Bug#8789)
Martin Rudalics [Sat, 8 Sep 2012 13:28:11 +0000 (15:28 +0200)]
Fix handling of debugger window.  (Bug#8789)

* window.el (display-buffer-in-previous-window): New buffer
display action function.

* emacs-lisp/debug.el (debugger-bury-or-kill): New option.
(debugger-previous-window): New variable.
(debug): Rewrite using display-buffer-in-previous-window,
quit-restore-window and debugger-bury-or-kill.  (Bug#8789)

11 years ago* nsterm.h (EmacsView): Add updateFrameSize.
Jan Djärv [Sat, 8 Sep 2012 12:48:33 +0000 (14:48 +0200)]
* nsterm.h (EmacsView): Add updateFrameSize.

* nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
in the internal border.
(x_set_window_size): Remove static variables and their usage.
(ns_redraw_scroll_bars): Fix NSTRACE arg.
(ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
fringe/internal border adjustment.
(ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
(ns_draw_window_cursor): Remove fringe/internal border adjustment.
(ns_fix_rect_ibw): Remove.
(ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
(ns_dumpglyphs_box_or_relief): Ditto.
(ns_maybe_dumpglyphs_background): Remove fringe/internal border
adjustment.
(ns_dumpglyphs_image): Ditto.
(ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
border adjustment.
(ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
their usage.  Add fringe_extended_p and its use as in other terms.
(ns_judge_scroll_bars): Code style fix.  Call updateFrameSize if
scroll bar was removed.
(updateFrameSize): New function.
(windowDidResize): Move code to updateFrameSize and call it.

Fixes: debbugs:11052

11 years agoFix setting of environment variables by nt/configure.bat.
Eli Zaretskii [Sat, 8 Sep 2012 11:20:32 +0000 (14:20 +0300)]
Fix setting of environment variables by nt/configure.bat.

 nt/configure.bat <use_extensions>: Don't leave it set in the
 environment when the script exits.

11 years ago* lisp/emacs-lisp/byte-run.el (defun): Tweak message. Simplify code.
Stefan Monnier [Fri, 7 Sep 2012 20:14:55 +0000 (16:14 -0400)]
* lisp/emacs-lisp/byte-run.el (defun): Tweak message.  Simplify code.

11 years ago* progmodes/python.el (python-shell-send-string): When
Matt McClure [Fri, 7 Sep 2012 14:53:15 +0000 (16:53 +0200)]
* progmodes/python.el (python-shell-send-string): When
default-directory is remote, create temp file on remote
filesystem.
(python-shell-send-file): When file is remote, pass local view of
file paths to remote Python interpreter.  (Bug#12340)

11 years ago* src/textprop.c (Fget_text_property): Minor doc fix.
Chong Yidong [Fri, 7 Sep 2012 14:45:28 +0000 (22:45 +0800)]
* src/textprop.c (Fget_text_property): Minor doc fix.

Fixes: debbugs:12323

11 years agoFix doc of local-variable-if-set-p.
Chong Yidong [Fri, 7 Sep 2012 14:15:59 +0000 (22:15 +0800)]
Fix doc of local-variable-if-set-p.

* doc/lispref/variables.texi (Creating Buffer-Local): Fix description of
local-variable-if-set-p.

* src/data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).

11 years agoMinor doc fix for switch-to-buffer.
Chong Yidong [Fri, 7 Sep 2012 13:53:21 +0000 (21:53 +0800)]
Minor doc fix for switch-to-buffer.

* doc/lispref/windows.texi (Display Action Functions)
(Choosing Window Options): Remove obsolete variable
display-buffer-reuse-frames.
(Switching Buffers): Minor doc tweak for switch-to-buffer.

* lisp/window.el (switch-to-buffer): Doc fix.

Fixes: debbugs:12181

11 years agont/config.nt: Sync with autogen/config.in.
Juanma Barranquero [Fri, 7 Sep 2012 12:15:08 +0000 (14:15 +0200)]
nt/config.nt: Sync with autogen/config.in.
(NO_ABORT, SIGNAL_H_AHB): Remove.

11 years agoFix handling of require-final-newline in after-find-file.
Chong Yidong [Fri, 7 Sep 2012 10:53:29 +0000 (18:53 +0800)]
Fix handling of require-final-newline in after-find-file.

* files.el (after-find-file): Don't fail on a read-only buffer if
require-final-newline is `visit' or `visit-save'.

Fixes: debbugs:11156

11 years ago* doc/lispref/eval.texi (Intro Eval): Add index entry for sexp.
Chong Yidong [Fri, 7 Sep 2012 10:36:39 +0000 (18:36 +0800)]
* doc/lispref/eval.texi (Intro Eval): Add index entry for sexp.

Fixes: debbugs:12233

11 years agoRemove obsolete display-buffer-reuse-frames from manuals.
Chong Yidong [Fri, 7 Sep 2012 10:27:11 +0000 (18:27 +0800)]
Remove obsolete display-buffer-reuse-frames from manuals.

* doc/emacs/windows.texi (Window Choice): Don't mention obsolete
display-buffer-reuse-frames.

* doc/lispref/windows.texi (Display Action Functions)
(Choosing Window Options): Remove obsolete variable
display-buffer-reuse-frames.

11 years agoLet ESC ESC quit in read-char-choice, and use it in userlock.el.
Chong Yidong [Fri, 7 Sep 2012 10:19:58 +0000 (18:19 +0800)]
Let ESC ESC quit in read-char-choice, and use it in userlock.el.

* lisp/subr.el (read-char-choice): Allow quitting via ESC ESC.

* lisp/userlock.el (ask-user-about-supersession-threat): Use
read-char-choice.

Fixes: debbugs:12093

11 years agoAuto-commit of generated files.
Glenn Morris [Fri, 7 Sep 2012 10:17:37 +0000 (06:17 -0400)]
Auto-commit of generated files.

11 years agoAdd a utility function buffer-narrowed-p, and use it.
Chong Yidong [Fri, 7 Sep 2012 08:58:31 +0000 (16:58 +0800)]
Add a utility function buffer-narrowed-p, and use it.

* lisp/subr.el (buffer-narrowed-p): New function.

* lisp/ses.el (ses-widen):
* lisp/simple.el (count-words--buffer-message):
* lisp/net/browse-url.el (browse-url-of-buffer): Use it

* lisp/simple.el (count-words-region): Don't signal an error if there
is a non-nil prefix arg and the mark is not set.

* doc/lispref/positions.texi (Narrowing): Document buffer-narrowed-p.

11 years ago* emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
Paul Eggert [Fri, 7 Sep 2012 08:55:03 +0000 (01:55 -0700)]
* emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.

Problem introduced when merging patches.  Noted by Eli Zaretskii in
<http://bugs.gnu.org/12327#67>.

11 years agoMore signal-handler cleanup.
Paul Eggert [Fri, 7 Sep 2012 08:46:44 +0000 (01:46 -0700)]
More signal-handler cleanup.

* configure.ac (FLOAT_CHECK_DOMAIN): Comment fix (Bug#12327).
* src/floatfns.c: Comment fix.
* src/lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
and anyway the declaration is harmless even if SIGDANGER is not defined.
* src/syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
defined BROKEN_FIONREAD).  systty.h formerly did this, but other
source files not surprisingly expected syssignal.h to define, or
not define, SIGIO, and it's cleaner to do it that way, for consistency.
Include <sys/ioctl.h>, for FIONREAD.
* src/systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
This eliminates a problem whereby other files mysteriously had
to include "syssignal.h" before including "systty.h" if they
wanted to use "#ifdef SIGIO".

11 years ago* lisp/simple.el (count-words--buffer-message): Fix narrowing check.
Chong Yidong [Fri, 7 Sep 2012 08:36:25 +0000 (16:36 +0800)]
* lisp/simple.el (count-words--buffer-message): Fix narrowing check.

11 years agoMS-Windows followup for 2012-09-07T01:27:44Z!eggert@cs.ucla.edu, signal-handler cleanup.
Eli Zaretskii [Fri, 7 Sep 2012 08:20:07 +0000 (11:20 +0300)]
MS-Windows followup for 2012-09-07T01:27:44Z!eggert@cs.ucla.edu, signal-handler cleanup.

 src/w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
 src/w32.c (sigemptyset): Empty the set.
 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.

 nt/inc/ms-w32.h (struct sigaction): Declare sa_handler __cdecl.

Fixes: debbugs:12327

11 years agoFix compilation failure under ENABLE_CHECKING.
Eli Zaretskii [Fri, 7 Sep 2012 07:24:08 +0000 (10:24 +0300)]
Fix compilation failure under ENABLE_CHECKING.

 src/alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.

Fixes: debbugs:12327

11 years ago* alloc.c (mark_buffer): Revert unsafe marking optimization.
Dmitry Antipov [Fri, 7 Sep 2012 07:05:56 +0000 (11:05 +0400)]
* alloc.c (mark_buffer): Revert unsafe marking optimization.
(mark_object): Likewise for frame objects.

11 years ago* syssignal.h (handle_on_main_thread): Always declare,
Paul Eggert [Fri, 7 Sep 2012 06:47:30 +0000 (23:47 -0700)]
* syssignal.h (handle_on_main_thread): Always declare,

even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
This ports to platforms without HAVE_PTHREAD.

11 years ago* lisp/progmodes/ruby-mode.el
Dmitry Gutov [Fri, 7 Sep 2012 05:06:05 +0000 (09:06 +0400)]
* lisp/progmodes/ruby-mode.el
(ruby-beginning-of-defun): Only consider 3 keywords defun beginners.
(ruby-end-of-defun): Expect that the point is at the beginning of
the defun.

11 years agoFix for invoking C-h c from the minibuffer.
Chong Yidong [Fri, 7 Sep 2012 05:00:32 +0000 (13:00 +0800)]
Fix for invoking C-h c from the minibuffer.

* help.el (describe-key-briefly): Allow the message to be seen
when invoked from the minibuffer.

Fixes: debbugs:7014

11 years agoAdd a couple of xrefs to the Lisp manual.
Chong Yidong [Fri, 7 Sep 2012 04:51:26 +0000 (12:51 +0800)]
Add a couple of xrefs to the Lisp manual.

* markers.texi (Moving Markers): Add xref to Point.

* syntax.texi (Low-Level Parsing): Add xref to Parser State.

Fixes: debbugs:12269

11 years ago* lisp/progmodes/ruby-mode.el (ruby-end-of-defun)
Dmitry Gutov [Fri, 7 Sep 2012 04:36:20 +0000 (08:36 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-end-of-defun)
(ruby-beginning-of-defun): Simplify, allow indentation before
block beginning and end keywords.  Also, fix accidental change in the former.

11 years ago* lisp/progmodes/ruby-mode.el (ruby-indent-beg-re): Add pieces from
Dmitry Gutov [Fri, 7 Sep 2012 04:15:56 +0000 (08:15 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-indent-beg-re): Add pieces from
ruby-beginning-of-indent, simplify, allow all keywords to have
indentation before them.
(ruby-beginning-of-indent): Adjust for above.  Search until the
found point is not inside a string or comment.
(ruby-font-lock-keywords): Allow symbols to start with "@"
character, give them higher priority than variables.
(ruby-syntax-propertize-function)
(ruby-font-lock-syntactic-keywords): Remove the "not comments"
matchers.  Expression expansions are not comments when inside a
string, and there comment syntax status is irrelevant.
(ruby-match-expression-expansion): New function.  Check that
expression expansion is inside a string, and it's not escaped.
(ruby-font-lock-keywords): Use it.

* test/automated/ruby-mode-tests.el: New tests (Bug#11613).

11 years agoPartially revert last Gnus merge.
Chong Yidong [Fri, 7 Sep 2012 04:07:00 +0000 (12:07 +0800)]
Partially revert last Gnus merge.

The add-face function has been added gnus-compat.el, but is not in
Emacs; this leaves Gnus in an unusable state.

* lisp/gnus/gnus-salt.el (gnus-tree-highlight-node):
* lisp/gnus/gnus-sum.el (gnus-summary-highlight-line):
* lisp/gnus/gnus-group.el (gnus-group-highlight-line): Revert use of add-face.

* lisp/gnus/gnus-util.el (gnus-put-text-property-excluding-characters-with-faces): Restore.

11 years agoSignal-handler cleanup.
Paul Eggert [Fri, 7 Sep 2012 01:27:44 +0000 (18:27 -0700)]
Signal-handler cleanup.

Emacs's signal handlers were written in the old 4.2BSD style with
sigblock and sigmask and so forth, and this led to some
inefficiencies and confusion.  Rewrite these to use
pthread_sigmask etc. without copying signal sets around.  Also,
get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
'signal', and instead use functions that do not attempt to take
over the system name space.  This patch causes Emacs's text
segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
* configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
Adjust to syssignal.h changes.
(SIGNAL_H_AB): Remove; no longer needed.
* src/alloc.c, src/emacsgtkfixed.c, src/nsfns.m, src/widget.c, src/xmenu.c:
Do not include <signal.h> or "syssignal.h", as these
modules do not use signals.
* src/atimer.c, src/callproc.c, src/data.c, src/dispnew.c, src/emacs.c:
* src/floatfns.c, src/gtkutil.c, src/keyboard.c, src/process.c, src/sound.c:
* src/sysdep.c, src/term.c, src/xterm.c:
Do not include <signal.h>, as "syssignal.h" does that for us now.
* src/atimer.c (sigmask_atimers): New function.
(block_atimers, unblock_atimers): New functions,
replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
All uses replaced.
* src/conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
no longer needed here.
* src/emacs.c (main): Inspect existing signal handler with sigaction,
so that there's no need to block and unblock SIGHUP.
* src/sysdep.c (struct save_signal): New member 'action', replacing
old member 'handler'.
(save_signal_handlers, restore_signal_handlers):
Use sigaction instead of 'signal' to save and restore.
(get_set_sighandler, set_sighandler) [!WINDOWSNT]:
New function.  All users of 'signal' modified to use set_sighandler
if they're writeonly, and to use sys_signal if they're read+write.
(emacs_sigaction_init, forwarded_signal): New functions.
(sys_signal): Remove.  All uses replaced by calls to sigaction
and emacs_sigaction_init, or by direct calls to 'signal'.
(sys_sigmask) [!__GNUC__]: Remove; no longer needed.
(sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
all uses replaced by pthread_sigmask etc. calls.
* src/syssignal.h: Include <signal.h>.
(emacs_sigaction_init, forwarded_signal): New decls.
(SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
(SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
(sigmask, sys_sigmask): Remove; no longer needed.
(sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
(sigblock, sigunblock, sigfree):
(sigsetmask) [!defined sigsetmask]:
Remove.  All uses replaced by pthread_sigmask.
(signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
no longer need to be replaced, and its typical old uses
are now done via emacs_sigaction_init and sigaction.
(sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
(sys_sigdel): Remove; unused.
(NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.

Fixes: debbugs:12327

11 years agoMisc changes made in Gnus master
Gnus developers [Thu, 6 Sep 2012 22:13:45 +0000 (22:13 +0000)]
Misc changes made in Gnus master

Use combining faces for highlighting.
Change ephemeral Gnus group names to be prettier.
gnus-util.el: Fix compilation error on XEmacs 21.4.

11 years agoFix bug #12327 with SIGCHLD handling on Windows and some other systems.
Eli Zaretskii [Thu, 6 Sep 2012 16:42:48 +0000 (19:42 +0300)]
Fix bug #12327 with SIGCHLD handling on Windows and some other systems.

 src/process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
 SIGCHLD handling on systems that don't have WNOHANG.

11 years ago* lisp/emacs-lisp/cl-macs.el (cl--do-arglist): Understand _ on &key args.
Stefan Monnier [Thu, 6 Sep 2012 15:35:08 +0000 (11:35 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl--do-arglist): Understand _ on &key args.
(cl--make-usage-args): Strip _ from argument names.

Fixes: debbugs:12367

11 years agoRemove references to obsolete variable speedbar-key-map.
Chong Yidong [Thu, 6 Sep 2012 09:38:56 +0000 (17:38 +0800)]
Remove references to obsolete variable speedbar-key-map.

* speedbar.el (speedbar-update-flag, speedbar-mode): Remove
references to obsolete variable speedbar-key-map.

11 years agoFix use of obsolete variables in vhdl-mode.el.
Rüdiger Sonderfeld [Thu, 6 Sep 2012 09:36:40 +0000 (17:36 +0800)]
Fix use of obsolete variables in vhdl-mode.el.

* progmodes/vhdl-mode.el (vhdl-speedbar-initialize): Don't use
obsolete alias speedbar-key-map.
(vhdl-doc-variable, vhdl-doc-mode): Use called-interactively-p.
(vhdl-index-menu-init): Don't use obsolete variable font-lock-maximum-size.

11 years ago* frame.el (window-system-version): Mark as obsolete.
Chong Yidong [Thu, 6 Sep 2012 09:29:32 +0000 (17:29 +0800)]
* frame.el (window-system-version): Mark as obsolete.

See http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00412.html

11 years agoExplicitly mark buffer_defaults and buffer_local_symbols.
Dmitry Antipov [Thu, 6 Sep 2012 09:15:44 +0000 (13:15 +0400)]
Explicitly mark buffer_defaults and buffer_local_symbols.
* alloc.c (Fgarbage_collect): Mark buffer_defaults and
mark_local_symbols here.
(mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
since special buffers aren't marked here any more.
(allocate_buffer): Chain new buffer with all_buffers here...
* buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
not here.
(Vbuffer_defaults, Vbuffer_local_symbols): Remove.
(syms_of_buffer): Remove staticpro of the above.
(init_buffer_once): Set names for buffer_defaults and
buffer_local_symbols.