texts: How to exclude several tags from view blocks?

texts:
I'm building my composite agenda view in org-mode. I want to exclude some entries shown in the lower block from the upper block since they are redundant.

This is what I got:

(setf org-agenda-custom-commands
        '(("a" "Agenda"
           ((tags "PRIORITY=\"A\""
                  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
                   (org-agenda-overriding-header "Tareas de alta prioridad por terminar:")))
            (agenda ""
                    ((org-agenda-span 'day)
                     (tags-todo "-cumpleaños|-aniversario|-santoral")
                     (org-agenda-overriding-header "Para hoy:")))
            (agenda ""
                    ((org-agenda-span 'week)
                     (tags-todo "-cita|-evento")
                     (org-agenda-files '("~/org/fechas.org"))
                     (org-agenda-overriding-header "Cumpleaños, aniversarios y santoral:")))
            (alltodo ""
                     ((org-agenda-skip-function
                       '(or (air-org-skip-subtree-if-habit)
                           (air-org-skip-subtree-if-priority ?A)
                           (org-agenda-skip-if nil '(scheduled deadline))))
                      (org-agenda-overriding-header "Todas las tareas de prioridad normal:")))))))

And this is how it looks:

Tareas de alta prioridad por terminar:

=========================================================================================================================================================
Para hoy:
Saturday    4 February 2017
  cosas por hacer:Sched. 8x:  POR-HACER Revisar el backlog          :repetitivo:
  fechas:     Scheduled:  POR-HACER Prueba de evento                    :evento:
  fechas:     Scheduled:  POR-HACER cumpleaños de prueba            :cumpleaños:
  cosas por hacer:66 d. ago:  POR-HACER Pagar deuda con Kolbi por factura atrazada :factura:

=========================================================================================================================================================
Cumpleaños, aniversarios y santoral:
Monday     30 January 2017 W05
Tuesday    31 January 2017
Wednesday   1 February 2017
Thursday    2 February 2017
Friday      3 February 2017
Saturday    4 February 2017
  fechas:     Scheduled:  POR-HACER Prueba de evento                    :evento:
  fechas:     Scheduled:  POR-HACER cumpleaños de prueba            :cumpleaños:
Sunday      5 February 2017

=========================================================================================================================================================
Todas las tareas de prioridad normal:
  cosas por hacer:POR-HACER Comprar alguno de estos 3 cursos sobre freelancing en Udemy

Somehow I cannot filter things tagged as evento from the block called Cumpleaños, aniversarios y santoral: and the same for things tagged cumpleaños from the Para hoy: block.

So, what am I doing wrong?

EDIT: Also, is there a way to hide empty days in a week?


texts: How to use a local version of a package in spacemacs?

texts:
This is similar to this question but the answer there seems to be deprecated.

Let's say I'm using a layer and want hack the code of a particular package that layer is using. How do I go about it?

To better illustrate what I want to accomplish in general, I present a specific example.

I try to get the spotify layer to work, but the current master branch in the helm-spotify package uses a deprecated web API. There is a pull request to fix this and I want to try it and maybe contribute something. My problem is, that I can not get the local copy of helm-spotify to load.

What I tried was to switch to the develop branch of spacemacs:

git branch --track develop origin/develop
git checkout develop

In ~/.emacs.d/layers/spotify/packages.el

I changed from

(setq spotify-packages '(spotify helm-spotify))

To

(setq spotify-packages
          '(
                spotify
                (helm-spotify :location local)
           ))

And pulled the helm-spotify repository to ~/.emacs.d/layers/spotify/local/helm-spotify

When I restart spacemacs I get

File error: Cannot open load file, no such file or directory, multi

In when I look into helm-spotify.el there is:

(require 'multi)

So my guess is, that when installing helm-spotify from melpa the dependency on multi gets resolved prior to loading helm-spotify but of course not anymore when I use a local copy of helm-spotify.

So my questions are:

How do resolve dependencies when using a local package?
Or should I do this completely differently from what I described?

I also tried, without success, to add multi to dotspacemacs-additional-packages and to spotify-packages:

(setq spotify-packages '(
                         multi ;; I added this
                         spotify
                         (helm-spotify :location local) ;; I modified here
                         ))

;; I added this
(defun spotify/init-multi ()
  (use-package multi))

;; the rest is as it was

(defun spotify/init-spotify ()
  (use-package spotify
    :config (spacemacs/set-leader-keys
              "amsp" 'spotify-playpause
              "amsn" 'spotify-next
              "amsN" 'spotify-previous
              "amsQ" 'spotify-quit)))

(when (configuration-layer/layer-usedp 'spacemacs-helm)
  (defun spotify/init-helm-spotify ()
    (use-package helm-spotify
      :config (spacemacs/set-leader-keys
                "amsg" 'helm-spotify))))

in packages.el. Also tried without adding multi to dotspacemacs-additional-packages.


texts:
I am new to the world of Emacs, so please forgive me if my question is too trivial.

I am trying to use standard console keybindings for Emacs too, by editing the configuration file. A few of them are in Emacs already, but I wanted to added some more.

I wanted to add keybindings for killing a part of the text.

My entries:

(global-set-key [C-h] 'backward-delete-char)
(global-set-key [C-w] 'backward-kill-word)
(global-set-key [C-u] 'backward-kill-sentence)

But I couldn't get these to work. I searched online and tried to use this, adding the following lines before the above lines:

(setq help-char nil)          ; To enable C-h for 'backward-delete-char
(setq kill-region nil)        ; To enable C-w for 'backward-kill-word
(setq universal-argument nil) ; To enable C-u for 'backward-kill-sentence

But that didn't help either. What am I doing wrong? How can I get it to work?


texts: Concatenate ascii/org tables with some different headings

texts:
I want to concatenate two ascii tables (one below the other) that share some but not all column headings.

e.g.

Table 1

Head1 HeadA
1     a
2     b

Table 2

HeadA HeadFoo
c     bar

And the result would be

Head1 HeadA HeadFoo
1     a
2     b
c           bar

There is a babel library which does not quite do this, but it may have some helper functions (which I can't locate in emacs 24.5, but I guess I could copy paste the lisp into a file and read it).

Regarding the answers: Both Gastove and Tobias' answers work correctly.  I chose Tobias only because it is more "pure".


texts: error autoloading failed to define function when loading custom file

texts:
I recently decided rewrite my emacs configuration. I want to load my custom org configuration only in the case when I am opening a *.org file. Considering a minimalistic configuration of init.el

(use-package orgmode-setup
  :load-path "custom/"
  :mode "\\.org\\'"
  )

that loads a orgmode-setup.el in .emacs.d/custom that looks like this

(provide 'orgmode-setup)

however I get the error

  File mode specification error: (error Autoloading failed to define
  function orgmode-setup)

However, before I am doing the same thing with Ido

(use-package ido-setup
  :load-path "custom/"
  )

with ido-setup.el saved in the  .emacs.d/custom folder.

I am not proficient with emacs, could you please help me to debug this?


texts: Set-up scspell like behavior for the flyspell

texts:
I was trying to enable scspell like behavior for Flyspell but still can't succeed.

Shortly - Flyspell parses "DemoWord" like "DemoWord" and scspell splits is into two words demo and word.

I was trying to change flyspell-get-word function; particularly - to change the regular expression but, perhaps, there is a more natural way?


texts: How can I block a frame from being split?

texts:
Currently I work with ruby and rspec. I really like the idea of having a separate frame in another monitor showing me the compilation buffer. My current setup uses a 'code' frame (in which I do actual work) and a 'test-result' frame (in which I see rspec results)

The problem is that when I try to open some compilation error or file in the 'test-result' frame, the window splits in that frame. What I would really like to do is for it to open in my 'code' frame.

I already use the option display-buffer-reuse-frames.
I also tried to set the compilation results window dedicated, but whenever emacs try to open a new window, a new frame would be created (which is particularly awful if you use Helm.)

Is there some easy way to achieve this ?


texts: Can buffer boundaries be displayed at the top and bottom of windows?

texts:
I know that Emacs can display the buffer boundaries in the fringe, by displaying angles at the boundaries, and arrows where the buffer can be scrolled. Is there some way to display these boundaries, and scroll status, at the top and bottom of a buffer? I’m hoping for an effect like that seen in Symbolics Genera. Take a look at this screenshot of Genera’s Document Examiner for an example:

The main Document Examiner window is scrolled part way through the document, with neither the top nor bottom boundaries visible. As such, both the top and bottom of the window display a torn-sheet effect, similar to a string of tilde characters ie. ~~~~~~~~~~.


texts: how to get Emacs to stop saving org-agenda as a file?

texts:
In my directory I keep on winding up with dozens of files with names like these:

#%2AOrg%20Agenda%2A#12182wk#
#%2AOrg%20Agenda%2A#13353nN#
#%2AOrg%20Agenda%2A#13568-1B#

The content of which is this:

Week-agenda (W20):
Monday     11 May 2015 W20
Tuesday    12 May 2015
Wednesday  13 May 2015
Thursday   14 May 2015
Friday     15 May 2015
Saturday   16 May 2015
Sunday     17 May 2015

I believe they're getting created when I run save-some-buffers, which I do to save all open files I'm working with.

I'm trying to get Emacs to ignore my org-agenda files when saving, but my attempt isn't working:

http://pastebin.com/UPVrGgLf


texts: How do I reliably get output from a process?

texts:
I have created a comint mode for using mongo. The mode works fine in the buffer, and now I am trying to use it programmatically where I need to get the output from commands.

Getting input to the process works fine. Getting output from the process though has remained tricky. What I want is to send a cmd to the mongo process, and have the function that sent the command return the output.

I have setup a filter function where I save the output into a variable:

(defun mongo-output-filter (output)
  "Hook function for handling process output."
  (setq mongo-output output))

I setup a function to take a command like this:

(defun ts (cmd)
  (comint-simple-send (get-buffer-process "*Mongo*") cmd)
  mongo-output)

The trouble is that sometimes it works, and sometimes it doesn't. What does work is I see the output in the Mongo buffer, but it isn't always returned by the function.

I tried adding (accept-process-output (get-buffer-process "Mongo")), but that does not always give me the output. Sometimes it does, and sometimes I just get a prompt. It doesn't seem to matter if I use any optional arguments.

Is this the right way to go about this? None of the other questions on SO seem to answer this question.


texts: Multiple transient (and colorful) mark-modes

texts:
When reading a book it's nice to have a marker to highlight some phrases.

When re-reading my own code, I often would like to highlight several regions ("here is the set-up", "here is the conclusion", ...). In a normal programming language one can write the code such that these divisions are themselves the structure of the code, but it's trickier with HTML. There one is left with just transient-mark-mode (and even then, there is no way to edit a file while the transient mark is active in a distinct segment of the buffer).

Does there exist a package that permits adding temporary markers (light yellow, light green, ...) to an arbitrary file. I'm familiar with Hi-Lock and ideas for how to use it for this objective in an arbitrary file are welcome.


texts:
I would like to bind C-h to do exactly the same thing as backspace, no matter
the mode I'm in. So far I bound C-h to delete-backward-char in global-map,
but the results are inconsistent across the modes (it doesn't work well with electric-pair for example, python mode is broken as well).


texts: Why is the default value of fill-column 70?

texts:
Is there a reason that the default value of fill-column is 70?

In my experience, everyone who cares about the value of fill-column prefers a default value of 80.


texts: Color calendar day according to number of event in org-agenda

texts:
I would like to color the background of each day in calendar according to the number of events in my org-agenda. The idea is to have a quick and visual idea of what are the busiest days. The code from How to highlight weekend days in Emacs calendar? might be a good start and I would need to write a function that, given a date, returns the number of scheduled event from my org-agenda/diary (I use org-diary) and set the face to face-busy-0, face-busy-1, etc.

I already wrote a Python code for doing more or less the same in the terminal (see Yearly calendar view of agenda (with colored background) but my elisp is not so good.


texts: Emacs Org-mode: How to add headlines with a premade property drawer

texts:
I have different single files where i store different types of data, one data type per file. For instance one file for addresses and one file with an entry for each of my music CD's.

I need the following functionality per data file: For each new headline I make, automatically insert a :PROPERTIES: drawer, with specified property keys, just below the headline.

So, for instance when in my address file, I hit C-c  to add a new headline for a new entry, and I get something like this:

* <headline text to be made>
:PROPERTIES:
   :Name:
   :Street:
   :Tel:
:END:

where the property keys ("Name", "Street", "Tel") are given with no property value.

Or, if my single file contains data for my mineral collection, I would like each new headline to look like this:

* <headline text to be made>
:PROPERTIES:
   :Mineral_type:
   :Longitude:
   :Latitude:
:END:

I have two questions:

1) How can I automatically insert such property drawers, with specified property keys, under each header, based on some file variable settings in the top of the file?

2) How can I cycle through the properties in a drawer to add property values to each property key?


texts: A workflow for managing compiled elisp packages with different versions of emacs

texts:
I am using different versions of emacs, on different computers. On some of those (work computers) I don't really have a choice to update, whereas for my personal computers, I like to run the latest stable release.

I carry a customization "package" around, with init files and third-party packages, downloaded either separately or with the package manager.

Usually it works fine, but from time to time, after installing a new package on one of the devices, I will run into errors with the others.

It may happen that the package is simply not compatible with the older version of emacs (in which case I have no choice but to use package-load-list to exclude those packages), but more frequently the package is compatible, but its compiled version isn't.

A work-around is to recompile the package on the older emacs, but this is a hassle, and I'm always worried that I will lose on performances (the machines running older emacses are typically faster than my personal computer).

Hence my question: is there a way to have emacs automatically manage this, for example by indicating with each compiled file the version for which it was compiled, and recompiling if no compatible version is found?

Or, at least, is there a way to tell emacs to always compile packages for some specified older version of emacs?


texts: Is there a way to defer undo when the changes are off-screen?

texts:
Let's say I've added some text to some line:

some text▊

Then I scroll down a bit, so that the line is out of sight:

▊

When I press undo, I don't want Emacs to delete the line above immediatedly, but only locate it:

some text▊

And when I press undo a second time it should actually undo it:

▊


texts: Is it Possible to automate file editing using emacs?

texts:
So what i am trying to achieve is the auto-editing of hex files. For example - The user enters a hex address, and the hex value to replace at that address. This change is to be applied to 10 different binary files

Can anyone point me in the direction of auto-editing files(emacs auto opens the file, switches to hexl mode, jumps to address provided by user, inserts hex code at that address which is also provided by the user and saves file then finally exits)
So far i have only been able to achieve auto opening to hexl mode by launching it like

emacs file -f hexl-mode -f hexl-goto-hex-address

From here on i have no idea how to input the hex address and then move onto changing the code


texts: Can I have a window showing the diff or diffstat of the selected commit in the log window?

texts:
I know I can press Enter to show the commit diff, but

that's too slow for browsing
it steals focus from the log window
there's a lot of visual change in the frame with the diff window opening and closing
It's a lot of keystrokes to move from one commit's diff to the next

Can I program magit to a gitk kind of style that always shows the commit msg, changed files and diff of the currently selected commit?


texts:
Is there an interface similar to 'gdb-mi' for using Valgrind in emacs?

What are some ways to use Valgrind inside emacs?


texts: android-mode can't find project root error

texts:
I want to use Emacs for Android development, so I installed android-mode.

But I get an error.  I entering path, package, activity names and I get "can't find project root" error.

I am using Ubuntu 16.04


texts: How to go up one level in helm find files

texts:
With C-x C-f Helm tells me I can go up one level with C-| or possibly C-I.

However, when I try either, I get the following behavior instead:

C-I

Selects the highlighted file.  It does not go up one level.

C-|

So I guess it was supposed to be C-I but that isn't doing what is advertised.  How can I go up one level?


texts:
When I'm editing my code, I'd like to open the documentation via helm-dash-at-point in a new split besides my source code. But it only opens in the same window. I don't really care if it uses eww or w3m as long as it works (eww would be slightly better).

I am using the latest Spacemacs with the newest Emacs.

(There are a couple of solutions that are supposed to work with Emacs proper but don't with Spacemacs)


texts: Emacs(AUCtex) can't recognize \input{~/Documents}

texts:
I have three MacOSs, and set different names for User and Home Folder. I take Emacs as my default editor in those devices.

Using Emacs to edit tex-document, I found the code \input{~/Documents} and \input{$HOME/Documents} can't work when compiling, Error message said not found such file. To make it work, I must write the absolute path, such as \input{/Users/Abel/Documents} .

The trouble is due to the different account names and home folders in the three devices, I don't want to alter them into a same name.
Q: Is there any method that keeping the situation and Emacs can recognize \input{~/Documents} or \input{$HOME/Documents} ?

Here  are some extra information:

Use other editors, such as TeXShop, this trouble doesn't happen both \input{~/Documents} and \input{$HOME/Documents} make effect.
~/ can be known as Home directory by Emacs, typing C+ x + f, and ~/ , All Emacs(s) in devices point to the right Home Directory.


texts: Helm-bibtex and Bibdesk bibtex intergration

texts:
Currently using Bibdesk to organise my references and various associated documents. I would like if possible to use the great addons Helm-bibtex and org-ref.

To specify the location of the PDF associated with a reference it is possible to us two settings in Helm-bibtex; "helm-bibtex-library-path" which will look in the specified directory for a file based on the citation key and the "helm-bibtex-pdf-field" which will get the path to the pdf from the specified field in the bibtex entry. Currently Bibdesk stores information about attached files in fields called "Bdsk-File-#" where the hash is a numeric, using Base64-encoded pathnames.

My question is, has anybody got the intergration between Bibdesk bibtex files and Helm-bibtex working using the Base64-encoded pathnames? There is a perl script on github for decoding the pathname from the Bibdesk fields https://github.com/pmcarlton/BibDesk2Zotero_attachments that is used by Zotero for conversion of a Bibdesk bibtex file. Would it be possible to use this as basis to extract the information required?

I could use the "helm-bibtex-library-path" setting instead, but I would have to override the "helm-bibtex-find-pdf-in-library" function, to accommodate my custom sub-directory structure (based on author name and year) and Bibdesk's requirement that the filename be unique.

I would prefer to use the pdf field in the bibtex file, but my Lisp knowledge is limited, so any help or a point in the right direction would be appreciated to get either solution working.

Thank you

Update #1
Although I have not figured out an answer to the above question, there does seem to be a work around using BibDesk Applescripts. From the Bibdesk website, http://sourceforge.net/p/bibdesk/wiki/BibDesk_Applescripts/, Christiaan Hofman kindly provides Applescripts to automatically update the Local-Url field with the first linked file. It is possible to amend these scripts to have the Local-Url field contain all the linked files in a format similar to Mendeley.


texts: Evaluate algebraic formula in the buffer in place

texts:
Is there some package or builtin emacs feature which evaluates an algebraic formula in place?

E.g. I type in the scratch buffer:

(3 + 4) *  5

and when I invoke some command on this line then I get in the buffer:

(3 + 4) *  5 = 35

It's not hard to implement, I'd just like to know of there is an existing feature which can do this.


texts: Make load-library's TAB completion to ignore backup files

texts: Is it possible to make load-library's TAB completion to ignore backup files (.el~)?


texts: Idiomatic way to store and access custom LaTeX code

texts:
I have some latex classes or bunch of packages I use and that I'd like to move out of my init.el because it keeps on growing and I want them to be standalone.
How can I make them accessible from my init ?
For example would the following structure work :
.emacs.d/
    |
    |-------------- init.el
    |-------------- early-init.el
    |-------------- lisp/
    |-------------- snippets/
    |-------------- latex/
                       |
                       |------- templates.el

write something (minimal working example) like
(require 'ox-latex)

(add-to-list 'org-latex-classes
           '("notes"
         "\\documentclass[myLanguage]{article}
\\usepackage{somePackage}
\\usepackage{someOtherPackage}"))

(provide 'templates)

and then in my init.el
(use-package ox-latex
  :after org
  :defer t
  :load-path (concat user-emacs-directory "latex/templates.el")
  :config
  (more-config-stuff...))

Would that work or am I painting myself into a corner here?


texts: Emacs lisp format doesn't print to *scratch*?

texts:
I've got this function

(defun mt ()
    (dotimes (x 20)
      (dotimes (y 20)
        (format "%3d " (* (1+ x) (1+ y))))
      (format "\n")))

in my *scratch*. a Ctr-= prints back mt. But then evaluating (mt) only prints back nil. How would I get it to print out the multiplication table? This works in Common Lisp at the REPL. I know I'm missing something basic here...


texts: When running helm-buffers-list, after I start narrowing, how do I keep the ordering of the results by most recently used?

texts:
When I run helm-buffers-list, I get a list of buffers, ordered by most recently used. This is great.

But when I start filtering that list, it sorts by buffer name length! So the top result may be a buffer that I haven't viewed in months!

to see this behavior:

Create a buffer buf1.
Create a buffer thing2.
Create a buffer buffer3.
Create a buffer buff4.
Now you should only have one window, and that buffer should be displaying buff4.
M-x helm-buffers-list. You should see:

buffer3
thing2
buf1
buff4

The buffers *scratch* and *messages* will be in there, but they're not relevant for this.

type b. Helm will show:

buf1
buff4
buffer2

Note that this is sorted by the length of the buffer name.

I would like it to show:

buffer3
buf1
buff4

These are all buffers with b in their names, sorted by most recently accessed, with the current buffer (buff4) at the end. This is the same sorting that helm-buffers-list does by default.

How can I sort it this way?


texts: Show package description along with package name?

texts:
If i run M-x package-list-packages, it will list all packages with description like this.

If i run M-x package-install, it shows only package names like this.

How can i get package description along with package name?


texts: How can I set tramp-histfile-override using tramp-connection-properties?

texts:
I'm trying to set a different tramp history file override based on connection-specific rules. My attempts have been along the line of:

(add-to-list 'tramp-connection-properties
             (list (regexp-quote "/ssh:myremotehost:")
                   "histfile-override"
                   ".tramp_history3"))

But it's not working.

I think it might be because tramp-histfile-override isn't a pre-defined method-specific parameter to any methods in my tramp-methods (eg ssh). Therefore tramp-connection-properties can't be used to override this variable in this case?

Is there a way of customizing tramp-histfile-override on a per-connection basis?

Emacs version: 26.1
Tramp version: 2.3.3.26.1
OS version: OS X 10.11.6


texts: How to apply change from flyspell correction popup in Markdown mode?

texts:
This seems like such a dumb question. I'm using spacemacs and have in configuration-layers

(spell-checking :variables
                     enable-flyspell-auto-completion t)

So I'm in markdown and I pause the cursor on a misspelled word, I get a useful auto-completion box with suggestions. The only problem is, I cannot figure out how to apply the change suggested. tab and return both quit the auto-completion window. What am I missing? I get the expected behaviour in text mode and org mode.


texts:
I have CUA mode enabled, but sometimes when I hit C-c, emacs simply does not copy anything because it starts to think Iam typing some C-C something command. I tried:

(global-set-key (kbd "C-c") 'cua-copy-region)

Emacs simply ignores this setting. How to force C-c to do JUST cua-copy-region? Really, its starting to get on my nerves...


texts: Rounding time up to multiple of x in when using org-clock

texts: I use org-mode to do time registration. Is there a way to round time register using clock-in / clock-out up to a multiple of a user defined value for instance 5 mins when generating a org-clock-table report?


texts:
I'm noticing odd behaviour when I select some text with control-space and use p to paste -- in that the paste is done after the cursor character, rather than on the next line. Is that intentional, configurable, or a bug? This is evil from git.

For example, if my buffer is

one
two
three
four

When I copy the first two lines (cursor on 'o', C-space, jj, M-w) and paste with the cursor on 'f' of the last line, then the result is

one
two
three
fone
two
tour

If I use 2yy to copy the lines then the paste works as expected.

My .emacs contains minimal evil configuration, but removing it makes no difference.

(setq evil-cross-lines t
      evil-move-beyond-eol t
      evil-want-fine-undo t
      evil-symbol-word-search t)

(define-key evil-normal-state-map "\C-w" 'evil-delete)
(define-key evil-insert-state-map "\C-w" 'evil-delete)
(define-key evil-visual-state-map "\C-w" 'evil-delete)


texts: Invalid function in font-lock-fontify-keywords-region

texts:
Why do I get the error: font-lock-fontify-keywords-region: Invalid function: (concat "\\\\" (regexp-opt (quote ("cs" "hepth" "hepph" "heplat" "hepex" "nuclth" "nuclex" "grqc" "qalg" "dgga" ...))) "{\\([0-9]+\\)}")
when this code is evaluated?:
(defvar biblinks-keywords
  '(((concat "\\\\" (regexp-opt '("cs"
                  "hepth"
                  "hepph"
                  "heplat"
                  "hepex"
                  "nuclth"
                  "nuclex"
                  "grqc"
                  "qalg"
                  "dgga"
                  "accphys"
                  "alggeom"
                  "astroph"
                  "chaodyn"
                  "condmat"
                  "nlinsys"
                  "nlinsi"
                  "nlin"
                  "quantph"
                  "solvint"
                  "suprcon"
                  "mathph"
                  "physics")) "{\\([0-9]+\\)}")

     (0 `(face
      link
      keymap
      ,oldarXivid-keymap)
    prepend))))

If I use the following code instead, it works:
(defvar biblinks-keywords
  '(("\\\\\\(?:a\\(?:ccphys\\|lggeom\\|stroph\\)\\|c\\(?:haodyn\\|ondmat\\|s\\)\\|dgga\\|grqc\\|hep\\(?:ex\\|lat\\|[pt]h\\)\\|mathph\\|n\\(?:lin\\(?:s\\(?:i\\|ys\\)\\)?\\|ucl\\(?:ex\\|th\\)\\)\\|physics\\|q\\(?:alg\\|uantph\\)\\|s\\(?:olvint\\|uprcon\\)\\){\\([0-9]+\\)}"
      (0 `(face
           link
           keymap
           ,oldarXivid-keymap)
         prepend))))


texts: .emacs linked to emacs.link,open emacs.link in emacs-lisp mode

texts:
Say I have a symbolic link .emacs link to emacs.link,so when I open emacs.link,the associated buffer's major mode is Fundamental mode.
I want emacs.link's major mode  Emacs-Lisp.

Another example is: for a symbolic link .bashrc link to bashrc.link,I want bashrc.link opened in sh-mode.


texts: Is it possible to run package-refresh-contents as some sort of background process?

texts:
I've repurposed some code to show me a list of packages that I have installed which have upgrades available.

Currently I'm running package-refresh-contents when I start-up Emacs and then display the list of upgrade-able packages.  This however locks my Emacs up until the refresh completes.

Is there a way to run package-refresh-contents as a background process (inside Emacs, but possibly also as some kind of cronjob which would only reflect in Emacs sessions opened after said job has finished running) which doesn't interfere with my ability to carry on working?


texts: Async shell process buffer always clobbers window arrangement

texts:
I frequently launch external programs from emacs using M-!, such as Firefox or Evince, etc. Whenever I do, a buffer pops up full of results for the process, which clobbers whatever else I've got going on in terms of windows arrangement.

Is there a way to bury such buffers by default, so that I don't have to see them unless I decide to go looking for them?


texts: (ucs-names) in Emacs 26 is not working for "EURO SIGN"

texts:
I have in my .emacs:

(when (>= emacs-major-version 23)
  (define-key global-map "\C-x8g" (lambda nil (interactive) (ucs-insert `,(cdr (assoc-string "HRYVNIA SIGN" (ucs-names) t)))))
  (define-key global-map "\C-x8e" (lambda nil (interactive) (ucs-insert `,(cdr (assoc-string "EURO SIGN" (ucs-names) t)))))
  )

and with Cygwin Emacs-w32 v26 for:

(assoc-string "EURO SIGN" (ucs-names) t)

I get nil. Is it a bug? How can I get character by Unicode symbol name compatible with Emacs 24/25/26?


texts: Auto convert dot `.` to arrow `->` in C/C++?

texts:
I'm using flycheck in cc-mode and it reminds me when I'm typing:

member reference type 'ListNode *' is a pointer; did you mean to use '->'?

I want to know if there's any package can convert . into -> automatically when typing in C/C++ code, just like Qt Creator's default behavior?


texts: How to specify a directory to tangle all code blocks into

texts:
I am writing a report in latex, many of which contain code blocks which will be rendered with asymptote.
Since all the scripts will be tangled into the same subdirectory asyscripts, I don't want to have to write code like
this
#+BEGIN_SRC asy :tangle asyscripts/test.asy
write("Hello World!");
#+END_SRC

Specifying asyscripts every time is just too tedious. Any way I can specify globally which directory all the code blocks must be tangled into? (Each code block will be in general tangled into a different script.
)


texts: Some buffers don't allow evil mode commands

texts:
Switching to *Messages* causes evil-leader keys not to be used and :q tries to quit the whole emacs instance from this buffer, but not other buffers.  Also the C-w c (to close pane) doesn't work because it's the last buffer instance.  I end up having to kill the buffer then switch or load a blank file and switch, or use C-x b to switch buffers.

A few other buffers have weird behavior like that. Any ideas on how to make it more efficient so I don't have to remember which buffer/mode I'm in?

For reference my .emacs for leader:

(evil-mode 1)
(global-evil-leader-mode)
(evil-leader/set-key
  "n" 'neotree-toggle
  "t" 'elscreen-create
  "h" 'elscreen-previous
  "l" 'elscreen-next
  "p" 'projectile-find-file
  "b" 'switch-to-buffer
  "x" 'elscreen-kill
  "k" 'kill-buffer)


texts: Is there a more convenient key binding for RETURN?

texts:
Navigation with C-n, C-p etc. is quite easy in emacs, but I have to stretch my hand a lot to hit RETURN.

Is there another standard key binding with the same effect as the RETURN key?

background of my question:

I discovered that in many applications (like e. g. Safari on MacOS X) at least some of the motion commands of emacs do work, e. g. C-n and C-p, C-a and C-e.
As using the arrow keys forces me to leave the normal hands position during typing, I find it really helpful to use those instead of the arrow keys, e. g. for typing an address in the URL field of the Safari browser and then cycling to the matching suggestions of Safari:

Thats really cool, but then I have to stretch my pinky or move my hand to hit RETURN to select one of those, so I wondered if there might be a hidden way of directly going to the selected URL.

It seems that it is not yet defined, but I will try to define C-m to get an Emacs-compatible key-binding also in Safari.

Even cooler: with the Type-to-navigate extension I can type some characters and then can cycle through the found occurrences on the open web page with Cmd-G and then (again with RETURN) directly open a URL which contains this text.. navigation without the mouse is very helpful for me. But again, RETURN forces me to leave the normal hands position on my keyboard a little.


texts:
After opening a .txt file with Emacs, when the point is at the line

/folder/subfolder/file.xml:435

How can I fast jump to line 435 of the above mentioned file?

What I tried:

dired-at-point and find-file-at-point


texts:
I am using a Mac 10.9.5 and Emacs 24.4, installed with macports and aliased as

alias emacs  /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs

At the moment, when I have an emacs file open and I hit Cmd-N, emacs opens a replicate of the file already open. I am wondering if there is a way to modify the .emacs file so I can open new, Untitled empty files by using Cmd-N, like when using Aquamacs or MacVim.

In addition, when using aquamacs or MacVim, Cmd-T opens a new, Untitled tab next to the already existing (see screen capture attached).

In my emacs window, cmd-T opens the font menu. Is there a way to get cmd-T to behave in Emacs as in MacVim or aquamacs?

Thanks in advance for your time!


texts: How can I make imenu work with complex LaTeX documents?

texts:
I discovered a short time ago that M-x imenu plays nice with LaTeX documents – mostly.  With a master/slave document setup (one file inputs another), imenu will not pick up on the structural elements in the child documents.

Similarly, running M-x imenu on the child document will not pick up on the rest of the document.

Both of these are understandable, but how can imenu be extended to 'do the right thing' here?  (Probably making use of TeX-master-file.)

I am using AucTeX, but RefTeX is a bit too heavy-weight for my needs.


texts: How to create a weighted task cookie in org-mode

texts:
Task cookies are a cool feature in org-mode that I use everyday to quickly check my progress when doing todo lists

e.g

- Grandparent Task [50%]
  - [-] Parent Task [80%]
    - [X] Child Task 1
    - [X] Child Task 2
    - [X] Child Task 3
    - [X] Child Task 4
    - [ ] Child Task 5
  - [X] Parent Task [100%]
    - [X] Child Task 1
    - [X] Child Task 2

Is there a way to add a weight to task cookie to show relative effort automatically?


texts: Feasible tags solution for a large Ruby codebase?

texts:
I've been working in a large Ruby project using Vim with ctags. I have a git hook that generates an up-to-date tags file whenever I commit/pull/etc.

It basically boils down to

git ls-files | \
  ctags --tag-relative=yes -L - -f ".git/tags" --languages=-javascript,sql

It takes about 1 second to run, and results in a 7MB tags file.

I'd like to start using Emacs for this project, but generating etags takes well over a minute and outputs an 8GB TAGS file. Here's the command I'm using to generate etags (only differences from the previous command are the -e flag and the TAGS filename:

git ls-files | \
  ctags --tag-relative=yes -L - -e -f ".git/TAGS" --languages=-javascript,sql

Why is it such a huge file, and is there a better tags solution I can try?


texts: How to print to the stdout / stderr from an emacs graphical session?

texts:
I'd like to print into the terminal that started emacs, instead of using Emacs message, whats the most convenient way to do this in emacs that uses the terminal?

(printf "some number %d some string %s" 1 "test")


texts:
Elpy is dependent on a few python packages like jedi, yapf, etc.  However when I create enter a new virtual env and enter it using pyvenv-activate elpy is unable to find those packages without me installing them in the virtual environment.

I'd rather not install them in the virtual because it's a pain to do every time and those packages aren't really a requirement for others working on the project, just for me because I'm using elpy.

Is there anyway to point elpy to the global installs for these packages?


texts: What is the equivalent of doing a plain `git reset ` in magit?

texts:
I sometimes want to undo a commit without losing the changes, but just placing them back into an uncommitted and unstaged state. To do that at the cli, I do just git reset <sha-of-previous-commit>.

How would I do the same in magit?


texts: Select a word in a PDF by double-clicking on it (with pdf-tools)

texts:
I use pdf-tools in Emacs to view PDF documents. I would like to be able to select words (mark their region and then copy them to the kill-ring) in the PDF by double-clicking on them. Is there a function in pdf-tools or elsewhere I could use to obtain this functionality?

More specifically, I want to write a function (unless it already exists in some form)

(defun select-word-on-doubleclick (ev)
    "Set region to the word under the mouse pointer and copy it to the kill-ring"
    (interactive "@e")
    ...  ;; Set region to the word under the pointer
    (pdf-view-kill-ring-save)  ;; Save region to kill-ring
)

and bind it to <double-mouse-1>. I need help filling out the dots above.

In the pdf-tools package there is a function called

(pdf-info-gettext PAGE EDGES &optional SELECTION-STYLE FILE-OR-BUFFER)

which could be useful for this purpose. Based on the event ev, the position of the mouse pointer (when double-clicked) can be obtained. If somehow the edges of the word under the pointer could be determined from this position, the function above would do the trick. I greatly appreciate any hints on how to make this computation.


texts: How to scroll down/up by one full screen?

texts:
Is there a way to scroll down/up by one full screen? My keyboard doesn't have special purpose keys for this function.

In other words, is there a single command that is equivalent to the following sequence (for scrolling one screen down):

C-u -1 M-x move-to-window-line
C-u 1 M-x recenter

After this sequence, point is positioned at the top left corner of the window, but it's OK with me (even preferrable) if the scrolling leaves point at the same position relative to the window.


texts: How can Emacs mouse capture in an X11 based terminal be disabled to enable copy and past?

texts:
I am using Spacemacs in a terminal in a desktop, ie Konsole and when I try to copy and paste I see that emacs is capturing mouse clicks.

Is it possible to disable Emacs mouse capture for copying and pasting with the mouse to work. Even if it can be toggled on and off that will be fine.


texts: Switch to python shell without confirmation

texts:
In Emacs, when I need to start a python interpreter, I have to run (python-shell-switch-to-shell) , but then I always have to confirm two things:

Confirm the python-shell-interpreter-args.
Confirm to make a dedicated process (y or n), it is really tedious to confirm them every time i need to start a python shell, is there a way to provide the default options and skip these steps?

Also, I found every time I have the python shell restarted, I have to manually run python-shell-send-setup-code again to make the shell works properly. it seems this setup function only will be called when you start a new python shell, 'cus it is a hooked function for the inferior python mode, if you don't leave the python shell buffer, and restart the python shell within the same buffer, this setup function won't be called. Is there a way to solve this? e.g., by override the original python-shell-send-setup-code or python-shell-switch-to-shell


texts: xref-find-references: Exclude mentions in comments?

texts:
xref-find-references finds all references to the searched symbols. In many cases I find the results to be heavily cluttered with mentions of the symbol only in a comment.
Is there any way to tell xref-find-references to exclude matches in comments?


texts: How can I move by screen lines as quickly as forward-line?

texts:
next-line is very slow, and this is creating problems. I'll give some background then explain why.

By default, linum.el treats a wrapped line as a single line, and it takes into account hidden lines when numbering. I need it to number visual lines only - i.e. it should ignore hidden lines, and count wrapped lines as multiple lines.

For example, this is how it works by default:

1 This is a line.
2 This is a long line which has been auto-wrapped
 >by emacs.
3 This is another line.

This is the behaviour I want:

1 This is a line.
2 This is a long line which has been auto-wrapped
3>by emacs.
4 This is another line.

I have this behaviour working, but it's very slow. By default, linum.el uses forward-line to number each line. This is the code that actually moves down by one line and increments the line counter:

(let ((inhibit-point-motion-hooks t))
  (forward-line))
(setq line (1+ line))

I modified it to use next-line:

(let ((inhibit-point-motion-hooks t))
  ;; (forward-line)
  (next-line))
(setq line (1+ line))

This works, but next-line is very slow in comparison to forward-line. Line numbers must be updated frequently so this slows down Emacs considerably.

I don't actually need to number every line. I am happy to use forward-line and number only the beginning of lines, as so:

1 This is a line.
2 This is a long line which has been auto-wrapped
 >by emacs.
4 This is another line.

But if I want to do this, I need to be able to check how many screen lines I moved when I called forward-line.

Does anyone have any ideas on how to solve this?


texts: Edit a portion of YAML file (a multi-line string) with a different mode

texts:
I'm constantly editing a big yaml file with many multi-line strings, which are BASH scripts.

In org-mode I would use something like:

#+begin_src sh
echo "cool"
#+end_src

And then just to C-c ' (org-edit-src-code) to edit this portion of the file in a special "buffer" with the Shell-script[bash] mode.

Is it possible to do this in a YAML file? To select a portion of the file and edit it on its own buffer?

An example of this is:

something:
  data: |
    # this is my shell script
    echo "cool"
    # the end

Is it possible to edit this multi-line string as a Shell-script[bash] and also having Emacs removing the 4 spaces (which are part of yaml, stucture)? or Can I use org-edit-src-code outside org-mode?


texts: Drag and drop a file to org buffer to insert a link to this file

texts:
On Windows it is possible to create a link holding the Meta (Alt) key while dragging a file.

Is it possible to create a link to a file when it is dragged from an Explorer over to emacs holding the Meta key?

I know Onenote suports this behaviour, although you can choose to insert the whole file or just link to it.

Using dired (Ctrl-x d) to navigate to the file and copy it's name with w is a bit cumbersome. One has to add the path to the file manually. May there be also a better way to do this?


texts: Alternative to abbrev-mode that supports special characters in abbreviations?

texts:
I already use abbrev-mode to correct common typos, e.g. I have an abbrev setup for expanding functino to function, etc...

I'm currently writing a large document, and I keep stumbling over the decision whether to write "lifecycle" or "life-cycle", I decided to go with the former and add an abbreviation for "life-cycle" which would autocorrect it to "lifecycle". However, abbrev-mode is not able to expand over the - there and from what I understand there's no way to make abbrev-mode understand that.

Are there any alternatives out there that will make things like this work?


texts: How to checkout a specific commit inside magit?

texts: Inside the magic log history, I could see lots of commits, and I want to rollback to the specific commit, how to do that? I could move to that commit, use "d" could see the different/change of that commit, but how to check out that commit?


texts:
I've looked for a solution to this a number of times. Suppose 'kg' normally expands to 'knowledge' in my abbrev file. I wonder if there is any way to get emacs to expand after a single or double quotation mark, as in expanding from

  "kg

to

  "knowledge

I don't know lisp well but am willing to play with my .emacs. Thanks for any help!

Edit: I just noticed that it works fine in the scratch buffer, but not in markdown or LaTeX modes.


texts: Is variable assignment an atomic operation in elisp?

texts: I have a situation in a mode I'm writing that saves a portion of the output of a long-running asynchronous process to a variable at intermittent intervals. I need to access this data periodically. My question is are variable assignments in elisp atomic (meaning I would always get a complete value, even if it was potentially slightly out of date) or would this be a race condition?


texts: How to prevent org-protocol from creating new frames?

texts:
Whenever I use org-protocol via bookmarklet, a new Emacs frame is created.
A heavy use of org-protocol will create a great number of frames, slowing down the system. Is it possible to avoid this? Thank you!


texts: Org-ref: how to get absolute path of bibliography in exported LaTeX file

texts:
I use Org-ref to insert references in Org mode when writing articles.
I prefer to put bib files in a separate place, say /bib/ref.bib, instead of putting together with org files in ~/org/. After inserting references with absolute path bibliography:/bib/ref.bib, I exported the Org file to LaTeX file by C-c C-e l l. However, the bibliography in the exported LaTeX file is specified by relative path, \bibliography{../../../bib/ref}.
How to get bibliography with absolute path \bibliography{/bib/ref} in the exported LaTeX file?
The reason I want to use absolute path is that the exported LaTeX file may be copied to other location and compiled. In that case, I have to manually change the relative path. Thanks for your time.


texts:
Q: how do I rotate the elements of a list such that last becomes first?

Given a list of arbitrary length, how do I rotate the list
non-destructively such that the last element becomes the first
element?

What doesn't work

cl-rotatef doesn't seem to work for my purposes.  First, it
modifies in place (but I could deal with that).  Second, it
spits up when I use butlast and last (apparently, they're not
setf-able):

(let ((list '(a b c)))
  (cl-rotatef (butlast list) (last list)))

gives the error message

Symbol's function definition is void: (setf butlast)

What works, but seems inefficient

Here's what I've got:

(let ((list '(a b c)))
  (let ((rev (reverse list)))
    (cons (pop rev) (nreverse rev))))    ; => (c a b)

This snippet works as expected.  However, it seems inefficient in
that it reverses at the front and then nreverses at the back.

I'm only using this function on short lists (3 or 4 elements at
most), so it's not such a big deal in practice.  But I'd still
like to know how to rotate efficiently.  (If there's a built-in
function to do this that I've missed, even better.)


texts: Defer loading packages with use-package and package manager

texts:
How can I defer loading a package when it is installed using package.el with use-package? Basically, I want the package I use to only be activated using use-package instead of package-initialize so that this snippet would produce an error:

(use-package company
  :init
  (global-company-mode)
  (message "Company mode enabled globally"))

(and changing :init to :config would work as expected)


texts:
I want to bind the verb package's keymap within org-mode. Currently, I am using the with-eval-after-load function in the :init option.
(use-package org-plus-contrib
  :ensure t
  :init
  (require 'org-tempo)
  (with-eval-after-load 'org
    (define-key org-mode-map (kbd "C-c C-r") verb-command-map))
)

It seems there's a :bind-keymap option for this. But I just cannot get it to work. After I defined the :bind-keymap option, it does not seem to have any effect.


texts: How to use ivy to select email attachments with mu4e

texts:
I use the mu4e package to read my emails. However, I also use the ivy completion framework, which includes file completion.
Using both packages together is a bit of a problem though. mu4e uses its own file-completion dialog. That's probably fine, but it's different enough that it confuses me when I try to attach files to outgoing messages.
Is there a way to use ivy's completion features for selecting files in mu4e?


texts: How to prevent creating files starting with .# (lock files)?

texts:
Emacs 26

I have a file rest.api.rc. When I start editing it, the following lock file is automatically created:

.#rest.api.rc

After saving file rest.api.rc, the lock file .#rest.api.rc is gone.

How I can prevent generating the lock file .#rest.api.rc?


texts:
I've got emacs' HideShow mode working well with Perl code (let's face it, it's a doddle), but I don't know if it's even possible to get it to fold POD comments as well. Has anyone done this (and if so, how, please)?

(Note: when asked about this on stackoverflow I was encouraged to ask over here.  Sorry for the dup' thus caused.)


texts: Emacs not inheriting transparency from terminal

texts: When I run Emacs in a terminal window, via emacs - nw or emacsclient, Emacs loads in the terminal but without transparency.   (My terminal windows are set around 50 percent transparency.)   What could be the problem?  I'm running xfce4.  Thanks


texts: Is it possible to limit the scope of function apropos-value?

texts:
I've recently started using function apropos-value and have found its output burdensome-ly long, mainly due to a limited number of huge variables that I knew in advance would contain the value I was looking for, but which were not of interest to me.

Is there any way to limit the scope of function apropos-value, so that it not search certain variables?

In my case, I know in advance that the value will appear in variables such as kill-ring, values, minibuffer-history, and I have learned the hard way that taking a "hacktivist shortcut" such as (setq kill-ring nil) messes up future ability to use the kill ring.


texts: Is there a way to narrow down grep results?

texts:
When I search with grep, I get the results like:

-- mode: grep; default-directory: "~/code/" -- Grep started at Wed Feb 24 12:40:28
find . -type d ...

that is followed by multiple lines with results.
Now when I have the result, how do I narrow the search to the relevant results?
One way would be limiting the results to certain files in the folders listed.
Another option would be narrowing it down to a more refined search. For example, I grep for 'select' then how do I narrow down the results to 'select_email'?


texts:
When flyspell-mode is active, typing is somewhat – although barely noticeable
– more sluggish than without, also marking of words.

Is it possible to somehow speed up flyspell-mode, maybe make it not check as
frequently?

I’m running GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 on an
Intel Core i3 powered laptop with 8 GiB of RAM. As spell checker, I configured
hunspell installed from ezwinports.

Spell checking with speck-mode does not slow down typing, but here I ran into
another issue (now fixed).


texts: org mode is  very good in plotting table. But is there any way of creating line plot from the table directly in org mode?


texts:
I am running on Ubuntu 18.10 and emacs 25.2,

I changed the default font to

(set-default-font "Monaco 14")

but get error report as:

Debugger entered--Lisp error: (error "Font ‘tty’ is not defined")
  modify-frame-parameters(#<frame ~/Documents/Pubrepo/Algorithms/Algorithms_Wiley/graph_BFS.py 0x10d2c30> ((display . ":0") (minibuffer . t) (frameset--mini t) (frameset--id . "653D-A79A-BCEA-2E8C") (internal-border-width . 0) (unsplittable) (modeline . t) (width . 140) (height . 76) (font . "tty") (border-color . "#424242") (background-color . "#000000") (menu-bar-lines . 0) (vertical-scroll-bars) (tool-bar-lines . 0) (cursor-color . "#d54e53") (foreground-color . "#eaeaea") (background-mode . dark) (display-type . color)))

I googled but found no such a font tty.

How could I solve the problem?


texts:
In my markdown file (coming from a Windows computer on which I have no control), I have several multi-byte characters.

  Some text xx Some text yy Some text

In emacs, they are displayed as \221 and \222 in place of xx and yy respectively. And when I do describe character, I get this:

             position: 11 of 34 (29%), column: 10
            character:  (displayed as ) (codepoint 145, #o221, #x91)
    preferred charset: iso-8859-1 (Latin-1 (ISO/IEC 8859-1))
code point in charset: 0x91
               syntax: w    which means: word
             category: l:Latin
             to input: type "C-x 8 RET 91" or "C-x 8 RET PRIVATE USE ONE"
          buffer code: #xC2 #x91
            file code: #x91 (encoded by coding system iso-latin-1-dos)
              display: no font available

Character code properties: customize what to show
  old-name: PRIVATE USE ONE
  general-category: Cc (Other, Control)
  decomposition: (145) ('')

There are text properties here:
  charset              iso-8859-1
  fontified            t

How do I query-replace (or replace-regexp or replace-string) these characters?

I mean, when it asks me to enter the string to replace, how do I enter \221 or \222, etc.?


texts: How to make query-replace automatically fill what I want to replace with marked text?

texts:
I want to select some text somewhere in a buffer, call query-replace and then type (or paste from kill-ring) only the second argument, TO-STRING, (and make the selected text count as FROM-STRING).
I want a replacement to be performed within the entire buffer as well.


texts: How to find out where a function is called from (backtrace/stacktrace)?

texts:
I've hit a problem that region is deactivated (in transient-mark-mode). The function deactivate-mark is called and I would like to find out where (and why) it is called from.

I tried M-x debug-on-entry RET deactivate-mark and it stops but I found no way to find out the caller. Whole displayed stacktrace is:

Debugger entered--entering a function:
* deactivate-mark()

I tried M-x edebug-eval-defun but Edebug does not show the caller either.

How do I find out why (where from) deactivate-mark is called? I'm look for backtrace or stacktrace functinality.

EDIT:

An advice-add trick:

(defun message-show-backtrace ()
  (message "%s" (backtrace-frame 10)))

(advice-add deactivate-mark :before #'message-show-backtrace)

produces nil in *Messages*.

Edit: more info about deactivate-mark: http://emacshorrors.com/posts/deactivate-mark.html


texts:
How can I bind an f-key using jwiegley's use-package package? Any of these combinations produces an error:

 :bind ("f11" . multi-term)
 :bind (<f11> . multi-term)
 :bind ([f11] . multi-term)

(Of course, this falls under the scope of a use-package declaration.)


texts:
I'm using web-mode within emacs to edit an html file, in html-mode I can use C-c C-v to render html, it opens the file straight to Firefox.

How I do that with web-mode?

Thanks a lot,

P.S : Using emacs 26.3


texts: How can I get the search string from incremental regexp search to use with replace regexp

texts:
If I want to do a replace-regexp I usually start with a isearch-forward-regexp so I can get immediate visual feedback on the search string.
From there I'd like to grab the search string for using in the replace-regexp. Right now all I can see to do is use my OS to copy and paste it. Is there a way to do this built in? I had hoped those commands shared history but it didn't in my experiments.
Or is my whole approach wrong?
(Using spacemacs if that adds anything useful.)


texts: disable tabular output for code block in org-mode

texts: When I execute a code block in org mode, the output will be tabularized. I want to use this functionality to build a set of commands which I can then execute in a new code block, so I have to remove all pipe characters first. Is there a way to avoid this?


texts: local variable set to nil after switch-to-buffer call

texts:
Emacs 26.1 user here.
I know some common-lisp but new to elisp, so I wonder if I'm missing something obvious. I'm trying a rather simple frame setup with a function I wrote, and there's this strange behaviour. My local variable is getting set to nil after switch-to-buffer call. Here's the simplified version that has the same issue.
(defun my-frame-test1 ()
  (let ((frame (make-frame '((name . "test-frame")
                             (width . 300)
                             (visibility . nil)
                             (height . 100))))
        left-window edit-window-left edit-window-right)
    (set-frame-position frame 100 100)
    (make-frame-visible frame)
    (select-frame frame)
    (setq-local left-window (selected-window))
    (setq-local edit-window-left (split-window-right 30))
    (select-window edit-window-left)
    (setq-local edit-window-right (split-window-right))
    ;; ---- edit-window-right has the expected value at this point ----

    (dolist (f '("/tmp/file1.lisp" "/tmp/file2.lisp"))
      (find-file-noselect f t))
    (switch-to-buffer (get-file-buffer "/tmp/file1.lisp")) ;; after this line, edit-window-right has changed to nil
    (select-window edit-window-right) ;; <-- thus, this call doesn't work.
    (switch-to-buffer (get-file-buffer "/tmp/file2.lisp"))
    ))

I tried using setq instead of a let block, using different variable name, for example 'amp-edit-window-right, calling (switch-to-buffer (get-file-buffer "/tmp/file1.lisp") nil t), and all behave the same.
When I do a line by line execution by using the new frame and M-: it is the same. And the window that edit-window-right is set to (#<window 18 on some-file.el>) still has the same print value after edit-window-right is set to nil (i.e. the same window still exists).
Why would this happen?


texts: It is possible to generate daily checklist from org todo list?

texts:
Say I have a file called schedule.org, which looks like

* Coursework
** Corporate Finance Theory
*** TODO Lecture
    SCHEDULED: <2017-09-28 Thu 9:00-12:15 +1w>
*** NEXT Review Bolton & Freixas (2000)
    SCHEDULED: <2017-09-23 Sat>

Is it possible to general another org file which contains a daily checklist

* 2016
** 2016-09
*** 2016-09-23
-[] Review Bolton & Freixas (2000)
*** 2016-09-28
-[] Lecture

Thanks.


texts: Missing modules when debugging Python code in Emacs

texts:
For a number of reasons - the main one being that Emacs is amazing! - I am trying to do all my Python development at work in Emacs instead of Pycharm, which I was using previously.

The one component I have not been able to get running right in Emacs is the debugger. I have been trying to use pdb in emacs to debug the application I am working on, but I haven't been able to figure out how to get pdb to find all the necessary modules. Instead, when I run my __main__.py file through pdb, I get a bunch of import errors because it can't find the modules for the project. If I manually add the appropriate paths to sys.paths and then import the modules one by one from the interactive pdb prompt, this works, but obviously is not the right solution.

In the Pycharm debugger there are two options: "add content roots to PYTHONPATH" and "add source roots to PYTHONPATH", which configure this stuff automatically. My issue is that I haven't figured out how to configure equivalent options in Emacs - i.e., I am not sure how/where to set PYTHONPATH so that pdb within Emacs recognizes it. I have tried setting it a few different was in my Emacs config, but nothing seems to work. Any suggestions? Thank you!


texts: How can I use the physics package in mathjax for org-mode HTML export?

texts:
I’m trying to use org-mode to export something as an HTML document, with MathJax equations. I know that MathJax supports the physics package, so it seems like it should be possible to tell emacs to tell MathJax to load physics. But how?
The code suggested in the link above is
window.MathJax = {
  loader: {load: ['[tex]/physics']},
  tex: {packages: {'[+]': ['physics']}}
};

so I tried putting variations of these lines in the document:

#+HTML_MATHJAX: loader: {load: ['[tex]/physics']} tex: {packages: {'[+]': ['physics']}}
#+HTML_MATHJAX: load: ['[tex]/physics'] packages: {'[+]': ['physics']}

But neither worked. What’s the right way to do this?
Example:
#+TITLE: Some physics
^^^ What can I put here to use the physics package?

$\ket{-}=\frac{\ket{0}-\ket{1}}{\sqrt{2}}$

Edit: I put one solution down below that uses pandoc.


texts: How do I use use-package with diminish in my init.el?

texts:
It looks like use-package recently made a change and diminish is its own package. How do I install diminish which is its own package now?

Here is what the top of my init.el looks like:

;; Save customizations in a separate file (custom.el)
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror) ; Prevent errors if custom.el does not exist

;; Package setup
;; (require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/")
             t)
(eval-when-compile
  (require 'use-package))
(require 'diminish)
(require 'bind-key)

(package-initialize)

This fails with Cannot open load file: No such file or directory, diminish

I can add (use-package diminish ... to fix the issue but I'd like to know if there is an idiomatic way to set up use-package


texts:
I am running M-x compile commands in my Projectile projects. I would like to use vterm for running them as the compilations are getting very slow because the project is very large.
How do I make compilation use vterm instead of the default shell it is using?


texts: How to pipe large files through fold before opening?

texts:
On a regular basis I need to open files that have really long lines, which unfortunately causes emacs to grind to a halt. My understanding is that this is a long-term issue with the renderer. I've tried disabling every possible mode, using every possible line wrapping package, etc. but none work well enough.

What I have found does work is first transforming the files in shell before opening them:

$ fold -w80 myfile > temp

Generally speaking I don't need to edit the files that have this property just view them, but it would still be convenient to look at them in emacs instead of going to less in the terminal. Is it possible to automate this and just have emacs do this every time I open a file that is sufficiently large or that has a sufficiently large first line?

Find file hooks look like they let me run code after the buffer is opened, but in this case I want to intercept the request to open the file and make it open the a synchronously arriving shell command output instead. Preferably in a way that will just work regardless of whether I open the file with helm, dired, etc.


texts: Display latex output natively in emacs in a vertically split window

texts:
Running Doom Emacs 2.0.9 on Emacs 26.3.

Currenly, when I do TeX-command-run-all on a tex file, it opens the output in okular pdf viewer in a separate KDE window.

I was wondering if it is possible to have the output displayed natively in emacs in a vertically split window next to the tex file window.


texts: Simple way to test if string contains positive integer

texts:
I'm trying to test for whether a string contains a positive integer (1, 2, 3, ...).  By "string contains" I mean the string is only numbers (e.g. "1", "12", "123" but not "0", "1.1", "1a", "a1").

My first thought was to test the type and check if it is an integer but first I need to convert to numeric.

(typep (string-to-number "23K") 'integer)
;; t

This doesn't work because string-to-number ignores any trailing characters.

Then I thought I'd use regular expressions to test that every character is in [0-9].

(equal (nth 0 (re-seq "[0-9]+" "23K")) "23K")

where re-seq is taken from this post and searches for every occurrence of the regular expression (first arg) in the second arg.

Combining that with a test for the number being greater than 0 I end up with this:

(and (equal (nth 0 (re-seq "[0-9]+" "23K")) "23K")
     (> (string-to-number "23K") 0) )

I'm pretty new to lisp programming so I'm wondering if there is a simpler way to do this.


texts: function to do helm-do-ag for a specific project

texts:
I want to wrap the helm-do-ag in another function to search in a specific dir. The following is the description of helm-do-ag.

helm-do-ag is an interactive Lisp closure in `helm-ag.el'.
(helm-do-ag &optional BASEDIR TARGETS)

I have the following function (minimal working example):

(defun helm-do-ag-project ()
  "ag the string in the given project"
(interactive)
(let ((helm-ag-command-option (concat helm-ag-command-option " -G v$ -f --verilog ")))
 (helm-do-ag (concat "d:/Projects/ProjectName/workarea/module_name/hdl/rtl")))
)

But, the results it returns are:

rtl/filename.v: ...text....
rtl/mod1/filename1.v ....text....

The problem is the result also has the "rtl"(rtl is the dir provided as part of the BASEDIR. Hence I am not able to open the file using persistent action. Helm tries to look for

d:/Projects/ProjectName/workarea/module_name/hdl/rtl/rtl/filename.v

and helm is unable to open the file, since path is not correct.


texts: Why I can't delete first line after save *occur* buffer to separate file?

texts:
Windows 10, Emacs 26.1

I have file - file_first.txt:

I want to find all line content word hello. So I use occur for this

Nice.

Now I want to save result to SEPARATE file: file_second.txt

To do this I use menu File->Save As (C-x C-w)

And success save content of occur buffer to file file_second.txt

Nice.

Now I want to delete first line

2 matches for "hello"...

in file file_second.txt

To do this I go to first line, select whole line and press any key.

But I get message:

Text is read only

And first line NOT DELETE.

Why? This is not any more *occur* buffer. It's a SEPARATE file.

But I can success delete another line (e.g. second line)

Why I can edit any lines EXCEPT FIRST LINE?


texts:
When I work on a .py file a new buffer appear (*Python Completions*) and sometimes auto-complete my code (every time in a wrong way !).

It looks like this (on the right side, when I tiped i):

What is causing it and how may I disable it ?


texts: Is it possible to make the echo area next to cursor?

texts:
The problem: I found it's tiredsome to move my eyeballs up and down from where my cursor is to the bottom echo area.

The question: is it possible to make the echo area dynamically allocated close to my cursor, like tooltips? I searched for packages but not able to find one. I don't believe it's a new idea and someone must've done it.


texts: how to teach emacs that `'` (dead acute) + c = ç?

texts:
I've set up my keyboard layout in arch with

localectl set-x11-keymap us pc104 intl

By default, in this layout, the ' is a dead character. It is called a dead acute. In Portuguese, we are used to composing the ç char using ' + c  = ç when using international US-keyboard layouts.

I don't know why, but by default GNU/Linux distros come configured so that when you type this combination ' + c you get ć, which is an invalid char in Brazilian Portuguese.

So I did this. I've edited the following files:
sudo vim /usr/lib/gtk-3.0/3.0.0/immodules.cache
sudo vim /usr/lib/gtk-2.0/2.10.0/immodules.cache

I change the line:

"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa"

to

"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en"

I also replaced "ć" with "ç" and "Ć" with "Ç" on /usr/share/X11/locale/en_US.UTF-8/Compose:

$ sudo cp /usr/share/X11/locale/en_US.UTF-8/Compose /usr/share/X11/locale/en_US.UTF-8/Compose.bak

$ sed 's/ć/ç/g' < /usr/share/X11/locale/en_US.UTF-8/Compose | sed 's/Ć/Ç/g' > Compose
$ sudo mv Compose /usr/share/X11/locale/en_US.UTF-8/Compose

I also added two lines on /etc/environment:

GTK_IM_MODULE=cedilla
QT_IM_MODULE=cedilla

and then I restarted my computer.

And then it worked. It works fine in firefox, chromium, scite, gvim or any other gui tool. But not in Emacs. In Emacs, ' + c insists on producing ć, despite my efforts.

How can I teach Emacs to produce ç and not ć when I type a dead acute ' + c?


texts: Is there function/package that allows to make "wide string literals" as defined by C/C++ standards. That is, where one has to replace all non-ascii characters with escaped "\x.." sequences.


texts:
In my emacs config i wrote:

    (use-package gnus
      :bind (("<f12>" . gnus)
         :map gnus-group-mode-map
         ("q" . gnus-group-suspend)
         ("Q" . gnus-group-exit))
    :config ........)

After i load emacs, f12 works, but "q" and "Q" do not work in gnus buffer. Only when i manually load the same code these keys work.

Could you help me to automatically bound these keys?


texts: Add file to org-agenda-files from another agenda file?

texts:
I have one file that is my default file in org-agenda-files (which I set in my init.el file).

How can I add other files to the org-agenda-files list from within my default agenda file with paths relative to the default file?

Hypothetical example:

* One heading
  Some text
* Second heading (external)
  AGENDAFILE: ext/ext.org


texts:
The rendering of term command in emacs runs my zsh shell but doesn't render it properly. Can anyone direct me to a fix?

This is how it should look:


texts:
(On MacOS, emacsclient in -nw mode )
when point is at a xlsx file in a dired buffer,
how can I open the xlsx file with MS-Excel.

I have Excel installed in the Mac. and the xlsx file extension is associated with excel.


texts:
While reading through the source code for the dolist macro, I ran into the following comment.

  ;; This is not a reliable test, but it does not matter because both semantics are acceptable, tho one is slightly faster with dynamic scoping and the other is slightly faster (and has cleaner semantics) with lexical scoping.

Which referred to this snippet (which I've simplified for clarity).

(if lexical-binding
    (let ((temp list))
      (while temp
        (let ((it (car temp)))
          ;; Body goes here
          (setq temp (cdr temp)))))
  (let ((temp list)
        it)
    (while temp
      (setq it (car temp))
      ;; Body goes here
      (setq temp (cdr temp)))))

It surprised me to see a let form being used inside a loop. I used to think that's slow compared to repeatedly using setq on the same external variable (as is done on the second case above).

I would have dismissed that as nothing, if not for the comment immediately above it explicitly saying that's faster than the alternative (with lexical binding). So... Why is that?

Why does the code above differ in performance on lexical vs dynamic binding?
Why is the let form faster with lexical?


texts: Supplying suggested destination directories to dired

texts: When I rename files to move them I have a handful of popular destinations that I would like to see in the (pseudo)history so that I can just cursor up to choose one. What I'm thinking is something like what dired-guess-shell-alist-user does except instead of suggest commands, suggest destination directory. I know some commands allow you to supply a history but I did not find one for dired. Does such a thing already exist?


texts:
count down timer This code starts a count down timer every time org file is opened , but asks for a permission to reset timer every time . Can it be automated, meaning it should start counting as soon as org file is opened.
Second, it should show a pop up when time is up. Can you please help


texts: Save the records in text register persistently

texts:
I utilize the text register to collect new words I encountered

C-x  r s w (w for word)

append others to it with M-x append-to-register

Record all the word collected to a works.org file at the end of the day.

Unfortunately, If the  machine crashed during the day, all the records in register are gone.

How could save the records in text register persistently?


texts:
What I want to achieve is this. I open a bunch of files, edit them and quit Emacs. then tomorrow I open one the files and I want Emacs to jump to the last edited position on that file.
How can I achieve this ?


texts:
Under Debian-Jessie, Emacs recognizes qualified special keys, e.g. C-<home>, in an X terminal (e.g. mate-terminal) but in TTY it does not.

I have corrected this by making a replacement keymap, loaded by adding KMAP=myReplacement to /etc/default/keyboard, but I had to invent totally arbitrary strings for the qualified keys that I wanted (specifically C-<home> and C-<end>).

I had to edit .emacs to match these strings. The coordination cost of this solution is too high. How do I discover what Emacs expects for these key sequences so that I only have to modify my OS keymap and not both this and .emacs?


texts:
My goal is to have a file template (header + daily review), and then have further entries as is from the package (bulletpoint + timestamp).
Meaning the first thing in the morning I would open the journal, have a review of what's ahead, but I obviously don't want to do a review every time i call org-journal-new-entry.
I see here and here that capture templates are possible, but how can I create the 2 described behaviors? (I think maybe trigger the review via org-capture and any further entries via the default org-journal-new-entry? Unfortunately, I know pretty much 0 lisp)


texts: Mac stopped binding CMD-Up, which I use in Emacs and Racket

texts:
CMD/up, used in both Dr Racket and Portacle (Emacs) to retrieve the last command in the buffer, has stopped working for both programs.

Other combinations with CMD do work, such as CMD/P, and CMD/X, CMD/+

I am using OS X, on a Macbook Pro (aka root of all evils)

This seems to be related to a previous question (set-mark-command (C-SPC) not recognised/broken), however the stated solution for that question did not work (System Preferences > Keyboard > Shortcuts > Input Sources > Select the previous input source and uncheck). That question had assumed this was on the Emacs level but found it was on the OS level. That is obviously the case for me, as it affects more than one program.

I would greatly appreciate any help. I'm blocked on having an efficient development process until I fix this.


texts: Increase the level of dynamic binding with backtick / comma

texts:
I have a favorite function that contains several levels of set-process-sentinel and lambda sentinels.  I have been using lexical-let, but would like to see if it is possible to use dynamically bound variables using a backtick / comma to penetrate several levels deep.  In my testing, I see that a variable dynamically bound using a backtick / comma only pentetrates a couple of levels before the variable becomes void.  Is there a way to increase the levels of penetration when using the backtick?

Example with lexical-let:

  (defun example-lexical-fn ()
"Doc-string"
(interactive)
  (lexical-let* ((test-variable "Hello-world!"))
    (set-process-sentinel
      (start-process "process-one" "*one*" "echo" test-variable)
      (lambda (p e) (when (= 0 (process-exit-status p))
        (set-process-sentinel
          (start-process "process-two" "*two*" "echo" test-variable)
          (lambda (p e) (when (= 0 (process-exit-status p))
            (start-process "process-three" "*three*" "echo" test-variable)
            (set-process-sentinel
              (start-process "process-four" "*four*" "echo" test-variable)
              (lambda (p e) (when (= 0 (process-exit-status p))
                (set-process-sentinel
                  (start-process "process-five" "*five*" "echo" test-variable)
                  (lambda (p e) (when (= 0 (process-exit-status p))
                    (message "test-variable:  %s" test-variable)))))))))))))))

The dynamic binding putters-out and the test-variable becomes a void-variable at the section labeled "process-three".

  (defun example-dynamic-fn ()
"Doc-string"
(interactive)
  (let* ((test-variable "Hello-world!"))
    (set-process-sentinel
      (start-process "process-one" "*one*" "echo" test-variable)
      `(lambda (p e) (when (= 0 (process-exit-status p))
        (set-process-sentinel
          (start-process "process-two" "*two*" "echo" ,test-variable)
          `(lambda (p e) (when (= 0 (process-exit-status p))
            (start-process "process-three" "*three*" "echo" ,test-variable)
            (set-process-sentinel
              (start-process "process-four" "*four*" "echo" ,test-variable)
              `(lambda (p e) (when (= 0 (process-exit-status p))
                (set-process-sentinel
                  (start-process "process-five" "*five*" "echo" ,test-variable)
                  `(lambda (p e) (when (= 0 (process-exit-status p))
                    (message "test-variable:  %s" ,test-variable)))))))))))))))

Here is the working example based on the helpful answer of zk_phi:  "Change all backticks to quote (') except for the first one . . . ."

  (defun example-dynamic-fn ()
"Doc-string"
(interactive)
  (let ((test-variable "Hello-world!"))
    (set-process-sentinel
      (start-process "process-one" "*one*" "echo" test-variable)
      `(lambda (p e) (when (= 0 (process-exit-status p))
        (set-process-sentinel
          (start-process "process-two" "*two*" "echo" ,test-variable)
          '(lambda (p e) (when (= 0 (process-exit-status p))
            (start-process "process-three" "*three*" "echo" ,test-variable)
            (set-process-sentinel
              (start-process "process-four" "*four*" "echo" ,test-variable)
              '(lambda (p e) (when (= 0 (process-exit-status p))
                (set-process-sentinel
                  (start-process "process-five" "*five*" "echo" ,test-variable)
                  '(lambda (p e) (when (= 0 (process-exit-status p))
                    (message "test-variable:  %s" ,test-variable)))))))))))))))


texts: Not work C-t (tab-new) in the dired mode

texts:
Linux Mint 20, Emacs 27.2
Here my keybinding
;; You can run the command ‘tab-new’ with C-x t 2
(global-set-key (kbd "C-t") 'tab-new)
(global-set-key (kbd "C-<tab>") 'tab-next)

So when I, e.g. open file and press C-t then create new tab.
Before

After

Nice.
But when I'm in dired mode and press C-t then new tab NOT create.
And in the minibuffer show C-t


texts: Back/forward navigation that works like IntelliJ/Eclipse

texts:
I've been trying to find a navigation package that allows backwards/forwards navigation across and within buffers. I have found a lot of solutions out there but none of them seem to solve the whole problem. Here are the requirements:

Should work across buffers. This means locations within a buffer AND the in other buffers. Kind of like if the global mark ring merged all local buffer mark rings. I'd like the navigation between the two to be seamless and not require using separate commands for each one.
Records marks on any meaningful cursor movement, but minimizes noise ala this question description.
Has some sane bounds on the number of positions recorded and ideally is configurable.
Should be able to go backwards AND forwards.

This answer gets close, but doesn't seem to work consistently with navigating within the local buffer.

Is there something out there that meets all these requirements or do I need to roll my own?

If I've missed a solution somewhere else that meets these requirements, please let me know.

UPDATE:

I think what i'm looking for is something like evil-jumper but without the evil part :) There is jumpc, but it seems to only insert jumps on edits, not other navigation points.


texts:
I'm very new to Emacs. I've installed AUCTeX version 11.89.4 using package manager (list-packages, select auctex, install it). It works, at least it shows compiled pdf result from test .tex file in local buffer after several C-c C-c strokes. Now I want to do some customization -- for example, showing result in external evince program. However, the more tutorials and docs I read, the more it seems to me that my AUCTeX installation is somehow broken:

I know that C-h v AUCTeX-version should give me AUCTeX version. However, I don't have such variable -- describe variable gives no match. I have learned that the version is 11.89.4 from the package manager.
I don't have variable TeX-view-program-list, which, as I've read, is used for setting view program. In fact, I have only three variables starting with Tex, and all of them I've declared in initl.el myself: TeX-PDF-mode, TeX-auto-save, TeX-pase-self.
I don't have menu item LaTeX which is mentioned here. I have only menu item TeX, and there is no "Customize AUCTeX" submenu:

There is no key C-c ~ which is supposed to turn on math mode. There is no variable LaTeX-math-abbrev-prefix and no function LaTeX-math-mode, although I've added line (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) to my init.el and it had been read without any problems.
some other things, but I think this should be enough to show the problem.

My OS is Ubuntu 14.04, GNU Emacs 24.5.1. This is version is still absent from Ubuntu repos, so I have built it from sources and installed via checkinstall.

Additional info:
Ubuntu package auctex is not installed -- I just followed manual instructions and it doesn't says anything about system-wide packages. I have no variable TeX-lisp-directory; If I start Emacs without executing init.el (-q), and then run M-x package-initialize, I get the following error: (file-error "Cannot open load file" "no such file or directory" "tex-site"). I don't know what it means right now, but it seems that google has something on this -- I will look into.

There is another point which, as I think, should be made clear. As I have read in EmacsWiki since Emacs 24 package initialization happens after loading init.el. However, I needed package-installed-p function, so I forced loading packages in the beginning of init.el by inserting the following code (taken from wiki):

(setq package-enable-at-startup nil)
(package-initialize)

Update

I didn't noticed earlier, but in fact I get error "no such file or directory" "tex-site" after running package-initialize when calling in from init.el too. It seems to me that the root of my problem is that I forgot to add the line (require 'auctex). After adding it, auctex finally works, I have TeX-lisp-directory and other vars, however, now I see the following warning in Messages:

Warning (initialization): An error occurred while loading `/home/ars/.emacs.d/init.el':

error: Required feature `auctex' was not provided

What's wrong with this way of loading packages? Should I require them explicitly or not?


texts: Prevent other-window from choosing side window

texts:
I have recently started using buffer-display-alist to sensibly place windows within a frame. Typically, I'll have one or two windows of code buffers that I actively work in and a bottom "side window" that hosts shell and test buffers. My configuration looks like this:
(custom-set-variables
 '(display-buffer-alist
   (quote
    (("\\*eshell"
      (display-buffer-in-side-window)
      (side . bottom)
      (slot . -1))
     ("\\*shell"
      (display-buffer-in-side-window)
      (side . bottom)
      (slot . -1))
     ...

I had a now-lost configuration that prevented other-window (i.e. C-x o) from ever setting the bottom "side window" as the active window. If I wanted to interact with that window, I would click into it with the mouse or use some other command (e.g. windmove-*).
How can I accomplish this?


texts:
When I use C-c' (org-edit-special) to edit an org-mode code block, I am running into an error. After I open the code block and edit it, then exit with C-c' again, the code block is locked (I think that is the right term).

If I try to edit the same area in the org file in either org-mode or in the org-edit-special emacs-lisp-mode I get the following error (as displayed in my **Messages** buffer):

  user-error: Cannot modify an area being edited in a dedicated buffer

even though I have closed the org-mode src emacs-lisp-mode editing buffer with either C-c' or C-cC-k

I am using the following version of Emacs:

  GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of
  2018-06-06

with the following version of org-mode:

  Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @
  /app/share/emacs/26.1/lisp/org/)

installed on Ubuntu 18.04 with Flatpak via Flathub

Here are some screenshots if that might relevant to others:

Here is a screenshot of me before editing with C-c':

Here is a screenshot of me editing:

Here is a screenshot of that part of the file now being locked:

I am quite sure this a problem is due to a plugin, and not a problem caused by Emacs or Org-mode, but I wanted to post this in case anyone else was running into the same issue. What really motivated me to create this post was the fact that there are only 30 results for searching for this error on Google (hopefully soon to be 8).


texts: How to bind a command with a C-u prefix to a different key?

texts:
C-c C-x C-v calls org-toggle-inline-images function.  With prefix key it passes some arguments to this function (don't know which one).

How can I map the function with arguments to the F12 button so it does the same as C-u C-c C-x C-v?


texts: Fast way to copy a link at point in org mode

texts: If the point is on a link on org mode, how can I copy the link (complete link, including url and description) directly into the kill ring without marking the whole link, killing it and yanking it again?


texts: In Org Mode, how to get path of an attachment - given its ID - in a string format?

texts:
In Org Mode I have an attachment associated with some task

* Some task                                                          :ATTACH:
  :PROPERTIES:
  :Attachments: some_file.png
  :ID:       da335ac9-00ac-494b-9073-d17e70457bc8
  :END:

How to obtain a full path, in a string format, to some_file.png based on its ID?


texts: byte compile warning: `unintern` called with 1 argument, but requires 2

texts:
Q:  How to fix elmo-unintern to use 2 arguments instead of 1, or silence the byte-compiler on this issue.

Here is the macro definition:

  (defmacro elmo-unintern (string)
"Delete the symbol named NAME, if any, from OBARRAY.
The value is t if a symbol was found and deleted, nil otherwise.
NAME may be a string or a symbol.  If it is a symbol, that symbol
is deleted, if it belongs to OBARRAY--no other symbol is deleted.
OBARRAY, if nil, defaults to the value of the variable `obarray'."
  (static-if (fboundp 'unintern)
      (list 'unintern string)))

Here is the bye-compile message:

In elmo-imap4-parse-response:

filename.el:92495:45:Warning: unintern called with 1 argument, but requires 2

filename.el:92513:46:Warning: unintern called with 1 argument, but requires 2

filename.el:92516:38:Warning: unintern called with 1 argument, but requires 2

Here is the comment by @Stefan from a previous bug report:  https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-04/msg00560.html

> Loading this file works as expected, but compiling it generates the
> warning
>     unintern called with 1 argument, but requires 2
> But `unintern' doesn't require 2 arguments.

That's the `advertized-calling-convention' at work here.  IOW calling
the function with only one argument still works but is deprecated.

        Stefan


texts: Org Agenda schedule number of hours allocated to a task

texts: Is there a way to tell Org Agenda to schedule X number of hours for a task without a specific start-end time? Presently, the standard format is this: SCHEDULED: <2019-06-20 Thu 9:00-12:00>


texts: Strange sorting behavior for missing deadline and scheduled dates in org-agenda-sorting-strategy?

texts:
Running fresh (emacs -q), with the following org-mode items:
* TODO item 1
  DEADLINE: <2021-03-01 Mon> SCHEDULED: <2021-02-27 Sat>
* TODO item 2
  SCHEDULED: <2021-02-28 Sun>
* TODO item 3
  DEADLINE: <2021-03-02 Tue>

With org-agenda-sorting-strategy set to
((agenda deadline-up scheduled-up)...) (omitted other views for clarity)
I get the following agenda view for the day:
Tuesday     2 March 2021
  test:       Sched. 3x:  TODO item 1
  test:       Sched. 2x:  TODO item 2
  test:        1 d. ago:  TODO item 1
  test:       Deadline:   TODO item 3

and with ((agenda scheduled-up deadline-up)...), I get:
Tuesday     2 March 2021
  test:        1 d. ago:  TODO item 1
  test:       Deadline:   TODO item 3
  test:       Sched. 3x:  TODO item 1
  test:       Sched. 2x:  TODO item 2

These examples seem like unspecified deadlines and scheduling dates default to behave as if they are infinitely in the past (changing -up to -down is consistent with this).  But doesn't it make more sense for them to behave like infinitely in the future, or is that just me?
In any case, how would you work around this to achieve the latter?


texts: Launching emacs with configured packages

texts:
Let's say I want to use elisp functions in a script .
I rely in my script on some library, dash which I require.

#!/usr/local/bin/emacs --script
(require 'dash)

(message (describe-variable 'load-path))

As is, I will get

$ ./loader.sh
Cannot open load file: No such file or directory, dash

What is the simplest way to make a set of packages accessible to an elisp environment used in a script ?

PS : The equivalent for haskell, using nix, would be

#! /usr/bin/env nix-shell
#! nix-shell -i runghc -p "haskellPackages.ghcWithPackages(p: with p; [type-level-sets])"
#! nix-shell -I nixpkgs=channel:nixos-18.03

{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeApplications #-}

module Main where

import Data.Type.Set (Set(..), Proxy(..))

class Get a s where
  get :: Set s -> a

instance {-# OVERLAPS #-} Get a (a ': s) where
  get (Ext a _) = a

instance {-# OVERLAPPABLE #-} Get a s => Get a (b ': s) where
  get (Ext _ xs) = get xs

main :: IO ()
main = do
  let lst = Ext "hello" $ Ext 10 $ Empty
  putStrLn $ show $ get @String lst


texts: Repeat actions in slow motion, for presentation purposes

texts:
I would like to repeat actions (preferably as a keyboard macro, but I am open to other solutions), in some kind of automated, "slow motion".  By "slow motion", I mean at a speed that is close to human pace, rather than usual full speed of C-x e.

The goal is to be able to prepare actions then play them again during a presentation, or in order to capture them in a screencast (a bit like the GIF at the top of http://developer.atlassian.com/blog/2015/11/scripting-with-node/, or the videos in http://emacsgifs.github.io/).

There are of course a lot of information about automating tasks, and creating macros in Emacs, but nothing about slowing their repetition.


texts: org-mode: Enable ido/ivy/helm in org-tags-view

texts:
org-completion-use-ido seems to enable interactive completion everywhere but not in org-tags-view (which is called when you choose "Match a TAGS/PROP/TODO query" in Agenda Commands).
Out-of-the-box org-tags-view has only the dull <TAB>-completion which is annoyingly primitive, how do I enable a proper interactive completion there?


texts: Extract year from different date strings in alist

texts:
I have a function that tries to extract the year from date strings stored in an alist below:
(setq entry
 '(("date" . "1998/03")
   ("origdate" . "1930")))

(defun extract-year (date)
  (let ((string (cdr (assoc (symbol-name 'date) entry))))
  (progn
    (string-match
     "\\([0-9]\\{4\\}\\)[/-年\\.]?\\([0-9]+\\)?[/-月\\.]?\\([0-9]+\\)?[/-日\\.]?"
     string)
    (match-string 1 string))))

I would like to call, for example, (extract-year date) to get "1998" and (extract-year origdate) to get "1930".


texts: Is there a package manager for emacs that can use git repositories directly?

texts: Is there a way to manage packages in emacs where I can point to a git repository directly? (like vim-plug for eg).


texts:
I am using a german keyboard layout and because it is very annoying to type curly brackets I have remapped them to C-7 and C-0 in addition to the default binding AltGr-7 and AltGr-0. I also want to modify the behavior of smartparens for cpp-mode and there is already a code snippet in the smartparens documentation which does exactly what I want. When I type  { and press Return it immediately creates and empty line between the curly brackets and moves the pointer to that empty line with an indent. But it does so only when I use AltGr-7 and press Return but not when I used C-7 and press Return (it just inserts a new line). Is it possible to make smartparens behave with C-7 like it would with AltGr-7?
Code snippets I am referring too:
(global-set-key (kbd "C-7") (kbd "{"))
(global-set-key (kbd "C-0") (kbd "}"))

(use-package smartparens
  :hook
  (prog-mode . smartparens-mode)
  (c++-mode . smartparens-mode)
  :config (require 'smartparens-config)
  )

;; From smartparens documentation
(sp-local-pair 'c++-mode "{" nil :post-handlers '((my-create-newline-and-enter-sexp "RET")))

(defun my-create-newline-and-enter-sexp (&rest _ignored)
  "Open a new brace or bracket expression, with relevant newlines and indent. "
  (newline)
  (indent-according-to-mode)
  (forward-line -1)
  (indent-according-to-mode))


texts: What is the difference between the error handler in condition-case and the error function

texts:
I am wondering the semantic of the error function. For condition-case, the Elisp manual says:

  The arguments after the protected form are handlers. Each handler
  lists one or more condition names (which are symbols) to specify which
  errors it will handle.

From its example:

(condition-case nil
    (delete-file filename)
  (error nil))

The error in (error nil) is the condition which is a symbol in my understanding.

On the other hand, when we want to raise an error, we use the function error as well. From the Elisp manual:

  Function: error format-string &rest args

  This function signals an error with an error message constructed by applying format-message (see Formatting Strings) to format-string and args.

and example:

(error "That is an error -- try something else")

The error function will create a message and signal the error. What I cannot understand is, what is the difference between this error signaling function, and the error symbol in the (condition-case) above? If (error) is a function used to signal an error, in the (condition-case) above the (error nil) should be eval-ed and raise an error with a nil message instead of catching an error?


texts: Combine fileskip0 and stepskip0 in org mode clock tables


texts: How to tell eshell to use the os-specific tools if available

texts:
I understand why eshell provides elisp interpretations of the kill and rm commands, however, I would like Emacs to use the operating-specific implementations if they are available in the $PATH (especially in the case of rm, because the elisp implementation of rm can take minutes to delete large directories of files).

How can I tell Emacs to use the rm command in $PATH if available, and only fall back to the elisp implementation if not found?


texts:
So, I'm finding myself writing React a lot, and not finding myself happy doing so in EMACS. I've been resorting to Visual Studio Code, which is a fine editor but suffers seriously by not being EMACS.

There seem to be a whole bunch of bits and pieces around, but little coherence. What is needed to make EMACS play nicely with modern Javascript, Node, and frameworks like React?


texts: Avy is not labelling every character I want to jump to

texts:
I can't jump to every instance of a character, for instance consider this line :

if( c == '\n' ||  c == ' ' || c == '\n') continue;

Pressing avy-shortcut SPACE to label all the white spaces will only allow me to jump at the spaces between the c and the =, all the other spaces after and before the (, ), | are ignored. Any idea on how to fix this behavior ?