From 19bd64d8967f4dfd833d80b50df27604bb8df71e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Pinard?= Date: Fri, 1 Mar 2013 15:43:43 -0500 Subject: [PATCH] poporg.el (poporg-current-line): Inlined, used only once. --- poporg.el | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/poporg.el b/poporg.el index 8d0c4eb..d23f682 100644 --- a/poporg.el +++ b/poporg.el @@ -64,12 +64,6 @@ If yes, pop the editing buffer and return t." (setq found t)))) found)) -(defun poporg-current-line () - "Return the contents of the line where the point is." - (buffer-substring-no-properties - (save-excursion (beginning-of-line) (point)) - (save-excursion (end-of-line) (point)))) - (defun poporg-dwim () (interactive) "Single overall command for poporg (a single keybinding may do it all). @@ -253,9 +247,12 @@ A prefix common to all buffer lines, and to PREFIX as well, gets removed." ;; Reduce prefix as needed. (goto-char (point-min)) (while (not (eobp)) - (setq prefix (or (fill-common-string-prefix - prefix (poporg-current-line)) - "")) + (setq prefix + (or (fill-common-string-prefix + prefix + (buffer-substring-no-properties (line-beginning-position) + (line-end-position))) + "")) (forward-line 1)) ;; Remove common prefix. (goto-char (point-min))