[elpa] externals/orgalist f13a1e3: Fix narrowed region before calling filling function
branch: externals/orgalist commit f13a1e35032a2648ddfb09d9d56e65e7c88483af Author: Nicolas Goaziou Commit: Nicolas Goaziou Fix narrowed region before calling filling function * orgalist.el (orgalist--call-in-item): Narrow buffer to a part of the item without any child. Also handle text between two sub-lists, as in the following example: - item - sub-item 1 Text in-between - sub-item 2 --- orgalist.el | 38 +- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/orgalist.el b/orgalist.el index 74cbfc1..ac66eda 100644 --- a/orgalist.el +++ b/orgalist.el @@ -251,16 +251,36 @@ group 4: description tag") (defun orgalist--call-in-item (fun pos &rest arguments) "Call function FUN with buffer narrowed to item starting at POS. -Call function with ARGUMENTS. Return the value FUN returns." - (let* ((struct (save-excursion (goto-char pos) (orgalist--struct))) - (next (org-list-get-item-end pos struct)) - (fill-prefix - (make-string (+ (length (org-list-get-bullet pos struct)) - (org-list-get-ind pos struct)) - ?\s))) + +Call function with ARGUMENTS. Return the value FUN returns. + +Buffer is narrowed to the surrounding part of the item which +doesn't include any sub-item. Wrap `fill-prefix', set to the +indentation of the current item, before calling FUN." + (let* ((struct (org-with-point-at pos (orgalist--struct (save-restriction - (narrow-to-region pos next) - (apply fun arguments + ;; Narrow to the part before first child, if any, or between two + ;; consecutive items. + (let ((children (org-list-get-children + pos struct (org-list-parents-alist struct))) +start end) +(catch :exit + (dolist (child children) +(cond + ((> (point) child) + (setq start (org-list-get-item-end child struct))) + ((< (point) child) + (setq end child) + (throw :exit t)) + (t + (error "Point does not belong directly to item %s" pos) +(narrow-to-region (or start pos) + (or end (org-list-get-item-end pos struct + (let ((fill-prefix + (make-string (+ (length (org-list-get-bullet pos struct)) + (org-list-get-ind pos struct)) + ?\s))) +(apply fun arguments) (defun orgalist--boundaries () "Return buffer boundaries, as a cons cell, where lists are acceptable.
[elpa] externals/orgalist 48fa839: Bump to version 1.13
branch: externals/orgalist commit 48fa839f9120f95b39edd41dc3b46a61d393abe6 Author: Nicolas Goaziou Commit: Nicolas Goaziou Bump to version 1.13 --- orgalist.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orgalist.el b/orgalist.el index ac66eda..fecf6fb 100644 --- a/orgalist.el +++ b/orgalist.el @@ -6,7 +6,7 @@ ;; Maintainer: Nicolas Goaziou ;; Keywords: convenience ;; Package-Requires: ((emacs "24.4")) -;; Version: 1.12 +;; Version: 1.13 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by
[elpa] externals/shell-command+ cb6a66e 5/5: Merge remote-tracking branch 'shell-command+/shell-command+' into externals/shell-command+
branch: externals/shell-command+ commit cb6a66ea171a9f5243f6db7e0946bb257d456909 Merge: 984dc25 0c42623 Author: Stefan Monnier Commit: Stefan Monnier Merge remote-tracking branch 'shell-command+/shell-command+' into externals/shell-command+ --- README.md | 23 +++ shell-command+.el | 26 ++ 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1a51bf8..9140eb5 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,29 @@ Neukirchen][leah]. Features +Usually `shell-command+` acts just like `shell-command`, but in +certain cases, `shell-command+` pre-processes the input. Here are a +few examples of what that might look like: + + > wc -l + +Count all lines in a buffer, and display the result in the +minibuffer. + + .. < ls -l + +Replace the current region (or buffer in no region is selected) +with a directory listing of the parent directory. + + | tr -d a-z + +Delete all instances of the charachters a, b, c, ..., z, in the +selected region (or buffer, if no region was selected). + + .../src make + +Run Eshell's make (via `compile`) in the parent's parent +directory, and then in `src`. How to use diff --git a/shell-command+.el b/shell-command+.el index e8fcba6..ff93cc7 100644 --- a/shell-command+.el +++ b/shell-command+.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2020 Free Software Foundation, Inc. ;; Author: Philip K. -;; Version: 1.0.3 +;; Version: 2.0.0 ;; Keywords: unix, processes, convenience ;; Package-Requires: ((emacs "24.1")) ;; URL: http://elpa.gnu.org/packages/shell-command+.html @@ -24,7 +24,10 @@ ;;; Commentary: ;; ;; `shell-command+' is a `shell-command' substitute, that extends the -;; regular Emacs command with several features. +;; regular Emacs command with several features. After installed, +;; configure the package as follows: +;; +;; (global-set-key (kbd "M-!") #'shell-command+) ;; ;; A few examples of what `shell-command+' can do: ;; @@ -49,8 +52,11 @@ ;; ;; ... make ;; -;; Run Eshell's make (i.e. `compile') in the parent's parent +;; Run Eshell's make (via `compile') in the parent's parent ;; directory. +;; +;; See `shell-command+'s docstring for more details on how it's input +;; is interpreted.. (eval-when-compile (require 'rx)) (require 'eshell) @@ -63,8 +69,11 @@ :prefix "shell-command+-") (defcustom shell-command+-use-eshell t - "Check if there is an eshell-handler for each command." - :type 'boolean) + "Check for eshell handlers. +If t, always invoke eshell handlers. If a list, only invoke +handlers if the symbol (eg. `man') is contained in the list." + :type '(choice (boolean :tag "Always active?") + (repeat :tag "Selected commands" symbol))) (defconst shell-command+--command-regexp (rx bos @@ -79,8 +88,8 @@ ;; allow whitespace after indicator (* space) ;; actual command (and command name) - (group (: (group (*? not-newline)) -(? space)) + (group (? (group (+ not-newline)) +(+ space)) (+ not-newline)) eos) "Regular expression to parse `shell-command+' input.") @@ -149,7 +158,8 @@ between BEG and END. Otherwise the whole buffer is processed." (shell-command-on-region beg end rest t t shell-command-default-error-buffer t)) - ((and shell-command+-use-eshell + ((and (or (eq shell-command+-use-eshell t) +(memq (intern cmd) shell-command+-use-eshell)) (intern-soft (concat "eshell/" cmd))) (eshell-command rest (and current-prefix-arg t))) (t (shell-command rest (and current-prefix-arg t)
[elpa] externals/shell-command+ 0c42623 4/5: expand "features" section in readme
branch: externals/shell-command+ commit 0c426232f6242f4a1068fab0d97e3e14f9e364c2 Author: Philip K Commit: Philip K expand "features" section in readme --- README.md | 23 +++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 1a51bf8..9140eb5 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,29 @@ Neukirchen][leah]. Features +Usually `shell-command+` acts just like `shell-command`, but in +certain cases, `shell-command+` pre-processes the input. Here are a +few examples of what that might look like: + + > wc -l + +Count all lines in a buffer, and display the result in the +minibuffer. + + .. < ls -l + +Replace the current region (or buffer in no region is selected) +with a directory listing of the parent directory. + + | tr -d a-z + +Delete all instances of the charachters a, b, c, ..., z, in the +selected region (or buffer, if no region was selected). + + .../src make + +Run Eshell's make (via `compile`) in the parent's parent +directory, and then in `src`. How to use
[elpa] externals/shell-command+ e35e1ce 3/5: updated commentary section
branch: externals/shell-command+ commit e35e1ceee49d00b9581c09a77e0e39d27efcd53f Author: Philip K Commit: Philip K updated commentary section --- shell-command+.el | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shell-command+.el b/shell-command+.el index 1a76f7b..8b3036f 100644 --- a/shell-command+.el +++ b/shell-command+.el @@ -17,7 +17,10 @@ ;;; Commentary: ;; ;; `shell-command+' is a `shell-command' substitute, that extends the -;; regular Emacs command with several features. +;; regular Emacs command with several features. After installed, +;; configure the package as follows: +;; +;; (global-set-key (kbd "M-!") #'shell-command+) ;; ;; A few examples of what `shell-command+' can do: ;; @@ -42,8 +45,11 @@ ;; ;; ... make ;; -;; Run Eshell's make (i.e. `compile') in the parent's parent +;; Run Eshell's make (via `compile') in the parent's parent ;; directory. +;; +;; See `shell-command+'s docstring for more details on how it's input +;; is interpreted.. (eval-when-compile (require 'rx)) (require 'eshell)
[elpa] externals/shell-command+ 03c2f2a 2/5: bump version
branch: externals/shell-command+ commit 03c2f2aa1f9df9c67d58323f5e6696d23fc1d8eb Author: Philip K Commit: Philip K bump version --- shell-command+.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell-command+.el b/shell-command+.el index 9a51630..1a76f7b 100644 --- a/shell-command+.el +++ b/shell-command+.el @@ -1,7 +1,7 @@ ;;; shell-command+.el --- An extended shell-command -*- lexical-binding: t -*- ;; Author: Philip K. -;; Version: 1.0.3 +;; Version: 2.0.0 ;; Keywords: unix, processes, convenience ;; Package-Requires: ((emacs "24.1")) ;; URL: http://elpa.gnu.org/packages/shell-command+.html
[elpa] externals/shell-command+ updated (984dc25 -> cb6a66e)
monnier pushed a change to branch externals/shell-command+. from 984dc25 * shell-command+.el: Add copyright notice and change license to GPLv3+ new e965dd4 fix and improve eshell command handling new 03c2f2a bump version new e35e1ce updated commentary section new 0c42623 expand "features" section in readme new cb6a66e Merge remote-tracking branch 'shell-command+/shell-command+' into externals/shell-command+ Summary of changes: README.md | 23 +++ shell-command+.el | 26 ++ 2 files changed, 41 insertions(+), 8 deletions(-)
[elpa] externals/shell-command+ e965dd4 1/5: fix and improve eshell command handling
branch: externals/shell-command+ commit e965dd40d9f2a965a6743b91dfc8abf961a81f51 Author: Philip K Commit: Philip K fix and improve eshell command handling --- shell-command+.el | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/shell-command+.el b/shell-command+.el index 32b4fa2..9a51630 100644 --- a/shell-command+.el +++ b/shell-command+.el @@ -56,8 +56,11 @@ :prefix "shell-command+-") (defcustom shell-command+-use-eshell t - "Check if there is an eshell-handler for each command." - :type 'boolean) + "Check for eshell handlers. +If t, always invoke eshell handlers. If a list, only invoke +handlers if the symbol (eg. `man') is contained in the list." + :type '(choice (boolean :tag "Always active?") + (repeat :tag "Selected commands" symbol))) (defconst shell-command+--command-regexp (rx bos @@ -72,8 +75,8 @@ ;; allow whitespace after indicator (* space) ;; actual command (and command name) - (group (: (group (*? not-newline)) -(? space)) + (group (? (group (+ not-newline)) +(+ space)) (+ not-newline)) eos) "Regular expression to parse `shell-command+' input.") @@ -142,7 +145,8 @@ between BEG and END. Otherwise the whole buffer is processed." (shell-command-on-region beg end rest t t shell-command-default-error-buffer t)) - ((and shell-command+-use-eshell + ((and (or (eq shell-command+-use-eshell t) +(memq (intern cmd) shell-command+-use-eshell)) (intern-soft (concat "eshell/" cmd))) (eshell-command rest (and current-prefix-arg t))) (t (shell-command rest (and current-prefix-arg t)