texts: Time tracking and reporting with cross-cutting concerns in org-mode

texts:
I've been tracking my work time in org-mode for several years. My normal practice is to use clocktable mode in the agenda for daily tracking, and a clocktable block in my main projects file for monthly tracking. Both of these give me sums of my work time by file hierarchy, which in my org files corresponds to areas of responsibility and projects.

This is great, but now I need to be able to track time in this way, but also by type of activity (i.e., how much time on project management tasks, how much time on documentation, how much on customer meetings, etc.). I could tag the particular tasks I work on with tags for type of activity, but is there a way to get summed times (daily or monthly) by tag?

Has anyone had to do this (sum times in two different ways)? If so, what did you do?


texts: Execute function when (after) window scrolls

texts:
I need to execute a function every time a window scrolls. I mean the function to be executed at point "after" the window has been scrolled (with C-v, M-v or with the <down> key). I tried:

(add-hook 'window-scroll-functions 'my-function)

but it didn't work (emacs froze until C-g). How can I achieve it?

Additional details. My goal is to sync the Emacs window that contains some LaTeX code with the PDF viewer (Okular). I know I can do it with AUCTeX but, for some reasons, I can't use it.

I imagined a solution like:

(defun my-sync-scroll-up ()
  (interactive)
  (scroll-up-command)
  (my-function))

(global-set-key (kbd "C-v") 'my-sync-scroll-up)

rebinding the C-v shortcut to my new function but I'd prefer something more generalized and automatic.

The function I want to run after window scrolls is:

(defun okular-forward-search-mod ()
  (interactive)
  (setq PID (number-to-string (emacs-pid)))
  (call-process-shell-command
   (concat "okular --unique file:"
       (concat (file-name-sans-extension (buffer-file-name)) ".pdf")
       "#src:"
       (number-to-string (line-number-at-pos (point)))
       (buffer-file-name))
   )
  (call-process-shell-command (concat "wmctrl -ia $(wmctrl -lp | awk -vpid=$PID '$3=="
                      PID
                      " {print $1; exit}')"))
)
(add-hook 'window-scroll-functions 'okular-forward-search-mod)

On Ubuntu 16.04, Emacs 25.3.2.


texts: Use normal delete-region with backspace in markdown-mode

texts:
I would like to use the "normal" behaviour for <backspace> in markdown-mode. That is, instead of calling markdown-exdent-or-delete, I would like to call cua-delete-region. So I tried this rebinding (using bind-key):

(use-package markdown-mode
    :ensure t
  :mode ("\\.\\(m\\(ark\\)?down\\|md\\)$" . markdown-mode)
  :config (bind-key "<backspace>" 'cua-delete-region)
)

But I get no changes. (Or rather I do: but for some strange reason only in the minibuffer!)

Any ideas?


texts: Two versions of Emacs on MS Windows: change the default "emacs" binding in the MS Windows shell

texts:
I have got two versions of Emacs on my Windows 10 laptop: Emacs 25.3.1 (x86_64-w64-mingw32) and Emacs 26.1 (build 1, x86_64-w64-mingw32). I would like the windows shell to run the 26.1 version by default when I type "emacs". At the moment, it runs 25.3.1.

So far, I tried renaming several variables in the registry editor, but to no avail. I don't want to continue doing it without understanding what I am changing...

[Update: I managed to make it work by going through the registry searching for any phrase containing "emacs" and changing some bindings containing 25.3.1 to 26.1. I did it for ones that seemed reasonable -- I did not touch any of the weird-looking binaries. No clue which one did the trick, so I am not removing this question.]


texts: Spacemacs: shortcut to jump from opened orgmode file to Neotree pane

texts:
I am using Spacemacs. So I have a Neotree pan that I open with Spc-f-t and that works fine. Then I can navigate down the tree to open a file with l and that will move the cursor from the Neotree pane to the opened file, which is in the adjacent pane. Then I can make edits in the org-mode file.

Now, I want to know if there is a key shortcut to jump from the org-mode file back to the Neotree pane? So that way I can move to the a subsequent file in the directory.

I checked the Spacemacs and the NeoTree documentation, but did not find any reference to going from an opened buffer back to the NeoTree pane. And that kind of makes sense, since the shortcuts of the opened pane (org-mode or otherwise) would dictate behavior. But I was wondering if there was a way to go back and forth between opened files and the Neotree pane.

I can use the Spc-f-t key twice to close the pane and reopen it. That will work. But I was wondering if there was a smoother way to do it.


texts: emacs auto-complete-c-headers and closing brackets

texts:
I'm new to Emacs. I followed a tutorial for Emacs as IDE for C/C++ but there are steps that do not work fully for me: the auto-complete for c-headers.

I installed yasnippet and auto-complete for C/C++ headers.

1) I get the normal auto-complete behavior for #include <stdio.h but > closing hook is not added even if I type tab on h .

2) And some functions (I don't know how many) aren't called even with
   their headers.

Other posts, particularly this one, helped me to solve an issue about #include <float  when  is not completed with .h, now it works but as alwas tab on h does not add >.

So after changing my .emacs from the link above , #include <ctype.h>  doesn't call at least isdig  knowing that I want isdigit ...
And for getchar it doesn't add  ()wherease for  while, for loops it works fine...

Here is my new .emacs after following the link above.

; start package.el with emacs
(require 'package)
;add MELPA to repository list
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
;initialize package.el
(package-initialize)
;start auto-complete with emacs
(require 'auto-complete)
;do default config for auto-complete
(require 'auto-complete-config)
(ac-config-default)
;start yasineppet with emacs
(require 'yasnippet)
(yas-global-mode 1)
;let's define a function which initializes auto-complete-c-headers and gets called for c/c++ headers hooks
(defun my:ac-c-header-init ()
  (require 'auto-complete-c-headers)
  (add-to-list 'ac-sources 'ac-source-c-headers)
  (setq achead:include-directories
  (append '("/usr/include/c++/5"
        "/usr/include/x86_64-linux-gnu/c++/5"
        "/usr/include/c++/5/backward"
        "/usr/lib/gcc/x86_64-linux-gnu/5/include"
        "/usr/local/include"
        "/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed"
        "/usr/include/x86_64-linux-gnu")
        achead:include-directories)))
;now let's call this function from c/c++ hooks
(add-hook 'c++-mode-hook 'my:ac-c-header-init)
(add-hook 'c-mode-hook 'my:ac-c-header-init)

Something is missing ?
The path for headers comes from gcc -xc++ -E -v -

ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include


texts: Sometimes my buffer list has 10+ dired windows, and I end up using buffer-menu to manually mark and kill all of them.  Is there a faster way to close all open dired windows?


texts: decrease time until "C-x-" shows in echo area after pressing the keys

texts:
When I try enter commands via C-x, it takes 1-2 seconds until the echo area shows this prefix key, as C-x-.   I'm quite new to Emacs, so this often confuses me, and I get lost.

The ESC key acts similar to this, so when I try to escape out of some half-entered command, I often end up looping pressing ESC and again after 1-2 second I see ESC- in the echo area.

Is there a way to decrease the time it takes to show a reaction in the echo area, am I doing something wrong, or is this somehow intended?


texts: Kill ring not synchronizing with clipboard in Windows

texts:
I have been using Emacs 24 on Windows 7 for almost a year without any issues. But recently, kill-ring in my Emacs has stopped synchronizing with clipboard (actually whatever I copy from within Emacs is available in system's clipboard but not other way around). I've successfully used Shift + insert to paste things off my clipboard all the time earlier but not any more :(. I've tried adding lines below to my Emacs init script.

  (setq x-select-enable-clipboard t)
  (setq x-select-enable-primary nil)
  ;; Treat clipboard input as UTF-8 string first; compound text next, etc.
  (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))

But it has not affect on the erroneous behaviour of synchronization between kill-ring and clipboard. Any help or suggestions or guidance to debug the issue would be appreciated.

Notes

I'm using arsclip as clipboard manager.
I'm running Windows 7 x64 and emacs-w64.
I use conemu, I noticed that my clipboard is no synchronizing both ways.


texts:
When I open pdf with emacs, it got frozen. And I installed pdf-tools, open pdf, it got frozen again.

What's the underlining process when emacs open a pdf? Is there a lot of converting work? What should I do to speed it up?

Emacs 24.4
Ubuntu 14.04 LTS
Intel 2.4GHz x 2
4G RAM.

Update:

I just found this page:

"learnt a lesson. Never open a pdf in emacs. Never even do it accidentally."

https://twitter.com/ergoemacs/status/456088661059457024

It's a sad news to me! Isn't it a great idea to view pdf using Emacs?

Update 2

I thought it was because my pdf file is too large:

5.7M, 1313 pages

So I tried a small pdf file,

402K, 66 pages

it got frozen again.

Update 3

I open pdf file using C-c C-x from helm, and it opens the pdf file in an external viewer: zathura. Since there is no converting process, the file opens lighting fast. (As fast as mupdf. I guess zathura using mupdf as its back end.)

There are four points makes zathura outstanding:

Lighting fast. (Both open and search)
High quality display.
Tab displays the chapter/section menu just like Adobe Reader.
Good keyboard shortcuts support. (Actually, it uses vim-style keybinding, which make sense since there is no need to switch mode in pdf viewer.

Update 4

Screen shot for quality comparasion:

!Left: Zathura; Right: PDF in Emacs

I really got confused what Emacs uses for open PDF.
(I've already removed pdf-tools)


texts: How do I associate org-mode source buffer to appropriate session?

texts:
I want to execute org-babel code blocks associated with a session without locking up Emacs. I found the ob-async package, but it doesn't have support for sessions yet. I've found that opening the code block in a source buffer allows me to run code blocks without locking up Emacs. I'm mostly happy with that workflow. I can hit C-' C-b to evaluate R code blocks using ESS, for example.

One annoyance however is that I have to choose the instance to use for execution, if I have multiple R sessions open. This is particularly cumbersome, since I have to do this every time I revisit the code block using C-'. I'd like to have the session automatically associated (using the :session argument in the header). How would I go about doing this?


texts:
I've been working on EMACS/Org-agenda to pop-up a message based upon an event in my org-agenda file. I used the techniques in here: http://emacs-fu.blogspot.com/2009/11/showing-pop-ups.html
as well as from here:
Good methods for setting up alarms (audio + visual) triggered by org-mode events?
Right now when I open up EMACS I get the little blue-box in the top-right.
Now, I may be reading this wrong. I went ahead and set up an agenda file from Rainer Konig's videos on: youtube tutoral vids and tested them. It works just as his shown, so I know THAT's set up right. But still I don't get what I thought I'm suppose to. So let me ask. Am I doing something wrong? Or what I want, isn't exactly what this code is suppose to?
What I'd like is like the screen shot shows, but it shows something like "Weekly review scheduled" which pops up on the date scheduled in the agenda file. (I've attached it here:)

#+SEQ_TODO: NEXT(n) TODO(t) WAITING(w) SOMEDAY(s) PROJECT(p) | DONE(D) CANCELLED(c)

gtd related things
** NEXT weekly review    SCHEDULED: <2021-03-08 Mon 21:10>

Here is the code from my .EMACS files

;; pop-up alert ;;
(org-agenda-to-appt); reloads the agenda everytime emacs is turned on.
;Good methods for setting up alarms (audio + visual) triggered by org-mode events?
(require 'notifications)
(notifications-notify :title "This is EMACS!"
:body (format "You have an appointment in %d minutes" 10)
:app-name "Emacs: Org"
:sound-name "alarm-clock-elapsed")
;; org-alert from: https://github.com/spegoraro/org-alert (add-to-list
'load-path "~/.emacs.do/list/org-alert/org-alert.el") (require
'org-alert)
(setq alert-default-style 'libnotify)

I use:
GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian
Org-mode 9.3.1
Thanks for any help you can give

Kan


texts: Installing Emacs from source: no 'configure' file

texts:
I wish to build the latest development version of Emacs from source. I've browsed to https://savannah.gnu.org/projects/emacs and executed the command suggested on the front page, namely

git clone -b master git://git.sv.gnu.org/emacs.git

I then read the INSTALL file, which says

  2a. 'cd' to the directory where you unpacked Emacs and invoke the
        'configure' script:

   ./configure

I followed these instructions, but this resulted in the following error message:

  -bash: ./configure: No such file or directory

Inspecting the directory where I unpacked Emacs, I see that there is indeed no file named 'configure'. The closest matches are the files 'config.bat' and 'configure.ac'.

Why isn't there a 'configure' file in my installation directory? How do I proceed from here?

I run macOS Sierra version 10.12.5 .


texts:
In this example:

If I add for example '0.5' where the cursor is, instead of adding '0.5' while moving the remaining text to the right, Emacs will delete the part '}{ckt1}' while adding '0.5'. Is it possible to avoid it so that when the cursor is in that position and I type 0.5 the result be just '[width=0.5]{ckt1}'?


texts: Why does viewing PGP encrypted PDF fail?

texts:
When I try to open a PGP encrypted PDF file.pdf.gpg, then – after entering the PIN in my smartcard reader – a window pops up with an error message:

Error: /syntaxerror in (binary token, type=150)
Operand stack:
   -117240830   -2063108939
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa
lse   1   %stopped_push   1967   1   3   %oparray_pop   1966   1   3   %oparray_
pop   1950   1   3   %oparray_pop   1836   1   3   %oparray_pop   --nostringval-
-   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringv
al--   2   %stopped_push
Dictionary stack:
   --dict:1200/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--
Current allocation mode is local
GPL Ghostscript 9.19: Unrecoverable error, exit code 1

Close this window with the close button on the title bar or the system menu.

I would expect the PDF to be shown in DocView mode.

About my system:

Windows 7 x64
GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570
Viewing PDFs in DocView mode works fine.
Viewing PGP encrypted text files with EasyPG Assistant (epa) works fine.


texts: Is there a "variable inspector" in ELPY?

texts:
I miss a way to see the list of variables in Elpy (variable inspector/editor). Is this possible at all?
Thank you!


texts: How to execute a function in all files in the git working tree?

texts:
How to invoke a function on all files in the git working tree, while opening the ones which have had no opened buffers beforehand?

A potential use case: Check and fix spelling in all project files with flyspell.


texts:
I want to create a popup menu, like the ones created by mouse-buffer-menu, but I also want to bind hotkeys in that context (e.g. 1 to select the first entry).
I want to specifically use the x-popup-menu facility, or something behaving similar, in order to be able to select from a list of choices without switching buffers, and also to retain the capability when using Emacs from a terminal.
Is there any such capability?


texts: What controls things like cursor appearance in a terminal?

texts:
In the GUI version of Emacs, it is easy to see that something like (blink-cursor-mode t) makes the cursor blink.

However, in a terminal emulator, such as on Mac OS X, it is possible to set things such as the cursor color or whether or not the cursor blinks, in various places (like your ~/.profile or in the Terminal Preferences.

So, my question is, what determines when a "graphical" element, such as text color, is controlled by a terminal emulator (in Terminal in Mac OS you can set the ANSI colors) versus when Emacs controls it (specifically when Emacs is running in a terminal emulator)


texts: I want to debug my init file, by exiting from loading the file in the middle so if something is wrong after that place it will not be loaded. How can I exit from .emacs file?


texts: How to hide the *Org Links* buffer when insert org links

texts:
When insert org links with org-insert-link, an Org Links buffer is created.
How can I hide it?


texts: Enable prog-mode when minor mode is activated

texts:
I created a minor mode for some specific file extension to fontify the syntax and provide correct indentation.

1)The indentation doesn't work for some reason.

2) How to enable prog-mode when the minor mode is enabled?

(define-minor-mode kwds-gl-mode
  "kwds gl mode."
  nil " kg" nil
  (if kwds-gl-mode
      (font-lock-add-keywords nil kwds-gl)
    (font-lock-remove-keywords nil kwds-gl)
    )
  ;; Don't know if this actually works
  (if kwds-gl-mode
      ;;Tab:4
      (setq tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120)))
    nil
    )
  (if (fboundp 'font-lock-flush)
      (font-lock-flush)
    (when font-lock-mode
      (with-no-warnings (font-lock-fontify-buffer)))))

(defcustom kwds-gl-modes '(gl-mode)
  "List of modes where Lisp Extra Font Lock Global mode should be
        enabled."
  :type '(repeat symbol)
  :group 'kwds-gl-lock)

;;;###autoload
(define-global-minor-mode kwds-gl-global-mode
  kwds-gl-mode
  (lambda ()
    (when (apply 'derived-mode-p kwds-gl-modes) (kwds-gl-mode 1)))
  :group 'kwds-gl)

(add-to-list 'auto-mode-alist '("\\.gl\\'" . kwds-gl-mode))
(kwds-gl-global-mode 1)

Second version:

  (define-derived-mode gl-mode prog-mode "gl"
    "major mode for gl language code."
    (setq font-lock-defaults '(kwds-gl)))
  (add-to-list 'auto-mode-alist '("\\.gl\\'" . gl-mode))
  (add-hook 'gl-mode-hook (lambda () (flycheck-mode 0)))


texts: eshell: How to create a git diff patch using the greater-than > symbol

texts:
Eshell does not seem to have built-in support for the greater-than symbol.  How can I run the command:  git diff SHA1234567890 > patch.diff

I could run a separate shell command ...

(start-process "git-diff" nil "/bin/bash" "-c" COMMAND-STRING)`

... but, I'd like to add Eshell support for creating git diff patches.


texts: What datatype is accepted by the last argument of the define-key function?

texts:
(define-key mode map symbol)

Normally what you see a quoted value (which means literally that value).

(define-key evil-normal-state-map "i" 'evil-insert-state)

That means when the key is pressed, it actually looks up for that value as a variable and then execute it, a bit like what getattr(Object, 'string') does in Python. The subtle distinction is that 'string' is literally that value however getattr returns the function object with that name.

However I can perfectly replace this with an interactive lambda.

(define-key evil-normal-state-map "i"
  (lambda () (interactive) (message "%s" major-mode)))

How is it possible that a 'value (which I think is a bit like string in Python) can be replaced with a function object. Is it that (interactive) is doing something special?

Can someone please explain why there is an equivalence between 'string and the lambda in this case is it because the define-key knows to handle both these datatype appropriately?

FYKI: I bumped into this problem because I wanted to conditionally bind some key depending on the major-mode.


texts:
I have the following ~/.emacs:

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(require 'highlight-symbol)
(global-set-key [(control f3)] 'highlight-symbol)
(global-set-key [f3] 'highlight-symbol-next)
(global-set-key [(shift f3)] 'highlight-symbol-prev)
(global-set-key [(meta f3)] 'highlight-symbol-query-replace)

Then I added the file highlight-symbol.el to my ~/.emacs.d folder.

However when I start emacs I get:

Warning (initialization): An error occurred while loading ‘~/.emacs’:

File error: Cannot open load file, No such file or directory, highlight-symbol

I am new to emacs, what am I doing wrong?


texts: Can we just see the Hex code without preview in hexl-mode?

texts:
I would like to use the hexl-mode but without the ASCII characters printed on the right side as it is mostly gibberish and not a very helpful feature for me. Is there a way to achieve that?

For example:

00000000: 4672 6564 7269 636b 0000 0000 0000 0000  Fredrick........

Needs to be simply:

00000000: 4672 6564 7269 636b 0000 0000 0000 0000


texts: Pushing/Fetching all branches at once in magit

texts:
Context:
I have a relatively small project, in which I use branches to work on new features, so that when I'm finished, then I manually merge branches as I need.

I usually keep the same exact copy of my branches on many machines as I work remotely, and that's what I need. I'm not using GitHub, my remote server is just a Server of my company where we keep projects on.

So the question is:
How do I push, or fetch all branches at once using magit?

What I'm trying to achieve is the same exact output that I would have by executing these commands in the terminal:

git push --all

or

git fetch --all

More info;

Emacs version: GNU Emacs 25.3.1 (x86_64-w64-mingw32) of 2017-09-17
Magit version: 20190202.1535

If more is needed don't mind asking. Thanks in advance!


texts: Tab is not inserted when indent-line-function is defined

texts:
I defined indent-line-function variable for Makefile corresponding to the problem referred in the link.
But when this configuration is activated, pressing TAB key does not insert tab letter at the point.
How can I fix it ?
Following is from my init.el
(defun yh/makefile-indent-line ()
    "https://emacs.stackexchange.com/questions/3074/customizing-indentation-in-makefile-mode"
    (save-excursion
      (forward-line 0)
      (cond
       ;; keep TABs
       ((looking-at "\t")
        t)
       ;; indent continuation lines to 4
       ((and (not (bobp))
             (= (char-before (1- (point))) ?\\))
        (delete-horizontal-space)
        (indent-to 4))
       ;; delete all other leading whitespace
       ((looking-at "\\s-+")
        (replace-match "")))))

  (add-hook 'makefile-mode-hook
            (lambda ()
              (setq-local indent-line-function 'yh/makefile-indent-line))))

edit:
The first problem was indent-region in Makefile removes tab character at the beginning of all lines. I googled and reached the page linked above, then I just pasted the snippet from the answer into my init.el and it makes indent-region keep tab characters.
The second problem, which I mentioned in this post, was I could not insert tab character at all by pressing the tab key when indent-line-function above is defined. What I thought at that time was "Pressing tab key let emacs insert a tab character in the current position. How function for indentation affect inserting character ?".
Finally, I understand the problem. Tab is assigned to indent-for-tab-command function. And the docstring of the function says

The function called to actually indent the line or insert a tab
is given by the variable `indent-line-function'.

So I should modify the function I pasted so that it would insert tab character appropriately. The following is my modification
(defun yh/makefile-indent-line ()
    "https://emacs.stackexchange.com/questions/3074/customizing-indentation-in-makefile-mode"
    (let ((bol (= (point-beginning-of-line) (point)))
          (empty (string= (yh/current-line) "")))
      (message "-- %s %s %s" bol empty (point))
      (if bol
          (progn (when empty (insert "\t")))
        (save-excursion
          (forward-line 0)
          (cond
           ;; keep TABs
           ((looking-at "\t") t (message "1 %s" (point-max)))
           ;; indent continuation lines to 4
           ((and (not (bobp))
                 (= (char-before (1- (point))) ?\\))
            (delete-horizontal-space)
            (indent-to 4)
            (message "2"))
           ;; delete all other leading whitespace
           ((looking-at "\\s-+")
            (replace-match "")
            (message "3"))
           (t (message "4 %s" (point-max))))))))

Actually, this is not the perfect (in some situation, behave badly) but acceptable to me.


texts: How do I include .org.gpg files in my org-agenda-files? By default, it ignores them.


texts:
I want to store my passwords via pass in Dropbox and then open them with my secret key via emacs. Is it possible in "pass" to enter the path where my .password-store directory is stored.
Everything works, when i store my passwords in my home directory, but i need the directory in dropbox, so i can reach it from other places.


texts: compiling warning when installing auto-complete package in emacs 24

texts:
I tried to install auto-complete and followed the steps below:

(emacs version: GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.18.9))

1) delete dir elpa (make sure it's not installed)

2) M-x package-install RET auto-complete RET

 Leaving directory `/home/taochen/.emacs.d/elpa/popup-20150315.612'
 ^L
 Compiling file /home/taochen/.emacs.d/elpa/popup-20150315.612/popup-pkg.el at Tue Apr 14 10:47:58 2015
 Entering directory `/home/taochen/.emacs.d/elpa/popup-20150315.612/'
 ^L
 Compiling file /home/taochen/.emacs.d/elpa/popup-20150315.612/popup.el at Tue Apr 14 10:47:58 2015
 ^L
 Compiling no file at Tue Apr 14 10:47:58 2015
 Leaving directory `/home/taochen/.emacs.d/elpa/auto-complete-20150408.1132'
^L
Compiling file /home/taochen/.emacs.d/elpa/auto-complete-20150408.1132/auto-complete-config.el at Tue Apr 14 10:47:58 2015
Entering directory `/home/taochen/.emacs.d/elpa/auto-complete-20150408.1132/'

In end of data:
auto-complete-config.el:544:1:Warning: the following functions are not known to be defined:
    semantic-analyze-current-context, semantic-tag-class,
    semantic-tag-function-arguments, yas-expand-snippet,
    semantic-format-tag-type, semantic-format-tag-name
^L
Compiling file /home/taochen/.emacs.d/elpa/auto-complete-20150408.1132/auto-complete.el at Tue Apr 14 10:47:59 2015


texts: Programmatic way of calculating end of week/month/year

texts:
I'm trying to build functions that help me execute frequent sparse tree queries, using org-match-sparse-tree nil "<some_query>" in my code.

Some of these queries need to contain constraints such as SCHEDULED<=<end_of_this_month>, where <end_of_this_month> just means the end of the current month. The same could be true for this week, next week, this year, and so on.

I know about the possibility of writing SCHEDULED<=<1+y>, but that just means 1 year from now, meaning, as of the time of this writing, from Aug 28 2019 to Aug 27 2020, which is not what I want.

Is there a way to, programmatically, obtain in a string the end of the current or next month/year/week without having to manually calculate those (meaning using a preexisting date-handling function)?


texts: Org code block receives table without header

texts:
I'm trying to send an Org table as a lisp object to a code block for further processing with an elisp function. For testing I set up two code blocks, one that generates the table and another that receives the table.

The first block works fine:

#+NAME: from-r
#+BEGIN_SRC R :results value :colnames yes
  q <- data.frame(something1 = c("a", "b", "c"), something2 = c(1, 5, 100))
  q
#+END_SRC

#+RESULTS: from-r
| something1 | something2 |
|------------+------------|
| a          |          1 |
| b          |          5 |
| c          |        100 |

But the second block is not receiving the whole table!

#+BEGIN_SRC emacs-lisp :var the-table=from-r :results output
  (print the-table)
#+END_SRC

#+RESULTS:
:
: (("a" 1) ("b" 5) ("c" 100))

Looking at the messages buffer...

executing R code block (from-r)...
Wrote /tmp/babel-1755OIV/ob-input-17558YA
(("something1" "something2") hline ("a" 1) ("b" 5) ("c" 100))
executing Emacs-Lisp code block...

(the-table (quote (("a" 1) ("b" 5) ("c" 100))))

Code block evaluation complete.

...it's clear to me that the output of the 1st block is the complete table but the second block somehow removes the table header. For clarity:

Complete table: (("something1" "something2") hline ("a" 1) ("b" 5) ("c" 100))

Table w/o header: (("a" 1) ("b" 5) ("c" 100))

I'm I missing something?


texts: Result of math. operation - replace math. formula

texts:
If I want to do some math. operation I do next:

(* 5 3)

C-x C-e (eval-last-sexp)

Here result:

As you can see the result is in the minibuffer.

Nice.

But I need result to REPLACE math. formula.
I need smt. like this:

How I can do this?

P.S. Custom function eval-last-sexp not work for multiple cursors


texts:
How do I run an arbitrary function upon starting up Emacs?

My specific problem: in spacemacs, I have added the following to the config section of my .spacemacs file:

(add-hook 'evil-insert-state-exit-hook 'linum-relative-on)
(add-hook 'evil-insert-state-entry-hook 'linum-relative-off)

It works well, but I've noticed that this config produces weird behaviour if I don't first execute linum-relative-toggle immediately after opening spacemacs and before editing a file.

How can I get Emacs to automatically execute linum-relative-toggle on start up?


texts: What is the purpose of this code in `append-to-buffer`?

texts:
The append-to-buffer function's definition ends with:

(dolist (window windows)
  (when (= (window-point window) point)
    (set-window-point window (point))))))))

What is the purpose of this?  Experimenting, I commented out this code and re-ran, but could detect no difference in functionality?

Thanks for your responses, I'm responding to Drew's response.  Perhaps I did something wrong in my experiment.  However, in my experiment, I split the buffer into two windows, with identical window points, commented out the pertinent code, and executed the (altered) append-to-buffer.  I observed that the other window's point  "seemed" to have been adjusted correctly, despite the fact that I had commented out the code.

I specified point to emphasize that I was observing the 2nd window's point, not window-point, which I have no way of eyeballing.  Can anyone repeat my experiment to see if (in emacs 24.4) I've interpreted the actions correctly.  If so, that would suggest that emacs 24.4 was enhanced so that the code become redundant.  If not, then I did something wrong in my experiment.  This will help me, because I will be writing my own personal code, and I need to know what is necessary....  Thanks


texts: How to well deal with the git diff with compatible to visual-line-mode?

texts:
I typeset my manuscript in org-mode with visual-line-mode turned on. Physically one of my paragraphs is just a line which is soft-wrapped.

In this case, when I tried to git diff (magit) to see what I have changed, all of this line (paragraph) is marked to be changed. I could not find out which part of this paragraph have been changed simply.

I think there should be some solutions regrading this issue, but I could not find any answer from website. Can anyone share your good solution?


texts: Cursor moves one position left after exiting insert mode?

texts: I'm using evil via spacemacs.  When I exit insert state, the cursor moves to the left one character.  Why is that?  Is it a bug, or is it a feature?  Can I turn it off?


texts: Interrupt evaluation and observe current stack in the emacs-lisp debugger?

texts:
If some emacs-lisp function, such as a major mode hook, is taking longer than expected to execute, I would sometimes like to interrupt it and look at the current stack. Ideally, I'd also like to be able to look at variable values, and so on, in the debugger. I'm not talking about code that I am deliberately executing in emacs-lisp mode, but rather code that gets executed in the normal operation of emacs.

How can I interrupt execution of emacs-lisp code directly in emacs? I do not know up front which function I need to debug.

For example, typing C-g, while it interrupts execution, also tells me nothing about which function was interrupted.


texts: emacs dired create a copy of image with 50% brightness

texts:
I know in the command line in linux i can use image magick to quickly brighten an image

convert nebula.landscape.jpg -brightness-contrast 30 bright.jpg

im trying to create a function in emacs (dired?) to launch this command on an image and create a copy of that image (after the brightness command is run). I know one can use ! but i want it to be persistant over sessions and thus i thought of a function. The copy would have the .bright suffix added such as image.bright.jpg. can anyone help with an example.

if there are other internal emacs methods to do this i would be happy to use this as well. Also, if one couls save a list of commonly used commands used in ! and maybe use ivy/helm to choose them that also could work great.


texts: org-mode html publish fails with invalid regex error

texts:
I am using org-mode for generating a static website for my notes. For this, I followed the tutoriala at:
https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
And this is the relevant part on my .emacs file:
;; Org-mode html publish
(require 'ox-publish)
(setq org-publish-project-alist
  '(
    ("org-notes"
        :base-directory "~/org/"
        :base-extension "org"
        :publishing-directory "~/public_html/"
        :recursive t
        :publishing-function org-html-publish-to-html
        :headline-levels 4             ; Just the default for this project.
        :auto-preamble t
    )
    ("org-static"
        :base-directory "~/org/"
        :base-extension "css\\|js\\|php\\|jpg\\|png\\"
        :publishing-directory "~/public_html/"
        :recursive t
        :publishing-function org-publish-attachment
    )
    ("org" :components ("org-notes" "org-static"))
))

And I used this one for quite some time now. But lately, when I do M-x org-publish-project and pick org-static, it fails with the error message Invalid regexp: "Unmatched ( or \\(". I wonder where is the problem in my config and how this started failing all of a sudden. The project org-notes still works fine.


texts: Quake Terminal Like Access for Emacs Client Session

texts:
I am trying to get used to Emacs. I have a problem with the startup time of the Emacs and I give up Emacs easily when the startup times for "vim", "subl" (sublime text), and "code" (vs code) are much shorter and it is convenient to bring them up.

I want to solve the startup time and accessibility to emacs by

a) Running the emacs always in the background.

b) Configuring a hotkey to bring it to the foreground, start editing a file, and pressing a key to push to the background again.

I am using SpaceEmacs distribution of Emacs on Mac.

Any suggestions on how to accomplish a) and b) ?


texts: Encountering `Symbol's value as variable is void: <!DOCTYPE` error while installing Icicles in Emacs on Windows 7

texts:
I was trying to install the Icicles packages as presented here by following this guide. First I downloaded only the required packages and put them in this directory:

C:\Users\Administrator\AppData\Roaming\.emacs.d\icicles

Then added this directory to load-path by putting this line in .emacs file:

(add-to-list 'load-path "~/.emacs.d/icicles/")

and executing M-x eval-buffer, so the directory was put in load-path when I checked it by C-h v load-path. But when I executed M-x load-library RET icicles RET it prompted the error:

Symbol's value as variable is void: <!DOCTYPE

Is it due to the files icicles-chg.el, icicles-doc1.el and icicles-doc2.el being in the load-path?

I'm using Emacs 24.5 running on Windows 7.


texts: Spacemacs keeps installing and uninstalling auctex-latexmk

texts:
Running spacemacs 0.200.13.

Everytime I start spacemacs, it either installs auctex-latexmk or deletes it saying that it is an orphan package.

Here is some more information:

I have latex layer enabled
I also have a private layer. But that does not have anything to do with latex or auctex

What is going wrong here? How do I set things right?


texts:
I’m using elpy for python development in emacs.

Some of the features are indispensable, like ‘C-c C-t’ for running individual tests.

However, after maybe an hour of development, my session is very slow—-like 1 full second command between keystrokes as simple as ‘C-n’, which becomes unusable.

I suspect I have something misconfigured or have conflicting autocomplete libraries, etc.

My question is: how can I (a) diagnose what is causing so much slowness and (b) fix it?


texts: Enter regular command in evil insert state?

texts: I'm using evil (specifically via spacemacs).  Is there a way to enter a regular command without leaving insert state? For example, running SPC i u (for adding unicode character) while still in insert state?


texts: Shift-R is not all selecting all the occurrences

texts:
I'm watching doom emacs multi cursor tutorial on youtube.
According to tutor, when the press R (i.e., Shift - r) after selecting the word M-d it should select all the occurrences of the selection.
But that is not happening in my case.
What i'm doing wrong?


texts: Show only file names starting with the given string in emacs history

texts:
When using C-x C-F to open a file, pressing ⇧ (up arrow) will iterate over the files I have recently opened. I believe the relevant lines from my ~/.emacs file are:

(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 50)

In any case, removing those lines empties my history (although the ⇧ is still there, it complains about no items in history). If those are not the correct lines, you can see my entire .emacs file here.

How can I configure this so that if, after C-x C-F, I type foo and press ⇧, only those files in my history whose name starts with foo are displayed. In *nix shells, this can be done by adding the following lines to ~/.inputrc:

"\e[A": history-search-backward
"\e[B": history-search-forward

How can I get emacs to do the same?


texts: .emacs file issues with org-mode TODO tutorials

texts:
I am customizing my ~/.emacs file. Specifically, I am customizing org-mode's TODO list feature to include more tasks. However, I keep receiving the following error:

  File mode specification error: (wrong-type-argument stringp\ (sequence
  "TODO" "IN-PROGRESS" "WAITING" "DONE"))

I've pasted my ~/.emacs file below. I am every new to emacs and org-mode. Would love any insights.

;; -*- mode: emacs-lisp -*-

;; Disable the splash screen (to enable it agin, replace th\
e t with 0)
(setq inhibit-splash-screen t)

;; Enable transient mark mode
(transient-mark-mode 1)

;;;;org-mode configuration
;; Enable org-mode
(require 'org)
(setq org-todo-keywords
  '((sequence "TODO" "IN-PROGRESS" "WAITING" "DONE")))
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

;; don't create backupfiles
(setq make-backup-files nil)

;; don't create auto-save files
(setq auto-save-default nil)

Thanks -- any insights would be appreciated.


texts: Programmatically controlling the order of functions within a hook

texts:
I am looking for an example, please, to programmatically control the order of functions within a particular hook:

First in time, which is easy -- i.e., don't append using add-hook.
Last in time, which is easy -- i.e., append using add-hook.
Second to last -- not so easy?

In the context of this particular question, there are three (3) functions assigned to the post-command-hook.

An overlay removal function, which must always be first in time.
A flyspell-post-command-hook function that must always be last in time -- if flyspell-mode is active.
A overlay placement function that must be last in time when flyspell-mode is not active, or second to last when flyspell-mode is active.

Essentially, I would like to control the overlay placement function to programmatically check to see whether flyspell-mode is active, and if so, then place it second to last.  If flyspell-mode is not active, then just append so that the overlay placement function becomes the last in the hook.


texts:
I have C-RET set to other-window globally. For modes that would override this I manually add a hook to the mode's key map, e.g.

(add-hook 'magit-log-mode-hook (lambda () (local-unset-key (kbd "<C-return>"))))

This doesn't work for magit-status-mode-hook.

I've also tried

(define-key magit-status-mode-map (kbd "<C-return>") nil)

which has no effect either.

How do I tell magit-status-mode-hook to not interfere with my global setting?


texts: How is the variable scoping for macros determined?

texts:
Take the following example macro, defined in macro.el.

(defmacro some-macro (&rest body)
  `(let ((some-variable 1))
     ,@body))

And take the following function, defined in a different file, function.el.

(defun some-function ()
  (some-macro (do-something)))

When function.el is byte-compiled, will some-variable be bound under lexical or dynamic binding?

I understand this depends on whether the file uses -*- lexical-binding: t; -*-, so my question specifically regards the following situations:

If function.el uses lexical binding, but macro.el doesn't.
If macro.el uses lexical binding, but function.el doesn't.

Does it make a difference if some-var has been declared global (with a defvar) inside function.el? If it does, I'm specifically interested in the case where it hasn't.


texts: What is the  key on the Apple extended keyboard?

texts:
[OS X 11.6, Emacs 25.1]

Using my Apple Extended Keyboard I just stumbled on an Emacs key called <select-window>. It is bound, naturally, to select-window. I discovered the key by  accidentally hitting it, seeing something happen, and checking what key I hit by viewing Lossage.

What key (possibly modified) is this?? I can't find it anywhere.


texts: Placing auto-saves in a different folder doesn't work

texts:
I am working on my personal emacs config and  I wanted to keep .emacs.d/ uncluttered. So I created a temp folder inside .emacs.d/ that includes a backup directory. This part works fine. Also sending backup files (tilde files) into the backup directory works, but this is not the case with my autosaves.
My code is:
(setq auto-save-file-name-transforms `((".*" ,db/backup-dir t))) (setq auto-save-list-file-prefix db/backup-dir)
The variable db/backup-dir is created before and works just fine, folder is also created.
Exchanging the variable to ~/.emacs.d/temp/backup/ does not help either.
I am running emacs 27. I have tried this on both linux and windows, the problem persists.
What am I doing wrong?


texts: How to write an interactive function which repeats when the last key in the keybinding is repeatedly pressed?

texts:
I want to repeat a function when the last key in the key binding is repeatedly pressed.
For example, say the keybinding is C-n for next-line, what I want to happen is that next-line is repeated when I just press n. Also, I need some way to end the repetition. Ideally any other key press should do what it normally does.
I have no idea where to begin with this so no close attempts I could show.
Note: In the example above it's not actually important that C-n runs the function. The first execution of the function could be on the first separate n key press.


texts:
I already checked around the stack exchange and internet for a while to why this issue is occurring, but I can't seem to find the solution.

Whenever I try to enable a disabled command in Emacs, it tells me the following:

Saving file c:/.emacs...
basic-save-buffer-2: Opening output file: Permission denied, c:/.emacs

I have no clue how to fix it because I thought that Emacs only loads it's .emacs on startup or when told to refresh and it wouldn't cause an issue.

Any help is extremely appreciated.


texts: Emacs 25.1 & Python 3.6.0 Integration [Newbie]

texts:
Preface:

I've been dabbling with python programming for a mere few months now. Previously, I spent most of my programming time using C# with Visual Studio. In the Python world, I've been using PyCharm for my projects. It has excellent code-completion (much like the IntelliSense I'm used to) and a nice level of customizability. However, at the end of the day, I want something a little bit lighter and less clunky. I have seen videos of developers using Emacs with Python and I'm quite interested in learning it.

Setup:

Python 3.6.0 is installed.
I have downloaded emacs-25.1-x86_64-w64-mingw32.zip from the Emacs website.
I have created a folder C:\emacs and extracted the zip file to this location
I have identified the Emacs home folder as C:\Users\joshu\AppData\Roaming\.emacs.d
I have created an init.el file in this directory since one did not exist

Python Integration:

Now, this is where I'm struggling. I'm still extremely new to the software so it's a bit hard to piece together information from the internet. Using this tutorial I have developed a baseline init.el file. Due to my reputation points, I cannot include a third link here. The Gist containing my init.el file is commented below.

When I open Emacs and open a python file, editing works. However, I'm running into the issues outlined below:

C-c C-c returns an error. It seems to be a relatively wide-spread error upon Googling. By simply typing C-c C-c again, the shell will appear with the code being executed; however, it gives me the line python.el: native completion setup failed

Edit: The error is Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support
    readline, yet ‘python-shell-completion-native’ was t and "python3" is not
    part of the ‘python-shell-completion-native-disabled-interpreters’ list.
    Native completions have been disabled locally.

Python autocomplete doesn't seem to be working properly. When using PyCharm, I get a much, much more robust offering of completions. In the case of Emacs, if I begin typing something such as from tkint it will not suggest tkinter. Similarly, if I start typing from math import a it will not suggest abs. I'm not sure at all how to configure Python autocompletion. I've read a few things about using pip install jedi and so on, but I haven't done any of that.

I realize this may be just as much a python question as an Emacs question in some regards. Any insight is appreciated.


texts: mu4e overwrites minibuffer output when switching buffers

texts:
I'm using mu4e for email and I really like it.  The only time it annoys me is when I'm switching buffers and I want to see a list of suggested buffer names in the echo area / minibuffer, because mu4e insists on writing [mu4e] Retrieving mail... / into the echo area.  In order to refresh the list of buffer names I must edit the now invisible text in the minibuffer, but it only flashes for a moment as it is again overwritten by mu4e's notification.

I like this notification when I don't use the minibuffer, so I don't want to disable it completely.  Is there a way to prevent it from appearing when I'm actively using the minibuffer?


texts:
I'd like to change the foreground color of non-current ivy items. The only way that I've found to do that so far is to define my own ivy-format-function like this:

(defun aj/ivy-format-function-line (cands)
"Transform CANDS into a string for minibuffer."
  (ivy--format-function-generic
   (lambda (str)
     (ivy--add-face (concat str "\n") 'ivy-current-match))
   (lambda (str)
     (ivy--add-face (concat str "\n") 'ivy-not-current))
   cands
   ""))

Unfortunately, this prevents ivy-minibuffer-match-face-1's foreground color from taking effect (it should be white and bold) because ivy-not-current takes precedence. Is there a better way to do this?


texts: How to make $ not part of a symbol in tcl-mode?

texts:
Recently I found out about isearch-forward-symbol-at-point but in tcl it's rather useless, because when dereferencing a variable the $ is part of the symbol and so the symbol-at-point $var does not match ${var} or var.

In the following example code look at each symbol with M-: (symbol-at-point)

set var 1
puts "var = $var"
puts "${var}23"

Funny enough the syntax highlighting clearly differentiates between the symbol and the syntactic character. In perl-mode this is working well.

So the question is: what has to be changed in tcl.el (the one that comes with emacs 24.5.1) to exclude $ from  the symbol?


texts: Is it possible to make imenu refresh on every access, and to remove the *Rescan* item from the menu?


texts: `capitalize` capitalizes letters following an apostrophe

texts:
I wrote an Elisp script to deal with some file names with English phrases. capitalize converts "I'm a cat" to "I'M A Cat".
What's the right way to get the desired result? ("I'm A Cat") Should I use regex and write my own capitalization function?


texts:
I have been using Emacs for some time but I am quite new for PHP and Web development. I want to use Emacs as a PHP editor.

I have searched a lot of pages and I have found that many people recommend web-mode for editing mixed PHP and HTML code.

I installed it from MELPA and started using it but I have a problem with curly brackets indentation. As you can see on the attached screenshot I have two blocks of PHP code separated by a small piece of HTML.

It seems that web-mode cannot recognize that the second block is a continuation of the first one so the curly braces and the else clause are automatically aligned to the left side. This looks very ugly.

I tried to find a solution by reading documentation and searching in Google but I could not find anything helpful.

How can I get this working correctly?
Is it something that should be added to the configuration file?

--- WEB-MODE DEBUG BEG ---
versions: emacs(26.3) web-mode("17.0.0")
vars: engine("php") minor("php") content-type("html") file("x:/www/delete.php")
system: window(w32) config("x86_64-w64-mingw32")
colors: fg(nil) bg(nil)
minor modes: (global-eldoc-mode)
vars:
web-mode-enable-current-column-highlight=t
web-mode-enable-current-element-highlight=nil
indent-tabs-mode=t
--- WEB-MODE DEBUG END ---
You can run the command ‘web-mode-debug’ with M-x w-deb RET
--- WEB-MODE DEBUG END ---


texts: Cannot set default theme. Dark theme even if loaded without .emacs and without .emacs.d

texts:
When I load emacs without any configuration I see a dark theme:

There is no way for me to get back to the default theme. I tried the following:

M-x disable-theme: no theme is enabled
M-x customize-themes: I can set custom themes, but disabling them gets me to the weird default dark theme
M-x customize-variable RET frame-background-mode: setting to light/dark changes the colors slightly but no default emacs theme still, and I still have a dark background.
starting Emacs without .emacs configuration : no change
starting Emacs without .emacs.d/ : no change
removing completely Emacs with apt remove --purge emacs*, reinstalling and restarting it, without ~/.emacs, without ~/.emacs.d/: no change (??)

Are there configuration files/folders other than ~/.emacs and ~/emacs.d/?

EDIT:
fixed using the help from this question: Emacs cursor color is different in daemon and non-daemon modes
It was indeed the Xresources. xrdb -query -all didn't give any "Emacs*" stuff but calling xrdb -remove fixed the issue !


texts: How do I make sure a frame is fullscreen?

texts:
The command #'toggle-frame-fullscreen does exactly what it says; it toggles between fullscreen and not.

What command can I run to make sure the frame is fullscreen? That is, if not fullscreen, make it fullscreen; if already fullscreen, don't do anything.


texts: Octal character representation in keyboard macros

texts:
I generated a macro as a help for generating indices for words I have marked before. Now this macro looks as follows

(fset 'index
   "\367\\index{\C-y")

What does \367stand for and where can I look it up?


texts:
When I install ox-gfm package, I got below warning:

Leaving directory ‘/Users/root/.emacs.d/elpa/ox-gfm-20170304.1504’

Compiling file /Users/root/.emacs.d/elpa/ox-gfm-20170304.1504/ox-gfm.el at Mon Apr  3 22:11:54 2017
Entering directory ‘/Users/root/.emacs.d/elpa/ox-gfm-20170304.1504/’

Compiling no file at Mon Apr  3 22:11:55 2017
Warning (bytecomp): reference to free variable ‘info’
Warning (bytecomp): org-export-collect-footnote-definitions called with 1
argument, but requires 2
Warning (bytecomp): org-html--anchor called with 4 arguments, but accepts only
0-3
Warning (bytecomp): the function ‘org-export-get-reference’ is not known to be
defined.

But sounds like org-export-get-reference will be used in publish code, so when I try to publish org file to md file (refer to this link), it will report a error:

org-gfm-format-toc: Symbol’s function definition is void: org-export-get-reference

So I guess we should not ignore the warning!
Not sure if any other depend package missed!

My emacs version on MacOSX 10.12:

GNU Emacs 25.2.1 (x86_64-apple-darwin16.0.0, NS appkit-1504.00 Version 10.12 (Build 16A323)) of 2017-04-03


texts:
To post this question and this question, I had to copy the contents of minibuffer.

I tried to copy from minibuffer but it didn't worked.

I came across this discussion  and checked *Messages* buffer also. But minibuffer contents won't be there always.

Is it possible to copy mini buffer contents? How?

Update:

I am in a python process buffer and run kill-this-buffer, emacs will show this message in minibuffer

  Buffer "Python" has a running process; kill it (y or n)?

I want to copy that text.

Update:

In above example that message will be available in *Messages* buffer,  but  if  am creating a new branch using magit b c, it will prompt with message

  Create branch starting at (default master):

which  will  NOT be available in *Messages*. I need to copy this text also.


texts: Org-mode: A function to org-copy and org-archive unique tasks to different files

texts:
Suppose I have two files:

completed-YYYY.org_archive
archive-YYYY.org_archive

where YYYY is the current year.

I have an agenda file that looks like this, where each project and task has a unique ID:

** My Project
   :PROPERTIES:
   :ID: 1235-48
   :END:
*** DONE Task 1
    :PROPERTIES:
    :ID: 8943-41
    :END:
*** NEXT Task 2
    :PROPERTIES:
    :ID: 0124-47
    :END:
*** Task 3
    :PROPERTIES:
    :ID: 8491-03
    :END:

When I go to "archive" Task 1 (because it's DONE), I want the following to happen:

Check archive-YYYY.org_archive to see if a "My Project" task with ID 1235-48 exists. If not, copy the contents (not including subtrees) of the "My Project" heading to the file.
Check archive-YYYY.org_archive to see if a "Task 1" task with ID 8943-41 exists. If not, copy the contents of "Task 1" and place it under the "My Project" heading.
org-archive "Task 1" into completed-YYYY.org_archive.

So when I mark Task 2 as DONE and go to "archive" it, its contents should be copied into archive-YYYY.org_archive under the existing "My Project" task (below Task 1), and then archived as normal into completed-YYY.org_archive.

Is this possible to write a function for?


texts: After I updated Emacs 25.1 to 26.1 org-mode does not work any more

texts:
I am anything but an Emacs expert but I use Emacs org-mode quite frequently. I configured Emacs to regognize .org files. After I updated to version 26.1 Emacs does not only recognize .org files any longer:

File mode specification error: (file missing Cannot open load file No such file or directory ob-sh)

but can not even change to org-mode. M-x org-mode gives:

Cannot open load file No such file or directory ob-sh

I did not move my .emacs file or the .emacs.d folder.

Any idea?


texts: How to disable Prelude Emacs and use system-wide Emacs

texts: I have installed Prelude Emacs by using wget --no-check-certificate https://github.com/bbatsov/prelude/raw/master/utils/installer.sh -O - | sh. I am using Debian and  new to Emacs. Now whenever I run emacs in terminal, it opens Prelude Emacs. I wonder it is possible to two versions of Emacs; one for system emacs (installed by apt-get install emacs ) and the other installed by the above command. I don't want to uninstall Prelude Emacs. But just having two different emacs. (This question could be asked for a different version emacs such as spacemacs which uses .emacs.d directory). So it will overwrite my configuration files inside ~/.emacs.d/ as Prelude did it for my system-wide Emacs.


texts: Include elisp function in org-capture template

texts:
I've tried following some of the other answered questions here regarding this topic but can't seem to get my head around this particular part of the problem.

I have the following function, which returns the value of a key :PROPERTIES: pair when a cursor is under an org header:

  (defun capture-noter-link ()
    "insert PROPERTY value of pdftools link"
    ;; (interactive)
    (let ((linkStr
           (save-excursion
             (save-window-excursion
               (switch-to-buffer (plist-get org-capture-plist :original-buffer))
               (org-entry-get nil "NOTER_PAGE"))
             )))
      (insert linkStr)))

Calling this function interactively while in the source org file gives me the desired result. I then tried to implement this in org-capture by using the following template:

("ai" "Anki IR"
 entry
 (file+headline org-my-anki-file "Incremental Reading Cards")
          "* %<%H:%M>   %^g\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Cloze\n:ANKI_DECK: MegaDeck\n:END:\n** Text\n%x\n** Extra\n %(capture-noter-link)\n")

However the desired link isn't inserted into the capture buffer. What could I be doing wrong?


texts:
I always have file called ~/notes.org open in my emacs. It's my "notepad".

As a developer, I visit hundreds of files every day. Sometimes, I will be inside a file, looking at a method definition

module Email
  class SendAlertsWorker < ApplicationWorker
    include Sidekiq::Worker

    sidekiq_options unique: :until_executed

    def perform

When I'm on line 7, for example, is there some way I can tell emacs to
insert/append a link to
file:/whatever/file/I/was/browsing::def perform

in to my ~/notes.org

That way, if I have to revisit that particular file location later in the week, I have a convenient link to it in my org file.


texts:
I need to copy part of the file (with re-search-forward) to another file under the marker. I know how to use re-search-forward, but I have problems with buffer.

Am i right with my logic?

1) open needed file with temp buffer
2) create new buffer
3) find needed lines with re-search-forward and copy them in this new
buffer
4) insert lines into opened file with insert-buffer-substring

Right now i have a function like this:

(defun my-insert-file-name (filename)
  (interactive "*fInsert file name: ")
  (save-excursion
    (goto-char (point-min))
    (when (re-search-forward "#here")
      (forward-line 1)
      (------something should be here-----)))


texts: How to report that an interactive command couldn't run?

texts:
When writing my own interactive function, whats the best way to report that nothing happened.

(if line-is-empty
    (message "Found empty line, nothing to do!")
  (do-stuff))

Or is it better to use an error (even though it's not exactly an error, just that the command can't do anything useful).

(when line-is-empty
  (error "Found empty line, nothing to do!"))
(do-stuff)


texts: Can a symbol have a function, variable, and class?

texts:
Q: can one symbol refer to a function, a variable, and a class?

Elisp is a Lisp-2 in which a symbol can have separate
function and variable values.  So, for example, I can define the
following function and variable:

(defun kittens ()
  "Profess love of kittens."
  (message "I love kittens!"))

(defvar kittens nil
  "A variable to store information about kittens.")

And query their respective contents:

(symbol-value 'kittens)       ; => nil
(symbol-function 'kittens)    ; => (lambda nil "Profess love...")

However, once I define a class with the same name:

(defclass kittens ()
  ((quantity
    :initarg :quantity
    :initform 1000
    :accessor kittens-quantity
    :documentation "How many kittens anyone should strive to own."))
  "Kitten class.")

The class appears to supercede the function and the variable:

(symbol-value 'kittens)       ; => kittens
(symbol-function 'kittens)    ; => (lambda (&rest slots) "Create a new object...")

So: do classes simply clobber the original function and variable,
or do the original values still exist somewhere?


texts: Calling a function with a shorter but unknown argument signature length

texts:
Is there a terse idiomatic way of calling a function in the manner of funcall (dereferencing function symbols) when that function may have a variably shorter function signature?

Say for example: a hook assumes a signature of (VALUE PARENT), but for convenience it would be nice to also allow functions with the signature (VALUE) or ().  Evaluation using funcall will throw an error if the signature is any shorter than the arguments of the funcall invocation.

Here's a demonstration of the behavior I'm looking for:

(require 'dash)

(defun my/foo (a)
  (* a a))

(defun my/bar (a b)
 (* a b))

(defun my/easy-going-funcall (fn &rest args)
  ""
  (let ((num-args (length (cadr (if (symbolp fn)
                                      (symbol-function fn)
                                   fn)))))
     (apply fn (-slice args 0 num-args))))

(my/easy-going-funcall #'my/foo 2 3 4)  ;; 4
(my/easy-going-funcall #'my/bar 2 3 4) ;; 6
(my/easy-going-funcall (lambda () 42) 2 3 4) ;; 42

What equivalent does elisp have for something like my/easy-going-funcall?

P.S. I realize this method of reflection doesn't work for built-in C functions and breaks down with argument keywords, but I don't know any better yet!

Edit:

This really boils down to syntactic sugar for users and developers of a library.  From the user's perspective, if a hook expects functions with signature (ARG1 ARG2 ARG3) and their function ignores all three arguments they could write (lambda (&rest _unused) ...) for legibility.  If the hook itself has a mechanism to reliably call functions with shorter signatures (as this question asks) then the user may omit &rest _unused entirely and write (lambda () ...) as a matter of convenience.

On the flip-side, developers have additional flexibility in defining hooks.  Adding an additional argument to a hook signature does not need to be a breaking change.


texts: How to stop "emacsclient -t -a '' --eval" output to stdout?

texts:
I am running emacsclient with the command:

emacsclient -t -a "" --eval "some-exp"

The emacsclient -t -a "" is a must.

The problem is, for example, if I run:

emacsclient -t -a "" --eval "nil"

when quitting emacsclient, the command line will have "nil" printed.

My question is, how to totally stop the printing of the returned value ? (in here, it's nil).


texts: How to stop ESS overriding AUCTeX's TeX-newline in LaTeX parts of .Rnw?

texts:
I'm new to Emacs, and am trying to learn it for knitting LaTeX and R (using AUCTeX and ESS). In my ~/.emacs I have:

(setq-default TeX-newline-function 'reindent-then-newline-and-indent)

which means that when I press RET AUCTeX applies the proper LaTeX indentation automatically for me. However, in an .Rnw file it seems that ESS overrides the TeX-newline. In an .Rnw file C-h m returns:

RET     TeX-newline
(that binding is currently shadowed by another mode)

and C-h k RET returns:

RET (translated from <return>) runs the command ess-noweb-newline,
which is an interactive compiled Lisp function in `ess-noweb-mode.el'.

It is bound to RET.

(ess-noweb-newline &optional ARG)

A kludge to get round very odd behaviour of newline in quoted code.

Basically I only want ESS to override RET when the point is inside an R chunk (<<>> @) or the brackets of an \Sexpr{} expression. Seems to me that this should be the default behaviour, but is there any way to force it?


texts: Emacs not active when switching from different workspace

texts: this repulses me to my core. Every so often when I switch to my emacs from a different workspace (awesome wm) the cursor appears just as an outlined box and is not active until I switch back and forth between workspaces a second time. What is this behaviour and how can I prevent it?


texts: How to filter the package list by package name part or regex

texts:
Via M-x list-packages I can view a list of installable and installed packages. Great! But how can I filter this list by a portion of the package name?

PS: I know about package-menu-filter, but for me this command filters only on the package description, not the package name. E.g. when I filter on lsp-mode I get packages like lsp-scala, etc, but not what I was looking for, namely lsp-mode...


texts: How can I make backward-kill-word stop at special character such as paratheses and line breaks?

texts: Is it possible to change the behavior of backward-kill-word (bound to M-DEL by default) to stop at special characters? Quite often it deletes parentheses and line breaks against my will.


texts: Function to count how many times a keyboard macro is invoked?

texts: I am quite bad at counting and remember how many times I have invoked a special command, so I wonder is there any way to count and show in the minibuffer how many time a keyboard macro was invoked? Say that I want to use the macro to navigate the buffer in a specific way, and increment a counter as I move.


texts: Restoring windows with Desktop when running Emacs inside a terminal?

texts:
Maybe a silly question: I'm using desktop for saving Emacs' sessions. I've set

(setq desktop-restore-frames t)
(desktop-save-mode 0)

So windows and frames state is supposed to be saved, and I'm saving and reading desktop files manually.

When I run Emacs in its own X window, and I do desktop-read or desktop-change-dir everything is fine - frames, buffers and windows (including window splitting) are restored (for example, if I split a window with C-x 2, then save the desktop, this state is restored).

However, when I run Emacs either in a terminal emulator or in a virtual terminal only buffers are restored - window splitting is not shown, and although, when loading a desktop file I see a message like "Desktop: 2 frames, 5 buffers restored." in the minibuffer, and I see "F1" in the mode line, nothing happen when I do, for example C-x 5 o (that is, other-frame).

Is this how it is supposed to work or am I missing something?


texts: Why do multi-line comment blocks influence C++ indentation?

texts:
I'm a long-term Emacs user who recently started to learn C++.  I was surprised to discover that indentation for C++ is actually rather bad, specifically in files containing multi-line comment blocks.

In the example below I copy/paste a C++ exercise description into a multi-line comment block, then I start writing the main function.  Notice that the main function header line is incorrectly indented.  Notice that the closing bracket is incorrectly indented as well.

/* ch6_6
Write a program that checks if a sentence is correct according to the
“English” grammar in §6.4.1.  Assume that every sentence is terminated
by a full stop (.) surrounded by whitespace.  For example, `birds fly
but the fish swim .' is a sentence, but `birds fly but the fish swim'
(terminating dot missing) and `birds fly but the fish swim.' (no space
before dot) are not.  For each sentence entered, the program should
simply respond “OK” or “not OK.”  Hint: Don’t bother with tokens; just
read into a string using `>>'.
*/

  int main() {
  return 0;
                                 }

If I remove the multi-line comment block indentation is correct, but multi-line comment blocks seem to be rather fundamental to writing real-world code.

This cannot possibly be right.  Why does the present of a comment influence indentation at all? / What am I doing wrong here?  I'm on GNU Emacs 25.2.1 (Fedora 25), started with emacs -q.


texts:
I need to plot data evaluated in org-mode. Referring to #+RESULTS: returns
org-babel-ref-resolve: Reference ‘myResult’ not found in this buffer
whereas referring to #+tblname: works.

    #+RESULTS: myResult
    | 2057-01-01 | 10 |
    | 2057-01-02 |  5 |
    | 2057-01-03 |  3 |
    | 2057-01-04 |  2 |

    #+tblname: myTable
    | 2057-01-01 | 10 |
    | 2057-01-02 |  5 |
    | 2057-01-03 |  3 |
    | 2057-01-04 |  2 |

Note the failing reference data=myResult, while data=myTable works.

    #+begin_src gnuplot :var data=myTable :exports code :file basic-plot.png
    set xdata time
    set timefmt "%Y-%m-%d"
    plot data u 1:2 with linespoints

What did I miss here https://orgmode.org/worg/org-contrib/babel/intro.html#results in order to refer to RESULTS?


texts: Shift + cursor stopped behave as usual in org mode

texts:
after a package update and restart shift+arrow does not behave as usual in org mode:  move one day up/down in dates or cycling between statuses (todo, done, waiting...) in task lists.

org-support-shift-select is nil

How can I set again that behaviour, or at least guess where is the issue?


texts: org-mode: how to print agenda showing only some categories

texts:
I'm trying to print today's agenda hiding some categories.

I'm using C-u < to hide the categories I don't want, but when I print (either the buffer or by selecting the text and using lpr-region), it prints also the categories I've hidden.

How can I print only what I see?


texts: In Org-Mode, how to export to ASCII, maintaining capitalisation of the heading

texts: Whenever I export to ASCII, the heading always converts to all capitals. How can I maintain the original capitalisation?


texts: Highlight text without call commands in pdf-tools

texts:
Can I enter some 'highlight-mode' in pdf-tools that I can select and highlight text immediately without calling pdf-annot-add-highlight-markup-annotation or C-c C-a h?
Thanks!


texts: Avoiding overwriting global key bindings

texts:
Okay, this is a persistent problem for me. As I continue to use emacs more and more, I'm starting to customize it to my needs by installing the packages(and/or defining functions) and the one big problem I face when I configure a package is:- what keybinding to use for commands. I do not want to overwrite the global key bindings emacs ships with.

Right now, to check if a key-binding is being used for a command or not, I execute counsel-discbinds and enter the key-binding to see if it's already mapped to a command. If not, I proceed to map it to a command. But there is another problem, counsel-descbinds shows mapping only the current active major-mode. There have been times when I realized OH! I have overwritten another major-mode binding with this command and I had to again remap to another binding( which sucks :| ).

So, what can I do to avoid overwriting global-key-bindings. Is there something that lists all the unused key bindings that I could use for a command (which is not being used for any other major-mode). And whats a good rule of thumb whenever I'm creating new bindings for commands?

EDIT: Adding to the list of answers, I came across these two commands which I find to be very useful when you want to define key bindings:-

(describe-personal-keybindings) defined in bind-key (which comes with use-package). This lists all the key-bindings which are made by the enduser according to mode specific maps.
free-keys command defined in the package free-keys.el. This will show all the key chords which aren't bound to any command for the current buffer. You can also change the prefix key to something like C-c, to list all the unbound key chords.


texts: Re-Aligning Issue with org-mode tables in spite of monospaced font (Emacs 25.3 / Mac OS X)

texts:
I changed from Aquamacs to Emacs for Mac OS X (25.3). Now I have an issue with org-mode tables. After writing and before re-aligning it looks like this:

After re-align the table with C-c C-c or TAB it looks like this:

When I save the file, restart Emacs and open the org-file again everything looks fine:

Further changes to the table with following re-aligning leed again to the alignemnt-issue.

After another restart the table looks fine again. I found a similar problem because of non-use of a monospaced font here. But the default font is monospaced (Menlo). A Change to Monaco-font does not solve the problem either. (C-u C-x = shows

mac-ct:-*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1 (#x4C)

and

mac-ct:-*-Monaco-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1 (#x4F)

respectively. Does anyone have an idea, why this happens and how to solve it?

Edit: I am using Emacs via Spotlight only.


texts: How to disable completion-at-point in emacs shell (i.e., so I can have my `TAB` key back)?

texts:
Any suggestions on how to disable completion-at-point in Emacs shell (see below)?

I've looked in the GNU docs on the relevant hook (which is oddly named) - completion-at-point-functions - but given that the hook's value is simply a list of available functions, it's not clear to me how I can use it as a toggle.

The goal is to be able to have my TAB key back when using the Emacs shell.  I'd also be okay with turning off completion-at-point-functions globally (since I'm an ido junkie) but I'm not sure how to do that for global minor modes.

As reference, this is the window I'm referring to:

Click <mouse-2> on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
CLUTTER_IM_MODULE   DBUS_SESSION_BUS_ADDRESS    DEFAULTS_PATH


texts:
Emacs 25.1 obsoletes a variable isearch-word and recommends to use the new isearch-regexp-function instead.  Because Emacs 24 does not have the new variable, I can't just replace it like:

(if isearch-regexp-function

What's the best way to support both Emacs 24 and Emacs 25?

I don't want to just suppress the warning with with-no-warnings, which is already answered here: "How to avoid obsolete warning when defining a compatibility alias?"


texts: How to find a file from root with spacemacs?

texts: I have spacemacs and when I press SPC f f it starts of in the current directory. Problem is the file I need is in /etc so I first have to delete the current path by pressing backspace numerous times before I can start typing my path. Is there a way to not have a default path pre-written when pressing SPC f f ?


texts: Trying to install org-ref package, but getting error 'emacs-25.1' unavailable

texts:
I am trying to install org-ref package but getting error

package-compute-transaction: Package 'emacs-25.1' is unavailable.

I searched Stack overflow, Stack Exchange Emacs, and github.  I've found many solutions like this but isn't working for me.

I am using Emacs 25.1 in Ubuntu 16.4.

Edit: I am using Emacs 24.5.1 version.

I was able to install org-ref earlier but need to reinstall as it got corrupted.


texts: Green lines are invisible in diff output for some files in *shell*

texts:
I use Emacs a lot including for most terminal sessions. One of activities includes typing git commands inside a shell buffer.

I found a very interesting color puzzle.
After downloading forked repository https://github.com/yaitskov/java-nio-tcp-proxy
I encountered that new lines which should be green are blank.
And only deleted lines are visible (in red color).
It was a big surprise for me because I did it a lot of times with different repositories.

After trying different combinations there are facts:

git diff --color works well in other existing and new GIT repositories
in Emacs shell, Emacs term, Emacs ansi-term and gnome-terminal.

git diff --color works well for any GIT repo in
Emacs term, Emacs ansi-term and gnome-terminal.

Not all files in the repo have the bug. But most of them do (java files, pom.xml).

But green lines are visible for config.properties.

I aware that a shell buffer is not 100% terminal.
But I'm thrilled by this instability.


texts: Handling text files with mixed encodings

texts:
I created a text file by copying its different parts from different
sources (webpages, other text files, pdf files) into gedit and saved
it to the file. I wonder if that is the reason why I may have
multiple encodings in the text file, see also here.

How shall I avoid creating a text file with mixed encodings when copying its different parts from different sources into an editor such as emacs?
Whenever I open the file in gedit, gedit can always show or decode
every part of the text correctly.

But when I open the file in emacs, there will be characters that
can't be shown correctly. I wonder why emacs can't do that? Is it
because gedit add some metadata to the text file about which
encoding for which part, and these metadata can't be accessed by
emacs?
When I find the correct encoding for a part of the text file, and
change the encoding of the text file by C-x RET R <found encoding>, and save the change to the file, it is expected that
emacs still can't show  the other parts of the text files with
different encodings. Also gedit can't show or decode the entire file
correctly. Is it because the other parts with other encodings were
altered as well?

How should I do to convert the text file with mixed encodings to a
single encoding such as utf-8?


texts: I'm new to emacs and trying to setup emacs for ES6/React developement. I would like to have auto suggestions for es6 imports like lodash similar to vscode (as shown in screenshot). Is there a way to acheive this in emacs?


texts:
elpy (or rather flake8 I suppose) complains about a line over-indented on the line 52 (see below image)

I tried to change this line's begin but no change.
I always use TAB to have the correct indentation (and this position is where TAB leads).

Here's my elpy config:

Emacs.............: 26.3
Elpy..............: 1.33.0
Virtualenv........: None
Interactive Python: python3 3.8.3 (/usr/bin/python3)
RPC virtualenv....: rpc-venv (/home/david/.emacs.d/elpy/rpc-venv)
 Python...........: /usr/bin/python3 3.8.3 (/usr/bin/python3)
 Jedi.............: 0.17.0
 Rope.............: 0.17.0
 Autopep8.........: 1.5.2
 Yapf.............: 0.30.0
 Black............: 19.10b0
Syntax checker....: flake8 (/home/david/.local/bin/flake8)


texts: keyboard macro with input-method inserts characters twice

texts:
When I define keyboard macro with some input method enabled (lets say, english-dvorak), self-insert commands are repeated twice.

For example, if I define macro like this:
F3insert chars asdfF4
and then hit F4, I will get the following line:

insert chars asdf

But if I'll use some input method:
F3insert charsC-\asdfF4
, I will get:

insert chars aaooeeuu

Characters that were typed with english-dvorak input method enabled are repeated twice when macro is called. This happens with all input methods.

How can I fix this?


texts: How to search certain subdirectories of directories that are ignored by Git

texts:
I'm working in a Scala project that has target/ directories entered as ignored in the .gitignore. However, there is also Scala code being generated during the build which is being nested under a target/ directory, which I want to have included in my search. If I remove the target/ entry from .gitignore, the search picks it up (and lots of other junk). However, I don't really want to exclude these files from being ignored by Git, because they are not supposed to be committed. I just want to exclude them from being ignored by searching.

I am using the develop (prerelease 0.300) version of Spacemacs, with Helm. An example of a search command I am using is SPC s P (search project w/input) which I press while the cursor is on some identifier that I want to find in project files. I have both ag and grep installed. I don't know what Helm is using to search (maybe even git grep?).

SPC SPC describe-key RET SPC s P:

SPC s P runs the command spacemacs/helm-project-smart-do-search-region-or-symbol
(found in evil-normal-state-local-map), which is an interactive Lisp function in
‘../../funcs.el’.

It is bound to SPC *, SPC s P, M-m *, M-m s P.

(spacemacs/helm-project-smart-do-search-region-or-symbol)

Search in current project using ‘dotspacemacs-search-tools’ with
 default input.
 Search for a search tool in the order provided by ‘dotspacemacs-search-tools’.

What's the best way to essentially add a rule !foo/target/**/*.scala for the sake of search, but not of Git?


texts:
I created a theme which I stored in ~/.emacs.d/themes/, added this
directory to custom-theme-load-path, and put (load-theme
"the-theme.el") in my init.el.  Now restarting emacs, I get
prompted whether really to load, and then whether to consider safe in
future.  I said yes to both and confirmed that the file's SHA256 sum
was put into init.el.  But: next time I restart emacs, I get asked
again!  What am I missing?  Running 26.1.


texts: Activate global minor modes from use-package

texts:
I used global-company-mode from my .emacs like this:

(add-hook 'after-init-hook 'global-company-mode)

Now I’m trying to move to use-package, like this:

(use-package company
  :config
  (global-company-mode))

Now if I check with C-h m, company-mode is said to be active, but it’s not listed on my modeline (I don’t use anything that would hide it). And it actually works, as I get the company popup, when I start typing a function or variable name.

whitespace-mode is much worse, though:

(use-package whitespace
  :ensure t  ;; I also tried without this line
  :config
    (global-whitespace-mode)
  :bind
  (([f10] . whitespace-mode)
   ([(shift f10)] . global-whitespace-mode)))

Now WS doesn’t appear on my modeline as expected (again, I don’t hide anything) and I cannot see its effects like the end-of-line marker $ characters, and it’s not even listed when I press C-h m. But when I press shift f10, it says

Global Whitespace mode disabled

and when I press it again, I get the message that it got enabled, and I can also see the effects in all my buffers (and in C-h m).

What am I missing?

Edit: I just realised that diminish is actually installed as a dependency (I’m trying to figure out what pulled it in). However, diminished-mode-alist is nil, so I don’t think that’s the reason of mode names not displaying in my mode line (correct me if I’m wrong).

Edit2: deferring loading the diminish package solved the company problem, but the whitespace related one still persists.


texts:
Elpy Configuration

Virtualenv........: None

RPC Python........: 2.7.10 (/usr/bin/python)

Interactive Python: ipython (not found)

Emacs.............: 25.2.1

Elpy..............: 1.16.0

Jedi..............: Not found (0.10.2 available)

Rope..............: Not found (0.10.5 available)

Importmagic.......: Not found (0.1.7 available)

Autopep8..........: Not found (1.3.2 available)

Yapf..............: Not found (0.16.3 available)

Syntax checker....: Not found (flake8)

Hello,
I have installed all the required packages (Jedi, Rop...) for elpy, but for some reason they seem not installed, also the autocomplete not working!, any idea ?. Thank you in advance.


texts:
Suppose, we have a link [[https://www.google.com/][Google]]. When I put the cursor at the link and run org-open-at-point, instead of opening https://www.google.com/ in browser it downloads the page to /var/tmp and opens the file in browser: file:///var/tmp/kdecache-user/krun/20635_0_. All the css and js are broken of course.
Can I make it open the direct link in browser? Or maybe, it's not Emacs, but KDE.


texts: How to define key bindings for major mode extensions?

texts:
I am writing some extension features for various major modes. The features are (as usual in Emacs) some functions that should be bound to some keys to simplify the workflow of the user.

I started out by assigning these functions to function-keys F1, F2, F3, and so on.. But realized later that if these extensions should be used by others than myself, it would not be a very good idea. According to Appendix D.2 Key Binding Conventions in the Emacs Lisp manual, the function-keys should not be touched; they should be free for the user to customize.

So which keybindings should be assigned for extension features for a major mode?
Are there any guidelines for this? Consider for example cperl-mode or LaTeX-mode, they define most keys on the mode-specific-map i.e. the C-c prefix key. Is it a good idea to use the same keymap, or is this also going to breakdown sometimes in the future when the author of the major mode changes the bindings or adds new bindings to this map? I guess there could also very well be a chance that this keymap (mode-specific-map) would at some point get exhausted for reasonable/sensible key combinations.. Should I instead use another prefix key? And then,  which is safe/good to use? What is common practice?


texts:
I just moved to spacemacs from vim and am a complete newbie with emacs.

I cannot figure out how to expand yasnippets while in evil-insert-mode. I know yasnippet is available because I can choose from the available snippets using Spc i s. However I'd like to be able to <Tab> expand them.  What am I missing?


texts: Apply Python formatting rules to files not ending in .py

texts:
I need to edit a few .pyt files, which are python code but specific to ESRI ArcGIS software.
Is there a variable that lists the file ending that python formatting is applied to that I could add .pyt to in order to have those files formatted?
Thanks


texts: Upload large email attachments to owncloud in mu4e

texts:
When composing/sending messages, I would like to automatically upload large attachments to my owncloud server, similar to what the Thunderbird AddOn https://addons.mozilla.org/de/thunderbird/addon/owncloud-for-filelink/ does.

I'm aware that probably this functionality doesn't exist yet, but is anybody aware of any building blocks I could use in implementing such a package?


texts: How can I move a window from being a horizontal split down below all other windows to being a vertical split panel on the left? I don't want to move buffer contents - I want to move the actual window.


texts:
I am experiencing font issues for a few specific characters, namely the "SYMBOL FOR …" family, which are textual representations of control characters such as NUL, BEL, BS, etc.

This screenshot shows:

on the left, emacs -Q, with completion candidates for C-x 8 RET SYMBOL FOR;
on the right, a Terminator console running Python, displaying some of the same characters.

Not shown: a file containing some of these characters, opened with the Geany text editor. Geany displays the same glyphs as Terminator.

While the symbols on the left are rather cute, I would rather have Emacs show the same glyphs as Terminator and Geany. I have no idea of what causes this though. Terminator and Geany both use the Monospace font, but customizing Emacs's default face to Monospace does not change the situation. I do not know yet whether the issue comes from:

my system (font cache, what have you);
my Emacs configuration (unlikely, since -Q includes --no-init-file --no-site-file);
the Emacs software.

C-u C-x = on e.g. SYMBOL FOR NULL has this to say about the character:

             position: 146 of 151 (96%), column: 0
            character: ␀ (displayed as ␀) (codepoint 9216, #o22000, #x2400)
    preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x2400
               script: symbol
               syntax: _    which means: symbol
             category: .:Base, c:Chinese
             to input: type "C-x 8 RET 2400" or "C-x 8 RET SYMBOL FOR NULL"
          buffer code: #xE2 #x90 #x80
            file code: #xE2 #x90 #x80 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-unknown-Symbola-normal-normal-semicondensed-*-15-*-*-*-*-0-iso10646-1 (#x77D)

Character code properties: customize what to show
  name: SYMBOL FOR NULL
  old-name: GRAPHIC FOR NULL
  general-category: So (Symbol, Other)
  decomposition: (9216) ('␀')

There are text properties here:
  fontified            t

Note that emacs -nw is unaffected, i.e. the characters on the right side of the screenshot are shown. I guess Terminator takes care of font selection in this case?

I would appreciate any input on the subject. I do not know whether this warrants a bug report, since for all I know my whole setup is working "as intended" for some value of "intended".

Emacs version: GNU Emacs 25.1.1 (i686-pc-linux-gnu, GTK+ Version 3.14.5)
Terminator version: terminator 0.97
Python version: Python 3.4.2
Geany version: geany 1.24.1 (built on 2014-04-19 with GTK 2.24.23, GLib 2.40.0)
OS: BunsenLabs GNU/Linux 8.5 (Hydrogen) (essentially Debian Jessie)

PS: I tried to reproduce on a Xubuntu 14.04 machine, and saw intricate glyphs composed of a square box, featuring the acronym (e.g. NUL, BS) in the bottom half and the weird symbol (e.g. heart, spades) in the top-right corner (could not take a screenshot unfortunately).

PS2: now that I've copy-pasted the above code-block in Firefox (49.0), I can also add that Firefox uses the same glyph than Terminator and Geany.


texts: How to enable the superword minor mode globally?

texts:
I am just wondering how to enable the superword-mode globally?

I tried to enable it following the answers found here:

How to enable ido-mode forever?

, using:

(require 'superword-mode)
(superword-mode t)

But I am getting an error:

File is missing: Cannot open load file, No such file or directory, superword-mode

I am using Emacs 26 under Ubuntu 18.04. Using M-x superword-mode manually enables the mode right. But I just don't want to enable the mode every time.

I also tried (superword-mode t) alone, but it does not work and emacs is still stopping at underscores when moving forward a word (M-f).

I guess a related question is, is there a generic way of enabling a minor mode?

-- Update --

I tried:

(require 'superword)

as suggested in the comments. But I am still getting the same error:

Warning (initialization): An error occurred while loading ‘/home/user/.emacs.d/init.el’:

File is missing: Cannot open load file, No such file or directory, superword

This is with GNU Emacs 26.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)


texts: Which version of CEDET should be used with EMACS 24.4.1 for java development?

texts:
CEDET Version:  2.0
I have EMACS version

GNU Emacs 24.4.1 (x86_64-w64-mingw32) of 2014-10-20 on KAEL

which comes with CEDET version

        Requested   File        Loaded
Package     Version     Version     Version
----------------------------------------------------------
cedet:      2.0     nil     ok
eieio:      1.4     nil     ok
semantic:       2.2     nil     ok
srecode:        1.2     nil     Not Loaded
ede:            1.2     nil     Not Loaded

Is this the best version to be using for java development?  I can find no mention of javap in the code yet it is mentioned often in the various documentation sources.

EDIT:

I am in the process if rewriting malabar-mode which relies heavily upon CEDET.  I am hoping to find the "correct" version so when malabar-mode is released, it will be based on the right CEDET.


texts: Why after-init-hook is not invoked? (workaround is emacs-startup-hook)

texts:
short story: The theme just did not show up automatically at emacs start, when it is invoked by an after-init-hook. However, with emacs-startup-hook it worked as expected:

(use-package heaven-and-hell
  ...
;;:hook (after-init . heaven-and-hell-init-hook) ;; does not work
  :hook (emacs-startup . heaven-and-hell-init-hook) ;; this one does

I run plain emacs (emacs -l test.el -Q) with a test script (modified from this question)

test.el

(defun buffer-hook-function ()
  (append-to-file (format "%s" (buffer-list)) nil  "log.txt")
  (append-to-file "\n" nil  "log.txt")
  )

(append-to-file "Running ...\n" nil  "log.txt")

(add-hook 'emacs-startup-hook (lambda () (append-to-file "emacs-startup-hook\n" nil  "log.txt")))
(add-hook 'after-init-hook (lambda () (append-to-file "after-init-hook\n" nil  "log.txt")))
(add-hook 'before-init-hook (lambda () (append-to-file "before-init-hook\n" nil  "log.txt")))
(add-hook 'window-setup-hook (lambda () (append-to-file "window-setup-hook\n" nil  "log.txt")))
(add-hook 'emacs-startup-hook (lambda () (append-to-file "emacs-startup-hook after window-setup-hook\n" nil  "log.txt")))
(add-hook 'emacs-startup-hook (lambda () (append-to-file (format "after-init-time %.2fs (printed via emacs-startup-hook)\n" (float-time (time-subtract (current-time) after-init-time))) nil "log.txt")))
(add-hook 'buffer-list-update-hook 'buffer-hook-function)

log.txt

Running ...
  (*scratch*  *Minibuf-0* *Messages*  *code-conversion-work*  *Echo Area 0*  *Echo Area 1*)
  after-init-time 0.03s (printed via emacs-startup-hook)
  emacs-startup-hook after window-setup-hook
  emacs-startup-hook
  window-setup-hook
  (*scratch*  *Minibuf-0* *Messages*  *code-conversion-work*  *Echo Area 0*  *Echo Area 1*)

So after-init-hook does not appear, but after-init-time seems to be set, which seems to come from an after-init-hook.

I still do not see why after-init-hook is not called. This question refers to the command-line processing part of after-init-hook, so I tried different configurations, terminals and (non-)window modes.

Why after-init-hook is not called?
Does this mean, other packages with init hooks can also fail?

Edit: Using emacs 26.2, Manjaro Linux 18.0.4 xfce

Update: after rewriting my theme and addressing an issue in spacemacs-theme, after-init seems to work so far via heaven-and-hell. emacs-startup hook had other issues like additional syntax highlighting via prog-mode-hook did not work.

Update 2: The example test.el perhaps always fails. If you run without -Q it is invoked: emacs -l test.el:

Running ...
<snip>
  after-init-hook
  (*scratch*  *Minibuf-0* *Messages*  *code-conversion-work*  *Echo Area 0*  *Echo Area 1*  *load*)
  Running ...
  (*scratch*  *Minibuf-0* *Messages*  *code-conversion-work*  *Echo Area 0*  *Echo Area 1*)
  after-init-time 0.06s (printed via emacs-startup-hook)
  emacs-startup-hook after window-setup-hook
  emacs-startup-hook
  window-setup-hook
<snip>


texts: Why does C-c C-x look like an empty keymap?

texts:
I'm trying to find which map C-c C-x is bound to on my system, but C-c C-x C-h reveals nothing.  (describe-key (kbd "C-c C-x")) reports that the sequence is unbound, yet I can still type C-c C-x and Emacs awaits more input (as if it were waiting for another key in the sequence).

What's going on?


texts:
While point is inside a diff in a Magit buffer I press RET, which invokes magit-diff-visit-file.

After checking this file, I want to quit it and get back to the Magit buffer that was previously showing.

I type q, it does the job but it always says that I start keyboard-macro recording.

So two questions here:

What does q actually do in the buffer shown by magit-diff-visit-file?
How can I list all the commands in the buffer after I run the magit-diff-visit-file command?


texts: Is it possible to change and freeze the current date-time in Emacs?

texts:
I'm a heavy Emacs Org-mode user and VERY dependent on the date functionality. I frequently enter events, receipts, etc. using capture templates after they've already occurred. My current solution is to prompt for the relevant dates or change them manually, but this is time consuming and error prone. Emacs documentation and Googling failed me.

I'd like to be able to hit a few keys (or execute a function), change and freeze the date-time at (for example) noon yesterday, [2016-01-11 12:00], perform some Org-mode functions (state changes, capture templates, logging time, etc.) which all operate as indented with the new "frozen date-time", then hit a few keys (or execute a function) to return the clock to normal behavior.

Thanks!


texts: Citations with page numbers from helm-bibtex and org-ref

texts:
I currently use org-ref and helm-bibtex with one notes file per source to manage my library. For any given source, I may have several headers, each for notes on different chapters or topics I have captured.
But now I want to cite a note, and I want to include the page numbers it references...
But how do you do this with only one notes file per source? And if notes get broken out into individual files, each with their own citation, how do you avoid having multiple citations for each source show up in my helm-bibtex search window, each with the same title and author, etc?


texts: is there a hook that is run before a window is deleted

texts:
I want to do some custom stuff before a window is deleted?

window-configuration-change-hook seems to be invoked after a window is deleted.


texts:
When I process emails, 90% of my messages are either deleted or archived. When I get a big backlog, I work through the list marking a batch, then archiving or deleting them (B del or B m), and then moving on to the next batch. If I'm in the middle of marking a delete batch, I can't mark a message for archiving, or vice versa.

Is it possible to use two different marks in Gnus? It would be great if I could work down my list once, marking each message for either archiving or deletion, and then moving them all at once after I've finished. Is this possible? If not, is there another feature of Gnus that would help with this workflow?

Update 23 October 2017

I've switched to mu4e for email, and it does allow for marking emails for deletion and archiving at the same time, with the actions executed together once you're finished. So if you need that feature, it's there in mu4e. As this might still be useful for Gnus users, I'll leave the question for now.


texts: Debugging ELPA and Emacs connection issues behind a corporate proxy

texts: I'm having trouble getting to ELPA behind our corporate proxy. I see proxy traffic attempting to CONNECT to the ELPA domain which then fails. How can I turn on debugging to see the exact URL that Emacs is trying to access? -debug-init didn't work for me with Emacs 27.1